@umengfe/mcp-server-chart 0.0.4 → 0.0.5

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.
@@ -32,3 +32,4 @@ export declare const MapTitleSchema: z.ZodString;
32
32
  export declare const MapWidthSchema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
33
33
  export declare const MapHeightSchema: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
34
34
  export declare const POIsSchema: z.ZodArray<z.ZodString, "atleastone">;
35
+ export declare const LabelFormatterSchema: z.ZodOptional<z.ZodString>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.POIsSchema = exports.MapHeightSchema = exports.MapWidthSchema = exports.MapTitleSchema = exports.EdgeSchema = exports.NodeSchema = exports.AxisYTitleSchema = exports.AxisXTitleSchema = exports.TitleSchema = exports.HeightSchema = exports.WidthSchema = exports.TextureSchema = exports.PaletteSchema = exports.BackgroundColorSchema = exports.ThemeSchema = void 0;
3
+ exports.LabelFormatterSchema = exports.POIsSchema = exports.MapHeightSchema = exports.MapWidthSchema = exports.MapTitleSchema = exports.EdgeSchema = exports.NodeSchema = exports.AxisYTitleSchema = exports.AxisXTitleSchema = exports.TitleSchema = exports.HeightSchema = exports.WidthSchema = exports.TextureSchema = exports.PaletteSchema = exports.BackgroundColorSchema = exports.ThemeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  // Define Zod schemas for base configuration properties
6
6
  exports.ThemeSchema = zod_1.z
@@ -72,3 +72,20 @@ exports.POIsSchema = zod_1.z
72
72
  .array(zod_1.z.string())
73
73
  .nonempty("At least one POI name is required.")
74
74
  .describe('A list of keywords for the names of points of interest (POIs) in Chinese. These POIs usually contain a group of places with similar locations, so the names should be more descriptive, must adding attributives to indicate that they are different places in the same area, such as "北京市" is better than "北京", "杭州西湖" is better than "西湖"; in addition, if you can determine that a location may appear in multiple areas, you can be more specific, such as "杭州西湖的苏堤春晓" is better than "苏堤春晓". The tool will use these keywords to search for specific POIs and query their detailed data, such as latitude and longitude, location photos, etc. For example, ["西安钟楼", "西安大唐不夜城", "西安大雁塔"].');
75
+ exports.LabelFormatterSchema = zod_1.z
76
+ .string()
77
+ .optional()
78
+ .describe("Set the label formatter for chart using d3-format syntax: [[fill]align][sign][symbol][0][width][,][.precision][~][type]. " +
79
+ "Fill: padding character, default is space. " +
80
+ "Align: '<' left align, '^' center, '>' right align, '=' number right align. " +
81
+ "Sign: '+' always show sign, '-' show negative sign only, '(' negative in parentheses. " +
82
+ "Symbol: '#' base prefix, '$' currency symbol. " +
83
+ "0: zero padding. " +
84
+ "Width: minimum width. " +
85
+ ",: thousands separator. " +
86
+ "Precision: precision control. " +
87
+ "~: trim trailing zeros. " +
88
+ "Type: format type. " +
89
+ "Common types: 'd' integer (42), 'f' fixed decimals (42.00), 'e' scientific notation (4.2e+1), 's' SI prefix (42k, 1.5M), '%' percentage (42%), '$' currency ($42.00), 'r' significant digits (42.0), 'g' general (42). " +
90
+ "Examples: '.2f' fixed 2 decimals (23.45), '.0f' integer (23), '.1%' percentage (23.4%), ',.0f' thousands separator (1,234,567), 's' SI prefix (1.2M, 3.4k), '.1s' 1 decimal SI (1.2M, 3.4k), '~s' trimmed SI (1.2M, 3k), '.0s' integer SI (1M, 3k), '$,.2f' currency ($1,234.56), '$.2s' currency SI ($1.23M), '.2e' scientific (1.23e+6), '.2g' general (1.2e+6 or 1234), 'd' decimal (1234), 'x' hexadecimal (4d2), 'o' octal (2322), 'b' binary (10011010010).");
91
+ // 帮我添加一个labelFormater的配置项,用于格式化标签, 主要使用d3的format方法,相关知识懂 test.md中获取
@@ -35,6 +35,23 @@ export declare const column: {
35
35
  title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
36
36
  axisXTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
37
37
  axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
38
+ axis: z.ZodOptional<z.ZodObject<{
39
+ y: z.ZodOptional<z.ZodObject<{
40
+ LabelFormatter: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ LabelFormatter?: string | undefined;
43
+ }, {
44
+ LabelFormatter?: string | undefined;
45
+ }>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ y?: {
48
+ LabelFormatter?: string | undefined;
49
+ } | undefined;
50
+ }, {
51
+ y?: {
52
+ LabelFormatter?: string | undefined;
53
+ } | undefined;
54
+ }>>;
38
55
  };
39
56
  tool: {
40
57
  name: string;
@@ -40,6 +40,11 @@ const schema = {
40
40
  title: base_1.TitleSchema,
41
41
  axisXTitle: base_1.AxisXTitleSchema,
42
42
  axisYTitle: base_1.AxisYTitleSchema,
43
+ axis: zod_1.z.object({
44
+ y: zod_1.z.object({
45
+ LabelFormatter: base_1.LabelFormatterSchema,
46
+ }).optional().describe("Axis configuration for the chart y-axis, optional."),
47
+ }).optional().describe("Axis configuration for the chart with a JSON object, optional."),
43
48
  };
44
49
  // Column chart tool descriptor
45
50
  const tool = {
@@ -7,12 +7,12 @@ export declare const heatmap: {
7
7
  value: z.ZodNumber;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  value: number;
10
- x: string | number;
11
10
  y: string | number;
11
+ x: string | number;
12
12
  }, {
13
13
  value: number;
14
- x: string | number;
15
14
  y: string | number;
15
+ x: string | number;
16
16
  }>, "atleastone">;
17
17
  style: z.ZodOptional<z.ZodObject<{
18
18
  backgroundColor: z.ZodOptional<z.ZodString>;
@@ -6,12 +6,12 @@ export declare const scatter: {
6
6
  y: z.ZodNumber;
7
7
  group: z.ZodOptional<z.ZodString>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- x: number;
10
9
  y: number;
10
+ x: number;
11
11
  group?: string | undefined;
12
12
  }, {
13
- x: number;
14
13
  y: number;
14
+ x: number;
15
15
  group?: string | undefined;
16
16
  }>, "atleastone">;
17
17
  style: z.ZodOptional<z.ZodObject<{
package/build/server.js CHANGED
@@ -59,7 +59,7 @@ const logger_1 = require("./utils/logger.js");
59
59
  function createServer() {
60
60
  const server = new index_js_1.Server({
61
61
  name: "umeng-mcp-server-chart",
62
- version: "0.0.4",
62
+ version: "0.0.5",
63
63
  description: "本工具返回内容为 Markdown 格式,建议客户端按 Markdown 渲染",
64
64
  }, {
65
65
  capabilities: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@umengfe/mcp-server-chart",
3
3
  "description": "A Model Context Protocol server for generating charts using AntV. This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "exports": {