Open the node or edge format drawer in temporary mode or a dialog with the same contents, but instead of editing the default attributes, edit the attributes of the selected node or edge.
Nothing happens. Click-insert works. Drag-and-drop works in Firefox.
Debugging shows that no drag start events are fired. Maybe related to react-dnd/react-dnd-html5-backend#18, although the workaround suggested didn't help.
Currently, unfilled nodes must be interacted with through the perimeter or through the node text which makes it a little harder to select them or to draw edges from and to them. This is analogous to how the URL attribute works:
For svg [...] output, the active area for a node is its visible image. For example, an unfilled node with no drawn boundary will only be active on its label.
Filled nodes can be interacted with anywhere on or inside its perimeter, including its background.
Ideas
When displaying the graph, set fill="transparent" on the SVG basic shape.
If neither the error message nor the line number changes when the DOT source is edited, the error indication is removed, although the error is still present.
A workaround is to add or delete a line in the beginning of the DOT source, which forces the line number to change.
The reason for this bug seems to be that the Ace editor clears the annotations internally and the React Ace Component does not update them if they are not changed, see the source code.
The reason is that the mechanism that inserts the error marker in the editor gutter also re-insert the latest text exported from the editor which might not be up-to-date when typing fast.
The visual editing insert capability currently requires the DOT source to have the graph closing statement on a separate line, since it currently operates by inserting a new line between existing lines.
The only indication today is loss of focus in the text editor pane, indicated by a change of background color on the current line.
Ideas in the order currently preferred:
Colored frame on graph pane
Different backgrounds in both panes depending on focus
The node and edge format drawers are displayed instead of the text editor. This is intentional.
However, the editor is terminated when a format drawer is opened and a new editor instance is started when the drawer is closed which causes the editor state to be lost. The editor should be running all the time and it's visibility toggled instead.
This is just a minor flaw, maybe not even a bug, but it means that graph keyboard shortcuts are not operational directly after the insertion. In particular, pressing Ctrl-Z for undo has no effect. The user needs to focus the graph pane by clicking it in order to use a keyboard shortcut.
This bug is valid both for drag-and-drop insert and for click insert from the node shape insertion panel.
When the mouse is moved back in over the canvas, the select area changes with the mouse position, but when the mouse button is clicked, nothing is selected.
Currently, such edges can be selected individually, but not deleted because it would involve quite drastic changes to the DOT source, possibly involving cloning nodes and edges, which the user probably does not want.
Ideas
When selecting an edge in the graph that is the result of one edge to or from a subgraph in the DOT source, select also all other edges that are the result of the same edge in the DOT source.
When deleting such edges, delete the edge to or from the subgraph in the DOT source.
The edges could be highlighted with a different color to distinguish them from non-subgraph edges.
When focus is in the text editor, most mouse operations in the graph removes the focus from the text editor, but not all. This causes unwanted effects.
One case: Trying to delete objects selected with area select when focus was is in the text editor deletes text in the editor, not the selected objects.
The visual editing delete capability currently requires the DOT source to be organized with only one node or edge per line, since it currently operates by deleting complete lines.
The insert capablity part originally included in this issue has been spawned to #27.
After starting the editor, the text editor contents should be initialized from a URL parameter.
Ideas
Name name of the URL parameter could for example be: dotSrc, src or graph.
If the editor is first initialized with the contents from local storage and then from the URL parameter, it will be possible to undo the change if an update was not what the user intended.
Should a warning be issued when this happens? (Always after the first time).
If there is an error in the DOT source code, but the error indication is not in the visible area of the text editor, it can be hard to find where the error is if the DOT source code is large. A function that scrolls the line with the error into view would simplify this.
Ideas:
Scroll automatically when an error occurs.
Probably requires some kind of filtering to avoid interfering with user scrolling.
No scroll if the error message and line number does not change.
No scroll if the error message and line number as counted from the end of the file does not change.
Scroll on user command.
Through a keyboard shortcut?
Through a button somewhere (not shown when error free)?
Currently, edges must be interacted with through the arrow head or tail or through the sometimes very thin edge path itself which makes it a little hard to select them. This is analogous to how the URL attribute works:
For svg [...] output, [...]. For edges, the active areas are small circles where the edge contacts its head and tail nodes. In addition [...] the active area includes a thin polygon approximating the edge [...]. If the edge has a label, this will also be active. Finally, if the edge has a head or tail label, this will also be active.
Ideas
When displaying the graph, add an invisible overlay path that can be used to select the edge and has the same attributes as the real edge path, but with a stroke-width attribute with a larger value and stroke="transparent". An algorithm for calculating the width can be based on: