My intention to is to pass in a property title and value in the nodeDataArray and access these when a specific node is (re)set as .visible = false|true
I’ve added ‘showWith’ as shown below on the last item:
"nodeDataArray": [
{"category":"Comment", "loc":"329 -1", "text":"Test Additional Params", "key":-13},
{"key":-1, "category":"Start", "loc":"175 0", "text":"Start"},
<span style="line-height: 1.4;">{"text":"Y_D1", "category":"Answer", "key":-14, "loc":"254.5 151", "focusMe":"center"}, </span>
{"text":"N_D1", "category":"Answer", "key":-15, "loc":"418 168", "focusMe":"top"},
<span style="line-height: 1.4;">{"category":"Comment", "text":"Show me \nwith Y_D1", "figure":"RoundedRectangle", "key":-6, "loc":"105 174", "<b>showWith</b>":"-14"} </span>
In code I would have hoped to have access to the showWith property simply through
</span>
if(node.data.showWith == theNode.data.key) {
// do stuff
}
but it seems the general framework doesn’t expose the parameter in this manner.
I can see that if I programatically set the value such as …
</span>
<span ="apple-tab-span"="" style="white-space:pre"> </span>var data = myDiagram.model.findNodeDataForKey('-6');
<span ="apple-tab-span"="" style="white-space:pre"> </span>if (data !== null) {
<span ="apple-tab-span"="" style="white-space:pre"> </span>myDiagram.model.setDataProperty(data, "showWith", "-14");
<span ="apple-tab-span"="" style="white-space:pre"> </span>}
then I can access it but I don’t want to add code if it’s possible to push this value in the nodeDataArray as I would expect.
I’ve seen some examples here where users appear to be setting ‘additional’ params in the nodeDataArray but can’t see the full run-through to accessing this as part of a node object interrogation, any assistance would be gratefully received.
Thanks
Dylan