-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualization-chart-spec-schema.json
More file actions
94 lines (94 loc) · 3 KB
/
Copy pathvisualization-chart-spec-schema.json
File metadata and controls
94 lines (94 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/visualization/refs/heads/main/json-schema/visualization-chart-spec-schema.json",
"title": "ChartSpec",
"description": "A portable specification describing a single chart or visualization, including its type, data source, encodings, and rendering options.",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Human-readable name of the chart.",
"example": "Monthly Revenue by Region"
},
"description": {
"type": "string",
"description": "Optional description of what the chart visualizes.",
"example": "Stacked bar chart of monthly revenue broken down by sales region."
},
"chart_type": {
"type": "string",
"description": "The kind of chart or visualization to render.",
"enum": [
"bar",
"line",
"area",
"pie",
"donut",
"scatter",
"bubble",
"heatmap",
"histogram",
"boxplot",
"table",
"kpi",
"map",
"treemap",
"sankey",
"subway-map",
"graph",
"other"
],
"example": "bar"
},
"data_source": {
"type": "object",
"description": "Reference to the data source the chart queries against.",
"properties": {
"id": { "type": "string", "example": "ds_warehouse_prod" },
"type": {
"type": "string",
"enum": ["sql", "api", "file", "warehouse", "metric", "model"],
"example": "sql"
},
"query": {
"type": "string",
"description": "Query, expression, or reference used to fetch chart data.",
"example": "SELECT region, month, SUM(revenue) FROM orders GROUP BY region, month"
}
},
"required": ["type"]
},
"encodings": {
"type": "object",
"description": "Mapping of visual channels (x, y, color, size, etc.) to data fields.",
"properties": {
"x": { "type": "string", "example": "month" },
"y": { "type": "string", "example": "revenue" },
"color": { "type": "string", "example": "region" },
"size": { "type": "string" },
"tooltip": {
"type": "array",
"items": { "type": "string" }
}
}
},
"options": {
"type": "object",
"description": "Rendering options such as theme, legend, axes, and stacking.",
"properties": {
"stacked": { "type": "boolean", "example": true },
"theme": { "type": "string", "example": "light" },
"legend": { "type": "boolean", "example": true },
"width": { "type": "integer", "example": 800 },
"height": { "type": "integer", "example": 400 }
}
},
"tags": {
"type": "array",
"description": "Tags categorizing the chart.",
"items": { "type": "string" },
"example": ["revenue", "finance", "regional"]
}
},
"required": ["name", "chart_type"]
}