Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andydandy74 committed Dec 26, 2024
1 parent 93ae436 commit bd4c50b
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 46 deletions.
30 changes: 21 additions & 9 deletions nodes/3.x/PathGraph.AllPaths.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
{
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "pathgraphlist = IN[0]\r\nstart = IN[1]\r\nend = IN[2]\r\npathgraph = dict()\r\n\r\nfor item in pathgraphlist:\r\n\tpathgraph[item[0]] = item[1]\r\n\r\n# script found here:\r\n# https://www.python.org/doc/essays/graphs/\r\n\r\ndef find_all_paths(graph, start, end, path=[]):\r\n\tpath = path + [start]\r\n\tif start == end:\r\n\t\treturn [path]\r\n\tif not graph.has_key(start):\r\n\t\treturn []\r\n\tpaths = []\r\n\tfor node in graph[start]:\r\n\t\tif node not in path:\r\n\t\t\tnewpaths = find_all_paths(graph, node, end, path)\r\n\t\t\tfor newpath in newpaths:\r\n\t\t\t\tpaths.append(newpath)\r\n\treturn paths\r\n\r\nOUT = find_all_paths(pathgraph,start,end)",
"Code": "pathgraphlist = IN[0]\r\nstart = IN[1]\r\nend = IN[2]\r\npathgraph = dict()\r\n\r\nfor item in pathgraphlist:\r\n\tpathgraph[item[0]] = item[1]\r\n\r\n# script found here:\r\n# https://www.python.org/doc/essays/graphs/\r\n\r\ndef find_all_paths(graph, start, end, path=[]):\r\n\tpath = path + [start]\r\n\tif start == end:\r\n\t\treturn [path]\r\n\tif start not in graph:\r\n\t\treturn []\r\n\tpaths = []\r\n\tfor node in graph[start]:\r\n\t\tif node not in path:\r\n\t\t\tnewpaths = find_all_paths(graph, node, end, path)\r\n\t\t\tfor newpath in newpaths:\r\n\t\t\t\tpaths.append(newpath)\r\n\treturn paths\r\n\r\nOUT = find_all_paths(pathgraph,start,end)",
"Engine": "IronPython2",
"VariableInputPorts": true,
"Id": "da920ed9abbc416298e3760a71672a85",
"Inputs": [
Expand Down Expand Up @@ -57,7 +58,7 @@
}
],
"Replication": "Disabled",
"Description": "Runs an embedded IronPython script."
"Description": "Führt ein eingebettetes Python-Skript aus."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
Expand All @@ -83,7 +84,7 @@
}
],
"Replication": "Disabled",
"Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
"Description": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
Expand All @@ -109,7 +110,7 @@
}
],
"Replication": "Disabled",
"Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
"Description": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
Expand All @@ -135,7 +136,7 @@
}
],
"Replication": "Disabled",
"Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
"Description": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore",
Expand All @@ -156,7 +157,7 @@
],
"Outputs": [],
"Replication": "Disabled",
"Description": "A function output, use with custom nodes"
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Function, DynamoCore",
Expand All @@ -179,7 +180,7 @@
{
"Id": "c6896ad109dc40429a532d8696cc376b",
"Name": "pathGraph",
"Description": "return value",
"Description": "Rückgabewert",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand Down Expand Up @@ -220,18 +221,29 @@
"Dependencies": [
"e671caea-80d8-4245-8bf3-72144e19e559"
],
"NodeLibraryDependencies": [
{
"Name": "Clockwork for Dynamo 2.x",
"Version": "2.12.2",
"ReferenceType": "Package",
"Nodes": [
"c497b32aadb74bdebd9a19a6a76dcc9e"
]
}
],
"Author": "None provided",
"Bindings": [],
"View": {
"Dynamo": {
"ScaleFactor": 1.0,
"HasRunWithoutCrash": false,
"IsVisibleInDynamoLibrary": true,
"Version": "2.0.1.5055",
"Version": "2.12.1.8246",
"RunType": "Manual",
"RunPeriod": "1000"
},
"Camera": {
"Name": "Background Preview",
"Name": "Hintergrundvorschau",
"EyeX": -17.0,
"EyeY": 24.0,
"EyeZ": 50.0,
Expand Down
51 changes: 27 additions & 24 deletions nodes/3.x/PathGraph.ByPairs.dyf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
],
"Replication": "Disabled",
"Description": "Applies a function over all elements of a list, generating a new list from the results."
"Description": "Wendet eine Funktion für alle Elemente einer Liste an, und erstellt aus den Ergebnissen eine neue Liste."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction, DynamoCore",
Expand All @@ -58,7 +58,7 @@
{
"Id": "b6cf3614392b4613afc8bb3fb9619a5c",
"Name": "list0",
"Description": "Lists to join into one.\n\nvar[]..[]",
"Description": "Die zu einer Liste zu verkettenden Listen\n\nvar[]..[]",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand All @@ -78,15 +78,15 @@
{
"Id": "d082a126172d4e98aa52cef4d8ee178b",
"Name": "list",
"Description": "Joined list.",
"Description": "Verbundene Liste",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Disabled",
"Description": "Concatenates all given lists into a single list.\n\nList.Join (lists: var[]..[]): var[]..[]"
"Description": "Verkettet alle angegebenen Listen zu einer einzelnen Liste.\n\nList.Join (lists: var[]..[]): var[]..[]"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore",
Expand All @@ -97,7 +97,7 @@
{
"Id": "776231042cd84ca2a24533298042128b",
"Name": "list",
"Description": "List to be reversed.\n\nvar[]..[]",
"Description": "Umzukehrende Liste\n\nvar[]..[]",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand All @@ -108,15 +108,15 @@
{
"Id": "4e87203e14ca4b4990b2878cc53aad16",
"Name": "list",
"Description": "New list.",
"Description": "Umgekehrte Liste",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Disabled",
"Description": "Creates a new list containing the items of the given list but in reverse order.\n\nList.Reverse (list: var[]..[]): var[]..[]"
"Description": "Erstellt eine neue Liste mit den Elementen der angegebenen Liste, jedoch in umgekehrter Reihenfolge.\n\nList.Reverse (list: var[]..[]): var[]..[]"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
Expand All @@ -142,7 +142,7 @@
}
],
"Replication": "Disabled",
"Description": "A function parameter, use with custom nodes.\r\n\r\nYou can specify the type and default value for parameter. E.g.,\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
"Description": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore",
Expand All @@ -163,12 +163,13 @@
],
"Outputs": [],
"Replication": "Disabled",
"Description": "A function output, use with custom nodes"
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
},
{
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "indices = IN[0]\r\nflatlist = IN[1]\r\npathgraph = dict()\r\n\r\n# script found here:\r\n# https://www.python.org/doc/essays/graphs/\r\n\r\nfor index in indices:\r\n\tindexlist = list()\r\n\tfor item in flatlist:\r\n\t\tif index == item[0]:\r\n\t\t\tindexlist.append(item[1])\r\n\tpathgraph[index] = indexlist\t\r\n# convert dictionary to list as Dynamo does not allow Python dictionaries\r\nOUT = pathgraph.items()",
"Engine": "CPython3",
"VariableInputPorts": true,
"Id": "9deaff7936b84a8382de55963e7047fd",
"Inputs": [
Expand Down Expand Up @@ -203,7 +204,7 @@
}
],
"Replication": "Disabled",
"Description": "Runs an embedded IronPython script."
"Description": "Führt ein eingebettetes Python-Skript aus."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore",
Expand All @@ -214,7 +215,7 @@
{
"Id": "cc74c186ad8c41fbb6507db1ad66d5f8",
"Name": "list",
"Description": "List to filter duplicates out of.\n\nvar[]..[]",
"Description": "Liste, aus der Duplikate ausgefiltert werden sollen\n\nvar[]..[]",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
Expand All @@ -225,15 +226,15 @@
{
"Id": "8b0def24d77d4e29bafda5999a15d04f",
"Name": "list",
"Description": "Filtered list.",
"Description": "Gefilterte Liste",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Auto",
"Description": "Creates a new list containing all unique items in the given list.\n\nList.UniqueItems (list: var[]..[]): var[]..[]"
"Description": "Erstellt eine neue Liste mit allen eindeutigen Elementen in der angegebenen Liste.\n\nList.UniqueItems (list: var[]..[]): var[]..[]"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore",
Expand All @@ -244,16 +245,16 @@
{
"Id": "ca6f4f13077748679d6cf77b542cf545",
"Name": "list",
"Description": "List to flatten.\n\nvar[]..[]",
"Description": "Zu vereinfachende Liste\n\nvar[]..[]",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
},
{
"Id": "7ef927197de24c26a5ea948a15c3b4cf",
"Name": "amt",
"Description": "Layers of nesting to remove.\n\nint\nDefault value : -1",
"Name": "amount",
"Description": "Layer der zu entfernenden Listenverschachtelung (-1 entfernt alle Listenverschachtelungen)\n\nint\nVorgabewert : -1",
"UsingDefaultValue": true,
"Level": 2,
"UseLevels": false,
Expand All @@ -263,16 +264,16 @@
"Outputs": [
{
"Id": "ec85699be3b046ef8649e504d2ef4269",
"Name": "var[]..[]",
"Description": "var[]..[]",
"Name": "list",
"Description": "Vereinfachte Liste nach Betrag",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Auto",
"Description": "Flattens a nested list of lists by a certain amount.\n\nList.Flatten (list: var[]..[], amt: int = -1): var[]..[]"
"Description": "Vereinfacht eine verschachtelte Liste von Listen um eine bestimmte Anzahl von Ebenen.\n\nList.Flatten (list: var[]..[], amount: int = -1): var[]..[]"
}
],
"Connectors": [
Expand Down Expand Up @@ -323,18 +324,20 @@
}
],
"Dependencies": [],
"NodeLibraryDependencies": [],
"Author": "None provided",
"Bindings": [],
"View": {
"Dynamo": {
"ScaleFactor": 1.0,
"HasRunWithoutCrash": false,
"IsVisibleInDynamoLibrary": true,
"Version": "2.0.1.5055",
"Version": "2.12.1.8246",
"RunType": "Manual",
"RunPeriod": "1000"
},
"Camera": {
"Name": "Background Preview",
"Name": "Hintergrundvorschau",
"EyeX": -17.0,
"EyeY": 24.0,
"EyeZ": 50.0,
Expand Down Expand Up @@ -457,8 +460,8 @@
"Background": "#FFC1D676"
}
],
"X": -34.468808553869,
"Y": -51.1231535101859,
"Zoom": 1.00646868784672
"X": -109.65783718757757,
"Y": 82.4748388093999,
"Zoom": 0.77087948042730847
}
}
Loading

0 comments on commit bd4c50b

Please sign in to comment.