Skip to content
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

JSON format for layers (groups) #126

Closed
forresto opened this issue Jan 10, 2014 · 8 comments
Closed

JSON format for layers (groups) #126

forresto opened this issue Jan 10, 2014 · 8 comments

Comments

@forresto
Copy link
Member

Before I work on flowhub/the-graph#43 much more I'd like to nail down the JSON format.

If we follow the convention of processes, then graph.groups should be an object.

For hierarchical organization and autolayout noflo/noflo-ui#53 , it would be better if each node could belong to only one group. So

node.metadata.group: groupKey

group.metadata.parent: groupKey

@bergie
Copy link
Member

bergie commented Jan 10, 2014

@forresto if we want to have nodes belonging only to a single group, we can constrain that on UI level. Typically with groups you want to be able to have a many-to-many relationship, so that is what we have on JSON level

@bergie
Copy link
Member

bergie commented Jan 10, 2014

Here is the original groups format ticket: #62

@bergie bergie closed this as completed Jan 10, 2014
@forresto
Copy link
Member Author

Seems easier for things to match between JSON structure & UI. If groups are tree-like layers, then I'd vote for a change. If groups are many-to-many tags, the current system works, but seems less useful in the UI.

We need a flat representation of a tree. Groups need a unique key in order to nest them inside each other. How should this work?

{
  "name": "countdown",
  "id": "g_countdown",
  "nodes": ["interaction/ListenMouse_1u0rk", "strings/SendString_zry4n", ...],
  "metadata": {}
},
{
  "name": "save",
  "id": "g_save",
  "nodes": ["core/MakeFunction_t17n", "core/Split_xyb8x", ...],
  "metadata": {
    "description": "click save, run countdown, make jpg from canvas",
    "parent": "g_countdown"
  }
},

... seems fragile.

If groups were an object:

"g_countdown": {
  "name": "countdown",
  "nodes": ["interaction/ListenMouse_1u0rk", "strings/SendString_zry4n", ...],
  "metadata": {}
},
"g_save": {
  "name": "save",
  "nodes": ["core/MakeFunction_t17n", "core/Split_xyb8x", ...],
  "metadata": {
    "description": "click save, run countdown, make jpg from canvas",
    "parent": "g_countdown"
  }
},

... we could also take nodes out of the groups and each node could have the group id in metadata.

@forresto
Copy link
Member Author

For many-to-many groups, a metadata.keywords array in the process would be a better mapping.

@bergie
Copy link
Member

bergie commented Jan 16, 2014

I'd start with what we have now, and consider changes only if necessary

@forresto
Copy link
Member Author

That's what I'm doing... groups need an id to reference a parent group so they can be hacked to work hierarchically in the UI.

Should I make a new layers object that works as I need?

@bergie
Copy link
Member

bergie commented Jan 16, 2014

@forresto I'd try to avoid tree structures as long as possible

@forresto
Copy link
Member Author

Explain?

They are required in some form to do collapsable groups with autolayout.

Also for the photoshop layer style view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants