Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use yaml syntax #808

Closed
jgroom33 opened this issue Mar 16, 2019 · 8 comments
Closed

Use yaml syntax #808

jgroom33 opened this issue Mar 16, 2019 · 8 comments
Labels
Type: New Shape Request for new shape

Comments

@jgroom33
Copy link

jgroom33 commented Mar 16, 2019

The goal of this issue is to implement a data driven approach to the graph.

This approach will allow a structured syntax to handle layouts, layout properties, shapes, shape properties, lines and line properties. Here's an example:

---
graph:
  layout: hierarchical
  properties:
    layout_direction: TD
    edge_weight: 100
    node_spacing: 100
  vertices:
    - name: myCircle
      shape: circle
      color: blue
    - name: myClass
      shape: class
      color: blue
      class_vars:
        - int foo
        - str bar
  edges:
    - A: myCircle
      Z: myClass
      A_end: circle
      Z_end: arrow
      line: dashed
      text: something interesting

mermaid code language would still be used. The above codeblock is using yml to provide syntax highlighting

@jgroom33
Copy link
Author

I assume the above syntax would allow this library to grow to handle significantly more complex use cases. It should also provide a more structured use of the underlying libraries that are providing the layout and view capabilities.

tbh, I haven't looked at the codebase though, so I might be completely incorrect. :)

@CamiloTDex
Copy link

I would love it

@jgroom33
Copy link
Author

here's another repo that could provide some guidance for implementation:
https://github.com/cidrblock/drawthe.net

@CrossEye
Copy link

Doesn't this counter the whole point of writing diagrams in a Markdown-like way?

There are many tools out there to help you write diagrams. What sets this one apart, IMHO, is exactly the input format. It's really nice to have Markdown environments in which adding diagrams is simple.

Or are you suggesting something different?

@jgroom33
Copy link
Author

jgroom33 commented May 1, 2019

I think what sets this tool apart is its inclusion in markdown rendering.
These three types of diagrams are roughly similar:

  • ClassDiagram
  • Flowchart
  • git graph

They could be drawn using the current implementation (DSL) or drawn using a generic implementation (this issue).

This issue would provide development to address the above examples in a generic manner and also address the following issues(not a complete list):
#822 #827 #825 #821 #820 #815 #814 #811 #806 #760 #770 #780

@CrossEye
Copy link

CrossEye commented May 3, 2019

I wonder if your goals wouldn't be better met by trying to get some DOT language interpreter embedded in Markdown implementations. That has a less verbose syntax than your proposal (more verbose than Mermaid, of course), but covers a lot more uses of graphs than Mermaid attempts.

Although embedding in Markdown is one of the reasons to use Mermaid, for me it's the ability to write diagrams logically without any nasty fiddling with alignment, box size, or any of the many other details required to use a visual editing program on these.

I've been using such tools when I can since I first saw Alex Moffat's text-diagram -> PNG tool, Sequence, more than 15 years ago, and I still really appreciate them. They have the same rationale for me that Markdown itself does: it's an extremely readable publishing format that can easily be transformed into any number of other formats if desired.

@jgroom33
Copy link
Author

jgroom33 commented May 4, 2019

I agree that a standardized graph format would be better than the initial recommendation

@stale
Copy link

stale bot commented Jul 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Type: New Shape Request for new shape label Jul 3, 2019
@jgroom33 jgroom33 closed this as completed Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Shape Request for new shape
Projects
None yet
Development

No branches or pull requests

3 participants