Open Fr33maan opened 10 years ago
The flare_data
structure was just a nice way to get started. In the model, nodes look like:
{
id: "id",
collapsed: bool,
parent: "id",
children: ["id", "id", ...],
data: {
name: "Some awesome node", // <-- this is what is actually displayed
done: bool, // also used visually
// you can add any extra data you want here.
}
}
There's a root node id, and everything is filled in from there by traversing the children
.
If I understand correctly, you want to be able to have full JSON loading & export?
This could be accomplished by adding a type
attribute to the data
object (it is supported to add arbitrary values to data
, which are preserved).
You would need to write a custom Node
class that was aware of the type
attribute and displayed things accordingly, but I think it would be totally doable.
@jaredly "If I understand correctly, you want to be able to have full JSON loading & export?"
Exactly, i want to have a tool that is able to load/edit a JSON with no need of a particular structure.
I can see in the given example that json structure is assumed as following :
I see on the sample app that 'name' field is used for display node name.
I would like to use a JSON structure like this :
Then i would like this to be samely displayed as in app example.
I would like to know how easy it will be to make 'JSON structure switchin ' improvement