generate_graph_chart
Visualize relationships between entities in network graphs by generating interactive charts. Input nodes and edges to create customizable layouts, themes, and outputs like PNG, SVG, or ECharts options.
Instructions
Generate a network graph chart to show relationships (edges) between entities (nodes), such as, relationships between people in social networks.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
data | Yes | Data for network graph chart, such as, { nodes: [{ id: 'node1', name: 'Node 1' }], edges: [{ source: 'node1', target: 'node2' }] } | |
height | No | Set the height of the chart, default is 600px. | |
layout | No | Layout algorithm for the graph. Default is 'force'. | force |
outputType | No | 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. | png |
theme | No | Set the theme for the chart, optional, default is 'default'. | default |
title | No | Set the title of the chart. | |
width | No | Set the width of the chart, default is 800px. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"data": {
"additionalProperties": false,
"description": "Data for network graph chart, such as, { nodes: [{ id: 'node1', name: 'Node 1' }], edges: [{ source: 'node1', target: 'node2' }] }",
"properties": {
"edges": {
"default": [],
"description": "Array of edges connecting nodes.",
"items": {
"additionalProperties": false,
"properties": {
"source": {
"description": "Source node id.",
"type": "string"
},
"target": {
"description": "Target node id.",
"type": "string"
},
"value": {
"description": "Weight or value of the edge.",
"type": "number"
}
},
"required": [
"source",
"target"
],
"type": "object"
},
"type": "array"
},
"nodes": {
"description": "Array of nodes in the network.",
"items": {
"additionalProperties": false,
"properties": {
"category": {
"description": "Category of the node (affects color).",
"type": "string"
},
"id": {
"description": "Unique identifier for the node.",
"type": "string"
},
"name": {
"description": "Display name of the node.",
"type": "string"
},
"value": {
"description": "Value associated with the node (affects size).",
"type": "number"
}
},
"required": [
"id",
"name"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"nodes"
],
"type": "object"
},
"height": {
"default": 600,
"description": "Set the height of the chart, default is 600px.",
"exclusiveMinimum": 0,
"type": "integer"
},
"layout": {
"default": "force",
"description": "Layout algorithm for the graph. Default is 'force'.",
"enum": [
"force",
"circular",
"none"
],
"type": "string"
},
"outputType": {
"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.",
"enum": [
"png",
"svg",
"option"
],
"type": "string"
},
"theme": {
"default": "default",
"description": "Set the theme for the chart, optional, default is 'default'.",
"enum": [
"default",
"dark"
],
"type": "string"
},
"title": {
"description": "Set the title of the chart.",
"type": "string"
},
"width": {
"default": 800,
"description": "Set the width of the chart, default is 800px.",
"exclusiveMinimum": 0,
"type": "integer"
}
},
"required": [
"data"
],
"type": "object"
}