-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stdlib): add xod/core/arity-level, xod/core/average nodes
- Loading branch information
1 parent
f8e0c0b
commit b17f125
Showing
8 changed files
with
508 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
node { | ||
void evaluate(Context ctx) { | ||
emitValue<output_OUT>(ctx, getValue<input_IN1>(ctx) + 1); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
workspace/__lib__/xod/core/arity-level-internal/patch.xodp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"nodes": [ | ||
{ | ||
"id": "HJk7Ze2M_", | ||
"position": { | ||
"units": "slots", | ||
"x": 4, | ||
"y": 1 | ||
}, | ||
"type": "xod/patch-nodes/variadic-1" | ||
}, | ||
{ | ||
"id": "BJBQbx3Md", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 1 | ||
}, | ||
"type": "xod/patch-nodes/not-implemented-in-xod" | ||
}, | ||
{ | ||
"id": "ry9mWx3fd", | ||
"position": { | ||
"units": "slots", | ||
"x": 2, | ||
"y": 0 | ||
}, | ||
"type": "xod/patch-nodes/input-t1" | ||
}, | ||
{ | ||
"id": "S1gVWl2Md", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 0 | ||
}, | ||
"type": "xod/patch-nodes/input-number" | ||
}, | ||
{ | ||
"id": "SkLNbxnfO", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 2 | ||
}, | ||
"type": "xod/patch-nodes/output-number" | ||
}, | ||
{ | ||
"id": "SJj4Ze3zO", | ||
"position": { | ||
"units": "slots", | ||
"x": 5, | ||
"y": 1 | ||
}, | ||
"type": "xod/patch-nodes/utility" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"description": "When connected to a variadic-pass input, outputs arity level of parent node", | ||
"links": [ | ||
{ | ||
"id": "ry2DSx3G_", | ||
"input": { | ||
"nodeId": "rkKPBe2G_", | ||
"pinKey": "ry9mWx3fd" | ||
}, | ||
"output": { | ||
"nodeId": "B1DIHlhzu", | ||
"pinKey": "__out__" | ||
} | ||
}, | ||
{ | ||
"id": "r16wrx3fO", | ||
"input": { | ||
"nodeId": "HJTUBe3f_", | ||
"pinKey": "__in__" | ||
}, | ||
"output": { | ||
"nodeId": "rkKPBe2G_", | ||
"pinKey": "SkLNbxnfO" | ||
} | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"id": "HyCrHxnzO", | ||
"position": { | ||
"units": "slots", | ||
"x": 3, | ||
"y": 1 | ||
}, | ||
"type": "xod/patch-nodes/variadic-pass-1" | ||
}, | ||
{ | ||
"id": "B1DIHlhzu", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 0 | ||
}, | ||
"type": "xod/patch-nodes/input-t1" | ||
}, | ||
{ | ||
"id": "HJTUBe3f_", | ||
"position": { | ||
"units": "slots", | ||
"x": 0, | ||
"y": 2 | ||
}, | ||
"type": "xod/patch-nodes/output-number" | ||
}, | ||
{ | ||
"id": "rkKPBe2G_", | ||
"position": { | ||
"units": "slots", | ||
"x": 0, | ||
"y": 1 | ||
}, | ||
"type": "@/arity-level-internal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"description": "Adds the input values together and divides by the number of values", | ||
"links": [ | ||
{ | ||
"id": "Bk4hHl3Gd", | ||
"input": { | ||
"nodeId": "ByG2rlnfu", | ||
"pinKey": "HkqmLAOrD1W" | ||
}, | ||
"output": { | ||
"nodeId": "rJG5SlhGu", | ||
"pinKey": "__out__" | ||
} | ||
}, | ||
{ | ||
"id": "HJv3SxnMd", | ||
"input": { | ||
"nodeId": "S10jrlhG_", | ||
"pinKey": "B1DIHlhzu" | ||
}, | ||
"output": { | ||
"nodeId": "rJG5SlhGu", | ||
"pinKey": "__out__" | ||
} | ||
}, | ||
{ | ||
"id": "rks2Bl2Mu", | ||
"input": { | ||
"nodeId": "Sytnrx3Mu", | ||
"pinKey": "SkdIRuBD1b" | ||
}, | ||
"output": { | ||
"nodeId": "ByG2rlnfu", | ||
"pinKey": "SyomIRurDJ-" | ||
} | ||
}, | ||
{ | ||
"id": "SJhhSe2Gd", | ||
"input": { | ||
"nodeId": "Sytnrx3Mu", | ||
"pinKey": "BytUCdHD1-" | ||
}, | ||
"output": { | ||
"nodeId": "S10jrlhG_", | ||
"pinKey": "HJTUBe3f_" | ||
} | ||
}, | ||
{ | ||
"id": "BJ62He2f_", | ||
"input": { | ||
"nodeId": "BJgjHe3Mu", | ||
"pinKey": "__in__" | ||
}, | ||
"output": { | ||
"nodeId": "Sytnrx3Mu", | ||
"pinKey": "BkqLCOSw1W" | ||
} | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"id": "rJG5SlhGu", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 0 | ||
}, | ||
"type": "xod/patch-nodes/input-number" | ||
}, | ||
{ | ||
"id": "S1wcrgnfu", | ||
"position": { | ||
"units": "slots", | ||
"x": 5, | ||
"y": 1 | ||
}, | ||
"type": "xod/patch-nodes/variadic-pass-1" | ||
}, | ||
{ | ||
"id": "BJgjHe3Mu", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 3 | ||
}, | ||
"type": "xod/patch-nodes/output-number" | ||
}, | ||
{ | ||
"id": "S10jrlhG_", | ||
"position": { | ||
"units": "slots", | ||
"x": 3, | ||
"y": 1 | ||
}, | ||
"type": "@/arity-level" | ||
}, | ||
{ | ||
"id": "ByG2rlnfu", | ||
"position": { | ||
"units": "slots", | ||
"x": 0, | ||
"y": 1 | ||
}, | ||
"type": "@/add" | ||
}, | ||
{ | ||
"id": "Sytnrx3Mu", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 2 | ||
}, | ||
"type": "@/divide" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
OUT1 OUT2 OUT3 | ||
1 2 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
"links": [ | ||
{ | ||
"id": "BJ5oSGTzO", | ||
"input": { | ||
"nodeId": "SytiSzTGO", | ||
"pinKey": "__in__" | ||
}, | ||
"output": { | ||
"nodeId": "HyziHf6Md", | ||
"pinKey": "HJTUBe3f_" | ||
} | ||
}, | ||
{ | ||
"id": "HyZa3rGazO", | ||
"input": { | ||
"nodeId": "SJeanBM6GO", | ||
"pinKey": "__in__" | ||
}, | ||
"output": { | ||
"nodeId": "HJT2SfTf_", | ||
"pinKey": "HJTUBe3f_" | ||
} | ||
}, | ||
{ | ||
"id": "BJ-fArM6MO", | ||
"input": { | ||
"nodeId": "H1xf0rf6zd", | ||
"pinKey": "__in__" | ||
}, | ||
"output": { | ||
"nodeId": "SyG0BMTzd", | ||
"pinKey": "HJTUBe3f_" | ||
} | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"boundLiterals": { | ||
"B1DIHlhzu": "\"foo\"" | ||
}, | ||
"id": "HyziHf6Md", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 1 | ||
}, | ||
"type": "xod/core/arity-level" | ||
}, | ||
{ | ||
"id": "SytiSzTGO", | ||
"position": { | ||
"units": "slots", | ||
"x": 1, | ||
"y": 2 | ||
}, | ||
"type": "xod/patch-nodes/output-number" | ||
}, | ||
{ | ||
"arityLevel": 2, | ||
"boundLiterals": { | ||
"B1DIHlhzu": "0" | ||
}, | ||
"id": "HJT2SfTf_", | ||
"position": { | ||
"units": "slots", | ||
"x": 4, | ||
"y": 1 | ||
}, | ||
"type": "xod/core/arity-level" | ||
}, | ||
{ | ||
"id": "SJeanBM6GO", | ||
"position": { | ||
"units": "slots", | ||
"x": 4, | ||
"y": 2 | ||
}, | ||
"type": "xod/patch-nodes/output-number" | ||
}, | ||
{ | ||
"arityLevel": 6, | ||
"boundLiterals": { | ||
"B1DIHlhzu": "True" | ||
}, | ||
"id": "SyG0BMTzd", | ||
"position": { | ||
"units": "slots", | ||
"x": 8, | ||
"y": 1 | ||
}, | ||
"type": "xod/core/arity-level" | ||
}, | ||
{ | ||
"id": "H1xf0rf6zd", | ||
"position": { | ||
"units": "slots", | ||
"x": 8, | ||
"y": 2 | ||
}, | ||
"type": "xod/patch-nodes/output-number" | ||
}, | ||
{ | ||
"id": "B1MbIzTzd", | ||
"position": { | ||
"units": "slots", | ||
"x": 16, | ||
"y": 1 | ||
}, | ||
"type": "xod/patch-nodes/tabtest" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
IN1 IN2 IN3 IN4 IN5 OUT | ||
1 2 3 4 5 3 | ||
10000 1000 100 10 1 2222.2 |
Oops, something went wrong.