1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | import { DataInterface, DataSet, DataView } from 'vis-data';
|
20 | export type DataInterfaceEdges = DataInterface<Edge, 'id'>
|
21 | export type DataInterfaceNodes = DataInterface<Node, 'id'>
|
22 | export type DataSetEdges = DataSet<Edge, 'id'>
|
23 | export type DataSetNodes = DataSet<Node, 'id'>
|
24 | export type DataViewEdges = DataView<Edge, 'id'>
|
25 | export type DataViewNodes = DataView<Node, 'id'>
|
26 |
|
27 | export type IdType = string | number;
|
28 | export type DirectionType = 'from' | 'to';
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export type TimelineAnimationType = boolean | AnimationOptions;
|
36 |
|
37 | export type NetworkEvents =
|
38 | 'click' |
|
39 | 'doubleClick' |
|
40 | 'oncontext' |
|
41 | 'hold' |
|
42 | 'release' |
|
43 | 'select' |
|
44 | 'selectNode' |
|
45 | 'selectEdge' |
|
46 | 'deselectNode' |
|
47 | 'deselectEdge' |
|
48 | 'dragStart' |
|
49 | 'dragging' |
|
50 | 'dragEnd' |
|
51 | 'hoverNode' |
|
52 | 'blurNode' |
|
53 | 'hoverEdge' |
|
54 | 'blurEdge' |
|
55 | 'zoom' |
|
56 | 'showPopup' |
|
57 | 'hidePopup' |
|
58 | 'startStabilizing' |
|
59 | 'stabilizationProgress' |
|
60 | 'stabilizationIterationsDone' |
|
61 | 'stabilized' |
|
62 | 'resize' |
|
63 | 'initRedraw' |
|
64 | 'beforeDrawing' |
|
65 | 'afterDrawing' |
|
66 | 'animationFinished' |
|
67 | 'configChange';
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 | export class Network {
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | constructor(container: HTMLElement, data: Data, options?: Options);
|
84 |
|
85 | /**
|
86 | * Remove the network from the DOM and remove all Hammer bindings and references.
|
87 | */
|
88 | destroy(): void;
|
89 |
|
90 | /**
|
91 | * Override all the data in the network.
|
92 | * If stabilization is enabled in the physics module,
|
93 | * the network will stabilize again.
|
94 | * This method is also performed when first initializing the network.
|
95 | *
|
96 | * @param data network data
|
97 | */
|
98 | setData(data: Data): void;
|
99 |
|
100 | /**
|
101 | * Set the options.
|
102 | * All available options can be found in the modules above.
|
103 | * Each module requires it's own container with the module name to contain its options.
|
104 | *
|
105 | * @param options network options
|
106 | */
|
107 | setOptions(options: Options): void;
|
108 |
|
109 | /**
|
110 | * Set an event listener.
|
111 | * Depending on the type of event you get different parameters for the callback function.
|
112 | *
|
113 | * @param eventName the name of the event, f.e. 'click'
|
114 | * @param callback the callback function that will be raised
|
115 | */
|
116 | on(eventName: NetworkEvents, callback: (params?: any) => void): void;
|
117 |
|
118 | /**
|
119 | * Remove an event listener.
|
120 | * The function you supply has to be the exact same as the one you used in the on function.
|
121 | * If no function is supplied, all listeners will be removed.
|
122 | *
|
123 | * @param eventName the name of the event, f.e. 'click'
|
124 | * @param [callback] the exact same callback function that was used when calling 'on'
|
125 | */
|
126 | off(eventName: NetworkEvents, callback?: (params?: any) => void): void;
|
127 |
|
128 | /**
|
129 | * Set an event listener only once.
|
130 | * After it has taken place, the event listener will be removed.
|
131 | * Depending on the type of event you get different parameters for the callback function.
|
132 | *
|
133 | * @param eventName the name of the event, f.e. 'click'
|
134 | * @param callback the callback function that will be raised once
|
135 | */
|
136 | once(eventName: NetworkEvents, callback: (params?: any) => void): void;
|
137 |
|
138 | /**
|
139 | * This function converts canvas coordinates to coordinates on the DOM.
|
140 | * Input and output are in the form of {x:Number, y:Number} (IPosition interface).
|
141 | * The DOM values are relative to the network container.
|
142 | *
|
143 | * @param position the canvas coordinates
|
144 | * @returns the DOM coordinates
|
145 | */
|
146 | canvasToDOM(position: Position): Position;
|
147 |
|
148 | /**
|
149 | * This function converts DOM coordinates to coordinates on the canvas.
|
150 | * Input and output are in the form of {x:Number,y:Number} (IPosition interface).
|
151 | * The DOM values are relative to the network container.
|
152 | *
|
153 | * @param position the DOM coordinates
|
154 | * @returns the canvas coordinates
|
155 | */
|
156 | DOMtoCanvas(position: Position): Position;
|
157 |
|
158 | /**
|
159 | * Redraw the network.
|
160 | */
|
161 | redraw(): void;
|
162 |
|
163 | /**
|
164 | * Set the size of the canvas.
|
165 | * This is automatically done on a window resize.
|
166 | *
|
167 | * @param width width in a common format, f.e. '100px'
|
168 | * @param height height in a common format, f.e. '100px'
|
169 | */
|
170 | setSize(width: string, height: string): void;
|
171 |
|
172 | /**
|
173 | * The joinCondition function is presented with all nodes.
|
174 | */
|
175 | cluster(options?: ClusterOptions): void;
|
176 |
|
177 | /**
|
178 | * This method looks at the provided node and makes a cluster of it and all it's connected nodes.
|
179 | * The behaviour can be customized by proving the options object.
|
180 | * All options of this object are explained below.
|
181 | * The joinCondition is only presented with the connected nodes.
|
182 | *
|
183 | * @param nodeId the id of the node
|
184 | * @param [options] the cluster options
|
185 | */
|
186 | clusterByConnection(nodeId: string, options?: ClusterOptions): void;
|
187 |
|
188 | /**
|
189 | * This method checks all nodes in the network and those with a equal or higher
|
190 | * amount of edges than specified with the hubsize qualify.
|
191 | * If a hubsize is not defined, the hubsize will be determined as the average
|
192 | * value plus two standard deviations.
|
193 | * For all qualifying nodes, clusterByConnection is performed on each of them.
|
194 | * The options object is described for clusterByConnection and does the same here.
|
195 | *
|
196 | * @param [hubsize] optional hubsize
|
197 | * @param [options] optional cluster options
|
198 | */
|
199 | clusterByHubsize(hubsize?: number, options?: ClusterOptions): void;
|
200 |
|
201 | /**
|
202 | * This method will cluster all nodes with 1 edge with their respective connected node.
|
203 | *
|
204 | * @param [options] optional cluster options
|
205 | */
|
206 | clusterOutliers(options?: ClusterOptions): void;
|
207 |
|
208 | /**
|
209 | * Nodes can be in clusters.
|
210 | * Clusters can also be in clusters.
|
211 | * This function returns an array of nodeIds showing where the node is.
|
212 | *
|
213 | * Example:
|
214 | * cluster 'A' contains cluster 'B', cluster 'B' contains cluster 'C',
|
215 | * cluster 'C' contains node 'fred'.
|
216 | *
|
217 | * network.clustering.findNode('fred') will return ['A','B','C','fred'].
|
218 | *
|
219 | * @param nodeId the node id.
|
220 | * @returns an array of nodeIds showing where the node is
|
221 | */
|
222 | findNode(nodeId: IdType): IdType[];
|
223 |
|
224 | /**
|
225 | * Similar to findNode in that it returns all the edge ids that were
|
226 | * created from the provided edge during clustering.
|
227 | *
|
228 | * @param baseEdgeId the base edge id
|
229 | * @returns an array of edgeIds
|
230 | */
|
231 | getClusteredEdges(baseEdgeId: IdType): IdType[];
|
232 |
|
233 | /**
|
234 | * When a clusteredEdgeId is available, this method will return the original
|
235 | * baseEdgeId provided in data.edges ie.
|
236 | * After clustering the 'SelectEdge' event is fired but provides only the clustered edge.
|
237 | * This method can then be used to return the baseEdgeId.
|
238 | */
|
239 | getBaseEdge(clusteredEdgeId: IdType): IdType;
|
240 |
|
241 | /**
|
242 | * For the given clusteredEdgeId, this method will return all the original
|
243 | * base edge id's provided in data.edges.
|
244 | * For a non-clustered (i.e. 'base') edge, clusteredEdgeId is returned.
|
245 | * Only the base edge id's are returned.
|
246 | * All clustered edges id's under clusteredEdgeId are skipped,
|
247 | * but scanned recursively to return their base id's.
|
248 | */
|
249 | getBaseEdges(clusteredEdgeId: IdType): IdType[];
|
250 |
|
251 | /**
|
252 | * Visible edges between clustered nodes are not the same edge as the ones provided
|
253 | * in data.edges passed on network creation. With each layer of clustering, copies of
|
254 | * the edges between clusters are created and the previous edges are hidden,
|
255 | * until the cluster is opened. This method takes an edgeId (ie. a base edgeId from data.edges)
|
256 | * and applys the options to it and any edges that were created from it while clustering.
|
257 | */
|
258 | updateEdge(startEdgeId: IdType, options?: EdgeOptions): void;
|
259 |
|
260 | /**
|
261 | * Clustered Nodes when created are not contained in the original data.nodes
|
262 | * passed on network creation. This method updates the cluster node.
|
263 | */
|
264 | updateClusteredNode(clusteredNodeId: IdType, options?: NodeOptions): void;
|
265 |
|
266 | /**
|
267 | * Returns true if the node whose ID has been supplied is a cluster.
|
268 | *
|
269 | * @param nodeId the node id.
|
270 | */
|
271 | isCluster(nodeId: IdType): boolean;
|
272 |
|
273 | /**
|
274 | * Returns an array of all nodeIds of the nodes that
|
275 | * would be released if you open the cluster.
|
276 | *
|
277 | * @param clusterNodeId the id of the cluster node
|
278 | */
|
279 | getNodesInCluster(clusterNodeId: IdType): IdType[];
|
280 |
|
281 | /**
|
282 | * Opens the cluster, releases the contained nodes and edges,
|
283 | * removing the cluster node and cluster edges.
|
284 | * The options object is optional and currently supports one option,
|
285 | * releaseFunction, which is a function that can be used to manually
|
286 | * position the nodes after the cluster is opened.
|
287 | *
|
288 | * @param nodeId the node id
|
289 | * @param [options] optional open cluster options
|
290 | */
|
291 | openCluster(nodeId: IdType, options?: OpenClusterOptions): void;
|
292 |
|
293 | /**
|
294 | * If you like the layout of your network
|
295 | * and would like it to start in the same way next time,
|
296 | * ask for the seed using this method and put it in the layout.randomSeed option.
|
297 | *
|
298 | * @returns the current seed of the network.
|
299 | */
|
300 | getSeed(): number;
|
301 |
|
302 | /**
|
303 | * Programatically enable the edit mode.
|
304 | * Similar effect to pressing the edit button.
|
305 | */
|
306 | enableEditMode(): void;
|
307 |
|
308 | /**
|
309 | * Programatically disable the edit mode.
|
310 | * Similar effect to pressing the close icon (small cross in the corner of the toolbar).
|
311 | */
|
312 | disableEditMode(): void;
|
313 |
|
314 | /**
|
315 | * Go into addNode mode. Having edit mode or manipulation enabled is not required.
|
316 | * To get out of this mode, call disableEditMode().
|
317 | * The callback functions defined in handlerFunctions still apply.
|
318 | * To use these methods without having the manipulation GUI, make sure you set enabled to false.
|
319 | */
|
320 | addNodeMode(): void;
|
321 |
|
322 | /**
|
323 | * Edit the selected node.
|
324 | * The explaination from addNodeMode applies here as well.
|
325 | */
|
326 | editNode(): void;
|
327 |
|
328 | /**
|
329 | * Go into addEdge mode.
|
330 | * The explaination from addNodeMode applies here as well.
|
331 | */
|
332 | addEdgeMode(): void;
|
333 |
|
334 | /**
|
335 | * Go into editEdge mode.
|
336 | * The explaination from addNodeMode applies here as well.
|
337 | */
|
338 | editEdgeMode(): void;
|
339 |
|
340 | /**
|
341 | * Delete selected.
|
342 | * Having edit mode or manipulation enabled is not required.
|
343 | */
|
344 | deleteSelected(): void;
|
345 |
|
346 | /**
|
347 | * Returns the x y positions in canvas space of the nodes with the supplied nodeIds as an object.
|
348 | *
|
349 | * Alternative inputs are a String containing a nodeId or nothing.
|
350 | * When a String is supplied, the position of the node corresponding to the ID is returned.
|
351 | * When nothing is supplied, the positions of all nodes are returned.
|
352 | */
|
353 | getPositions(nodeIds?: IdType[]): { [nodeId: string]: Position };
|
354 | getPositions(nodeId: IdType): Position;
|
355 |
|
356 | |
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 | storePositions(): void;
|
371 |
|
372 | |
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 | moveNode(nodeId: IdType, x: number, y: number): void;
|
381 |
|
382 | |
383 |
|
384 |
|
385 |
|
386 | getBoundingBox(nodeId: IdType): BoundingBox;
|
387 |
|
388 | |
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | getConnectedNodes(nodeOrEdgeId: IdType, direction?: DirectionType): IdType[] | Array<{ fromId: IdType, toId: IdType }>;
|
396 |
|
397 | |
398 |
|
399 |
|
400 |
|
401 |
|
402 | getConnectedEdges(nodeId: IdType): IdType[];
|
403 |
|
404 | |
405 |
|
406 |
|
407 |
|
408 |
|
409 | startSimulation(): void;
|
410 |
|
411 | |
412 |
|
413 |
|
414 |
|
415 |
|
416 | stopSimulation(): void;
|
417 |
|
418 | |
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 | stabilize(iterations?: number): void;
|
426 |
|
427 | |
428 |
|
429 |
|
430 |
|
431 | getSelection(): { nodes: IdType[], edges: IdType[] };
|
432 |
|
433 | |
434 |
|
435 |
|
436 |
|
437 |
|
438 | getSelectedNodes(): IdType[];
|
439 |
|
440 | |
441 |
|
442 |
|
443 |
|
444 |
|
445 | getSelectedEdges(): IdType[];
|
446 |
|
447 | |
448 |
|
449 |
|
450 |
|
451 |
|
452 | getNodeAt(position: Position): IdType;
|
453 |
|
454 | |
455 |
|
456 |
|
457 |
|
458 |
|
459 | getEdgeAt(position: Position): IdType;
|
460 |
|
461 | |
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | selectNodes(nodeIds: IdType[], highlightEdges?: boolean): void;
|
468 |
|
469 | |
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | selectEdges(edgeIds: IdType[]): void;
|
476 |
|
477 | |
478 |
|
479 |
|
480 |
|
481 |
|
482 | setSelection(selection: { nodes: IdType[], edges: IdType[] }, options?: SelectionOptions): void;
|
483 |
|
484 | |
485 |
|
486 |
|
487 |
|
488 | unselectAll(): void;
|
489 |
|
490 | |
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | getScale(): number;
|
497 |
|
498 | |
499 |
|
500 |
|
501 |
|
502 |
|
503 | getViewPosition(): Position;
|
504 |
|
505 | |
506 |
|
507 |
|
508 |
|
509 |
|
510 | fit(options?: FitOptions): void;
|
511 |
|
512 | |
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 | focus(nodeId: IdType, options?: FocusOptions): void;
|
519 |
|
520 | |
521 |
|
522 |
|
523 |
|
524 | moveTo(options: MoveToOptions): void;
|
525 |
|
526 | |
527 |
|
528 |
|
529 | releaseNode(): void;
|
530 |
|
531 | |
532 |
|
533 |
|
534 |
|
535 |
|
536 | getOptionsFromConfigurator(): any;
|
537 | }
|
538 |
|
539 |
|
540 |
|
541 |
|
542 | export interface FocusOptions extends ViewPortOptions {
|
543 | |
544 |
|
545 |
|
546 |
|
547 |
|
548 | locked?: boolean;
|
549 | }
|
550 |
|
551 |
|
552 |
|
553 |
|
554 | export interface ViewPortOptions {
|
555 | |
556 |
|
557 |
|
558 |
|
559 | scale?: number;
|
560 |
|
561 | |
562 |
|
563 |
|
564 |
|
565 | offset?: Position;
|
566 |
|
567 | |
568 |
|
569 |
|
570 |
|
571 | animation?: AnimationOptions | boolean;
|
572 | }
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 | export interface MoveToOptions extends ViewPortOptions {
|
579 | |
580 |
|
581 |
|
582 | position?: Position;
|
583 | }
|
584 |
|
585 |
|
586 |
|
587 |
|
588 | export interface AnimationOptions {
|
589 | |
590 |
|
591 |
|
592 | duration: number;
|
593 | |
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 | easingFunction: EasingFunction;
|
602 | }
|
603 |
|
604 | export type EasingFunction =
|
605 | 'linear' |
|
606 | 'easeInQuad' |
|
607 | 'easeOutQuad' |
|
608 | 'easeInOutQuad' |
|
609 | 'easeInCubic' |
|
610 | 'easeOutCubic' |
|
611 | 'easeInOutCubic' |
|
612 | 'easeInQuart' |
|
613 | 'easeOutQuart' |
|
614 | 'easeInOutQuart' |
|
615 | 'easeInQuint' |
|
616 | 'easeOutQuint' |
|
617 | 'easeInOutQuint';
|
618 |
|
619 |
|
620 |
|
621 |
|
622 | export interface FitOptions {
|
623 | |
624 |
|
625 |
|
626 | nodes?: string[];
|
627 |
|
628 | |
629 |
|
630 |
|
631 |
|
632 | animation: TimelineAnimationType;
|
633 | }
|
634 |
|
635 | export interface SelectionOptions {
|
636 | unselectAll?: boolean;
|
637 | highlightEdges?: boolean;
|
638 | }
|
639 |
|
640 |
|
641 |
|
642 |
|
643 | export interface BoundingBox {
|
644 | top: number;
|
645 | left: number;
|
646 | right: number;
|
647 | bottom: number;
|
648 | }
|
649 |
|
650 |
|
651 |
|
652 |
|
653 | export interface ClusterOptions {
|
654 | |
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 | joinCondition?(nodeOptions: any): boolean;
|
662 |
|
663 | |
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 | processProperties?(clusterOptions: any, childNodesOptions: any[], childEdgesOptions: any[]): any;
|
671 |
|
672 | |
673 |
|
674 |
|
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 | clusterNodeProperties?: NodeOptions;
|
681 |
|
682 | |
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 | clusterEdgeProperties?: EdgeOptions;
|
691 | }
|
692 |
|
693 |
|
694 |
|
695 |
|
696 | export interface OpenClusterOptions {
|
697 | |
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 | releaseFunction(
|
710 | clusterPosition: Position,
|
711 | containedNodesPositions: { [nodeId: string]: Position }): { [nodeId: string]: Position };
|
712 | }
|
713 |
|
714 | export interface Position {
|
715 | x: number;
|
716 | y: number;
|
717 | }
|
718 |
|
719 | export interface Data {
|
720 | nodes?: Node[] | DataInterfaceNodes;
|
721 | edges?: Edge[] | DataInterfaceEdges;
|
722 | }
|
723 |
|
724 | export interface Node extends NodeOptions {
|
725 | id?: IdType;
|
726 | }
|
727 |
|
728 | export interface Edge extends EdgeOptions {
|
729 | from?: IdType;
|
730 | to?: IdType;
|
731 | id?: IdType;
|
732 | }
|
733 |
|
734 | export interface Locales {
|
735 | [language: string]: LocaleMessages | undefined;
|
736 | en?: LocaleMessages;
|
737 | cn?: LocaleMessages;
|
738 | de?: LocaleMessages;
|
739 | es?: LocaleMessages;
|
740 | it?: LocaleMessages;
|
741 | nl?: LocaleMessages;
|
742 | 'pt-br'?: LocaleMessages;
|
743 | ru?: LocaleMessages;
|
744 | }
|
745 |
|
746 | export interface LocaleMessages {
|
747 | edit: string;
|
748 | del: string;
|
749 | back: string;
|
750 | addNode: string;
|
751 | addEdge: string;
|
752 | editNode: string;
|
753 | editEdge: string;
|
754 | addDescription: string;
|
755 | edgeDescription: string;
|
756 | editEdgeDescription: string;
|
757 | createEdgeError: string;
|
758 | deleteClusterError: string;
|
759 | editClusterError: string;
|
760 | }
|
761 |
|
762 | export interface Options {
|
763 | autoResize?: boolean;
|
764 |
|
765 | width?: string;
|
766 |
|
767 | height?: string;
|
768 |
|
769 | locale?: string;
|
770 |
|
771 | locales?: Locales;
|
772 |
|
773 | clickToUse?: boolean;
|
774 |
|
775 | configure?: any;
|
776 |
|
777 | edges?: EdgeOptions;
|
778 |
|
779 | nodes?: NodeOptions;
|
780 |
|
781 | groups?: any;
|
782 |
|
783 | layout?: any;
|
784 |
|
785 | interaction?: any;
|
786 |
|
787 | manipulation?: any;
|
788 |
|
789 | physics?: any;
|
790 | }
|
791 |
|
792 | export interface Image {
|
793 | unselected?: string;
|
794 | selected?: string;
|
795 | }
|
796 |
|
797 | export interface Color {
|
798 | border?: string;
|
799 |
|
800 | background?: string;
|
801 |
|
802 | highlight?: string | {
|
803 | border?: string;
|
804 | background?: string;
|
805 | };
|
806 |
|
807 | hover?: string | {
|
808 | border?: string;
|
809 | background?: string;
|
810 | };
|
811 | }
|
812 |
|
813 | export interface NodeOptions {
|
814 | borderWidth?: number;
|
815 |
|
816 | borderWidthSelected?: number;
|
817 |
|
818 | brokenImage?: string;
|
819 |
|
820 | color?: string | Color;
|
821 |
|
822 | fixed?: boolean | {
|
823 | x?: boolean,
|
824 | y?: boolean,
|
825 | };
|
826 |
|
827 | font?: string | {
|
828 | color?: string,
|
829 | size?: number,
|
830 | face?: string,
|
831 | background?: string,
|
832 | strokeWidth?: number,
|
833 | strokeColor?: string,
|
834 | align?: string,
|
835 | vadjust?: string,
|
836 | multi?: string,
|
837 | bold?: string | FontOptions,
|
838 | ital?: string | FontOptions,
|
839 | boldital?: string | FontOptions,
|
840 | mono?: string | FontOptions,
|
841 | };
|
842 |
|
843 | group?: string;
|
844 |
|
845 | hidden?: boolean;
|
846 |
|
847 | icon?: {
|
848 | face?: string,
|
849 | code?: string,
|
850 | size?: number,
|
851 | color?: string,
|
852 | };
|
853 |
|
854 | image?: string | Image;
|
855 |
|
856 | label?: string;
|
857 |
|
858 | labelHighlightBold?: boolean;
|
859 |
|
860 | level?: number;
|
861 |
|
862 | margin?: {
|
863 | top?: number;
|
864 | right?: number;
|
865 | bottom?: number;
|
866 | left?: number;
|
867 | };
|
868 |
|
869 | mass?: number;
|
870 |
|
871 | physics?: boolean;
|
872 |
|
873 | scaling?: OptionsScaling;
|
874 |
|
875 | shadow?: boolean | OptionsShadow;
|
876 |
|
877 | shape?: string;
|
878 |
|
879 | shapeProperties?: {
|
880 | borderDashes?: boolean | number[],
|
881 | borderRadius?: number,
|
882 | interpolation?: boolean,
|
883 | useImageSize?: boolean,
|
884 | useBorderWithImage?: boolean
|
885 | };
|
886 |
|
887 | size?: number;
|
888 |
|
889 | title?: string;
|
890 |
|
891 | value?: number;
|
892 |
|
893 | |
894 |
|
895 |
|
896 |
|
897 |
|
898 | widthConstraint?: number | boolean | { minimum?: number, maximum?: number };
|
899 |
|
900 | x?: number;
|
901 |
|
902 | y?: number;
|
903 | }
|
904 |
|
905 | export interface EdgeOptions {
|
906 | arrows?: string | {
|
907 | to?: boolean | {
|
908 | enabled?: boolean,
|
909 | scaleFactor?: number,
|
910 | type?: string
|
911 | },
|
912 | middle?: boolean | {
|
913 | enabled?: boolean,
|
914 | scaleFactor?: number,
|
915 | type?: string
|
916 | },
|
917 | from?: boolean | {
|
918 | enabled?: boolean,
|
919 | scaleFactor?: number,
|
920 | type?: string
|
921 | }
|
922 | };
|
923 |
|
924 | arrowStrikethrough?: boolean;
|
925 |
|
926 | color?: string | {
|
927 | color?: string,
|
928 | highlight?: string,
|
929 | hover?: string,
|
930 | inherit?: boolean | string,
|
931 | opacity?: number,
|
932 | };
|
933 |
|
934 | dashes?: boolean | number[];
|
935 |
|
936 | font?: string | {
|
937 | color?: string,
|
938 | size?: number,
|
939 | face?: string,
|
940 | background?: string,
|
941 | strokeWidth?: number,
|
942 | strokeColor?: string,
|
943 | align?: string,
|
944 | vadjust?: string,
|
945 | multi?: string,
|
946 | bold?: string | FontOptions,
|
947 | ital?: string | FontOptions,
|
948 | boldital?: string | FontOptions,
|
949 | mono?: string | FontOptions,
|
950 | };
|
951 |
|
952 | hidden?: boolean;
|
953 |
|
954 | hoverWidth?: number;
|
955 |
|
956 | label?: string;
|
957 |
|
958 | labelHighlightBold?: boolean;
|
959 |
|
960 | length?: number;
|
961 |
|
962 | physics?: boolean;
|
963 |
|
964 | scaling?: OptionsScaling;
|
965 |
|
966 | selectionWidth?: number;
|
967 |
|
968 | selfReferenceSize?: number;
|
969 |
|
970 | shadow?: boolean | OptionsShadow;
|
971 |
|
972 | smooth?: boolean | {
|
973 | enabled: boolean,
|
974 | type: string,
|
975 | forceDirection?: string | boolean,
|
976 | roundness: number,
|
977 | };
|
978 |
|
979 | title?: string;
|
980 |
|
981 | value?: number;
|
982 |
|
983 | width?: number;
|
984 | }
|
985 |
|
986 | export interface FontOptions {
|
987 | color?: string;
|
988 | size?: number;
|
989 | face?: string;
|
990 | mod?: string;
|
991 | vadjust?: string;
|
992 | }
|
993 |
|
994 | export interface OptionsScaling {
|
995 | min?: number;
|
996 | max?: number;
|
997 | label?: boolean | {
|
998 | enabled?: boolean,
|
999 | min?: number,
|
1000 | max?: number,
|
1001 | maxVisible?: number,
|
1002 | drawThreshold?: number
|
1003 | };
|
1004 | customScalingFunction?(min?: number, max?: number, total?: number, value?: number): number;
|
1005 | }
|
1006 |
|
1007 | export interface OptionsShadow {
|
1008 | enabled: boolean;
|
1009 | color: string;
|
1010 | size: number;
|
1011 | x: number;
|
1012 | y: number;
|
1013 | }
|