Diagram
About this tool
How to use it
- Choose this tool. You do not need to add a file.
- Type or paste your diagram text, and choose its syntax if asked.
- Pick a theme and the picture format.
- Press Generate.
- Download the diagram.
What you get back
Try Diagram in the Studio
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/render/diagram" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'source=graph TD
A[Start] --> B{Ready?}
B -->|Yes| C[Ship]' \
-F 'syntax=auto' \
-F 'output=png'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.render.diagram({
"source": "graph TD\n A[Start] --> B{Ready?}\n B -->|Yes| C[Ship]",
"syntax": "auto",
"output": "png"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->render()->diagram([
'source' => 'graph TD
A[Start] --> B{Ready?}
B -->|Yes| C[Ship]',
'syntax' => 'auto',
'output' => 'png',
]);
echo $result->requestId;