-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update readme on how to load JSON with attributes. #87
base: master
Are you sure you want to change the base?
Conversation
Hey thanks! This is a feature I've been meaning to add for a while now. :) I reckon this would be better as something built-in rather than asking users to patch a function in the readme. It looks like you're pretty close to getting it working already. |
Yes, you are right. I thought of preserving the API. With the capability built-in I would need to extend the API -- say with a loadJSONRich command. A new name is needed so that it does not disrupt the existing users of loadJSON. |
Hmm, do you think it'd be possible to extend the existing Currently nodes are expected to be passed as simple string ids, which makes passing extra metadata difficult. Perhaps nodes could be in an extended format? e.g. graph.loadJSON({
nodes: [
"a",
["b", { label: "B" }] // Maybe like this?
],
edges: [
["a", "b", { label: "ab" }], // I think this already works
]
}); |
Thanks for the insight -- yes, I think that could work... |
Added capability into springy.js and also updated README to reflect changes. Springy 1.2+ also accepts JSON with node attributes see |
I would rebase/squash commits and probably split JSON instructions into two parts. |
Hi, This is just a documentation update which I think Springy users may find helpful.
This just saves them a bit of time in reading the source.