@@ -296,7 +296,6 @@ export interface LocaleMessages {
296
296
back : string ;
297
297
addNode : string ;
298
298
addEdge : string ;
299
- editNode : string ;
300
299
editEdge : string ;
301
300
addDescription : string ;
302
301
edgeDescription : string ;
@@ -685,6 +684,37 @@ export type VisNetworkRef = {
685
684
callback : EventCallback
686
685
) => NativeEventSubscription ;
687
686
687
+ /**
688
+ * Go into addEdge mode.
689
+ * The explaination from addNodeMode applies here as well.
690
+ */
691
+ addEdgeMode ( ) : void ;
692
+
693
+ /**
694
+ * Go into addNode mode. Having edit mode or manipulation enabled is not required.
695
+ * To get out of this mode, call disableEditMode().
696
+ * The callback functions defined in handlerFunctions still apply.
697
+ * To use these methods without having the manipulation GUI, make sure you set enabled to false.
698
+ */
699
+ addNodeMode ( ) : void ;
700
+
701
+ /**
702
+ * Delete selected.
703
+ * Having edit mode or manipulation enabled is not required.
704
+ */
705
+ deleteSelected ( ) : void ;
706
+
707
+ /**
708
+ * Remove the network from the DOM and remove all Hammer bindings and references.
709
+ */
710
+ destroy ( ) : void ;
711
+
712
+ /**
713
+ * Go into editEdge mode.
714
+ * The explaination from addNodeMode applies here as well.
715
+ */
716
+ editEdgeMode ( ) : void ;
717
+
688
718
/**
689
719
* Returns the x y positions in canvas space of a requested node or array of nodes.
690
720
*
@@ -715,4 +745,103 @@ export type VisNetworkRef = {
715
745
*
716
746
*/
717
747
focus ( nodeId : IdType , options ?: FocusOptions ) : void ;
748
+
749
+ /**
750
+ * You can use this to programatically move a node.
751
+ * The supplied x and y positions have to be in canvas space!
752
+ *
753
+ * @param nodeId the node that will be moved
754
+ * @param x new canvas space x position
755
+ * @param y new canvas space y position
756
+ */
757
+ moveNode ( nodeId : IdType , x : number , y : number ) : void ;
758
+
759
+ /**
760
+ * You can animate or move the camera using the moveTo method.
761
+ *
762
+ */
763
+ moveTo ( options : MoveToOptions ) : void ;
764
+
765
+ /**
766
+ * Redraw the network.
767
+ */
768
+ redraw ( ) : void ;
769
+
770
+ /**
771
+ * Programatically release the focussed node.
772
+ */
773
+ releaseNode ( ) : void ;
774
+
775
+ /**
776
+ * Selects the edges corresponding to the id's in the input array.
777
+ * This method unselects all other objects before selecting its own objects.
778
+ * Does not fire events.
779
+ *
780
+ */
781
+ selectEdges ( edgeIds : IdType [ ] ) : void ;
782
+
783
+ /**
784
+ * Selects the nodes corresponding to the id's in the input array.
785
+ * If highlightEdges is true or undefined, the neighbouring edges will also be selected.
786
+ * This method unselects all other objects before selecting its own objects. Does not fire events.
787
+ *
788
+ */
789
+ selectNodes ( nodeIds : IdType [ ] , highlightEdges ?: boolean ) : void ;
790
+
791
+ /**
792
+ * Override all the data in the network.
793
+ * If stabilization is enabled in the physics module,
794
+ * the network will stabilize again.
795
+ * This method is also performed when first initializing the network.
796
+ *
797
+ * @param data network data
798
+ */
799
+ setData ( data : Data ) : void ;
800
+
801
+ /**
802
+ * Set the options.
803
+ * All available options can be found in the modules above.
804
+ * Each module requires it's own container with the module name to contain its options.
805
+ *
806
+ * @param options network options
807
+ */
808
+ setOptions ( options : Options ) : void ;
809
+
810
+ /**
811
+ * Set the size of the canvas.
812
+ * This is automatically done on a window resize.
813
+ *
814
+ * @param width width in a common format, f.e. '100px'
815
+ * @param height height in a common format, f.e. '100px'
816
+ */
817
+ setSize ( width : string , height : string ) : void ;
818
+
819
+ /**
820
+ * You can manually call stabilize at any time.
821
+ * All the stabilization options above are used.
822
+ * You can optionally supply the number of iterations it should do.
823
+ *
824
+ * @param [iterations] the number of iterations it should do
825
+ */
826
+ stabilize ( iterations ?: number ) : void ;
827
+
828
+ /**
829
+ * Start the physics simulation.
830
+ * This is normally done whenever needed and is only really useful
831
+ * if you stop the simulation yourself and wish to continue it afterwards.
832
+ */
833
+ startSimulation ( ) : void ;
834
+
835
+ /**
836
+ * This stops the physics simulation and triggers a stabilized event.
837
+ * Tt can be restarted by dragging a node,
838
+ * altering the dataset or calling startSimulation().
839
+ */
840
+ stopSimulation ( ) : void ;
841
+
842
+ /**
843
+ * Unselect all objects.
844
+ * Does not fire events.
845
+ */
846
+ unselectAll ( ) : void ;
718
847
} ;
0 commit comments