Giter Club home page Giter Club logo

Comments (4)

28mm avatar 28mm commented on July 23, 2024

At present, there's no direct way to produce a colored SVG from the command line, since javascript is doing the coloring-in. You can save the resulting svg through the browser, but that isn't quite as fast/automatic as what you seem to have in mind.

from blast-radius.

abitrolly avatar abitrolly commented on July 23, 2024

Who makes SVG output? There is a lot of style duplication, and if is possible to convert labels to class names - it will be possible to change colors with plain CSS.

For example, change this.

<!-- [root] var.environment -->
<g id="node_60" class="node"><title>[root] var.environment</title>
<polygon fill="none" stroke="black" points="2172,-394 2172,-409 2236,-409 2236,-394 2172,-394"/>
<text text-anchor="start" x="2196" y="-399.6" font-family="courier new" font-size="8.00">var</text>
<polygon fill="none" stroke="black" points="2172,-379 2172,-394 2236,-394 2236,-379 2172,-379"/>
<text text-anchor="start" x="2175" y="-384.6" font-family="courier new" font-size="8.00">environment</text>
</g>

To this.

<!-- [root] var.environment -->
<g id="node_60" class="node var"><title>[root] var.environment</title>
<polygon points="2172,-394 2172,-409 2236,-409 2236,-394 2172,-394"/>
<text text-anchor="start" x="2196" y="-399.6">var</text>
<polygon points="2172,-379 2172,-394 2236,-394 2236,-379 2172,-379"/>
<text text-anchor="start" x="2175" y="-384.6">environment</text>
</g>
<style>
.var polygon {fill: none}
</style>

from blast-radius.

abitrolly avatar abitrolly commented on July 23, 2024

Found the code. Uses dot -Tsvg.

def svg(self):

graphviz is pretty limited according to these questions, therefore a post-processor is needed.

https://www.google.com/search?q=graphviz+svg+output+with+class

from blast-radius.

28mm avatar 28mm commented on July 23, 2024

I agree that a post-processor of some kind is needed. One could be added to the python code base, and optionally enabled with a flag.

  • You could read in blast-radius/blastradius/server/static/js/categories.json to get the expected category groupings.
  • I imagine inline styles would be easier than style-sheets, since the number of colors needed isn't fixed. Or I suppose you could write a big long stylesheet.
  • Headings might be a bit of a pain since there could be a whole bunch of them stacked atop each other (the case for modules), each needing either a different class or inline style.

from blast-radius.

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.