-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod-schema.json
396 lines (394 loc) · 20.2 KB
/
mod-schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"axis": {
"type": "object",
"title": "Axis definitions",
"description": "Specifies properties that can be used to configure Axis and ColorAxis entries.",
"required": ["mode"],
"properties": {
"mode": {
"type": "string",
"title": "Mode",
"description": "Specifies what kind of expressions this axis supports: categorical, continuous or both.",
"enum": ["continuous", "categorical", "dual"],
"examples": ["categorical"]
},
"preferredDualMode": {
"type": "string",
"title": "Preferred mode for dual axis",
"enum": ["continuous", "categorical"],
"default": "categorical",
"description": "Specifies the mode that this axis prefers to be in. This option only applies if this axis is configured with mode 'dual'."
},
"allowNonAggregatingMeasures": {
"type": "boolean",
"title": "Allow non-aggregating measures",
"description": "Specifies if this axis supports non-aggregating expressions (expressions without an aggregation method) when it is in continuous mode.",
"default": false
},
"automaticConfiguration": {
"type": "object",
"title": "Automatic configuration",
"description": "Specifies how automatic configuration is made for this axis when the Mod Visualization is created.",
"additionalProperties": false,
"properties": {
"expressionHeuristics": {
"type": "string",
"title": "Expression heuristics",
"enum": ["none", "default"],
"default": "default",
"description": "Specifies the heuristics to use when this axis is assigned an initial expression. Use 'none' to skip the heuristics and leave this axis with an empty expression."
},
"priority": {
"type": "integer",
"title": "Priority",
"default": "0",
"description": "Specifies the order in which this axis will be treated when the heuristics assigns the initial expression. A higher value means it will be treated before axes with a lower value. Two axes with the same value will be treated in undefined order."
}
}
},
"dataTypes": {
"type": "object",
"title": "Supported Data Types",
"description": "Specifies which data types that this axis should support. These settings affect which expressions that Spotfire will consider valid for this axis.",
"additionalProperties": false,
"properties": {
"allowNumeric": {
"type": "boolean",
"title": "Allow Numeric data types",
"default": true,
"description": "Specifies whether to allow expressions with numeric data types."
},
"allowDateTime": {
"type": "boolean",
"title": "Allow the Time, Date and DateTime data types",
"default": false,
"description": "Specifies whether to allow expressions with Time, Date and DateTime data types."
},
"allowTimeSpan": {
"type": "boolean",
"title": "Allow the TimeSpan data type",
"default": false,
"description": "Specifies whether to allow expressions with TimeSpan data type."
},
"allowString": {
"type": "boolean",
"title": "Allow the String data type",
"default": false,
"description": "Specifies whether to allow expressions with String data type."
},
"allowBoolean": {
"type": "boolean",
"title": "Allow the Boolean data type",
"default": false,
"description": "Specifies whether to allow expressions with Boolean data type."
}
}
},
"dropTarget": {
"type": "object",
"title": "Drop target",
"description": "Specifies the drop target behavior for this axis.",
"additionalProperties": false,
"required": ["icon", "description"],
"properties": {
"icon": {
"type": "string",
"title": "The drop target icon",
"description": "Specifies which, from a selection of built-in icons, to use as the drop target.",
"enum": [
"XAxis",
"YAxis",
"XAxis3D",
"YAxis3D",
"ZAxis3D",
"SectorSize",
"MarkerSize",
"Size",
"Color",
"Shape",
"Line",
"TrellisPanels",
"TrellisHorizontally",
"TrellisVertically",
"Column",
"ColumnAxis",
"RowAxis",
"CellValues",
"CellValuesSum",
"Icon",
"Tile",
"Hierarchy",
"Time",
"Compare",
"TableCategories"
],
"examples": ["XAxis"]
},
"description": {
"type": "string",
"title": "The drop target description",
"description": "Specifies the text to display when dragging an expression or column over the drop target. Use {0} to inject the name of the item being dragged.",
"examples": ["Set {0} on the Size axis"]
}
}
}
}
}
},
"title": "The Spotfire mod manifest schema",
"type": "object",
"required": ["apiVersion", "version", "name", "id", "icon", "files"],
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"title": "Mod version.",
"description": "Specifies the version of this Mod.",
"default": "",
"examples": ["1.0"],
"pattern": "^(.*)$"
},
"apiVersion": {
"type": "string",
"title": "Mod API version.",
"description": "Specifies the version of the Mod JavaScript API used by the code of this Mod. Set the lowest possible version number that the Mod requires to ensure best possible backward compatibility with older Spotfire systems. Using a newer API version than specified will result in runtime errors, even if the current Spotfire system includes that API.",
"default": "1.3",
"examples": ["1.0", "1.1", "1.2", "1.3"],
"pattern": "^(.*)$"
},
"name": {
"type": "string",
"title": "Name of the mod",
"description": "Specifies the name of this Mod. The name will be shown to the user when this Mod is handled in Spotfire.",
"default": "",
"examples": ["Spotfire mod boilerplate"],
"pattern": "^(.*)$"
},
"icon": {
"type": "string",
"title": "Specifies the name of the file containing the svg icon to be used for this Mod.",
"default": "icon.svg"
},
"id": {
"type": "string",
"title": "Mod ID. A unique string.",
"default": "",
"examples": ["spotfire-boilerplate-id"],
"pattern": "^(.*)$"
},
"externalResources": {
"type": "array",
"title": "Specifies external resources loaded from the mod.",
"description": "Only declared external resources will work in the mod. A visualization mod with external resources cannot be exported using the web client.",
"items": {
"type": "string",
"examples": ["https://www.example.com"]
}
},
"properties": {
"type": "array",
"title": "Mod Properties",
"description": "Specifies the properties that are stored in this Mods part of the Spotfire document. Use properties to store settings values.",
"default": null,
"items": {
"type": "object",
"title": "The Items Schema",
"required": ["name", "type", "defaultValue"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"title": "Property name",
"description": "Specifies the unique name used to refer to this property from the code.",
"default": "",
"examples": ["width"],
"pattern": "^(.*)$",
"additionalProperties": false
},
"type": {
"type": "string",
"enum": ["integer", "double", "string", "boolean"],
"title": "Value type",
"description": "Specifies the type of values stored by this property.",
"default": "string",
"examples": ["integer"],
"pattern": "^(.*)$",
"additionalProperties": false
},
"defaultValue": {
"type": ["string", "number", "boolean"],
"title": "Default value",
"description": "Specifies the value that this property will have when an instance of the Mod is created.",
"default": "",
"examples": ["3"],
"pattern": "^(.*)$",
"additionalProperties": false
}
}
}
},
"dataViewDefinition": {
"type": "object",
"title": "Mod view definition",
"description": "Specifies how Spotfire computes the data consumed by the Mod.",
"default": {},
"additionalProperties": false,
"properties": {
"colorAxis": {
"allOf": [
{ "$ref": "#/definitions/axis" },
{
"type": "object",
"title": "ColorAxis",
"description": "Specifies that the Mod shall have a color axis.",
"properties": {
"legendItem": {
"type": "object",
"title": "Legend Item",
"description": "Specifies behavior and properties of how this axis is shown in the legend.",
"additionalProperties": false,
"properties": {
"defaultVisibility": {
"type": "string",
"title": "Default visibility",
"enum": ["visible", "hidden"],
"description": "Specifies whether to initially show or hide the item for this axis in the legend."
}
}
}
}
}
]
},
"axes": {
"type": "array",
"title": "The mod axes",
"description": "Specifies the axes that defines how Spotfire computes the data view consumed by the Mod.",
"items": {
"allOf": [
{ "$ref": "#/definitions/axis" },
{
"type": "object",
"title": "Axis",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"title": "Name",
"default": "X",
"description": "Specifies the unique named used to refer to this axis from the code.",
"examples": ["X"],
"pattern": "^(.*)$"
},
"allowMultipleMeasures": {
"type": "boolean",
"title": "Allow multiple measures",
"description": "Specifies if this axis supports having multiple measure expression when it is in continuous mode.",
"default": false
},
"placement": {
"type": "string",
"title": "Placement",
"enum": ["left", "bottom", "top", "right", "none"],
"description": "Specifies the placement of the axis tray for this axis.",
"examples": ["bottom"]
},
"legendItem": {
"type": "object",
"title": "Legend Item",
"description": "Specifies behavior and properties of how this axis is shown in the legend.",
"additionalProperties": false,
"properties": {
"defaultVisibility": {
"type": "string",
"title": "Default visibility",
"enum": ["visible", "hidden"],
"default": "visible",
"description": "Specifies whether to initially show or hide the item for this axis in the legend."
},
"title": {
"type": "string",
"title": "Title",
"description": "Specifies the title to show in the item for this axis in the legend."
}
}
},
"propertyControl": {
"type": "object",
"title": "Property Control",
"description": "Specifies behavior and properties of how a control for this axis is shown in the properties dialog.",
"additionalProperties": false,
"properties": {
"visibility": {
"type": "string",
"title": "Visibility",
"enum": ["visible", "hidden"],
"default": "visible",
"description": "Specifies whether to show a control for this axis in the properties dialog."
},
"title": {
"type": "string",
"title": "Title",
"description": "Specifies the title of the control for this axis."
}
}
}
}
}
]
}
},
"tooltip": {
"type": "object",
"title": "Use configurable tooltips",
"description": "Specifies how the Mod uses Spotfire native style configurable tooltips. Added in API version 1.3",
"default": {},
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"title": "Enabled",
"default": true,
"description": "Specifies whether to enable configurable tooltips, both in the API and in the properties dialog."
}
}
}
}
},
"legend": {
"type": "object",
"title": "Legend",
"description": "Specifies properties of the Spotfire Legend for the Mod.",
"default": {},
"additionalProperties": false,
"properties": {
"defaultPlacement": {
"type": "string",
"enum": ["left", "right"],
"title": "Default placement of the Legend",
"description": "Specifies where the Legend is initially placed. If omitted, the Legend will be placed to the right."
},
"defaultVisibility": {
"type": "string",
"enum": ["visible", "hidden"],
"title": "Default visibility of Legend",
"description": "Specifies whether to initially show or hide the Legend. If omitted, the Legend will be shown."
}
}
},
"files": {
"type": "array",
"title": "The files stored in the mod",
"description": "All files of a mod will be saved into Spotfire. The files array lists all files so that Spotfire can save them.",
"items": {
"type": "string",
"title": "The Items Schema",
"default": "",
"examples": ["index.html", "main.css", "main.js"],
"pattern": "^(.*)$"
}
}
}
}