Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8707f59
add mermaid
danmarshall Aug 19, 2025
fac773c
add complex diagram and use columns for table
danmarshall Aug 19, 2025
c9f9b28
enhance mermaid plugin with flexible input modes and usage examples
danmarshall Aug 19, 2025
e657d08
handle no-peer listeners
danmarshall Aug 19, 2025
933d582
add error handling for empty diagram data in renderDataDrivenDiagram
danmarshall Aug 19, 2025
be663a7
add dynamic string input example
danmarshall Aug 19, 2025
dd83c85
remove error from html
danmarshall Aug 19, 2025
6b98cbd
clone incoming instead of outgoing
danmarshall Aug 19, 2025
8f3685b
support placeholders in empty plugins
danmarshall Aug 19, 2025
a93ae09
use template with diagram header
danmarshall Aug 19, 2025
4a16241
whitespace
danmarshall Aug 19, 2025
4f1d30c
rename packages
danmarshall Aug 20, 2025
ce7c355
add mermaid (for types)
danmarshall Aug 20, 2025
345203b
lazy load mermaid
danmarshall Aug 20, 2025
19f31bc
dont bundle mermaid
danmarshall Aug 20, 2025
dc716b9
rename to diagramType
danmarshall Aug 20, 2025
b683896
output when listening and built
danmarshall Aug 20, 2025
b68905b
remove mermaid script from index.html
danmarshall Aug 20, 2025
714b478
revised template
danmarshall Aug 20, 2025
6138a30
variables in header
danmarshall Aug 20, 2025
79666d3
common renderer
danmarshall Aug 20, 2025
c7d515e
handle mermaid dep static or dynamic
danmarshall Aug 20, 2025
8317cfc
cleanup: remove temporary dmermaid divs after rendering
danmarshall Aug 20, 2025
2fa569f
add mermaid to resources
danmarshall Aug 20, 2025
4a92c8a
refactor: update mermaid import and initialization logic
danmarshall Aug 20, 2025
97f51d8
rebuild
danmarshall Aug 20, 2025
8a5c7ee
feat(tabulator): add rowMoved event listener to output data
danmarshall Aug 21, 2025
3e33bee
rebuild
danmarshall Aug 21, 2025
eb018b2
schema template
danmarshall Aug 22, 2025
03a7738
add mermaid to compiler
danmarshall Aug 22, 2025
39329c2
export interface
danmarshall Aug 22, 2025
ee8da53
new build
danmarshall Aug 22, 2025
7d5ffc2
listener error renders markdown directly
danmarshall Aug 22, 2025
d75e64b
add mermaid org chart example
danmarshall Aug 22, 2025
c5e76e7
add mermaid plugin examples and documentation
danmarshall Aug 22, 2025
9e8e707
add mermaid diagrams to ecosystem documentation
danmarshall Aug 22, 2025
f8b388b
corrected comments
danmarshall Aug 22, 2025
5781d4c
remove examples in test folder
danmarshall Aug 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The Chartifact GitHub repo has source code for these interoperating modules:
* **Inputs** – Textboxes, checkboxes, sliders, dropdowns
* **Tables** – Sortable, selectable, and editable data grids
* **Charts** – Vega and Vega-Lite visualizations
* **Diagrams** – Mermaid diagrams (flowcharts, networks, and more) via the mermaid plugin, including tabular data-driven diagram generation
* **Images** – Dynamic image URLs based on variables
* **Presets** – Named sets of variable values for quick scenario switching

Expand Down
4 changes: 4 additions & 0 deletions docs/assets/examples/features.markdown.folder.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"title": "Presets",
"href": "markdown/features/8.presets.idoc.md"
},
{
"title": "Mermaid",
"href": "markdown/features/9.mermaid.idoc.md"
},
{
"title": "Data URL",
"href": "markdown/features/data-url.idoc.md"
Expand Down
277 changes: 277 additions & 0 deletions docs/assets/examples/json/features/9.mermaid.idoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
{
"$schema": "https://microsoft.github.io/chartifact/schema/idoc_v1.json",
"title": "Feature: Mermaid Plugin",
"variables": [
{
"variableId": "flowchartOutput",
"type": "string",
"initialValue": ""
},
{
"variableId": "networkOutput",
"type": "string",
"initialValue": ""
}
],
"dataLoaders": [
{
"dataSourceName": "jsonData",
"type": "inline",
"format": "json",
"content": [
{
"lineTemplate": "node",
"id": "A",
"label": "Start"
},
{
"lineTemplate": "node",
"id": "B",
"label": "Middle"
},
{
"lineTemplate": "node",
"id": "C",
"label": "End"
},
{
"lineTemplate": "labeledEdge",
"from": "A",
"to": "B",
"label": "Next"
},
{
"lineTemplate": "edge",
"from": "B",
"to": "C"
}
]
},
{
"dataSourceName": "networkData",
"type": "inline",
"format": "json",
"content": [
{
"lineTemplate": "subgraph",
"name": "Production"
},
{
"lineTemplate": "server",
"id": "web1",
"name": "Web Server",
"ip": "10.0.1.10"
},
{
"lineTemplate": "server",
"id": "db1",
"name": "Database",
"ip": "10.0.1.20"
},
{
"lineTemplate": "end"
},
{
"lineTemplate": "subgraph",
"name": "Development"
},
{
"lineTemplate": "server",
"id": "dev1",
"name": "Dev Server",
"ip": "10.0.2.10"
},
{
"lineTemplate": "end"
},
{
"lineTemplate": "secureConnection",
"from": "web1",
"to": "db1"
},
{
"lineTemplate": "connection",
"from": "dev1",
"to": "web1"
}
]
}
],
"groups": [
{
"groupId": "intro",
"elements": [
"# Mermaid Plugin Examples",
"This page demonstrates the mermaid plugin in Chartifact, including raw text, data-driven, and dynamic modes."
]
},
{
"groupId": "raw-text",
"elements": [
"## Raw Text Mode",
"Simple flowchart using raw mermaid syntax:",
{
"type": "mermaid",
"diagramText": "flowchart TD\n A[Start] --> B{Is it?}\n B -->|Yes| C[OK]\n B -->|No| D[End]\n C --> D"
}
]
},
{
"groupId": "data-driven",
"elements": [
"## Data-Driven Mode",
"Template-based diagram generation:",
{
"type": "table",
"dataSourceName": "jsonData",
"variableId": "jsonTable",
"editable": true,
"tabulatorOptions": {
"columns": [
{
"title": "LineTemplate",
"field": "lineTemplate",
"editor": "list",
"editorParams": {
"values": [
"node",
"edge",
"labeledEdge"
]
}
},
{
"title": "ID",
"field": "id",
"editor": "input"
},
{
"title": "Label",
"field": "label",
"editor": "input"
},
{
"title": "From",
"field": "from",
"editor": "input"
},
{
"title": "To",
"field": "to",
"editor": "input"
},
{
"title": "Text",
"field": "text",
"editor": "input"
}
],
"layout": "fitColumns",
"maxHeight": "150px"
}
},
{
"type": "mermaid",
"template": {
"dataSourceName": "jsonTable",
"header": "flowchart TD",
"lineTemplates": {
"node": "{{id}}[{{label}}]",
"edge": "{{from}} --> {{to}}",
"labeledEdge": "{{from}} -->|{{label}}| {{to}}"
}
},
"variableId": "flowchartOutput"
},
"### Generated Mermaid Source:",
"```\n{{flowchartOutput}}\n```"
]
},
{
"groupId": "network",
"elements": [
"## More Complex Example",
"Network diagram with servers and connections:",
{
"type": "table",
"dataSourceName": "networkData",
"variableId": "networkTable",
"editable": true,
"tabulatorOptions": {
"columns": [
{
"title": "LineTemplate",
"field": "lineTemplate",
"editor": "list",
"editorParams": {
"values": [
"server",
"connection",
"secureConnection",
"subgraph",
"end"
]
}
},
{
"title": "ID",
"field": "id",
"editor": "input"
},
{
"title": "Name",
"field": "name",
"editor": "input"
},
{
"title": "IP",
"field": "ip",
"editor": "input"
},
{
"title": "From",
"field": "from",
"editor": "input"
},
{
"title": "To",
"field": "to",
"editor": "input"
}
],
"layout": "fitColumns",
"maxHeight": "200px"
}
},
{
"type": "mermaid",
"template": {
"dataSourceName": "networkTable",
"header": "graph LR",
"lineTemplates": {
"server": "{{id}}[{{name}}<br/>{{ip}}]",
"connection": "{{from}} --- {{to}}",
"secureConnection": "{{from}} -.->|SSL| {{to}}",
"subgraph": "subgraph {{name}}",
"end": "end"
}
},
"variableId": "networkOutput"
},
"### Generated Network Diagram Source:",
{
"type": "textbox",
"variableId": "networkOutput",
"multiline": true
},
"## String Input Mode",
"This example shows how to consume the generated Mermaid text from above and render it directly:",
{
"type": "mermaid",
"variableId": "networkOutput"
},
"This demonstrates the flexible input capability - the same `dataSourceName` property can handle string or array input."
]
}
]
}
Loading