jquery.flowchart icon indicating copy to clipboard operation
jquery.flowchart copied to clipboard

Adding extra values to a connector

Open MadTomT opened this issue 7 years ago • 3 comments

Hi Is it possible to add extra values to an input or output connector ? Then when using getData have that data included ?

eg:

  "links": {
    "0": {
      "fromOperator": "operator1",
      "fromConnector": "output_1",
      "fromSubConnector": 0,
	  "fromValueA": "1234",
	  "fromValueB": "ABCD",
      "toOperator": "operator2",
      "toConnector": "input_1",
      "toSubConnector": 0
	  "toValueA": "5678",
	  "toValueB": "WXYZ",
    }
  },

Thanks

MadTomT avatar Jul 31 '18 10:07 MadTomT

Have you tried to see if this works anyway.? I needed to do the same thing (only not at the sub-connector level) and I added elements called "properties" at both the operator and input/output levels and added arbitrary data in those elements. These elements survive the setData/getData cycle.

I also needed additional data at the flowchart level (primarily version and view origin for panzoom) this was a bit harder. I created a new top level element to hold these - but that does NOT survive the setData/getData cycle. I added a little bit of JS to store that data against the HTML flowchart element and then retrieve it when doing a get data and wrapped that around the setData and getData. it probably would not be a lot of work to add this to flowchart - but I have not done that yet.

On Tue, 31 Jul 2018 at 11:33 MadTomT [email protected] wrote:

Hi Is it possible to add extra values to an input or output connector ? Then when using getData have that data included ?

eg:

"links": { "0": { "fromOperator": "operator1", "fromConnector": "output_1", "fromSubConnector": 0, "fromValueA": "1234", "fromValueB": "ABCD", "toOperator": "operator2", "toConnector": "input_1", "toSubConnector": 0 "toValueA": "5678", "toValueB": "WXYZ", } },

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sdrdis/jquery.flowchart/issues/88, or mute the thread https://github.com/notifications/unsubscribe-auth/ACItM9PtRctVzDxpnten-wGT4C_uJchDks5uMDJigaJpZM4VoAKy .

runette avatar Aug 11 '18 09:08 runette

I think I needed this too and that is how I handled it. I mark this as a possible enhancement. Thanks @runette for your participation!

sdrdis avatar Aug 11 '18 10:08 sdrdis

As a very simple test I added id: '123', to one of my outputs. This shows in the save getData, I then change the following to flowchart.js

var $operator_connector_label = $('<div class="flowchart-operator-connector-label"></div>'); To [var $operator_connector_label = $('<div id="' + connectorInfos.id + '" class="flowchart-operator-connector-label"></div>');

The HTML now has the ID against the element.

MadTomT avatar Sep 03 '18 10:09 MadTomT