-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
7 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
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,54 @@ | ||
import { settingsNodeColors as nodeColors } from "./settings_node_colors.js" | ||
|
||
export var filter = { | ||
templateName : "filter", | ||
name : "Filter", | ||
style:{ | ||
headerColor:nodeColors.inputObject, | ||
}, | ||
category:"data", | ||
|
||
props :[ | ||
{id:"output", expect:"text", label:"output", type:"hidden", editable:false, socket:"output", value:"output"}, | ||
{id:"paramName", expect:"text", label:"Param Name", type:"text", editable:true, socket:"input", value:"...."}, | ||
{id:"paramIndex", expect:"text", label:"Param Name", type:"text", editable:true, socket:"input", value:"...."}, | ||
{id:"a", expect:"data", label:"Data", type:"text", editable:true, socket:"input", value:"0"}, | ||
], | ||
methods:{ | ||
}, | ||
event:{ | ||
onEvaluate:(props, globals) =>{ | ||
// var instanceRepo = createInstancesManagement() | ||
// var currentInstance = instanceRepo.getById(globals.originInstance) | ||
// props.output.set(currentInstance) | ||
// var paramName = props.paramName.get() | ||
// if (paramName!="....") { | ||
// props.output.set("false") | ||
// let url = window.location.hash.slice(1) || '/'; | ||
// if (url.split("?")[1]) {//if there are already search params | ||
// var splitedParams = url.split("?")[1].split("&") | ||
// url = url.split("?")[0] | ||
// for (let i = 0; i < splitedParams.length; i++) { | ||
// const sparam = splitedParams[i].split("="); | ||
// if (paramName == sparam[0]) { | ||
// props.output.set(sparam[1] || "flase") | ||
// } | ||
// } | ||
// } | ||
// } | ||
if (Array.isArray(props.a.get()) && props.a.get()[0] && props.a.get()[0].attributes.type) { | ||
var oldDataSet = props.a.get() | ||
var newDataSet = [] | ||
for (let i = 0; i < oldDataSet.length; i++) { | ||
const element = oldDataSet[i]; | ||
if (i<2) { | ||
newDataSet.push(element) | ||
} | ||
} | ||
props.output.set(newDataSet) | ||
} | ||
}, | ||
// onInit:(props) =>{ | ||
// }, | ||
}, | ||
} |
7 changes: 7 additions & 0 deletions
7
src/js/modules/common_evaluators/templates/settings_node_colors.js
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,7 @@ | ||
export var settingsNodeColors = { | ||
input:0x83314a, | ||
inputData:0x00d6a3, | ||
inputObject:0xed9e5c, | ||
output:0x1d1d1d, | ||
attribute:0xa35abd, | ||
} |