Comments (4)
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.
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.
Found the code. Uses dot -Tsvg
.
blast-radius/blastradius/graph.py
Line 26 in 4b07f64
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.
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)
- Receiving issue when trying to connect to git for AWS provider HOT 4
- When using with an AWS project, diagram is blank. HOT 9
- BUG: Commit a7ec4ef Docker feature not functional, returns `no such file or dir` error HOT 3
- REQ: SemVer Release or Tag
- Python 3.10 incomptablity due to collections HOT 3
- AttributeError: module 'collections' has no attribute 'MutableSet' HOT 1
- Error using && Logical Operators
- Terraform initialized in an empty directory! but directory is not empty
- HTTP 500 internal server error: unexpected LEFTBRACKET HOT 4
- Importing ABC directly from collections will be removed in Python 3.10
- Using blast-radius for the first time HOT 1
- All I see is the graphviz svg graph HOT 1
- Error fetching terraform module in blast-radius HOT 16
- AttributeError: 'NoneType' object has no attribute 'groupdict' HOT 12
- Is this project still maintained? HOT 2
- Local install fails to find templates
- Error: Unsuitable value type HOT 1
- Blast Radius triggers 500 response HOT 4
- WORKING VERSION
- Does not start up HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blast-radius.