Live data from Hacker News

Diagram as Code

diagrams.mingrammer.com

31–40 of 77 posts

Re: Diagram as Code

#31
post #3

It seems to be hyperfocused on system architecture diagrams. There are some other kinds of diagrams would we like to draw that’s not system architecture diagrams, eg: - algorithms - decision trees - UML/ER Diagrams Mermaid (JS) helps draw quality diagrams quickly - more than system architecture diagrams. It would have been perfect if the development cycles that went here was used to create Mermaid templates instead.…

The focus would make sense to me if, say, it exported to initial terraform templates or something like that.

I'd love if it generated full terraform files with all the required information from the Python code, the rest from sane defaults.

Would also be great to import things with generic names:

    from diagrams.aws.database import RDS as Database
which you could replace at a later point with:

    from diagrams.gcp.database import SQL as Database
And have a provider neutral description that could eventually be compiled into a provider-specific Terraform description just by changing the imports.

Re: Diagram as Code

#32
Slightly different, but there is now an VSCode extension to use draw.io directly in the editor.

https://marketplace.visualstudio.com/items?itemName=hediet.v...

If you don't know draw.io, it's an free diagram software that not only has an XML format to save them, but can also be used to save it as a PNG that EMBEDS said XML, so you can edit it again, but display it like a regular image.

Re: Diagram as Code

#33
post #18

This is cool! I was hoping it would look something like: ‘’’ import diagrams calc_d = diagrams.new_diagram(“calculator_123”) calc_d.Datum("SuperNumber") class SuperNumber(int): pass @calc_d.Service(“Calculator”, “takes numbers and operations and operates”) class Calculator(object): @calc_d.Endpoint("Add", calls=["Increment"], main_data={"b": "SuperNumber}) def add(self, a, b: SuperNumber): out = a for i in range(b):…

Indent with 4 spaces at the start of each line for code blocks.

Re: Diagram as Code

#34
post #33
post #18

This is cool! I was hoping it would look something like: ‘’’ import diagrams calc_d = diagrams.new_diagram(“calculator_123”) calc_d.Datum("SuperNumber") class SuperNumber(int): pass @calc_d.Service(“Calculator”, “takes numbers and operations and operates”) class Calculator(object): @calc_d.Endpoint("Add", calls=["Increment"], main_data={"b": "SuperNumber}) def add(self, a, b: SuperNumber): out = a for i in range(b):…

Indent with 4 spaces at the start of each line for code blocks.

This is annoyingly difficult in a browser.

Re: Diagram as Code

#35

I've got a similar project which takes a diagram of your infrastructure, such as [1] and runs the diagram to build your devops infrastructure [2]. [1]: http://devops-pipeline.com/architecture.tb.png [2]: http://devops-pipeline.com/

Interesting. That was going to be my next question!

Re: Diagram as Code

#36
post #33
post #18

This is cool! I was hoping it would look something like: ‘’’ import diagrams calc_d = diagrams.new_diagram(“calculator_123”) calc_d.Datum("SuperNumber") class SuperNumber(int): pass @calc_d.Service(“Calculator”, “takes numbers and operations and operates”) class Calculator(object): @calc_d.Endpoint("Add", calls=["Increment"], main_data={"b": "SuperNumber}) def add(self, a, b: SuperNumber): out = a for i in range(b):…

Indent with 4 spaces at the start of each line for code blocks.

[deleted]

Re: Diagram as Code

#37
When I was ~10yrs old, I would play with a program called RPG Maker 2000. It had a really interesting code system where you could click blocks of code and it would bring up a UI for modifying them. It was always simple stuff like if/else, for, switch.. but it merged the simplicity of clicking dropdowns and the like with the complexity of actually seeing the code and learning to read and navigate it. You could also go rogue and write custom code.

I still think that this solution has more life to it and would like to explore that some day.

Re: Diagram as Code

#40

I was hoping this tool would support directionality/sequencing of nodes. A tool I've used in the past is SequenceDiagram.org for diagraming a sequence of service calls. While a bit old-school, it's good for its purpose. I've also used Whimsical[0] to model flows and graph-like relationships. It's got the added benefit of allowing multiple users to view and edit the same document. Whimsical is still my favorite tool r…

Looks visually pleasing, but I found their more complex diagrams harder to read compared with something more plain.
Post reply on HN