retejs / context-menu-plugin

https://retejs.org
MIT License
11 stars 43 forks source link

No info about inputs and outputs in a builder #16

Closed sbadulin closed 5 years ago

sbadulin commented 5 years ago

My goal is to recreate nodes with their connections in the editor from the JSON file. JSON structure: id: 'demo@0.1.0', nodes: { '1': { id: 1, name: 'MyNode', data: { title: 'Some title' }, inputs: { num1: { connections: [] } }, outputs: { num: { connections: [{ node: 2, input: 'num1' }] }, }, position: [0, 0], } In builder method I have everything from a 'data' object, but no inputs or outputs. Seems like it is was an intentional decision, but how to generate inputs then?

Ni55aN commented 5 years ago

JSON contains only presented nodes and connections between them, all other info (inputs/outputs/controls) are programmable in general.

For example, forms on many sites are programmable, bacause they have their own behaviour and logic. Sometimes a form factory based on JSON data is used.

You can create something like nodes generator based on JSON, but it will not be so flexible

Ni55aN commented 5 years ago

Is the issue still actual?