{ "custom": {}, "params": { "NS": true, "leak": 38, "stops": [ 10, 15, 20, 25, 30, 35, 40, 45, 50, 60 ] }, "propConfig": { "params.NS": { "paramDirection": "input", "persistent": true }, "params.leak": { "paramDirection": "input", "persistent": true }, "params.stops": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "height": 15 } }, "root": { "children": [ { "meta": { "name": "Label" }, "position": { "basis": "35%", "grow": 1 }, "props": { "textStyle": { "borderStyle": "dashed" } }, "type": "ia.display.label" }, { "meta": { "name": "Label_0" }, "position": { "basis": "65%", "grow": 1 }, "propConfig": { "props.style.backgroundImage": { "binding": { "config": { "path": "view.params.leak" }, "transforms": [ { "code": "\tstops \u003d self.view.params.stops\n # Colors\n\tnoleak \u003d \"rgba(0,0,0,0)\"\n\tleak \u003d \"rgba(255,0,0,0.75)\"\n\t# start the gradient\n\tgradient_parts \u003d []\n\t# iterate thourgh the stops\n\tfor i in range(len(stops) - 1):\n\t\tstart \u003d stops[i]\n\t\tend \u003d stops[i+1]\n\t\t# Set the segment color\n\t\tcolor \u003d leak if start \u003c\u003d value \u003c\u003d end else noleak\n\t\tgradient_parts.append(\"{color}\".format(color\u003dcolor))\n\t\n\t# get all the element together\n\treturn \"linear-gradient(to right, \" + \", \".join(gradient_parts) + \")\"", "type": "script" } ], "type": "property" } } }, "props": { "text": "\n" }, "type": "ia.display.label" } ], "meta": { "name": "root" }, "propConfig": { "props.direction": { "binding": { "config": { "path": "view.params.NS" }, "transforms": [ { "fallback": "column", "inputType": "scalar", "mappings": [ { "input": true, "output": "column" }, { "input": false, "output": "column-reverse" } ], "outputType": "scalar", "type": "map" } ], "type": "property" } } }, "type": "ia.container.flex" } }