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

shouldn't mermaid become more like Markdown ? #417

Closed
g3o2 opened this issue Nov 26, 2016 · 7 comments
Closed

shouldn't mermaid become more like Markdown ? #417

g3o2 opened this issue Nov 26, 2016 · 7 comments

Comments

@g3o2
Copy link

g3o2 commented Nov 26, 2016

This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript.

A look at Markdown's key objective:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

Maybe mermaid could inspire itself from this by making its text syntax look more like the final outcome rendered via javascript.

E.g. for graphs, a consequence could be to also allow:

graph:
  A
  |
  .
  B
 / \
.   .
C   D

which would be visually more appealing than:

graph TB;
  A-->B;
  B-->C;
  B-->D;
@g3o2 g3o2 changed the title shouldn't be mermaid become more like Markdown ? shouldn't mermaid become more like Markdown ? Nov 26, 2016
@sancarn
Copy link

sancarn commented Nov 27, 2016

As far as I am aware, the point of systems like Mermaid or Viz, isn't that the initial product should be visually appealing but that the initial product is easy for a computer to produce.

Ultimately, Viz and Mermaid are tools for automating the production of charts from data. In the end if you want something visually appealing why not just build it in a flowchart maker like draw.io?

An example use case of these graphers:
Say you have an object oriented program and you want to visualise the entire object structure to search for optimisations. It's far easier to write a program to search the code and turn it into:

object1-->object2
object2-->object3
object3-->object4
object3-->object5
object2-->object6
object1-->object7

Than it would be for the computer to produce something like:

            object1
             /  \
             .   .
       object2  object7
         /  \
         .   .
   object3  object6
     /  \
     .   .
object4  object5

Edit:
And even after editing the comment multiple times even I can't get the formatting correct...

@g3o2
Copy link
Author

g3o2 commented Nov 27, 2016

I see mermaid as an amazing tool when you don't want to spend too much time writing and deploying code for visualisation, or drawing such by hand in another tool.

What actually intrigues me is the parallel drawn in mermaid's documentation with Markdown. While both allow to convert plain text into a web format, mermaid's plain text is not (yet) in a shape that is always humanly apprehensible, as demonstrated by your example, formatting issues aside (tables in Markdown are not easier to format by hand).

@LarryKlugerDS
Copy link
Contributor

I think the docs comment re Wordpress is being interpreted too closely. The current format is good, IMHO. If @g3o2 wanted to create a converter from the format he describes to Mermaid, that would be an interesting project.

@g3o2
Copy link
Author

g3o2 commented Dec 22, 2016

I fully understand and agree with your comments. mermaid de facto provides an easy to understand and handy coding syntax for drawing diagrams, which can be included (like any other syntax or code) into a Markdown document.

However, the claim in the docs that mermaid would be markdown-like is in my opinion a little far stretched. Hence, my suggestion: a) to push mermaid further, which I understand from your replies may not be a desirable path, or b) to remove the said claim from the docs.

@karfau
Copy link

karfau commented Jan 20, 2017

In my opinion the mermaid format is easy to write and read for a textual representation of a graph.
Of course when you want to provide a visualization it is hard to do it using text, the goal is not surely not to write ASCII-art, right?

But I agree that it would make sense, to at least provide an elaboration on the relation to/ distinction from markdown.

@g3o2
Copy link
Author

g3o2 commented Feb 18, 2017

Heaven forbid manually drawn ASCII art, though mermaid would certainly be capable of producing such and vice versa. Maybe in a distant future version :-)

Regarding readability, mermaid provides a syntax for drawing a graph, but it is certainly not a textual representation. The latter would boil down to an interpretation à la "the graph has the shape of a diamond, represented by [x] nodes and [y] links, etc.".

@wigy-opensource-developer

I cannot agree with the proposal. I think tools like mermaid also help people just typing out a specification of a diagram and leave the representation to be calculated based on rules. Small changes in the specification could end up producing big changes in the diagram (one arrow or adding a day to a task on a Gantt-chart).

For me it seems more natural to keep the specification under version control, see the small diff between versions and leave the formatting and rendering to the software.

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants