sankey.json•2.51 kB
{
"name": "generate_sankey_chart",
"description": "Generate a sankey chart to visualize the flow of data between different stages or categories, such as, the user journey from landing on a page to completing a purchase.",
"inputSchema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "Source node name, such as 'Landing Page'."
},
"target": {
"type": "string",
"description": "Target node name, such as 'Product Page'."
},
"value": {
"type": "number",
"description": "Flow value between source and target, such as 50000."
}
},
"required": ["source", "target", "value"]
},
"minItems": 1,
"description": "Data for sankey chart, such as, [{ source: 'Landing Page', target: 'Product Page', value: 50000 }, { source: 'Product Page', target: 'Add to Cart', value: 35000 }]."
},
"height": {
"type": "integer",
"exclusiveMinimum": 0,
"default": 600,
"description": "Set the height of the chart, default is 600px."
},
"nodeAlign": {
"type": "string",
"enum": ["left", "right", "justify"],
"default": "justify",
"description": "Alignment of nodes in the sankey chart, such as, 'left', 'right', or 'justify'."
},
"theme": {
"type": "string",
"enum": ["default", "dark"],
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'."
},
"title": {
"type": "string",
"description": "Set the title of the chart."
},
"width": {
"type": "integer",
"exclusiveMinimum": 0,
"default": 800,
"description": "Set the width of the chart, default is 800px."
},
"outputType": {
"type": "string",
"enum": ["png", "svg", "option"],
"default": "png",
"description": "The output type of the diagram. Can be 'png', 'svg' or 'option'. Default is 'png', 'png' will return the rendered PNG image, 'svg' will return the rendered SVG string, and 'option' will return the valid ECharts option."
}
},
"required": ["data"],
"$schema": "http://json-schema.org/draft-07/schema#"
}
}