This package is a writer of Mermaid flowcharts for Graphity graphs, with labels, shapes, classes, styles and clusters taken from your own arrays by node ID and edge index. Mermaid flowcharts render in Markdown.
It is a package of Graphity for TypeScript, which is the TypeScript implementation of the Java library Graphity. Its counterpart in Java is the module graphity-mermaid. The README of the repository shows how to use it and how its API relates to Java's.
npm install @kobayami/graphity-mermaid
Licensed under the Apache License 2.0; see the files LICENSE and NOTICE in the package.
Export of graphs to Mermaid flowcharts, which render directly in Markdown, in issues and in documentation.
This package is the counterpart of the Java module
graphity-mermaid, released with@kobayami/graphity-coreat the same version. MermaidWriter writes a graph as the text of a Mermaid flowchart, in the Direction of choice and with node Shapes. A graph holds no data, so the writer takes labels, shapes, classes and styles from hooks that receive a node ID or an edge index and read the caller's arrays. The clusters come from a partition of the nodes, with a hook for their labels. Here, the packages of a small program that depend on each other in a cycle:The node filter keeps the node IDs of the graph, so the hooks read the same arrays as for the whole graph. Mermaid renders graphs of a few hundred nodes well; for larger ones, the package
@kobayami/graphity-dotwrites DOT (the language of Graphviz).A hook may return
nullorundefined, which means none. Errors follow the core: a plainErrorwhere Java throws anIllegalArgumentException.