hbmartin / graphviz2drawio

Convert graphviz (dot) files into draw.io (mxGraph) format
GNU General Public License v3.0
161 stars 32 forks source link

Support invisible nodes #67

Open Sponge5 opened 4 months ago

Sponge5 commented 4 months ago

Hi, I'm getting KeyError on both invisible nodes in my graph. Seems that graphviz doesn't create those nodes when converting to SVG.

Here's the dot source and I'm adding the generated SVG by hand as an attachment as well. (dot -Gsplines=none anon.dot | neato -n -Gsplines=ortho -Tsvg -oanon.svg)

digraph G {
    graph [rankdir = LR, splines=ortho];

    node[shape=record];

    emmc [label="eMMC" color="blue"]
    boot_host [label="" style=invis width=0 height=2]
    spinor [label="SPI NOR" color="green"]
    soc [label="SoC" height=4]
    nand [label="Raw NAND" color="yellow"]
    dev_eth [label="" style=invis width=0 height=2]
    eeprom [label="I2C EEPROM" color="red"]

    emmc -> soc [arrowhead=none]
    boot_host -> soc [xlabel="Boot Source"]
    boot_host -> soc [xlabel="USB" dir=both]
    spinor -> soc [arrowhead=none]
    soc -> nand [arrowhead=none]
    soc -> dev_eth [xlabel="USB-OTG" dir=both]
    soc -> dev_eth [xlabel="Ethernet" dir=both]
    soc -> eeprom [arrowhead=none]
}

anon

hbmartin commented 2 days ago

I started work on this but it will be more effort than I anticipated so will go out with 0.4 release If you're interested I could use the help 😄 https://github.com/hbmartin/graphviz2drawio/tree/invisible-nodes