@seed-ship/mcp-ui-solid 6.17.0 → 6.18.0
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/CHANGELOG.md +28 -0
- package/README.md +50 -3
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/presentation.cjs +141 -0
- package/dist/adapters/presentation.cjs.map +1 -0
- package/dist/adapters/presentation.d.ts +68 -0
- package/dist/adapters/presentation.d.ts.map +1 -0
- package/dist/adapters/presentation.js +141 -0
- package/dist/adapters/presentation.js.map +1 -0
- package/dist/adapters.cjs +4 -0
- package/dist/adapters.cjs.map +1 -1
- package/dist/adapters.d.cts +2 -0
- package/dist/adapters.d.ts +2 -0
- package/dist/adapters.js +4 -0
- package/dist/adapters.js.map +1 -1
- package/dist/components/ChartJSRenderer.cjs +165 -65
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +168 -68
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/ComponentToolbar.cjs.map +1 -1
- package/dist/components/ComponentToolbar.d.ts.map +1 -1
- package/dist/components/ComponentToolbar.js.map +1 -1
- package/dist/components/EditableLayoutContext.cjs +17 -0
- package/dist/components/EditableLayoutContext.cjs.map +1 -0
- package/dist/components/EditableLayoutContext.d.ts +5 -0
- package/dist/components/EditableLayoutContext.d.ts.map +1 -0
- package/dist/components/EditableLayoutContext.js +17 -0
- package/dist/components/EditableLayoutContext.js.map +1 -0
- package/dist/components/EditableUIResourceRenderer.cjs +87 -84
- package/dist/components/EditableUIResourceRenderer.cjs.map +1 -1
- package/dist/components/EditableUIResourceRenderer.d.ts.map +1 -1
- package/dist/components/EditableUIResourceRenderer.js +87 -84
- package/dist/components/EditableUIResourceRenderer.js.map +1 -1
- package/dist/components/ElicitationForm.cjs.map +1 -1
- package/dist/components/ElicitationForm.js.map +1 -1
- package/dist/components/FeedbackInline.cjs +0 -1
- package/dist/components/FeedbackInline.cjs.map +1 -1
- package/dist/components/FeedbackInline.js +0 -1
- package/dist/components/FeedbackInline.js.map +1 -1
- package/dist/components/GraphRenderer.cjs.map +1 -1
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/GridRenderer.cjs +12 -6
- package/dist/components/GridRenderer.cjs.map +1 -1
- package/dist/components/GridRenderer.d.ts.map +1 -1
- package/dist/components/GridRenderer.js +13 -7
- package/dist/components/GridRenderer.js.map +1 -1
- package/dist/components/MapRenderer.cjs.map +1 -1
- package/dist/components/MapRenderer.d.ts.map +1 -1
- package/dist/components/MapRenderer.js.map +1 -1
- package/dist/components/PresentationFeedback.cjs +0 -1
- package/dist/components/PresentationFeedback.cjs.map +1 -1
- package/dist/components/PresentationFeedback.js +0 -1
- package/dist/components/PresentationFeedback.js.map +1 -1
- package/dist/components/UIResourceRenderer.cjs +37 -22
- package/dist/components/UIResourceRenderer.cjs.map +1 -1
- package/dist/components/UIResourceRenderer.d.ts.map +1 -1
- package/dist/components/UIResourceRenderer.js +38 -23
- package/dist/components/UIResourceRenderer.js.map +1 -1
- package/dist/components/VerifiedText.cjs +0 -4
- package/dist/components/VerifiedText.cjs.map +1 -1
- package/dist/components/VerifiedText.d.ts.map +1 -1
- package/dist/components/VerifiedText.js +0 -4
- package/dist/components/VerifiedText.js.map +1 -1
- package/dist/components/chart-data-table.cjs +73 -0
- package/dist/components/chart-data-table.cjs.map +1 -0
- package/dist/components/chart-data-table.d.ts +23 -0
- package/dist/components/chart-data-table.d.ts.map +1 -0
- package/dist/components/chart-data-table.js +73 -0
- package/dist/components/chart-data-table.js.map +1 -0
- package/dist/context/MCPUIStringsContext.cjs +10 -9
- package/dist/context/MCPUIStringsContext.cjs.map +1 -1
- package/dist/context/MCPUIStringsContext.d.ts +17 -5
- package/dist/context/MCPUIStringsContext.d.ts.map +1 -1
- package/dist/context/MCPUIStringsContext.js +11 -10
- package/dist/context/MCPUIStringsContext.js.map +1 -1
- package/dist/hooks/createResponsiveGrid.cjs +37 -0
- package/dist/hooks/createResponsiveGrid.cjs.map +1 -0
- package/dist/hooks/createResponsiveGrid.d.ts +6 -0
- package/dist/hooks/createResponsiveGrid.d.ts.map +1 -0
- package/dist/hooks/createResponsiveGrid.js +37 -0
- package/dist/hooks/createResponsiveGrid.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-ui-spec/dist/schemas.cjs +13 -1
- package/dist/mcp-ui-spec/dist/schemas.cjs.map +1 -1
- package/dist/mcp-ui-spec/dist/schemas.js +13 -1
- package/dist/mcp-ui-spec/dist/schemas.js.map +1 -1
- package/dist/services/chat-bus.cjs.map +1 -1
- package/dist/services/chat-bus.d.ts.map +1 -1
- package/dist/services/chat-bus.js.map +1 -1
- package/dist/services/chat-prompt-controller.cjs.map +1 -1
- package/dist/services/chat-prompt-controller.d.ts.map +1 -1
- package/dist/services/chat-prompt-controller.js.map +1 -1
- package/dist/services/component-registry.cjs +162 -22
- package/dist/services/component-registry.cjs.map +1 -1
- package/dist/services/component-registry.d.ts +6 -3
- package/dist/services/component-registry.d.ts.map +1 -1
- package/dist/services/component-registry.js +162 -22
- package/dist/services/component-registry.js.map +1 -1
- package/dist/services/telemetry.cjs +0 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.js +0 -1
- package/dist/services/telemetry.js.map +1 -1
- package/dist/services/validation.cjs +21 -7
- package/dist/services/validation.cjs.map +1 -1
- package/dist/services/validation.d.ts.map +1 -1
- package/dist/services/validation.js +21 -7
- package/dist/services/validation.js.map +1 -1
- package/dist/types/index.d.ts +43 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +43 -8
- package/dist/types.d.ts +43 -8
- package/docs/briefs/VISUALIZATION-FOUNDATION-2026-09-14.md +105 -0
- package/package.json +4 -4
- package/src/adapters/index.ts +18 -0
- package/src/adapters/presentation.test.ts +114 -0
- package/src/adapters/presentation.ts +229 -0
- package/src/components/ChartJSRenderer.test.tsx +325 -0
- package/src/components/ChartJSRenderer.tsx +162 -27
- package/src/components/ChatPrompt.test.tsx +1 -1
- package/src/components/ComponentToolbar.tsx +1 -1
- package/src/components/EditableLayoutContext.tsx +12 -0
- package/src/components/EditableUIResourceRenderer.tsx +11 -8
- package/src/components/ElicitationForm.tsx +1 -1
- package/src/components/FeedbackInline.tsx +1 -1
- package/src/components/GraphRenderer.test.tsx +1 -2
- package/src/components/GraphRenderer.tsx +0 -2
- package/src/components/GridRenderer.tsx +6 -4
- package/src/components/MapRenderer.tsx +0 -3
- package/src/components/PresentationFeedback.tsx +1 -1
- package/src/components/ResponsiveGrid.test.tsx +166 -0
- package/src/components/TableRenderer.pagination.test.tsx +31 -0
- package/src/components/UIResourceRenderer.tsx +14 -9
- package/src/components/VerifiedText.tsx +0 -5
- package/src/components/chart-data-table.ts +97 -0
- package/src/context/MCPUIStringsContext.test.tsx +60 -0
- package/src/context/MCPUIStringsContext.tsx +31 -12
- package/src/hooks/createResponsiveGrid.ts +41 -0
- package/src/services/chat-bus.test.ts +1 -1
- package/src/services/chat-bus.ts +0 -2
- package/src/services/chat-prompt-controller.ts +0 -8
- package/src/services/component-registry.test.ts +81 -2
- package/src/services/component-registry.ts +167 -23
- package/src/services/telemetry.ts +1 -1
- package/src/services/validation.test.ts +1 -14
- package/src/services/validation.ts +23 -6
- package/src/services/visualization-validation.test.ts +42 -0
- package/src/types/index.ts +50 -9
- package/src/types/visualization-contracts.test.ts +66 -0
- package/src/utils/perf.test.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Component Registry Service
|
|
3
|
-
* Phase 0: Static registry with
|
|
3
|
+
* Phase 0: Static registry with Chart and Table definitions
|
|
4
4
|
* Phase 1: Dynamic registry populated from /api/mcp/tools/list
|
|
5
5
|
*
|
|
6
6
|
* Provides component schemas for LLM prompt engineering
|
|
7
7
|
*/
|
|
8
8
|
import type { ComponentRegistryEntry, ComponentType } from '../types';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Chart Component Registry Entry
|
|
11
|
+
*
|
|
12
|
+
* The historical export name is retained for source compatibility. The
|
|
13
|
+
* renderer is local-first: Chart.js is the native implementation, while the
|
|
14
|
+
* external QuickChart fallback is a host-level opt-in.
|
|
12
15
|
*/
|
|
13
16
|
export declare const QuickchartRegistry: ComponentRegistryEntry;
|
|
14
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../src/services/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGrE
|
|
1
|
+
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../../src/services/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGrE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,sBAqJhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBA6H3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,sBA2D5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,sBA2C1B,CAAA;AAMD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,sBAsC1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,sBAqD5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,sBAgD5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,sBAsB9B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,sBAsC9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,sBAkC1B,CAAA;AAwJD,eAAO,MAAM,WAAW,EAAE,sBAkIzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBA0G3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,sBAiD1B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBAgC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,sBA+CjC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,sBA+ClC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBAiC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,sBA+B5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,sBA+B3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,sBA+B1B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,GAAG,CAAC,aAAa,EAAE,sBAAsB,CAwBvE,CAAA;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,sBAAsB,GAAG,SAAS,CAEzF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,EAAE,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAc1C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,GAAG,GACV;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAmB5D"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DEFAULT_RESOURCE_LIMITS } from "./validation.js";
|
|
2
2
|
const QuickchartRegistry = {
|
|
3
3
|
type: "chart",
|
|
4
|
-
name: "
|
|
5
|
-
description: "Render charts
|
|
4
|
+
name: "Chart.js",
|
|
5
|
+
description: "Render charts locally with Chart.js. Supports bar, line, pie, doughnut, radar, scatter, bubble, and polarArea charts, including point and time-series data. An external QuickChart fallback is available only when the host explicitly opts in.",
|
|
6
6
|
schema: {
|
|
7
7
|
type: "object",
|
|
8
8
|
properties: {
|
|
9
9
|
type: {
|
|
10
10
|
type: "string",
|
|
11
|
-
enum: ["bar", "line", "pie", "doughnut", "radar", "scatter"],
|
|
11
|
+
enum: ["bar", "line", "pie", "doughnut", "radar", "scatter", "bubble", "polarArea"],
|
|
12
12
|
description: "Chart type"
|
|
13
13
|
},
|
|
14
14
|
title: {
|
|
@@ -30,8 +30,22 @@ const QuickchartRegistry = {
|
|
|
30
30
|
properties: {
|
|
31
31
|
label: { type: "string" },
|
|
32
32
|
data: {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// Empty arrays match both branches; mirror Zod's inclusive union.
|
|
34
|
+
anyOf: [
|
|
35
|
+
{ type: "array", items: { type: "number" } },
|
|
36
|
+
{
|
|
37
|
+
type: "array",
|
|
38
|
+
items: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
x: { oneOf: [{ type: "string" }, { type: "number" }] },
|
|
42
|
+
y: { type: "number" },
|
|
43
|
+
r: { type: "number", minimum: 0 }
|
|
44
|
+
},
|
|
45
|
+
required: ["x", "y"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
35
49
|
},
|
|
36
50
|
backgroundColor: {
|
|
37
51
|
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
@@ -39,7 +53,9 @@ const QuickchartRegistry = {
|
|
|
39
53
|
borderColor: {
|
|
40
54
|
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
41
55
|
},
|
|
42
|
-
borderWidth: { type: "number" }
|
|
56
|
+
borderWidth: { type: "number" },
|
|
57
|
+
fill: { oneOf: [{ type: "boolean" }, { type: "string" }] },
|
|
58
|
+
tension: { type: "number" }
|
|
43
59
|
},
|
|
44
60
|
required: ["label", "data"]
|
|
45
61
|
}
|
|
@@ -49,8 +65,34 @@ const QuickchartRegistry = {
|
|
|
49
65
|
},
|
|
50
66
|
options: {
|
|
51
67
|
type: "object",
|
|
52
|
-
description: "Chart.js options for customization"
|
|
53
|
-
|
|
68
|
+
description: "Supported Chart.js options for customization",
|
|
69
|
+
properties: {
|
|
70
|
+
responsive: { type: "boolean" },
|
|
71
|
+
maintainAspectRatio: { type: "boolean" },
|
|
72
|
+
tension: { type: "number" },
|
|
73
|
+
scales: {},
|
|
74
|
+
plugins: {}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
renderer: {
|
|
78
|
+
type: "string",
|
|
79
|
+
enum: ["native", "iframe", "auto"],
|
|
80
|
+
description: "Renderer preference; external iframe use still requires host opt-in"
|
|
81
|
+
},
|
|
82
|
+
exportable: { type: "boolean", description: "Show the PNG export action" },
|
|
83
|
+
timeAxis: {
|
|
84
|
+
type: "object",
|
|
85
|
+
description: "Time-series x-axis configuration; the host must install and register a compatible Chart.js date adapter",
|
|
86
|
+
properties: {
|
|
87
|
+
parser: { type: "string" },
|
|
88
|
+
unit: { type: "string", enum: ["day", "week", "month", "quarter", "year"] },
|
|
89
|
+
tooltipFormat: { type: "string" },
|
|
90
|
+
min: { type: "string" },
|
|
91
|
+
max: { type: "string" }
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
height: { type: "string", description: "Chart container height as a CSS value" },
|
|
95
|
+
className: { type: "string" }
|
|
54
96
|
},
|
|
55
97
|
required: ["type", "data"]
|
|
56
98
|
},
|
|
@@ -108,7 +150,7 @@ const QuickchartRegistry = {
|
|
|
108
150
|
const TableRegistry = {
|
|
109
151
|
type: "table",
|
|
110
152
|
name: "DataTable",
|
|
111
|
-
description: "Render tabular data with sortable columns and
|
|
153
|
+
description: "Render tabular data with sortable columns, client-side search, context-aware paging, virtualization, and export controls. Best for structured records with up to 100 rows per payload.",
|
|
112
154
|
schema: {
|
|
113
155
|
type: "object",
|
|
114
156
|
properties: {
|
|
@@ -140,11 +182,67 @@ const TableRegistry = {
|
|
|
140
182
|
},
|
|
141
183
|
pagination: {
|
|
142
184
|
type: "object",
|
|
185
|
+
description: "Legacy server-pagination metadata",
|
|
143
186
|
properties: {
|
|
144
187
|
currentPage: { type: "number" },
|
|
145
188
|
pageSize: { type: "number" },
|
|
146
189
|
totalRows: { type: "number" }
|
|
147
190
|
}
|
|
191
|
+
},
|
|
192
|
+
searchable: {
|
|
193
|
+
type: "boolean",
|
|
194
|
+
description: "Show the client-side search field (default: true)"
|
|
195
|
+
},
|
|
196
|
+
searchPlaceholder: { type: "string", description: "Search field placeholder" },
|
|
197
|
+
pageSize: {
|
|
198
|
+
type: "integer",
|
|
199
|
+
minimum: 0,
|
|
200
|
+
description: "Rows per page in expanded mode (default: 25; 0 disables client paging)"
|
|
201
|
+
},
|
|
202
|
+
chatPageSize: {
|
|
203
|
+
type: "integer",
|
|
204
|
+
minimum: 0,
|
|
205
|
+
description: "Rows per page in chat mode (default: min(10, pageSize); 0 disables client paging)"
|
|
206
|
+
},
|
|
207
|
+
initialPage: {
|
|
208
|
+
type: "integer",
|
|
209
|
+
minimum: 0,
|
|
210
|
+
description: "Initial zero-based client page"
|
|
211
|
+
},
|
|
212
|
+
virtualize: {
|
|
213
|
+
oneOf: [
|
|
214
|
+
{ type: "boolean" },
|
|
215
|
+
{
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
enabled: { type: "boolean" },
|
|
219
|
+
rowHeight: { type: "integer", minimum: 1 },
|
|
220
|
+
overscan: { type: "integer", minimum: 0 },
|
|
221
|
+
threshold: { type: "integer", minimum: 1 }
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
exportable: {
|
|
227
|
+
oneOf: [
|
|
228
|
+
{ type: "boolean" },
|
|
229
|
+
{
|
|
230
|
+
type: "object",
|
|
231
|
+
properties: {
|
|
232
|
+
formats: {
|
|
233
|
+
type: "array",
|
|
234
|
+
items: { type: "string", enum: ["csv", "tsv", "json"] }
|
|
235
|
+
},
|
|
236
|
+
filename: { type: "string" }
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
className: { type: "string" },
|
|
242
|
+
citationMap: { type: "object", description: "Citation metadata keyed by marker id" },
|
|
243
|
+
maxHeight: {
|
|
244
|
+
oneOf: [{ type: "string" }, { type: "number" }],
|
|
245
|
+
description: "Inline table height cap; use 'auto' to disable it"
|
|
148
246
|
}
|
|
149
247
|
},
|
|
150
248
|
required: ["columns", "rows"]
|
|
@@ -779,19 +877,36 @@ const MapRegistry = {
|
|
|
779
877
|
const GraphRegistry = {
|
|
780
878
|
type: "graph",
|
|
781
879
|
name: "NodeLinkGraph",
|
|
782
|
-
description: "Render a node-link graph (entities and their relationships) with @antv/g6. Best for provenance/source chains, dependency or process graphs, and ontology-lite entity/relation views.
|
|
880
|
+
description: "Render a node-link graph (entities and their relationships) with the optional @antv/g6 peer. Best for provenance/source chains, dependency or process graphs, and ontology-lite entity/relation views.",
|
|
783
881
|
schema: {
|
|
784
882
|
type: "object",
|
|
785
883
|
properties: {
|
|
884
|
+
title: { type: "string" },
|
|
786
885
|
nodes: {
|
|
787
886
|
type: "array",
|
|
788
887
|
description: "Graph nodes (at least one required)",
|
|
888
|
+
minItems: 1,
|
|
789
889
|
items: {
|
|
790
890
|
type: "object",
|
|
791
891
|
properties: {
|
|
792
|
-
id: { type: "string" },
|
|
892
|
+
id: { type: "string", minLength: 1 },
|
|
793
893
|
label: { type: "string" },
|
|
794
|
-
|
|
894
|
+
type: { type: "string" },
|
|
895
|
+
size: {
|
|
896
|
+
oneOf: [
|
|
897
|
+
{ type: "number" },
|
|
898
|
+
{
|
|
899
|
+
type: "array",
|
|
900
|
+
items: [{ type: "number" }, { type: "number" }],
|
|
901
|
+
additionalItems: false,
|
|
902
|
+
minItems: 2,
|
|
903
|
+
maxItems: 2
|
|
904
|
+
}
|
|
905
|
+
]
|
|
906
|
+
},
|
|
907
|
+
weight: { type: "number" },
|
|
908
|
+
style: { type: "object" },
|
|
909
|
+
data: { type: "object" }
|
|
795
910
|
},
|
|
796
911
|
required: ["id"]
|
|
797
912
|
}
|
|
@@ -802,20 +917,46 @@ const GraphRegistry = {
|
|
|
802
917
|
items: {
|
|
803
918
|
type: "object",
|
|
804
919
|
properties: {
|
|
805
|
-
source: { type: "string" },
|
|
806
|
-
target: { type: "string" },
|
|
920
|
+
source: { type: "string", minLength: 1 },
|
|
921
|
+
target: { type: "string", minLength: 1 },
|
|
807
922
|
label: { type: "string" },
|
|
808
|
-
|
|
923
|
+
type: { type: "string" },
|
|
924
|
+
weight: { type: "number" },
|
|
925
|
+
style: { type: "object" },
|
|
926
|
+
data: { type: "object" }
|
|
809
927
|
},
|
|
810
928
|
required: ["source", "target"]
|
|
811
929
|
}
|
|
812
930
|
},
|
|
813
931
|
layout: {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
932
|
+
oneOf: [
|
|
933
|
+
{
|
|
934
|
+
type: "string",
|
|
935
|
+
enum: ["force", "dagre", "mindmap", "tree", "circular", "grid", "concentric"]
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
type: "object",
|
|
939
|
+
properties: {
|
|
940
|
+
type: {
|
|
941
|
+
type: "string",
|
|
942
|
+
enum: ["force", "dagre", "mindmap", "tree", "circular", "grid", "concentric"]
|
|
943
|
+
},
|
|
944
|
+
options: { type: "object" }
|
|
945
|
+
},
|
|
946
|
+
required: ["type"]
|
|
947
|
+
}
|
|
948
|
+
],
|
|
949
|
+
description: "Layout shorthand or layout-plus-options object"
|
|
817
950
|
},
|
|
818
|
-
|
|
951
|
+
height: { type: "string" },
|
|
952
|
+
width: { type: "string" },
|
|
953
|
+
rendererPref: { type: "string", enum: ["canvas"] },
|
|
954
|
+
fitView: { type: "boolean" },
|
|
955
|
+
enableZoom: { type: "boolean" },
|
|
956
|
+
enableDrag: { type: "boolean" },
|
|
957
|
+
enableSelect: { type: "boolean" },
|
|
958
|
+
tooltip: { type: "boolean" },
|
|
959
|
+
className: { type: "string" }
|
|
819
960
|
},
|
|
820
961
|
required: ["nodes"]
|
|
821
962
|
},
|
|
@@ -827,11 +968,10 @@ const GraphRegistry = {
|
|
|
827
968
|
type: "graph",
|
|
828
969
|
position: { colStart: 1, colSpan: 12 },
|
|
829
970
|
params: {
|
|
830
|
-
directed: true,
|
|
831
971
|
layout: "dagre",
|
|
832
972
|
nodes: [
|
|
833
|
-
{ id: "claim", label: "Population = 522 250",
|
|
834
|
-
{ id: "source", label: "INSEE 2021",
|
|
973
|
+
{ id: "claim", label: "Population = 522 250", weight: 2 },
|
|
974
|
+
{ id: "source", label: "INSEE 2021", weight: 1 }
|
|
835
975
|
],
|
|
836
976
|
edges: [{ source: "claim", target: "source", label: "derived from" }]
|
|
837
977
|
}
|