@visuallyjs/browser-ui-vue 1.0.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.
@@ -0,0 +1,659 @@
1
+ import { BrowserElement, CanvasDropFilter, DataGeneratorFunction, GroupIdentifierFunction, ObjectData, OnVertexAddedCallback, Size, SurfaceOptions, TypeGeneratorFunction, EdgeMapping, NodeMapping, GroupMapping, PortMapping, ModelOptions, Base, Surface, PointXY, SvgExportUIOptions, ImageExportUIOptions, DiagramCell, PaletteMode, Diagram, PreparedShape } from "@visuallyjs/browser-ui";
2
+ export declare const DEFAULT_VUE_SURFACE_ID = "surfaceId";
3
+ export declare const PROP_TYPE_FUNCTION = "typeFunction";
4
+ export declare const PROP_CLICK_TO_CENTER = "clickToCenter";
5
+ export declare const PROP_ACTIVE_TRACKING = "activeTracking";
6
+ export declare const PROP_SURFACE_ID = "surfaceId";
7
+ export declare const PROP_CLASS_NAME = "className";
8
+ export declare const PROP_DATA = "data";
9
+ export declare const PROP_MODE = "mode";
10
+ export declare const PROP_OPTIONS = "options";
11
+ export declare const PROP_RENDER_OPTIONS = "renderOptions";
12
+ export declare const PROP_MODEL_OPTIONS = "modelOptions";
13
+ export declare const PROP_VIEW_OPTIONS = "viewOptions";
14
+ export declare const PROP_URL = "url";
15
+ export declare const PROP_INTERACTIVE = "interactive";
16
+ export declare const PROP_PIVOT = "pivot";
17
+ export declare const PROP_DATA_SOURCE_FILTER = "dataSourceFilter";
18
+ export declare const PROP_CSV_DATA = "csvData";
19
+ export declare const PROP_JSON_DATA = "jsonData";
20
+ export declare const PROP_USE_MODEL = "useModel";
21
+ export declare const PROP_ID = "id";
22
+ export declare const PROP_SELECTOR = "selector";
23
+ export declare const PROP_DATA_GENERATOR = "dataGenerator";
24
+ export declare const PROP_TYPE_GENERATOR = "typeGenerator";
25
+ export declare const PROP_GROUP_IDENTIFIER = "groupIdentifier";
26
+ export declare const PROP_ALLOW_DROP_ON_EDGE = "allowDropOnEdge";
27
+ export declare const PROP_ALLOW_DROP_ON_CANVAS = "allowDropOnCanvas";
28
+ export declare const PROP_ALLOW_DROP_ON_GROUP = "allowDropOnGroup";
29
+ export declare const PROP_ALLOW_DROP_ON_NODE = "allowDropOnNode";
30
+ export declare const PROP_IGNORE_DROP_ON_NODE = "ignoreDropOnNode";
31
+ export declare const PROP_ON_VERTEX_ADDED = "onVertexAdded";
32
+ export declare const PROP_SELECT_AFTER_ADD = "selectAfterAdd";
33
+ export declare const PROP_CLICK_TO_ADD_ONLY = "clickToAddOnly";
34
+ export declare const PROP_ALLOW_CLICK_TO_ADD = "allowClickToAdd";
35
+ export declare const PROP_DRAG_SIZE = "dragSize";
36
+ export declare const PROP_CANVAS_DROP_FILTER = "canvasDropFilter";
37
+ export declare const TAG_SHAPE = "Shape";
38
+ export declare const TAG_SHAPE_PALETTE = "ShapePalette";
39
+ export declare const DEFAULT_SHAPE_WIDTH = 120;
40
+ export declare const DEFAULT_SHAPE_HEIGHT = 90;
41
+ export declare const TAG_EDGE_TYPE_PICKER = "EdgeTypePickerComponent";
42
+ export declare const TAG_COLOR_PICKER = "ColorPickerComponent";
43
+ /**
44
+ * CSS class set on the root element rendered for some node
45
+ * @group CSS Classes
46
+ */
47
+ export declare const CLASS_VUE_NODE = "vjs-vue-node";
48
+ /**
49
+ * CSS class set on the root element rendered for some group
50
+ * @group CSS Classes
51
+ */
52
+ export declare const CLASS_VUE_GROUP = "vjs-vue-group";
53
+ /**
54
+ * Render options for a SurfaceComponent.
55
+ */
56
+ export interface RenderOptions extends Pick<SurfaceOptions, Exclude<keyof SurfaceOptions, [
57
+ "view",
58
+ "tags",
59
+ "container",
60
+ "directRender",
61
+ "storePositionsInModel"
62
+ ]>> {
63
+ }
64
+ /**
65
+ * Definition of a node in the view. If you provide a `component` here, VisuallyJs will use that component to render nodes of the given type. Otherwise a default component will be used.
66
+ */
67
+ export interface VueNodeMapping extends Omit<NodeMapping<BrowserElement>, "template" | "templateId" | "parameters"> {
68
+ /**
69
+ * Component used to render this node type. If you do not supply this a default component will be used.
70
+ */
71
+ component?: any;
72
+ }
73
+ /**
74
+ * Definition of a group in the view. If you provide a `component` here, VisuallyJs will use that component to render groups of the given type. Otherwise a default component will be used.
75
+ */
76
+ export interface VueGroupMapping extends Omit<GroupMapping<BrowserElement>, "template" | "templateId" | "parameters"> {
77
+ /**
78
+ * Component used to render this group type. If you do not supply this a default component will be used.
79
+ */
80
+ component?: any;
81
+ }
82
+ /**
83
+ * Definition of a port in the view. This is for advanced use cases. If you provide a `component` here, VisuallyJs will use that component to render ports of the given type. Otherwise a default component will be used.
84
+ */
85
+ export interface VuePortMapping extends Omit<PortMapping<BrowserElement>, "template" | "templateId" | "parameters"> {
86
+ /**
87
+ * Component used to render this port type.
88
+ *
89
+ */
90
+ component?: any;
91
+ }
92
+ /**
93
+ * Mapping definition for edges.
94
+ */
95
+ export interface VueEdgeMapping extends EdgeMapping {
96
+ }
97
+ /**
98
+ * Options for the view in the surface component. Maps node/group/port/edge types to Components and behaviour.
99
+ */
100
+ export interface ViewOptions {
101
+ /**
102
+ * Mappings for node appearance/behaviour.
103
+ */
104
+ nodes?: Record<string, VueNodeMapping>;
105
+ /**
106
+ * Mappings for group appearance/behaviour.
107
+ */
108
+ groups?: Record<string, VueGroupMapping>;
109
+ /**
110
+ * Port mappings. Because of Vue's reactivity, separate port mappings are rarely needed, but they are available if you need them.
111
+ */
112
+ ports?: Record<string, VuePortMapping>;
113
+ /**
114
+ * Mappings for edge appearance/behaviour.
115
+ */
116
+ edges?: Record<string, VueEdgeMapping>;
117
+ }
118
+ /**
119
+ * Miniview component tag
120
+ */
121
+ export declare const COMPONENT_MINIVIEW = "MiniviewComponent";
122
+ /**
123
+ * Surface component tag
124
+ */
125
+ export declare const COMPONENT_SURFACE = "SurfaceComponent";
126
+ /**
127
+ * Tag for the SurfaceProvider.
128
+ */
129
+ export declare const COMPONENT_SURFACE_PROVIDER = "SurfaceProvider";
130
+ /**
131
+ * Tag for the DiagramProvider.
132
+ */
133
+ export declare const COMPONENT_DIAGRAM_PROVIDER = "DiagramProvider";
134
+ /**
135
+ * Palette component tag
136
+ */
137
+ export declare const COMPONENT_PALETTE = "PaletteComponent";
138
+ /**
139
+ * Controls component tag
140
+ */
141
+ export declare const COMPONENT_CONTROLS = "ControlsComponent";
142
+ /**
143
+ * SVG/PNG/JPG export controls component tag
144
+ */
145
+ export declare const COMPONENT_EXPORT_CONTROLS = "ExportControlsComponent";
146
+ /**
147
+ * Diagram component tag
148
+ */
149
+ export declare const COMPONENT_DIAGRAM = "DiagramComponent";
150
+ /**
151
+ * Diagram palette component tag
152
+ */
153
+ export declare const COMPONENT_DIAGRAM_PALETTE = "DiagramPaletteComponent";
154
+ /**
155
+ * Column chart component tag
156
+ */
157
+ export declare const COMPONENT_COLUMN_CHART = "ColumnChartComponent";
158
+ /**
159
+ * Bar chart component tag
160
+ */
161
+ export declare const COMPONENT_BAR_CHART = "BarChartComponent";
162
+ /**
163
+ * XY chart component tag
164
+ */
165
+ export declare const COMPONENT_XY_CHART = "XYChartComponent";
166
+ /**
167
+ * Line chart component tag
168
+ */
169
+ export declare const COMPONENT_LINE_CHART = "LineChartComponent";
170
+ /**
171
+ * Area chart component tag
172
+ */
173
+ export declare const COMPONENT_AREA_CHART = "AreaChartComponent";
174
+ /**
175
+ * Pie chart component tag
176
+ */
177
+ export declare const COMPONENT_PIE_CHART = "PieChartComponent";
178
+ /**
179
+ * Scatter chart component tag
180
+ */
181
+ export declare const COMPONENT_SCATTER_CHART = "ScatterChartComponent";
182
+ /**
183
+ * Bubble chart component tag
184
+ */
185
+ export declare const COMPONENT_BUBBLE_CHART = "BubbleChartComponent";
186
+ /**
187
+ * Gauge chart component tag
188
+ */
189
+ export declare const COMPONENT_GAUGE_CHART = "GaugeChartComponent";
190
+ /**
191
+ * Sankey chart component tag
192
+ */
193
+ export declare const COMPONENT_SANKEY_CHART = "SankeyChartComponent";
194
+ /**
195
+ * inspector component tag
196
+ */
197
+ export declare const COMPONENT_INSPECTOR = "InspectorComponent";
198
+ /**
199
+ * HTML tag for a decorator
200
+ */
201
+ export declare const TAG_DECORATOR = "Decorator";
202
+ /**
203
+ * Supported props for the {@link MiniviewComponent}.
204
+ * @group Props
205
+ */
206
+ export interface MiniviewComponentProps {
207
+ /**
208
+ * ID of the surface to attach to. This is optional; Visually JS will use the default surface ID if you do not
209
+ * provide this. For apps where there's only one surface there is no need to provide this.
210
+ */
211
+ surfaceId?: string;
212
+ /**
213
+ * Optional CSS to add to the container element for the miniview.
214
+ */
215
+ className?: string;
216
+ /**
217
+ * Defaults to true, meaning the miniview will automatically track element dragging.
218
+ */
219
+ activeTracking?: boolean;
220
+ /**
221
+ * Defaults to true - a click on an element in the miniview will center the related element in the surface the
222
+ * miniview is attached to.
223
+ */
224
+ clickToCenter?: boolean;
225
+ }
226
+ /**
227
+ * Supported props for the {@link SurfaceComponent}.
228
+ * @group Props
229
+ */
230
+ export interface SurfaceComponentProps {
231
+ /**
232
+ * ID of the surface to attach to. This is optional; Visually JS will use the default surface ID if you do not
233
+ * provide this. For apps where there's only one surface there is no need to provide this.
234
+ */
235
+ surfaceId?: string;
236
+ /**
237
+ * Parameters to configure the underlying surface.
238
+ */
239
+ renderOptions?: RenderOptions;
240
+ /**
241
+ * Mapping of model object types to components and behaviour
242
+ */
243
+ viewOptions?: ViewOptions;
244
+ /**
245
+ * Options for the underlying model.
246
+ */
247
+ modelOptions?: ModelOptions;
248
+ /**
249
+ * Optional url for a dataset to load.
250
+ */
251
+ url?: string;
252
+ /**
253
+ * Optional dataset to load.
254
+ */
255
+ data?: any;
256
+ }
257
+ /**
258
+ * Props for the `ShapeComponent`.
259
+ * @group Props
260
+ */
261
+ export interface ShapeComponentProps {
262
+ /**
263
+ * Backing data for the vertex
264
+ */
265
+ obj: ObjectData;
266
+ /**
267
+ * Whether or not to show labels Defaults to false.
268
+ */
269
+ showLabels?: boolean;
270
+ /**
271
+ * Name of the property containing the object's label. Defaults to "label".
272
+ */
273
+ labelProperty?: string;
274
+ /**
275
+ * Stroke width for the label text.
276
+ */
277
+ labelStrokeWidth?: number;
278
+ /**
279
+ * Defaults to true - the label will be drawn across multiple lines.
280
+ */
281
+ multilineLabels?: boolean;
282
+ /**
283
+ * When using a multiline label, defines the maximum width of any given line.
284
+ */
285
+ labelFillRatio?: number;
286
+ /**
287
+ * Color for the label. Defaults to #000000.
288
+ */
289
+ labelColor?: string;
290
+ }
291
+ /**
292
+ * Props for the ShapePaletteComponent
293
+ * @group Props
294
+ */
295
+ export interface ShapePaletteComponentProps {
296
+ /**
297
+ * ID of the surface to attach to. This is optional; Visually JS will use the default surface ID if you do not provide this. For apps where there's only one surface there is no need to provide this.
298
+ */
299
+ surfaceId?: string;
300
+ /**
301
+ * Optional size to use for dragged elements.
302
+ */
303
+ dragSize?: Size;
304
+ /**
305
+ * Optional size to use for icons
306
+ */
307
+ iconSize?: Size;
308
+ /**
309
+ * Optional fill color to use for dragged elements. This should be in RGB format, _not_ a color like 'white' or 'cyan' etc
310
+ */
311
+ fill?: string;
312
+ /**
313
+ * Optional color to use for outline of dragged elements. Should be in RGB format.
314
+ */
315
+ outline?: string;
316
+ /**
317
+ * Message to use for the 'show all' option in the shape set drop down when there is more than one set of shapes. Defaults to `Show all`.
318
+ */
319
+ showAllMessage?: string;
320
+ /**
321
+ * When true (which is the default), a newly dropped vertex will be set as the underlying model's selection.
322
+ */
323
+ selectAfterDrop?: boolean;
324
+ /**
325
+ * Stroke width to use for shapes in palette. Defaults to 1.
326
+ */
327
+ paletteStrokeWidth?: number;
328
+ /**
329
+ * Mode of operation, supported values are "tap" and "drag" - default is "drag".
330
+ */
331
+ mode?: "tap" | "drag";
332
+ /**
333
+ * Optional function you can use to set some initial data for an element being dragged. Note that you cannot override the object's `type` with this function.
334
+ */
335
+ dataGenerator?: DataGeneratorFunction<ObjectData>;
336
+ /**
337
+ * When in tap mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drawing method also still works)
338
+ */
339
+ allowClickToAdd?: boolean;
340
+ /**
341
+ * Optional callback to invoke when a vertex has been dragged onto/dropped on the canvas
342
+ */
343
+ onVertexAdded?: OnVertexAddedCallback;
344
+ /**
345
+ * Indicates two things: first, when one or more vertices are selected, clicking on an entry in the palette will change the type of the selected vertices to that type. Secondly, selecting an element in the canvas will cause its related shape to be selected in the palette. Defaults to true.
346
+ */
347
+ inspector?: boolean;
348
+ /**
349
+ * Optional set of prepared shapes to show in the palette. When this is provided, the palette will only render these shapes, and not the contents of the shape library.
350
+ */
351
+ preparedShapes?: Array<PreparedShape>;
352
+ }
353
+ /**
354
+ * Props for the InspectorComponent
355
+ * @group Props
356
+ */
357
+ export interface InspectorComponentProps {
358
+ /**
359
+ * Whether or not to auto commit on enter keypress/blur. Defaults to true.
360
+ */
361
+ autoCommit?: boolean;
362
+ /**
363
+ * Whether or not to support multiple selections. Defaults to true.
364
+ */
365
+ multipleSelections?: boolean;
366
+ /**
367
+ * Optional filter you can use to instruct the inspector to ignore certain items.
368
+ * @param b The object to test
369
+ */
370
+ filter?: (b: Base) => boolean;
371
+ /**
372
+ * Callback invoked when the inspector is cleared.
373
+ * @internal
374
+ */
375
+ renderEmptyContainer: () => void;
376
+ /**
377
+ * Callback invoked when a new object has started to be edited.
378
+ * @param obj
379
+ * @param cb
380
+ */
381
+ refresh: (obj: Base) => void;
382
+ /**
383
+ * Optional extra css classes to set on the root element
384
+ */
385
+ className?: string;
386
+ /**
387
+ * Whether or not to show a close button. Defaults to false.
388
+ */
389
+ showCloseButton?: boolean;
390
+ /**
391
+ * Optional function to invoke after an update.
392
+ * @param s
393
+ */
394
+ afterUpdate?: (s: Surface) => void;
395
+ /**
396
+ * Optional ID of the surface to attach to. It is better to nest this component inside a SurfaceComponent or SurfaceProvider.
397
+ */
398
+ surfaceId?: string;
399
+ }
400
+ /**
401
+ * Props for the ControlsComponent
402
+ * @group Props
403
+ */
404
+ export interface ControlsComponentProps {
405
+ /**
406
+ * Defaults to true. Whether or not to show the 'clear dataset' button.
407
+ */
408
+ clear?: boolean;
409
+ /**
410
+ * ID of the surface to attach to. Optional, a default will be used if not provided.
411
+ */
412
+ surfaceId?: string;
413
+ /**
414
+ * Defaults to true, meaning show the undo/redo buttons.
415
+ */
416
+ undoRedo?: boolean;
417
+ /**
418
+ * Defaults to 'row' - whether to show buttons in a row or a column
419
+ */
420
+ orientation: 'row' | 'column';
421
+ /**
422
+ * Defaults to true, meaning the 'zoom to extents' button will be shown.
423
+ */
424
+ zoomToExtents?: boolean;
425
+ /**
426
+ * Defaults to false, meaning the zoom in/zoom out buttons are not shown by default.
427
+ */
428
+ zoomButtons?: boolean;
429
+ /**
430
+ * Optional message to use when the user presses the clear button. Defaults to 'Clear dataset?'.
431
+ */
432
+ clearMessage?: string;
433
+ /**
434
+ * A function to use instead of the browser's default prompt when the user presses the clear button.
435
+ */
436
+ onMaybeClear?: Function;
437
+ /**
438
+ * Optional class name(s) to attach to the component's container element.
439
+ */
440
+ className?: string;
441
+ }
442
+ /**
443
+ * Props for the ExportControlsComponent
444
+ * @group Props
445
+ */
446
+ export interface ExportControlsComponentProps {
447
+ /**
448
+ * Whether or not to show a label in front of the buttons. Defaults to true.
449
+ */
450
+ showLabel?: boolean;
451
+ /**
452
+ * What to show in the label, if visible. Defaults to "Export:".
453
+ */
454
+ label?: string;
455
+ /**
456
+ * Optional margins to apply to both SVG and image exports. Will not override any margins specified in svgOptions or imageOptions.
457
+ */
458
+ margins?: PointXY;
459
+ /**
460
+ * Options for SVG exports.
461
+ */
462
+ svgOptions?: SvgExportUIOptions;
463
+ /**
464
+ * Options for image exports.
465
+ */
466
+ imageOptions?: ImageExportUIOptions;
467
+ /**
468
+ * Defaults to true.
469
+ */
470
+ allowSvgExport?: boolean;
471
+ /**
472
+ * Defaults to true.
473
+ */
474
+ allowPngExport?: boolean;
475
+ /**
476
+ * Defaults to true.
477
+ */
478
+ allowJpgExport?: boolean;
479
+ /**
480
+ * The name of the property that holds the label for a vertex
481
+ */
482
+ labelProperty?: string;
483
+ /**
484
+ * Optional ID of the surface to attach to. It is better to nest this component inside a SurfaceComponent or SurfaceProvider.
485
+ */
486
+ surfaceId?: string;
487
+ }
488
+ /**
489
+ * Props for the `PaletteComponent`
490
+ * @group Props
491
+ */
492
+ export interface PaletteComponentProps {
493
+ /**
494
+ * CSS 3 selector identifying what child elements of `container` are draggable/can be tapped. Optional. If omitted, a default of `[data-vjs-type]` will be used.
495
+ */
496
+ selector?: string;
497
+ /**
498
+ * Function to use to get a dataset for an item that is being dragged/has been tapped. If omitted, Visually JS will use a default data generator that extracts data values from any `data-vjs-***` attribute on the element being dragged.
499
+ */
500
+ dataGenerator?: DataGeneratorFunction<BrowserElement>;
501
+ /**
502
+ * Function to use to get the type of an item that is being dragged/has been tapped.
503
+ */
504
+ typeGenerator?: TypeGeneratorFunction<BrowserElement>;
505
+ /**
506
+ * Function to use to determine whether an item that is being dragged/has been tapped represents a group.
507
+ */
508
+ groupIdentifier?: GroupIdentifierFunction<BrowserElement>;
509
+ /**
510
+ * Whether or not to allow drop on edge. Defaults to false.
511
+ */
512
+ allowDropOnEdge?: boolean;
513
+ /**
514
+ * Whether or not to allow drop on whitespace in the canvas. Defaults to true.
515
+ */
516
+ allowDropOnCanvas?: boolean;
517
+ /**
518
+ * Whether or not to allow drop on existing vertices. Defaults to true.
519
+ */
520
+ allowDropOnGroup?: boolean;
521
+ /**
522
+ * Optional size to use for elements dragged from the palette; used in drag mode only.
523
+ */
524
+ dragSize?: Size;
525
+ /**
526
+ * Optional callback that will be invoked after a new vertex has been dropped and added to the dataset.
527
+ * @param v
528
+ */
529
+ onVertexAdded?: OnVertexAddedCallback;
530
+ /**
531
+ * Defaults to false. When true, a newly added vertex is set as the model's current selection.
532
+ */
533
+ selectAfterAdd?: boolean;
534
+ /**
535
+ * Optional extra css classes to set on the element
536
+ */
537
+ className?: string;
538
+ /**
539
+ * Optional filter to test if objects may be dropped on the canvas.
540
+ */
541
+ canvasDropFilter?: CanvasDropFilter<BrowserElement>;
542
+ /**
543
+ * The surface to attach to. Optional: this component can derive a surface from a SurfaceProvider or SurfaceComponent. You'll only need this in certain advanced scenarios.
544
+ */
545
+ surface?: Surface;
546
+ /**
547
+ * Mode to operate in - 'drag', 'tap' or 'draw'. Defaults to 'drag'.
548
+ */
549
+ mode?: PaletteMode;
550
+ /**
551
+ * When in draw mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drawing method also still works)
552
+ */
553
+ allowClickToAdd?: boolean;
554
+ /**
555
+ * This flag relates to "draw" mode, and defaults to false. When true, the palette only supports click to draw new vertices, not drag. This flag is forced to true if the associated UI does not have `useModelForSizes` set, since there is no point in allowing a user to drag a vertex to some size if its not going to be honoured. When you set this flag and associated UI does have `useModelForSizes` set, the palette will use default sizes for new nodes/groups.
556
+ */
557
+ clickToAddOnly?: boolean;
558
+ /**
559
+ * Defaults to false. Allows items to be dropped onto nodes in the canvas. If this is true and an element is dropped onto a node, the result is the same as if the element has been dropped onto whitespace. Note that when this is false and the user has dragged something over a node, the drag item is still not considered to be over the canvas, and releasing the mouse button at that time will not cause a new node to be added. Use `ignoreDropOnNode` if that's the behaviour you want.
560
+ */
561
+ allowDropOnNode?: boolean;
562
+ /**
563
+ * Defaults to false. When true, the palette treats nodes as if they are part of the canvas - a user can drag new items on top of existing nodes and the new item will be added to the canvas. If you want to force your users to drop on canvas whitespace, don't set this. Note that this flag will force `allowDropOnNode` to `false`.
564
+ */
565
+ ignoreDropOnNode?: boolean;
566
+ }
567
+ /**
568
+ * Options for the DiagramPalette component
569
+ * @group Props
570
+ */
571
+ export interface DiagramPaletteProps {
572
+ /**
573
+ * Optional fill color to use for new elements. This should be in RGB format, _not_ a color like 'white' or 'cyan' etc.
574
+ */
575
+ fill?: string;
576
+ /**
577
+ * Optional color to use for outline of dragged elements. Should be in RGB format.
578
+ */
579
+ outline?: string;
580
+ /**
581
+ * Optional size to use for dragged elements.
582
+ */
583
+ dragSize?: Size;
584
+ /**
585
+ * Indicates that when one or more vertices are selected, clicking on an entry in the palette will change the type of the selected vertices to that type. Defaults to true.
586
+ */
587
+ inspector?: boolean;
588
+ /**
589
+ * Optional size to use for icons. Defaults to 150x100 pixels. If you provide this but not `dragSize` this size will also be used for an icon that is being dragged.
590
+ */
591
+ iconSize?: Size;
592
+ /**
593
+ * Optionally show each shape icon's label underneath it
594
+ */
595
+ showLabels?: boolean;
596
+ /**
597
+ * Stroke width to use for shapes in palette. Defaults to 1.
598
+ */
599
+ paletteStrokeWidth?: number;
600
+ /**
601
+ * Message to use for the 'show all' option in the shape set drop down when there is more than one set of shapes. Defaults to `Show all`.
602
+ */
603
+ showAllMessage?: string;
604
+ /**
605
+ * Callback to invoke when a new diagram cell has been added.
606
+ * @param dc
607
+ */
608
+ onCellAdded?: (dc: DiagramCell) => any;
609
+ /**
610
+ * Mode to operate in - 'drag' or 'tap'. Defaults to 'drag' (PALETTE_MODE_DRAG).
611
+ */
612
+ mode?: PaletteMode;
613
+ /**
614
+ * When in tap mode, allow addition of new vertices simply by clicking, instead of requiring a shape be drawn. (When this is true, the drawing method also still works)
615
+ */
616
+ allowClickToAdd?: boolean;
617
+ /**
618
+ * Defaults to true: when in 'tap' mode and a new group/node has been drawn on the canvas, the UI is set back to pan mode.
619
+ */
620
+ autoExitDrawMode?: boolean;
621
+ /**
622
+ * When true (which is the default), a newly dropped shape will be set as the underlying model's selection.
623
+ */
624
+ selectAfterAdd?: boolean;
625
+ /**
626
+ * Optional diagram to attach to. In most cases it is better to use a DiagramProvider to provision the diagram to this component.
627
+ */
628
+ diagram?: Diagram;
629
+ /**
630
+ * Optional class name to set on the diagram palette root element.
631
+ */
632
+ className?: string;
633
+ /**
634
+ * Optional set of prepared shapes to show in the palette. When this is provided, the palette will only render these shapes, and not the contents of the shape library.
635
+ */
636
+ preparedShapes?: Array<PreparedShape>;
637
+ }
638
+ /**
639
+ * @group Props
640
+ */
641
+ export interface ColorPickerComponentProps {
642
+ /**
643
+ * The name of the property to bind to.
644
+ */
645
+ propertyName: string;
646
+ /**
647
+ * Maximum number of color swatches to show, defaults to 10
648
+ */
649
+ maxColors?: number;
650
+ }
651
+ /**
652
+ * @group Props
653
+ */
654
+ export interface EdgeTypePickerComponentProps {
655
+ /**
656
+ * The name of the property to bind to.
657
+ */
658
+ propertyName: string;
659
+ }