Update readme on how to load JSON with attributes.#87
Update readme on how to load JSON with attributes.#87siuyin wants to merge 15 commits intodhotson:masterfrom
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.