Graph Editor
Label and Group Only
This version ONLY allows the user to change the label and the group. All other layout is done by these groups.
Attempting to Edit Color and Shapes
This turned out to be challenging since color can be a property but also an object. For detailed control of all colors including background and border colors for standard, hover and selected nodes we must have a very complex form. I feel this is better handled based on the group of the node.
Run the Graph Editor v18 Integer Node ID
Prompt
Please generate a graph network editor based on vis.js. The editor should be able to do the following:
1. Open a graph network from a JSON file to an in memory structure. Look for files with .json extensions.
2. Add, update and delete nodes and edges.
3. Edit various properties of the nodes and edges such as color, shape, size and image
4. Save the in-memory structure to the file or do a "Save As" to a new file
5. Allow the user to change and save global options
Upon reading the file, display statistics about what was in the file including node count and edge count. Also display the count of orphaned nodes when a file is read.
Perform checks on data quality as a new file is opened such as edges without nodes.
Graph Editor Check for Network
Check for Network after Load of JSON data
Adding Details to Node
1 2 3 4 5 6 7 8 9 10 11 12 |
|
ChatGPT said:
In addition to the properties you've already listed, here are some other common node properties that users might want to set:
- Image (for image-based nodes, with a URL to an image)
- Font (size, color, face for the label)
- Border Width (controls the thickness of the node's border)
- Border Color (set separately from edge color, allows customization of node outline)
- Opacity (allows transparency on nodes)
- Shadow (option to add shadows for depth perception)
- Group (used to assign nodes into categories for different styles or behaviors)
- Icon (if using icons instead of labels)
- Physics (whether the node is affected by physics simulation)
Updated JavaScript for Node Creation/Editing Form
Here is an updated version of your graph-editor.js that includes a form for setting all these parameters when creating or editing nodes:
References
Sam Adams TinkerTiny Vis.js Graph Editor - an interesting UI. One time code commit in 2022.