@standby/mcp-server-chart 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +285 -0
- package/build/charts/area.d.ts +41 -0
- package/build/charts/area.js +56 -0
- package/build/charts/bar.d.ts +41 -0
- package/build/charts/bar.js +57 -0
- package/build/charts/base.d.ts +30 -0
- package/build/charts/base.js +79 -0
- package/build/charts/boxplot.d.ts +40 -0
- package/build/charts/boxplot.js +50 -0
- package/build/charts/column.d.ts +41 -0
- package/build/charts/column.js +57 -0
- package/build/charts/dual-axes.d.ts +43 -0
- package/build/charts/dual-axes.js +59 -0
- package/build/charts/fishbone-diagram.d.ts +32 -0
- package/build/charts/fishbone-diagram.js +59 -0
- package/build/charts/flow-diagram.d.ts +39 -0
- package/build/charts/flow-diagram.js +45 -0
- package/build/charts/funnel.d.ts +36 -0
- package/build/charts/funnel.js +41 -0
- package/build/charts/histogram.d.ts +36 -0
- package/build/charts/histogram.js +45 -0
- package/build/charts/index.d.ts +26 -0
- package/build/charts/index.js +52 -0
- package/build/charts/line.d.ts +41 -0
- package/build/charts/line.js +52 -0
- package/build/charts/liquid.d.ts +39 -0
- package/build/charts/liquid.js +46 -0
- package/build/charts/mind-map.d.ts +30 -0
- package/build/charts/mind-map.js +43 -0
- package/build/charts/network-graph.d.ts +39 -0
- package/build/charts/network-graph.js +45 -0
- package/build/charts/organization-chart.d.ts +49 -0
- package/build/charts/organization-chart.js +60 -0
- package/build/charts/pie.d.ts +37 -0
- package/build/charts/pie.js +48 -0
- package/build/charts/radar.d.ts +38 -0
- package/build/charts/radar.js +49 -0
- package/build/charts/sankey.d.ts +43 -0
- package/build/charts/sankey.js +47 -0
- package/build/charts/scatter.d.ts +39 -0
- package/build/charts/scatter.js +47 -0
- package/build/charts/treemap.d.ts +44 -0
- package/build/charts/treemap.js +59 -0
- package/build/charts/venn.d.ts +37 -0
- package/build/charts/venn.js +49 -0
- package/build/charts/violin.d.ts +40 -0
- package/build/charts/violin.js +50 -0
- package/build/charts/waterfall.d.ts +44 -0
- package/build/charts/waterfall.js +73 -0
- package/build/charts/word-cloud.d.ts +36 -0
- package/build/charts/word-cloud.js +44 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +73 -0
- package/build/sdk.d.ts +6 -0
- package/build/sdk.js +24 -0
- package/build/server.d.ts +17 -0
- package/build/server.js +151 -0
- package/build/services/index.d.ts +3 -0
- package/build/services/index.js +9 -0
- package/build/services/sse.d.ts +2 -0
- package/build/services/sse.js +59 -0
- package/build/services/stdio.d.ts +2 -0
- package/build/services/stdio.js +21 -0
- package/build/services/streamable.d.ts +2 -0
- package/build/services/streamable.js +58 -0
- package/build/utils/callTool.d.ts +18 -0
- package/build/utils/callTool.js +129 -0
- package/build/utils/env.d.ts +12 -0
- package/build/utils/env.js +38 -0
- package/build/utils/generate.d.ts +4 -0
- package/build/utils/generate.js +35 -0
- package/build/utils/image-server.d.ts +18 -0
- package/build/utils/image-server.js +66 -0
- package/build/utils/index.d.ts +3 -0
- package/build/utils/index.js +9 -0
- package/build/utils/local-render.d.ts +17 -0
- package/build/utils/local-render.js +121 -0
- package/build/utils/logger.d.ts +28 -0
- package/build/utils/logger.js +57 -0
- package/build/utils/schema.d.ts +4 -0
- package/build/utils/schema.js +12 -0
- package/build/utils/spec-translator.d.ts +12 -0
- package/build/utils/spec-translator.js +515 -0
- package/build/utils/validator.d.ts +34 -0
- package/build/utils/validator.js +76 -0
- package/package.json +66 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.boxplot = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
const data = zod_1.z.object({
|
|
8
|
+
category: zod_1.z
|
|
9
|
+
.string()
|
|
10
|
+
.describe("Category of the data point, such as '分类一'."),
|
|
11
|
+
value: zod_1.z.number().describe("Value of the data point, such as 10."),
|
|
12
|
+
group: zod_1.z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("Optional group for the data point, used for grouping in the boxplot."),
|
|
16
|
+
});
|
|
17
|
+
const schema = {
|
|
18
|
+
data: zod_1.z
|
|
19
|
+
.array(data)
|
|
20
|
+
.describe("Data for boxplot chart, such as, [{ category: '分类一', value: 10 }] or [{ category: '分类二', value: 20, group: '组别一' }].")
|
|
21
|
+
.nonempty({ message: "Boxplot chart data cannot be empty." }),
|
|
22
|
+
style: zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
25
|
+
palette: base_1.PaletteSchema,
|
|
26
|
+
startAtZero: base_1.StartAtZeroSchema,
|
|
27
|
+
texture: base_1.TextureSchema,
|
|
28
|
+
})
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
31
|
+
theme: base_1.ThemeSchema,
|
|
32
|
+
width: base_1.WidthSchema,
|
|
33
|
+
height: base_1.HeightSchema,
|
|
34
|
+
title: base_1.TitleSchema,
|
|
35
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
36
|
+
axisYTitle: base_1.AxisYTitleSchema,
|
|
37
|
+
};
|
|
38
|
+
const tool = {
|
|
39
|
+
name: "generate_boxplot_chart",
|
|
40
|
+
description: "Generate a boxplot chart to show data for statistical summaries among different categories, such as, comparing the distribution of data points across categories.",
|
|
41
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
42
|
+
annotations: {
|
|
43
|
+
title: "Generate Boxplot Chart",
|
|
44
|
+
readOnlyHint: true,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.boxplot = {
|
|
48
|
+
schema,
|
|
49
|
+
tool,
|
|
50
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const column: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodObject<{
|
|
5
|
+
category: z.ZodString;
|
|
6
|
+
value: z.ZodNumber;
|
|
7
|
+
group: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
group: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
stack: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
default: "default";
|
|
16
|
+
rough: "rough";
|
|
17
|
+
}>>>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
default: "default";
|
|
21
|
+
academy: "academy";
|
|
22
|
+
dark: "dark";
|
|
23
|
+
}>>>;
|
|
24
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
25
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
26
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
};
|
|
30
|
+
tool: {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
34
|
+
[x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
annotations: {
|
|
37
|
+
title: string;
|
|
38
|
+
readOnlyHint: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.column = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Column chart data schema
|
|
8
|
+
const data = zod_1.z.object({
|
|
9
|
+
category: zod_1.z.string(),
|
|
10
|
+
value: zod_1.z.number(),
|
|
11
|
+
group: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
// Column chart input schema
|
|
14
|
+
const schema = {
|
|
15
|
+
data: zod_1.z
|
|
16
|
+
.array(data)
|
|
17
|
+
.describe("Data for column chart, such as, [{ category: 'Category A', value: 10 }, { category: 'Category B', value: 20 }], when grouping or stacking is needed for column, the data should contain a 'group' field, such as, [{ category: 'Beijing', value: 825, group: 'Gas Car' }, { category: 'Beijing', value: 1000, group: 'Electric Car' }].")
|
|
18
|
+
.nonempty({ message: "Column chart data cannot be empty." }),
|
|
19
|
+
group: zod_1.z
|
|
20
|
+
.boolean()
|
|
21
|
+
.optional()
|
|
22
|
+
.default(true)
|
|
23
|
+
.describe("Whether grouping is enabled. When enabled, column charts require a 'group' field in the data. When `group` is true, `stack` should be false."),
|
|
24
|
+
stack: zod_1.z
|
|
25
|
+
.boolean()
|
|
26
|
+
.optional()
|
|
27
|
+
.default(false)
|
|
28
|
+
.describe("Whether stacking is enabled. When enabled, column charts require a 'group' field in the data. When `stack` is true, `group` should be false."),
|
|
29
|
+
style: zod_1.z
|
|
30
|
+
.object({
|
|
31
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
32
|
+
palette: base_1.PaletteSchema,
|
|
33
|
+
texture: base_1.TextureSchema,
|
|
34
|
+
})
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
37
|
+
theme: base_1.ThemeSchema,
|
|
38
|
+
width: base_1.WidthSchema,
|
|
39
|
+
height: base_1.HeightSchema,
|
|
40
|
+
title: base_1.TitleSchema,
|
|
41
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
42
|
+
axisYTitle: base_1.AxisYTitleSchema,
|
|
43
|
+
};
|
|
44
|
+
// Column chart tool descriptor
|
|
45
|
+
const tool = {
|
|
46
|
+
name: "generate_column_chart",
|
|
47
|
+
description: "Generate a column chart, which are best for comparing categorical data, such as, when values are close, column charts are preferable because our eyes are better at judging height than other visual elements like area or angles.",
|
|
48
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
49
|
+
annotations: {
|
|
50
|
+
title: "Generate Column Chart",
|
|
51
|
+
readOnlyHint: true,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
exports.column = {
|
|
55
|
+
schema,
|
|
56
|
+
tool,
|
|
57
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const dualAxes: {
|
|
3
|
+
schema: {
|
|
4
|
+
categories: z.ZodArray<z.ZodString>;
|
|
5
|
+
series: z.ZodArray<z.ZodObject<{
|
|
6
|
+
type: z.ZodEnum<{
|
|
7
|
+
line: "line";
|
|
8
|
+
column: "column";
|
|
9
|
+
}>;
|
|
10
|
+
data: z.ZodArray<z.ZodNumber>;
|
|
11
|
+
axisYTitle: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
15
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
startAtZero: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
17
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
default: "default";
|
|
19
|
+
rough: "rough";
|
|
20
|
+
}>>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
default: "default";
|
|
24
|
+
academy: "academy";
|
|
25
|
+
dark: "dark";
|
|
26
|
+
}>>>;
|
|
27
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
28
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
29
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
30
|
+
axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
};
|
|
32
|
+
tool: {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
36
|
+
[x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
annotations: {
|
|
39
|
+
title: string;
|
|
40
|
+
readOnlyHint: boolean;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dualAxes = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Dual axes series schema
|
|
8
|
+
const DualAxesSeriesSchema = zod_1.z.object({
|
|
9
|
+
type: zod_1.z
|
|
10
|
+
.enum(["column", "line"])
|
|
11
|
+
.describe("The optional value can be 'column' or 'line'."),
|
|
12
|
+
data: zod_1.z
|
|
13
|
+
.array(zod_1.z.number())
|
|
14
|
+
.describe("When type is column, the data represents quantities, such as [91.9, 99.1, 101.6, 114.4, 121]. When type is line, the data represents ratios and its values are recommended to be less than 1, such as [0.055, 0.06, 0.062, 0.07, 0.075]."),
|
|
15
|
+
axisYTitle: zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.default("")
|
|
18
|
+
.describe("Set the y-axis title of the chart series, such as, axisYTitle: '销售额'.")
|
|
19
|
+
.optional(),
|
|
20
|
+
});
|
|
21
|
+
// Dual axes chart input schema
|
|
22
|
+
const schema = {
|
|
23
|
+
categories: zod_1.z
|
|
24
|
+
.array(zod_1.z.string())
|
|
25
|
+
.describe("Categories for dual axes chart, such as, ['2015', '2016', '2017'].")
|
|
26
|
+
.nonempty({ message: "Dual axes chart categories cannot be empty." }),
|
|
27
|
+
series: zod_1.z
|
|
28
|
+
.array(DualAxesSeriesSchema)
|
|
29
|
+
.describe("Series for dual axes chart, such as, [{ type: 'column', data: [91.9, 99.1, 101.6, 114.4, 121], axisYTitle: '销售额' }, { type: 'line', data: [0.055, 0.06, 0.062, 0.07, 0.075], 'axisYTitle': '利润率' }].")
|
|
30
|
+
.nonempty({ message: "Dual axes chart series cannot be empty." }),
|
|
31
|
+
style: zod_1.z
|
|
32
|
+
.object({
|
|
33
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
34
|
+
palette: base_1.PaletteSchema,
|
|
35
|
+
startAtZero: base_1.StartAtZeroSchema,
|
|
36
|
+
texture: base_1.TextureSchema,
|
|
37
|
+
})
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
40
|
+
theme: base_1.ThemeSchema,
|
|
41
|
+
width: base_1.WidthSchema,
|
|
42
|
+
height: base_1.HeightSchema,
|
|
43
|
+
title: base_1.TitleSchema,
|
|
44
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
45
|
+
};
|
|
46
|
+
// Dual axes chart tool descriptor
|
|
47
|
+
const tool = {
|
|
48
|
+
name: "generate_dual_axes_chart",
|
|
49
|
+
description: "Generate a dual axes chart which is a combination chart that integrates two different chart types, typically combining a bar chart with a line chart to display both the trend and comparison of data, such as, the trend of sales and profit over time.",
|
|
50
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
51
|
+
annotations: {
|
|
52
|
+
title: "Generate Dual Axes Chart",
|
|
53
|
+
readOnlyHint: true,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
exports.dualAxes = {
|
|
57
|
+
schema,
|
|
58
|
+
tool,
|
|
59
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type TreeDataType } from "../utils/validator";
|
|
3
|
+
export declare const FishboneNodeSchema: z.ZodType<TreeDataType>;
|
|
4
|
+
export declare const fishboneDiagram: {
|
|
5
|
+
schema: {
|
|
6
|
+
data: z.ZodType<TreeDataType, unknown, z.core.$ZodTypeInternals<TreeDataType, unknown>>;
|
|
7
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
default: "default";
|
|
10
|
+
rough: "rough";
|
|
11
|
+
}>>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
default: "default";
|
|
15
|
+
academy: "academy";
|
|
16
|
+
dark: "dark";
|
|
17
|
+
}>>>;
|
|
18
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
19
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
20
|
+
};
|
|
21
|
+
tool: {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
25
|
+
[x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
annotations: {
|
|
28
|
+
title: string;
|
|
29
|
+
readOnlyHint: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fishboneDiagram = exports.FishboneNodeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const validator_1 = require("../utils/validator.js");
|
|
7
|
+
const base_1 = require("./base.js");
|
|
8
|
+
// Fishbone node schema
|
|
9
|
+
// The recursive schema is not supported by gemini, and other clients, so we use a non-recursive schema which can represent a tree structure with a fixed depth.
|
|
10
|
+
// Ref: https://github.com/antvis/mcp-server-chart/issues/155
|
|
11
|
+
// Ref: https://github.com/antvis/mcp-server-chart/issues/132
|
|
12
|
+
exports.FishboneNodeSchema = zod_1.z.object({
|
|
13
|
+
name: zod_1.z.string(),
|
|
14
|
+
children: zod_1.z
|
|
15
|
+
.array(zod_1.z.object({
|
|
16
|
+
name: zod_1.z.string(),
|
|
17
|
+
children: zod_1.z
|
|
18
|
+
.array(zod_1.z.object({
|
|
19
|
+
name: zod_1.z.string(),
|
|
20
|
+
children: zod_1.z
|
|
21
|
+
.array(zod_1.z.object({
|
|
22
|
+
name: zod_1.z.string(),
|
|
23
|
+
}))
|
|
24
|
+
.optional(),
|
|
25
|
+
}))
|
|
26
|
+
.optional(),
|
|
27
|
+
}))
|
|
28
|
+
.optional(),
|
|
29
|
+
});
|
|
30
|
+
// Fishbone diagram input schema
|
|
31
|
+
const schema = {
|
|
32
|
+
data: exports.FishboneNodeSchema.describe("Data for fishbone diagram chart which is a hierarchical structure, such as, { name: 'main topic', children: [{ name: 'topic 1', children: [{ name: 'subtopic 1-1' }] }] }, and the maximum depth is 3.").refine(validator_1.validatedTreeDataSchema, {
|
|
33
|
+
message: "Invalid parameters: node name is not unique.",
|
|
34
|
+
path: ["data"],
|
|
35
|
+
}),
|
|
36
|
+
style: zod_1.z
|
|
37
|
+
.object({
|
|
38
|
+
texture: base_1.TextureSchema,
|
|
39
|
+
})
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
42
|
+
theme: base_1.ThemeSchema,
|
|
43
|
+
width: base_1.WidthSchema,
|
|
44
|
+
height: base_1.HeightSchema,
|
|
45
|
+
};
|
|
46
|
+
// Fishbone diagram tool descriptor
|
|
47
|
+
const tool = {
|
|
48
|
+
name: "generate_fishbone_diagram",
|
|
49
|
+
description: "Generate a fishbone diagram chart to uses a fish skeleton, like structure to display the causes or effects of a core problem, with the problem as the fish head and the causes/effects as the fish bones. It suits problems that can be split into multiple related factors.",
|
|
50
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
51
|
+
annotations: {
|
|
52
|
+
title: "Generate Fishbone Diagram",
|
|
53
|
+
readOnlyHint: true,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
exports.fishboneDiagram = {
|
|
57
|
+
schema,
|
|
58
|
+
tool,
|
|
59
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const flowDiagram: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodObject<{
|
|
5
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
9
|
+
source: z.ZodString;
|
|
10
|
+
target: z.ZodString;
|
|
11
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
default: "default";
|
|
17
|
+
rough: "rough";
|
|
18
|
+
}>>>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
default: "default";
|
|
22
|
+
academy: "academy";
|
|
23
|
+
dark: "dark";
|
|
24
|
+
}>>>;
|
|
25
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
26
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
27
|
+
};
|
|
28
|
+
tool: {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
32
|
+
[x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
annotations: {
|
|
35
|
+
title: string;
|
|
36
|
+
readOnlyHint: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flowDiagram = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const validator_1 = require("../utils/validator.js");
|
|
7
|
+
const base_1 = require("./base.js");
|
|
8
|
+
// Flow diagram input schema
|
|
9
|
+
const schema = {
|
|
10
|
+
data: zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
nodes: zod_1.z
|
|
13
|
+
.array(base_1.NodeSchema)
|
|
14
|
+
.nonempty({ message: "At least one node is required." }),
|
|
15
|
+
edges: zod_1.z.array(base_1.EdgeSchema),
|
|
16
|
+
})
|
|
17
|
+
.describe("Data for flow diagram chart, such as, { nodes: [{ name: 'node1' }, { name: 'node2' }], edges: [{ source: 'node1', target: 'node2', name: 'edge1' }] }.")
|
|
18
|
+
.refine(validator_1.validatedNodeEdgeDataSchema, {
|
|
19
|
+
message: "Invalid parameters",
|
|
20
|
+
path: ["data", "edges"],
|
|
21
|
+
}),
|
|
22
|
+
style: zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
texture: base_1.TextureSchema,
|
|
25
|
+
})
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
28
|
+
theme: base_1.ThemeSchema,
|
|
29
|
+
width: base_1.WidthSchema,
|
|
30
|
+
height: base_1.HeightSchema,
|
|
31
|
+
};
|
|
32
|
+
// Flow diagram tool descriptor
|
|
33
|
+
const tool = {
|
|
34
|
+
name: "generate_flow_diagram",
|
|
35
|
+
description: "Generate a flow diagram chart to show the steps and decision points of a process or system, such as, scenarios requiring linear process presentation.",
|
|
36
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
37
|
+
annotations: {
|
|
38
|
+
title: "Generate Flow Diagram",
|
|
39
|
+
readOnlyHint: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
exports.flowDiagram = {
|
|
43
|
+
schema,
|
|
44
|
+
tool,
|
|
45
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const funnel: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodObject<{
|
|
5
|
+
category: z.ZodString;
|
|
6
|
+
value: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
10
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
default: "default";
|
|
13
|
+
rough: "rough";
|
|
14
|
+
}>>>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
default: "default";
|
|
18
|
+
academy: "academy";
|
|
19
|
+
dark: "dark";
|
|
20
|
+
}>>>;
|
|
21
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
22
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
23
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
};
|
|
25
|
+
tool: {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
29
|
+
[x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
annotations: {
|
|
32
|
+
title: string;
|
|
33
|
+
readOnlyHint: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.funnel = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
const data = zod_1.z.object({
|
|
8
|
+
category: zod_1.z.string(),
|
|
9
|
+
value: zod_1.z.number(),
|
|
10
|
+
});
|
|
11
|
+
const schema = {
|
|
12
|
+
data: zod_1.z
|
|
13
|
+
.array(data)
|
|
14
|
+
.describe("Data for funnel chart, such as, [{ category: '浏览网站', value: 50000 }, { category: '放入购物车', value: 35000 }, { category: '生成订单', value: 25000 }, { category: '支付订单', value: 15000 }, { category: '完成交易', value: 8000 }].")
|
|
15
|
+
.nonempty({ message: "Funnel chart data cannot be empty." }),
|
|
16
|
+
style: zod_1.z
|
|
17
|
+
.object({
|
|
18
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
19
|
+
palette: base_1.PaletteSchema,
|
|
20
|
+
texture: base_1.TextureSchema,
|
|
21
|
+
})
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
24
|
+
theme: base_1.ThemeSchema,
|
|
25
|
+
width: base_1.WidthSchema,
|
|
26
|
+
height: base_1.HeightSchema,
|
|
27
|
+
title: base_1.TitleSchema,
|
|
28
|
+
};
|
|
29
|
+
const tool = {
|
|
30
|
+
name: "generate_funnel_chart",
|
|
31
|
+
description: "Generate a funnel chart to visualize the progressive reduction of data as it passes through stages, such as, the conversion rates of users from visiting a website to completing a purchase.",
|
|
32
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
33
|
+
annotations: {
|
|
34
|
+
title: "Generate Funnel Chart",
|
|
35
|
+
readOnlyHint: true,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
exports.funnel = {
|
|
39
|
+
schema,
|
|
40
|
+
tool,
|
|
41
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const histogram: {
|
|
3
|
+
schema: {
|
|
4
|
+
data: z.ZodArray<z.ZodNumber>;
|
|
5
|
+
binNumber: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
palette: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
texture: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
default: "default";
|
|
11
|
+
rough: "rough";
|
|
12
|
+
}>>>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
default: "default";
|
|
16
|
+
academy: "academy";
|
|
17
|
+
dark: "dark";
|
|
18
|
+
}>>>;
|
|
19
|
+
width: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
20
|
+
height: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
22
|
+
axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
};
|
|
25
|
+
tool: {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
inputSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
29
|
+
[x: string]: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
annotations: {
|
|
32
|
+
title: string;
|
|
33
|
+
readOnlyHint: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.histogram = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils/index.js");
|
|
6
|
+
const base_1 = require("./base.js");
|
|
7
|
+
// Histogram chart input schema
|
|
8
|
+
const schema = {
|
|
9
|
+
data: zod_1.z
|
|
10
|
+
.array(zod_1.z.number())
|
|
11
|
+
.describe("Data for histogram chart, it should be an array of numbers, such as, [78, 88, 60, 100, 95].")
|
|
12
|
+
.nonempty({ message: "Histogram chart data cannot be empty." }),
|
|
13
|
+
binNumber: zod_1.z
|
|
14
|
+
.number()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Number of intervals to define the number of intervals in a histogram, when not specified, a built-in value will be used."),
|
|
17
|
+
style: zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
backgroundColor: base_1.BackgroundColorSchema,
|
|
20
|
+
palette: base_1.PaletteSchema,
|
|
21
|
+
texture: base_1.TextureSchema,
|
|
22
|
+
})
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Style configuration for the chart with a JSON object, optional."),
|
|
25
|
+
theme: base_1.ThemeSchema,
|
|
26
|
+
width: base_1.WidthSchema,
|
|
27
|
+
height: base_1.HeightSchema,
|
|
28
|
+
title: base_1.TitleSchema,
|
|
29
|
+
axisXTitle: base_1.AxisXTitleSchema,
|
|
30
|
+
axisYTitle: base_1.AxisYTitleSchema,
|
|
31
|
+
};
|
|
32
|
+
// Histogram chart tool descriptor
|
|
33
|
+
const tool = {
|
|
34
|
+
name: "generate_histogram_chart",
|
|
35
|
+
description: "Generate a histogram chart to show the frequency of data points within a certain range. It can observe data distribution, such as, normal and skewed distributions, and identify data concentration areas and extreme points.",
|
|
36
|
+
inputSchema: (0, utils_1.zodToJsonSchema)(schema),
|
|
37
|
+
annotations: {
|
|
38
|
+
title: "Generate Histogram Chart",
|
|
39
|
+
readOnlyHint: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
exports.histogram = {
|
|
43
|
+
schema,
|
|
44
|
+
tool,
|
|
45
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* export all charts as named exports to match the chart type
|
|
3
|
+
*/
|
|
4
|
+
export { area } from "./area";
|
|
5
|
+
export { bar } from "./bar";
|
|
6
|
+
export { boxplot } from "./boxplot";
|
|
7
|
+
export { column } from "./column";
|
|
8
|
+
export { dualAxes as "dual-axes" } from "./dual-axes";
|
|
9
|
+
export { fishboneDiagram as "fishbone-diagram" } from "./fishbone-diagram";
|
|
10
|
+
export { flowDiagram as "flow-diagram" } from "./flow-diagram";
|
|
11
|
+
export { funnel } from "./funnel";
|
|
12
|
+
export { histogram } from "./histogram";
|
|
13
|
+
export { line } from "./line";
|
|
14
|
+
export { liquid } from "./liquid";
|
|
15
|
+
export { mindMap as "mind-map" } from "./mind-map";
|
|
16
|
+
export { networkGraph as "network-graph" } from "./network-graph";
|
|
17
|
+
export { organizationChart as "organization-chart" } from "./organization-chart";
|
|
18
|
+
export { pie } from "./pie";
|
|
19
|
+
export { radar } from "./radar";
|
|
20
|
+
export { sankey } from "./sankey";
|
|
21
|
+
export { scatter } from "./scatter";
|
|
22
|
+
export { treemap } from "./treemap";
|
|
23
|
+
export { venn } from "./venn";
|
|
24
|
+
export { violin } from "./violin";
|
|
25
|
+
export { waterfall } from "./waterfall";
|
|
26
|
+
export { wordCloud as "word-cloud" } from "./word-cloud";
|