You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 Generating Diagrams via the #create= Hash Property
The #create= hash property allows you to initialize the draw.io editor with pre-defined data, automatically generating a diagram upon loading. This is achieved by passing a JSON object as the hash value.
⚙️ JSON Object Structure for #create=
The #create= property must contain a JSON object with the following key parameters:
Parameter
Required/Optional
Description
data
Required
The raw text or compressed string containing the diagram input (e.g., description, Mermaid code, or CSV data).
type
Required
Specifies the type of input data and the generation engine to use.
compressed
Optional
Must be set to "true" if the data value is compressed.
🔍 Supported type Values
The type parameter determines how the data is processed to create the diagram:
"generate": Uses the AI backend to generate a diagram based on a natural language description provided in data.
"mermaid": Generates a diagram from Mermaid.js syntax provided in data.
"csv": Creates a diagram based on structured CSV data provided in data.
💡 Example: Using Compressed Mermaid Data
If you compress your Mermaid code (e.g., using a library like pako), your JSON object would look like this:
This feature is commonly used to generate a preview in an iframe or directly launch the diagram editor.
For an example demonstrating how to construct the URL and how to compress the data (e.g., using pako) for use with this property, please refer to the official draw.io tools example:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
📝 Generating Diagrams via the
#create=Hash PropertyThe
#create=hash property allows you to initialize the draw.io editor with pre-defined data, automatically generating a diagram upon loading. This is achieved by passing a JSON object as the hash value.⚙️ JSON Object Structure for
#create=The
#create=property must contain a JSON object with the following key parameters:datatypecompressed"true"if thedatavalue is compressed.🔍 Supported
typeValuesThe
typeparameter determines how thedatais processed to create the diagram:"generate": Uses the AI backend to generate a diagram based on a natural language description provided indata."mermaid": Generates a diagram from Mermaid.js syntax provided indata."csv": Creates a diagram based on structured CSV data provided indata.💡 Example: Using Compressed Mermaid Data
If you compress your Mermaid code (e.g., using a library like
pako), your JSON object would look like this:{ "data": "compressed_mermaid_string_here", "type": "mermaid", "compressed": "true" }Creating a Preview Link
This feature is commonly used to generate a preview in an iframe or directly launch the diagram editor.
For an example demonstrating how to construct the URL and how to compress the data (e.g., using pako) for use with this property, please refer to the official draw.io tools example:
Draw.io Tools: Generate Diagram Example
Example Link
Draw.io Mermaid Link
#create={"data":"graph TD\n A[Start] --> B[End]","type":"mermaid"}Beta Was this translation helpful? Give feedback.
All reactions