Code snippet test

If you want to get the first fault tree in my ExampleFaultTrees object, then the following code is for you: var exampleFaultTrees = new ExampleFaultTrees(); topNode = exampleFaultTrees.getFaultTree(0); You first need to instantiate an ExampleFaultTrees object and then you can ask it for the zeroth element in its internal array of fault trees. You can then simply call the topNode’s draw function, giving it the 2d context of the canvas as a parameter to draw to. [Read More]
test  code