terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.53k stars 414 forks source link

DRAKON diagram support #1066

Open qjcg opened 1 year ago

qjcg commented 1 year ago

Would the d2 project ever consider supporting DRAKON diagrams?

As far as I know, no other text-to-diagram tool currently supports this powerful diagram type, so this could be a strong differentiator. DRAKON diagrams are intended for clearly representing any process that has a goal --- so great for representing computing algorithms, business processes, health care procedures, etc.

Resources

alixander commented 1 year ago

hmm this would require new shapes and a new layout algorithm for this specific flowchart. i'm not opposed if someone wants to try the algorithm part using just boxes (it'd be a special layout algorithm like sequence_diagram). But it's not popular enough for the core team to spend time on it over all the other things.

if someone comes along and wants to try this, please ping me. I'll reopen and help guide you.

qjcg commented 1 year ago

@alixander I'm open to working on a "box-only-prototype" for this. I'm already a big user of d2, and it's a nice opportunity to contribute.

alixander commented 1 year ago

@qjcg that's great to hear! Is Drakon rule-based like sequence diagrams are? Can you lay out a rough plan of implementation? And then I'll help point you to places in the code and we can work out a design for a v1 together.

I think we can allow users to put shape: drakon, and everything in that container will use that, like sequence diagrams do. Nothing else in the semantics needs to change I don't believe, as it's just a way of laying out flowcharts right.

qjcg commented 1 year ago

Is Drakon rule-based like sequence diagrams are?

Broadly, yes, for example (via the Resources I listed above):

Can you lay out a rough plan of implementation? And then I'll help point you to places in the code and we can work out a design for a v1 together.

Sounds good! A rough plan follows:

Implementation Plan

The items below are high level and should probably be completed in descending order.

Feedback welcome!

Nothing else in the semantics needs to change I don't believe, as it's just a way of laying out flowcharts right.

I think that may indeed be right, but working through the plan above will allow us to confirm that one way or another.