@umengfe/mcp-server-chart 0.0.5 → 0.0.7

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.
@@ -33,3 +33,13 @@ 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
35
  export declare const LabelFormatterSchema: z.ZodOptional<z.ZodString>;
36
+ export declare const TooltipSchema: z.ZodOptional<z.ZodObject<{
37
+ channel: z.ZodDefault<z.ZodString>;
38
+ valueFormatter: z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ channel: string;
41
+ valueFormatter?: string | undefined;
42
+ }, {
43
+ channel?: string | undefined;
44
+ valueFormatter?: string | undefined;
45
+ }>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.TooltipSchema = 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
@@ -89,3 +89,10 @@ exports.LabelFormatterSchema = zod_1.z
89
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
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
91
  // 帮我添加一个labelFormater的配置项,用于格式化标签, 主要使用d3的format方法,相关知识懂 test.md中获取
92
+ exports.TooltipSchema = zod_1.z
93
+ .object({
94
+ channel: zod_1.z.string().default("y"),
95
+ valueFormatter: exports.LabelFormatterSchema,
96
+ })
97
+ .optional()
98
+ .describe("Set the tooltip for chart , default is y channel. format is {channel: 'y', valueFormatter: 'd3-format syntax'}");
@@ -37,21 +37,31 @@ export declare const column: {
37
37
  axisYTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
38
38
  axis: z.ZodOptional<z.ZodObject<{
39
39
  y: z.ZodOptional<z.ZodObject<{
40
- LabelFormatter: z.ZodOptional<z.ZodString>;
40
+ labelFormatter: z.ZodOptional<z.ZodString>;
41
41
  }, "strip", z.ZodTypeAny, {
42
- LabelFormatter?: string | undefined;
42
+ labelFormatter?: string | undefined;
43
43
  }, {
44
- LabelFormatter?: string | undefined;
44
+ labelFormatter?: string | undefined;
45
45
  }>>;
46
46
  }, "strip", z.ZodTypeAny, {
47
47
  y?: {
48
- LabelFormatter?: string | undefined;
48
+ labelFormatter?: string | undefined;
49
49
  } | undefined;
50
50
  }, {
51
51
  y?: {
52
- LabelFormatter?: string | undefined;
52
+ labelFormatter?: string | undefined;
53
53
  } | undefined;
54
54
  }>>;
55
+ tooltip: z.ZodOptional<z.ZodObject<{
56
+ channel: z.ZodDefault<z.ZodString>;
57
+ valueFormatter: z.ZodOptional<z.ZodString>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ channel: string;
60
+ valueFormatter?: string | undefined;
61
+ }, {
62
+ channel?: string | undefined;
63
+ valueFormatter?: string | undefined;
64
+ }>>;
55
65
  };
56
66
  tool: {
57
67
  name: string;
@@ -40,11 +40,18 @@ 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
+ axis: zod_1.z
44
+ .object({
45
+ y: zod_1.z
46
+ .object({
47
+ labelFormatter: base_1.LabelFormatterSchema,
48
+ })
49
+ .optional()
50
+ .describe("Axis configuration for the chart y-axis, optional."),
51
+ })
52
+ .optional()
53
+ .describe("Axis configuration for the chart with a JSON object, optional."),
54
+ tooltip: base_1.TooltipSchema,
48
55
  };
49
56
  // Column chart tool descriptor
50
57
  const tool = {
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.5",
62
+ version: "0.0.7",
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.5",
4
+ "version": "0.0.7",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "exports": {