I have been using the great code you've written to build an app that allows the user to dynamically build up a flowchart. The connector div omits a data-bind and I need to be able to colour the line depending on a couple of factors. The backgroundColor of the Div cannot be set either. I've like to add a 4th element to the connector class so that it looks like connector blocka blockb failSuccess - I then colour the line depending on the 4th value - is this quick and easy to do - can you give me some pointers - I have managed to change the color of course but I need the colour to depend on each line/connector? Much appreciated in advance....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1 - Modify the the js-graph-it as followed (add this at line 750 - this.connectorClass is only for orienation)
this.connectorClass = splitted[0] + ' ' + splitted[1] + ' ' + splitted[2];
//this is just a function-name you can choose.
if(OnInitConnection){
OnInitConnection(this);
}
this will allow you to call a method from another JS-File. in this case i choose the name OnInitConnection which is defined in my js-files.
2 - implement OnInitConnection in any of your referenced js-files.
functionOnInitConnection(connectionObject){varc=connectionObject;//will allow your own classes on the connection-divc.connectorClass=c.htmlElement.className;//may change the size(thickness) of the connection.c.size=5;}
I have been using the great code you've written to build an app that allows the user to dynamically build up a flowchart. The connector div omits a data-bind and I need to be able to colour the line depending on a couple of factors. The backgroundColor of the Div cannot be set either. I've like to add a 4th element to the connector class so that it looks like connector blocka blockb failSuccess - I then colour the line depending on the 4th value - is this quick and easy to do - can you give me some pointers - I have managed to change the color of course but I need the colour to depend on each line/connector? Much appreciated in advance....
hi, i just needed the same thing :)
I made it like this:
1 - Modify the the js-graph-it as followed (add this at line 750 - this.connectorClass is only for orienation)
this will allow you to call a method from another JS-File. in this case i choose the name OnInitConnection which is defined in my js-files.
2 - implement OnInitConnection in any of your referenced js-files.
3 - define a css-class to set the background
4 - add this class too your connection as needed
please be sure to place your css below the js-graph-it.css.
that's it :)
Last edit: Tobias Koller 2016-04-16