lots of fixes, added support for selection rectangle, rearrange nodes, highlight links, copypaste with links and fixed several bugs

This commit is contained in:
tamat
2018-03-29 19:44:03 +02:00
parent 7485fc68aa
commit 1a16d6bc24
12 changed files with 1753 additions and 1089 deletions

View File

@@ -39,7 +39,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 377,
"line": 378,
"description": "LGraph is the class that contain a full graph. We instantiate one and add nodes to it, and then we can run the execution loop.",
"is_constructor": 1
},
@@ -52,7 +52,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 1430,
"line": 1487,
"description": "Base Class for all the node type classes",
"params": [
{
@@ -71,7 +71,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 3134,
"line": 3203,
"description": "marks as dirty the canvas, this way it will be rendered again",
"is_constructor": 1,
"params": [
@@ -102,7 +102,7 @@
"plugin_for": [],
"extension_for": [],
"file": "../src/litegraph.js",
"line": 5876,
"line": 6083,
"description": "ContextMenu from LiteGUI",
"is_constructor": 1,
"params": [
@@ -144,7 +144,7 @@
{
"file": "../src/litegraph.js",
"line": 135,
"description": "create a new node type by passing a function, it wraps it with a propper class",
"description": "Create a new node type by passing a function, it wraps it with a propper class and generates inputs according to the parameters of the function.\nUseful to wrap simple methods that do not require properties, and that only process some input to generate an output.",
"itemtype": "method",
"name": "wrapFunctionAsNode",
"params": [
@@ -173,7 +173,7 @@
},
{
"file": "../src/litegraph.js",
"line": 164,
"line": 165,
"description": "Adds this method to all nodetypes, existing and to be created\n(You can add it to LGraphNode.prototype but then existing node types wont have it)",
"itemtype": "method",
"name": "addNodeMethod",
@@ -188,7 +188,7 @@
},
{
"file": "../src/litegraph.js",
"line": 182,
"line": 183,
"description": "Create a node of a given type with a name. The node is not attached to any graph yet.",
"itemtype": "method",
"name": "createNode",
@@ -213,7 +213,7 @@
},
{
"file": "../src/litegraph.js",
"line": 225,
"line": 226,
"description": "Returns a registered node type with a given name",
"itemtype": "method",
"name": "getNodeType",
@@ -232,7 +232,7 @@
},
{
"file": "../src/litegraph.js",
"line": 238,
"line": 239,
"description": "Returns a list of node types matching one category",
"itemtype": "method",
"name": "getNodeType",
@@ -251,7 +251,7 @@
},
{
"file": "../src/litegraph.js",
"line": 260,
"line": 261,
"description": "Returns a list with all the node type categories",
"itemtype": "method",
"name": "getNodeTypesCategories",
@@ -263,7 +263,7 @@
},
{
"file": "../src/litegraph.js",
"line": 403,
"line": 404,
"description": "Removes all nodes from this graph",
"itemtype": "method",
"name": "clear",
@@ -271,7 +271,7 @@
},
{
"file": "../src/litegraph.js",
"line": 452,
"line": 453,
"description": "Attach Canvas to this graph",
"itemtype": "method",
"name": "attachCanvas",
@@ -286,7 +286,7 @@
},
{
"file": "../src/litegraph.js",
"line": 471,
"line": 472,
"description": "Detach Canvas from this graph",
"itemtype": "method",
"name": "detachCanvas",
@@ -301,7 +301,7 @@
},
{
"file": "../src/litegraph.js",
"line": 489,
"line": 490,
"description": "Starts running this graph every interval milliseconds.",
"itemtype": "method",
"name": "start",
@@ -316,7 +316,7 @@
},
{
"file": "../src/litegraph.js",
"line": 517,
"line": 518,
"description": "Stops the execution loop of the graph",
"itemtype": "method",
"name": "stop execution",
@@ -324,7 +324,7 @@
},
{
"file": "../src/litegraph.js",
"line": 539,
"line": 540,
"description": "Run N steps (cycles) of the graph",
"itemtype": "method",
"name": "runStep",
@@ -339,7 +339,7 @@
},
{
"file": "../src/litegraph.js",
"line": 618,
"line": 619,
"description": "Updates the graph execution order according to relevance of the nodes (nodes with only outputs have more relevance than\nnodes with only inputs.",
"itemtype": "method",
"name": "updateExecutionOrder",
@@ -347,7 +347,15 @@
},
{
"file": "../src/litegraph.js",
"line": 722,
"line": 736,
"description": "Positions every node in a more readable manner",
"itemtype": "method",
"name": "arrange",
"class": "LGraph"
},
{
"file": "../src/litegraph.js",
"line": 780,
"description": "Returns the amount of time the graph has been running in milliseconds",
"itemtype": "method",
"name": "getTime",
@@ -359,7 +367,7 @@
},
{
"file": "../src/litegraph.js",
"line": 733,
"line": 790,
"description": "Returns the amount of time accumulated using the fixedtime_lapse var. This is used in context where the time increments should be constant",
"itemtype": "method",
"name": "getFixedTime",
@@ -371,7 +379,7 @@
},
{
"file": "../src/litegraph.js",
"line": 744,
"line": 801,
"description": "Returns the amount of time it took to compute the latest iteration. Take into account that this number could be not correct\nif the nodes are using graphical actions",
"itemtype": "method",
"name": "getElapsedTime",
@@ -383,7 +391,7 @@
},
{
"file": "../src/litegraph.js",
"line": 756,
"line": 813,
"description": "Sends an event to all the nodes, useful to trigger stuff",
"itemtype": "method",
"name": "sendEventToAllNodes",
@@ -403,7 +411,7 @@
},
{
"file": "../src/litegraph.js",
"line": 799,
"line": 856,
"description": "Adds a new node instasnce to this graph",
"itemtype": "method",
"name": "add",
@@ -418,7 +426,7 @@
},
{
"file": "../src/litegraph.js",
"line": 855,
"line": 912,
"description": "Removes a node from the graph",
"itemtype": "method",
"name": "remove",
@@ -433,7 +441,7 @@
},
{
"file": "../src/litegraph.js",
"line": 924,
"line": 981,
"description": "Returns a node by its id.",
"itemtype": "method",
"name": "getNodeById",
@@ -448,7 +456,7 @@
},
{
"file": "../src/litegraph.js",
"line": 937,
"line": 994,
"description": "Returns a list of nodes that matches a class",
"itemtype": "method",
"name": "findNodesByClass",
@@ -467,7 +475,7 @@
},
{
"file": "../src/litegraph.js",
"line": 953,
"line": 1010,
"description": "Returns a list of nodes that matches a type",
"itemtype": "method",
"name": "findNodesByType",
@@ -486,7 +494,7 @@
},
{
"file": "../src/litegraph.js",
"line": 970,
"line": 1027,
"description": "Returns a list of nodes that matches a name",
"itemtype": "method",
"name": "findNodesByName",
@@ -505,7 +513,7 @@
},
{
"file": "../src/litegraph.js",
"line": 986,
"line": 1043,
"description": "Returns the top-most node in this position of the canvas",
"itemtype": "method",
"name": "getNodeOnPos",
@@ -534,7 +542,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1173,
"line": 1230,
"description": "Assigns a value to all the nodes that matches this name. This is used to create global variables of the node that\ncan be easily accesed from the outside of the graph",
"itemtype": "method",
"name": "setInputData",
@@ -554,7 +562,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1188,
"line": 1245,
"description": "Returns the value of the first node with this name. This is used to access global variables of the graph from the outside",
"itemtype": "method",
"name": "setInputData",
@@ -573,7 +581,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1228,
"line": 1285,
"description": "returns if the graph is in live mode",
"itemtype": "method",
"name": "isLive",
@@ -581,7 +589,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1265,
"line": 1322,
"description": "Creates a Object containing all the info about this graph, it can be serialized",
"itemtype": "method",
"name": "serialize",
@@ -593,7 +601,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1298,
"line": 1355,
"description": "Configure a graph from a JSON string",
"itemtype": "method",
"name": "configure",
@@ -608,7 +616,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1485,
"line": 1542,
"description": "configure a node from an object containing the serialized info",
"itemtype": "method",
"name": "configure",
@@ -616,7 +624,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1581,
"line": 1638,
"description": "serialize the content",
"itemtype": "method",
"name": "serialize",
@@ -624,7 +632,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1657,
"line": 1714,
"description": "serialize and stringify",
"itemtype": "method",
"name": "toString",
@@ -632,7 +640,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1669,
"line": 1726,
"description": "get the title string",
"itemtype": "method",
"name": "getTitle",
@@ -640,7 +648,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1682,
"line": 1739,
"description": "sets the output data",
"itemtype": "method",
"name": "setOutputData",
@@ -660,7 +668,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1718,
"line": 1775,
"description": "retrieves the input data (data traveling through the connection) from one slot",
"itemtype": "method",
"name": "getInputData",
@@ -684,7 +692,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1754,
"line": 1811,
"description": "tells you if there is a connection in one input slot",
"itemtype": "method",
"name": "isInputConnected",
@@ -703,7 +711,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1767,
"line": 1824,
"description": "tells you info about an input connection (which node, type, etc)",
"itemtype": "method",
"name": "getInputInfo",
@@ -722,7 +730,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1782,
"line": 1839,
"description": "returns the node connected in the input slot",
"itemtype": "method",
"name": "getInputNode",
@@ -741,7 +749,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1803,
"line": 1860,
"description": "tells you the last output data that went in that slot",
"itemtype": "method",
"name": "getOutputData",
@@ -760,7 +768,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1821,
"line": 1878,
"description": "tells you info about an output connection (which node, type, etc)",
"itemtype": "method",
"name": "getOutputInfo",
@@ -779,7 +787,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1837,
"line": 1894,
"description": "tells you if there is a connection in one output slot",
"itemtype": "method",
"name": "isOutputConnected",
@@ -798,7 +806,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1850,
"line": 1907,
"description": "retrieves all the nodes connected to this output slot",
"itemtype": "method",
"name": "getOutputNodes",
@@ -817,7 +825,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1883,
"line": 1940,
"description": "Triggers an event in this node, this will trigger any output with the same name",
"itemtype": "method",
"name": "trigger",
@@ -837,7 +845,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1906,
"line": 1963,
"description": "Triggers an slot event in this node",
"itemtype": "method",
"name": "triggerSlot",
@@ -857,7 +865,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1953,
"line": 2010,
"description": "add a new property to this node",
"itemtype": "method",
"name": "addProperty",
@@ -887,7 +895,7 @@
},
{
"file": "../src/litegraph.js",
"line": 1979,
"line": 2036,
"description": "add a new output slot to use in this node",
"itemtype": "method",
"name": "addOutput",
@@ -912,7 +920,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2002,
"line": 2059,
"description": "add a new output slot to use in this node",
"itemtype": "method",
"name": "addOutputs",
@@ -927,7 +935,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2027,
"line": 2084,
"description": "remove an existing output slot",
"itemtype": "method",
"name": "removeOutput",
@@ -942,7 +950,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2041,
"line": 2098,
"description": "add a new input slot to use in this node",
"itemtype": "method",
"name": "addInput",
@@ -967,7 +975,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2065,
"line": 2122,
"description": "add several new input slots in this node",
"itemtype": "method",
"name": "addInputs",
@@ -982,7 +990,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2090,
"line": 2147,
"description": "remove an existing input slot",
"itemtype": "method",
"name": "removeInput",
@@ -997,7 +1005,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2104,
"line": 2161,
"description": "add an special connection to this node (used for special kinds of graphs)",
"itemtype": "method",
"name": "addConnection",
@@ -1027,7 +1035,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2125,
"line": 2182,
"description": "computes the size of a node according to its inputs and output slots",
"itemtype": "method",
"name": "computeSize",
@@ -1046,8 +1054,8 @@
},
{
"file": "../src/litegraph.js",
"line": 2176,
"description": "returns the bounding of the object, used for rendering purposes",
"line": 2233,
"description": "returns the bounding of the object, used for rendering purposes\nbounding is: [topleft_cornerx, topleft_cornery, width, height]",
"itemtype": "method",
"name": "getBounding",
"return": {
@@ -1058,7 +1066,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2191,
"line": 2249,
"description": "checks if a point is inside the shape of a node",
"itemtype": "method",
"name": "isPointInsideNode",
@@ -1082,7 +1090,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2215,
"line": 2273,
"description": "checks if a point is inside a node slot, and returns info about which slot",
"itemtype": "method",
"name": "getSlotInPosition",
@@ -1106,7 +1114,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2246,
"line": 2304,
"description": "returns the input slot with a given name (used for dynamic slots), -1 if not found",
"itemtype": "method",
"name": "findInputSlot",
@@ -1125,7 +1133,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2262,
"line": 2320,
"description": "returns the output slot with a given name (used for dynamic slots), -1 if not found",
"itemtype": "method",
"name": "findOutputSlot",
@@ -1144,7 +1152,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2277,
"line": 2335,
"description": "connect this node output to the input of another node",
"itemtype": "method",
"name": "connect",
@@ -1173,7 +1181,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2395,
"line": 2453,
"description": "disconnect one output to an specific node",
"itemtype": "method",
"name": "disconnectOutput",
@@ -1197,7 +1205,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2485,
"line": 2543,
"description": "disconnect one input",
"itemtype": "method",
"name": "disconnectInput",
@@ -1216,7 +1224,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2554,
"line": 2611,
"description": "returns the center of a connection point in canvas coords",
"itemtype": "method",
"name": "getConnectionPos",
@@ -1240,7 +1248,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2688,
"line": 2745,
"description": "Collapse the node to make it smaller on the canvas",
"itemtype": "method",
"name": "collapse",
@@ -1248,7 +1256,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2701,
"line": 2758,
"description": "Forces the node to do not move or realign on Z",
"itemtype": "method",
"name": "pin",
@@ -1256,7 +1264,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2793,
"line": 2852,
"description": "clears all the data inside",
"itemtype": "method",
"name": "clear",
@@ -1264,7 +1272,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2828,
"line": 2891,
"description": "assigns a graph, you can reasign graphs to the same canvas",
"itemtype": "method",
"name": "setGraph",
@@ -1279,7 +1287,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2859,
"line": 2922,
"description": "opens a graph contained inside a node in the current graph",
"itemtype": "method",
"name": "openSubgraph",
@@ -1294,7 +1302,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2886,
"line": 2949,
"description": "closes a subgraph contained inside a node",
"itemtype": "method",
"name": "closeSubgraph",
@@ -1309,7 +1317,7 @@
},
{
"file": "../src/litegraph.js",
"line": 2902,
"line": 2966,
"description": "assigns a canvas",
"itemtype": "method",
"name": "setCanvas",
@@ -1324,7 +1332,7 @@
},
{
"file": "../src/litegraph.js",
"line": 3150,
"line": 3219,
"description": "Used to attach the canvas in a popup",
"itemtype": "method",
"name": "getCanvasWindow",
@@ -1336,7 +1344,7 @@
},
{
"file": "../src/litegraph.js",
"line": 3164,
"line": 3233,
"description": "starts rendering the content of the canvas when needed",
"itemtype": "method",
"name": "startRendering",
@@ -1344,7 +1352,7 @@
},
{
"file": "../src/litegraph.js",
"line": 3188,
"line": 3257,
"description": "stops rendering the content of the canvas (to save resources)",
"itemtype": "method",
"name": "stopRendering",