magjac/graphviz-visual-editor

Copy-pasting a node with implicit attributes may differ visually from the copied node

Opened this issue · 1 comments

The reason is

  1. Only the copied node's explicit attributes are added to the pasted node
  2. The new node is inserted in the DOT source at the end of the graph where the implicit node attributes may be different than at the place in the DOT source where the copied node is defined.

Example

Initial DOT source

digraph {
    node [style=filled]
    node [fillcolor=red]
    
    a [color=blue]
    
    node [fillcolor=green shape=box]
    
}

Initial graph

image

DOT source after copy-paste of node a

digraph {
    node [style=filled]
    node [fillcolor=red]
    
    a [color=blue]
    
    node [fillcolor=green shape=box]
    
    n1 [ color=blue]
}

Graph after copy-paste of node a

image

A solution could be to insert the new node in the same DOT source context as where the copied node is defined.