Is there away of calling the effects of a GoJS sample into another one? For example let say that you want to give the nodes in the Swim Lanes sample the the Monitor Display effect without combining the source code of the desperate and unrelated samples.
In other words is there a way of linking in a tag or reference to the Swim Lanes sample source code to give the Monitor Display effect?
Fundamentally, all appearance and behavior is implemented in source code, although the templates are more data-structured than regular JavaScript code. So you’re going to have to do some merging of source code, even if it is just a matter of setting some properties and/or copying some template structure.
“Monitor Display” is embolden name on page. There are 7 pictures frames of kittens.
The main feature are the color coded symbols at the inside corners of the frames to indicate various conditions.
Actual wording on page:
Monitor display
This continuously shows the state of a number of stations on an imaginary shop floor. Every two seconds it updates the display, showing some random problems via highlighting. You can add nodes and links by adding data to the model text below and then clicking "Load".
Well, I was asking which “effects” that you wanted to port from the Shop Floor Monitor sample to the SwimLanes sample.
If I were you, I would copy the node template and supporting converter functions from the Shop Floor Monitor sample into the SwimLanes sample, replacing the SwimLanes’s node template. Then I would merge the two data models, copying the status data properties into the SwimLanes’s data. Finally I would copy the randomProblems function and the loop that calls it.
Of course in your app you are going to have to replace randomProblems and that loop with getting the real data from whatever feed you have on your server. Presumably you’ll get that data asynchronously (so you won’t need a setTimeout loop), at which time you can call Model.updateTargetBindings, just as randomProblems does.
Is there a way that someone can review the code that I merged of both swim lanes and shop floor monitor. It is almost complete but has a few snags in it that need ironing out
Add a property on your node data that is the color that you want, and on a Shape in your node template add a Binding of “fill” to your new property name. If you want a gradient, use a converter function.
2) Learn about web services and AJAX and JSON. This is covered in many manners on lots of web sites and in lots of books. Once you have JavaScript objects in memory, you can assign Diagram.model.nodeDataArray or you can modify model data by calling Model.setDataProperty.