Skip to content

Add a way to draw charts, graphs and diagrams from markdown / code / text #378

@Weibye

Description

@Weibye

Motivation

  • A lot of the learning-material in the Bevy-book can be improved by displaying graphs or diagrams as shown here: [Merged by Bors] - Introduction for ECS chapter #290 (comment)
  • Nearly all release-notes contain some form of charts, and will likely continue to do so in the future. Improving the process of creating these charts could take workload off of core maintainers and democratize the process
  • Hypothesis: Graphs and diagrams that are drawn from text or code is easier to maintain by a team compared to static images generated by a user
  • I initially thought adding mermaid support would be enough (Add support for mermaid diagrams #377) but after playing with it some it seems to not fully suitable

Types of diagrams we should consider supporting

I've focused on diagrams already in use or known to wanted in the near future

Type Examples Notes
Gantt Diagram 1 This example isn't enough to warrant spending tons of resources supporting this type of diagram. This is more "icon" than "diagram"
Flowchart 1 Same as above
Bar Chart 1 2 3 4 5 6 7 8 9 Due to its already extensive usage, supporting this makes sense
"ECS Overview Diagram" 1 This type of diagram would be extremely useful to display at the start of every example

Potential Solutions

mermaid

What

Javascript framework for rendering various diagrams

Pros

Cons

  • Hard to customize beyond colors and outlines
  • Poor layout solver with virtually no control, leading to unreadable diagrams as they grow in size
    • Some types of diagrams are better than others

HTML + CSS

What

By using shortcodes in Zola it is possible to create html blocs and display them in a page. However, for that to be composable and useful, we would need to add support for nested shortcodes, in which case we could write shortcodes somewhat similar to a mermaid script.

(Are there other ways to get it working?)

Pros

  • No javascript or external dependencies needed

Cons

LaTeX

What

LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation.

Example of how it looks in use

Pros

  • LaTeX is very powerful

Cons

Feedback wanted

  • Is this something that is valuable to pursue?
  • Would solving this improve our current or future situation?
  • Are there other types of diagrams we should consider adding to the list above?
  • Are there other technologies or approaches that could solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BookC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions