graphviz-visual-editor icon indicating copy to clipboard operation
graphviz-visual-editor copied to clipboard

chage the shape of an existing node

Open wuchaoAAA opened this issue 1 year ago • 3 comments

I need to change the shape of an existing node. Hello, what method in which file to call? I need to know urgently

wuchaoAAA avatar Sep 12 '22 11:09 wuchaoAAA

The Graphviz Visual Editor is a web application. It does not have files or methods, so I don't understand your question. You set the shape of a node with the shape attribute, but I guess you know this already.

magjac avatar Sep 12 '22 11:09 magjac

Hello, I have deployed your project on the Apple system. I want to modify the project code so that when I click an existing node on the canvas on the right, a dialog box will pop up asking whether to modify the node shape. If yes, the node shape can be changed from oval to circle. And the left editor can automatically set the node shape=circle . Is this a lot of work? Which files should I start to modify, or do you have any better suggestions

wuchaoAAA avatar Sep 14 '22 08:09 wuchaoAAA

I think it would be a lot of work.

  1. There are many ways to specify the node shape in the DOT source: explicit for a specific node or default node statements on graph or subgraph level. It can also be specified many times to override previous specifications (in a particular scope). If you restrict what DOT source constructs you support, perhaps it's doable to decide where in the DOT source to make changes.
  2. You need to extend https://github.com/magjac/graphviz-visual-editor/blob/master/src/dot.js to be able to locate and modify the correct shape attribute.
  3. You need to replace the current click handler in https://github.com/magjac/graphviz-visual-editor/blob/master/src/Graph.js with your own functionality.

magjac avatar Sep 14 '22 09:09 magjac