Code Monkey home page Code Monkey logo

Comments (11)

markthompson94 avatar markthompson94 commented on July 4, 2024

digraph_example.docx

Example .dot text included to assist troubleshooting

This .dot file was generated using the Python Diagrams module, using the following Python code;


from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Grouped Workers", show=True, outformat="dot", direction="TB"):
    ELB("lb") >> [EC2("worker1"),
                  EC2("worker2"),
                  EC2("worker3"),
                  EC2("worker4"),
                  EC2("worker5")] >> RDS("events")

from graphviz2drawio.

squio avatar squio commented on July 4, 2024

Ouch, got the same here; reduced testcase causes the same crash:

strict digraph CDD {
  splines="true"
  labelloc="t"
  label="CDD"
  // sep=.5
  Hello [label="/aa/bb\nHello"]
  World [shape=box, color=blue, fontcolor=blue, tooltip=aaaa]


  Hello -> { World }
}

Removing the tooltip attribute makes the conversion work

from graphviz2drawio.

markthompson94 avatar markthompson94 commented on July 4, 2024

@hbmartin could you possibly take a look into this for us? Much love and thanks!!

from graphviz2drawio.

ams1 avatar ams1 commented on July 4, 2024

just came across this really interesting repo -> @hbmartin THANK YOU for sharing!

@markthompson94 : i'll probably try to fix this over the weekend if it's still not working and get back to you.

from graphviz2drawio.

ams1 avatar ams1 commented on July 4, 2024

@markthompson94

The SVG file produced by graphviz via the Diagram lib (using the python code you provided) looks something like:

...

<!-- 1st g tag -->
<g id="edge3" class="edge">
  <title>94a1a24258c54e028e3b9cb0054dadc9&#45;&gt;739289249c574bffb2ed3d49b021b1da</title>
  <path fill="none" stroke="#7b8894" d="M338.5,-406.81C338.5,-406.81 338.5,-363.22 338.5,-363.22"/>

  <!-- this has a polygon tag -->
  <polygon fill="#7b8894" stroke="#7b8894" points="342,-363.22 338.5,-353.22 335,-363.22 342,-363.22"/>
</g>

...

<!-- 2nd g tag -->
<g id="node5" class="node">
  <title>2c1229f79a9141eea4b8ef297492ec26</title>
  <image xlink:href="does-not-matter/.local/lib/python3.8/site-packages/resources/aws/compute/ec2.png" width="101px" height="101px" preserveAspectRatio="xMinYMin meet" x="432" y="-335"/>
  <text text-anchor="middle" x="482.5" y="-219.6" font-family="Sans-Serif" font-size="13.00" fill="#2d3436">worker4</text>
  <!-- this does NOT hava a polygon tag -->
</g>

...

As we can see above, the 1st <g ...> tag HAS a <polygon .../> tag, while the 2nd g tag DOES NOT have a <polygon .../> tag, instead it has an <image ... /> tag.

Conclusion (might be wrong, I had just a quick look):

The problem is that this lib needs to have EITHER a <polygon .../> OR an <ellipse.../> in every <g ...> tag (see corresp. code below) and the python Diagrams returns an <image ...> tag instead, which is not supported.

@hbmartin Could you please just confirm -> yes/no? 😄

if SVG.has(g, "polygon"):
rect = self.rect_from_svg_points(
SVG.get_first(g, "polygon").attrib["points"]
)
else:
rect = self.rect_from_ellipse_svg(SVG.get_first(g, "ellipse").attrib)

from graphviz2drawio.

markthompson94 avatar markthompson94 commented on July 4, 2024

@hbmartin would you possibly be able to take a look at this? It'd be fantastic to have the ability to integrate Custom nodes from Python Diagrams in the graphviz2drawio module

from graphviz2drawio.

fabiomurillo avatar fabiomurillo commented on July 4, 2024

Was anyone able to workaround this issue?

from graphviz2drawio.

markthompson94 avatar markthompson94 commented on July 4, 2024

Think we need @hbmartin to help us out there 🤞

from graphviz2drawio.

markthompson94 avatar markthompson94 commented on July 4, 2024

Hi @hbmartin, when you have any time would you be able to look into this at all?

thanks so much!!

from graphviz2drawio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.