|
2 | 2 | "name": "generate_treemap_chart", |
3 | 3 | "description": "Generate a treemap chart to display hierarchical data and can intuitively show comparisons between items at the same level, such as, show disk space usage with treemap.", |
4 | 4 | "inputSchema": { |
5 | | - "$schema": "http://json-schema.org/draft-07/schema#", |
6 | 5 | "type": "object", |
7 | 6 | "properties": { |
8 | 7 | "data": { |
9 | 8 | "type": "array", |
10 | | - "minItems": 1, |
11 | 9 | "items": { |
12 | 10 | "type": "object", |
13 | 11 | "properties": { |
|
20 | 18 | "children": { |
21 | 19 | "type": "array", |
22 | 20 | "items": { |
23 | | - "$ref": "#/properties/data/items" |
| 21 | + "type": "object", |
| 22 | + "properties": { |
| 23 | + "name": { |
| 24 | + "type": "string" |
| 25 | + }, |
| 26 | + "value": { |
| 27 | + "type": "number" |
| 28 | + }, |
| 29 | + "children": { |
| 30 | + "type": "array", |
| 31 | + "items": { |
| 32 | + "type": "object", |
| 33 | + "properties": { |
| 34 | + "name": { |
| 35 | + "type": "string" |
| 36 | + }, |
| 37 | + "value": { |
| 38 | + "type": "number" |
| 39 | + } |
| 40 | + }, |
| 41 | + "required": ["name", "value"] |
| 42 | + } |
| 43 | + } |
| 44 | + }, |
| 45 | + "required": ["name", "value"] |
24 | 46 | } |
25 | 47 | } |
26 | 48 | }, |
27 | 49 | "required": ["name", "value"] |
28 | 50 | }, |
29 | | - "description": "Data for treemap chart, such as, [{ name: 'Design', value: 70, children: [{ name: 'Tech', value: 20 }] }]." |
30 | | - }, |
31 | | - "theme": { |
32 | | - "default": "default", |
33 | | - "description": "Set the theme for the chart, optional, default is 'default'.", |
34 | | - "enum": ["default", "academy", "dark"], |
35 | | - "type": "string" |
| 51 | + "minItems": 1, |
| 52 | + "description": "Data for treemap chart which is a hierarchical structure, such as, [{ name: 'Design', value: 70, children: [{ name: 'Tech', value: 20 }] }], and the maximum depth is 3." |
36 | 53 | }, |
37 | 54 | "style": { |
38 | | - "description": "Custom style configuration for the chart.", |
| 55 | + "type": "object", |
39 | 56 | "properties": { |
40 | 57 | "backgroundColor": { |
41 | | - "description": "Background color of the chart, such as, '#fff'.", |
42 | | - "type": "string" |
| 58 | + "type": "string", |
| 59 | + "description": "Background color of the chart, such as, '#fff'." |
43 | 60 | }, |
44 | 61 | "palette": { |
45 | | - "description": "Color palette for the chart, it is a collection of colors.", |
| 62 | + "type": "array", |
46 | 63 | "items": { |
47 | 64 | "type": "string" |
48 | 65 | }, |
49 | | - "type": "array" |
| 66 | + "description": "Color palette for the chart, it is a collection of colors." |
50 | 67 | }, |
51 | 68 | "texture": { |
52 | | - "default": "default", |
53 | | - "description": "Set the texture for the chart, optional, default is 'default'. 'rough' refers to hand-drawn style.", |
| 69 | + "type": "string", |
54 | 70 | "enum": ["default", "rough"], |
55 | | - "type": "string" |
| 71 | + "default": "default", |
| 72 | + "description": "Set the texture for the chart, optional, default is 'default'. 'rough' refers to hand-drawn style." |
56 | 73 | } |
57 | 74 | }, |
58 | | - "type": "object" |
| 75 | + "description": "Custom style configuration for the chart." |
| 76 | + }, |
| 77 | + "theme": { |
| 78 | + "type": "string", |
| 79 | + "enum": ["default", "academy", "dark"], |
| 80 | + "default": "default", |
| 81 | + "description": "Set the theme for the chart, optional, default is 'default'." |
59 | 82 | }, |
60 | 83 | "width": { |
61 | 84 | "type": "number", |
62 | | - "description": "Set the width of chart, default is 600.", |
63 | | - "default": 600 |
| 85 | + "default": 600, |
| 86 | + "description": "Set the width of chart, default is 600." |
64 | 87 | }, |
65 | 88 | "height": { |
66 | 89 | "type": "number", |
67 | | - "description": "Set the height of chart, default is 400.", |
68 | | - "default": 400 |
| 90 | + "default": 400, |
| 91 | + "description": "Set the height of chart, default is 400." |
69 | 92 | }, |
70 | 93 | "title": { |
71 | 94 | "type": "string", |
72 | 95 | "default": "", |
73 | 96 | "description": "Set the title of chart." |
74 | 97 | } |
75 | 98 | }, |
76 | | - "required": ["data"] |
| 99 | + "required": ["data"], |
| 100 | + "$schema": "http://json-schema.org/draft-07/schema#" |
77 | 101 | } |
78 | 102 | } |
0 commit comments