The expectation in pools with swim lanes is that swimmers mostly stay in their lanes and swim independently from each other. That is why the SwimLanes sample has a separate layout in each lane, causing layouts to be independent of each other.
Closest in achieving it is by using locations but it is currently hard to achieve, is there a property from layouts or nodes that can help me auto calculate the locations?
Why do you say that “b1” should be in the first row of nodes but the empty node or “c1” should be in the second row?
Answer: Since its connection is b1 to a2, It needs to be aligned to a1
For the Flowchartlayout, can it be customized to look like SwimLanes?
Property like angle, text, pickable. Is there something I can use to calculate the locations?
Noted on commitLanes :)
I am having problems using the FlowchartLayout library its stating that go cannot be found, but I am using it too, I tried adding import to the library but its unsuccessful, how can I add the go js library directly to the FlowchartLayout.js? Does this have a minified version? Apologies if I have many questions
and is this compatible with any versions of go library?
Use of all of our samples and example code is covered by the license agreement.
The file I gave you does define a “global” symbol. It, like all of the other extensions in the extensions directory, can be loaded with a <script> tag assuming the GoJS library has already been loaded.
If you want to change the code to define a UMD module, you can. There are lots of examples in the extensionsTS directory. Or search the web for descriptions of how to do it.
If you want to change the code to define an ES6 module, you can. There are lots of examples in the extensionsJSM directory.
The problem is we are not allowed to define it inside a tag, we are using a factory type definitions on all the external library, in there it reads the gojs library however when its the FlowchartLayout.js it is loaded but I cannot access the FlowchartLayout()
So I need to convert the library to UMD and ES6 module?
I’ve converted it to UMD but it still can’t see the definition for it when I add it to my factory, Apologies walter I don’t have any experience regarding the modules
(function (root, factory) {
if (typeof exports === 'object') {
// CommonJS
module.exports = factory(require('b'));
} else if (typeof define === 'function' && define.amd) {
// AMD
define(['b'], function (b) {
return (root.returnExportsGlobal = factory(b));
});
} else {
// Global Variables
root.returnExportsGlobal = factory(root.b);
}
}(this, function (b) {
'use strict';
function FlowchartLayout() {
go.Layout.call(this);
this._angle = 90;
this._nodeSpacing = 40; // between nodes in same layer
this._layerSpacing = 40; // between nodes in different layers
this._laneProperty = "lane"; // name of data property that identifies lane as a unique number or a string
this._laneComparer = null; // function for sorting FlowchartLanes
this._reset();
}
go.Diagram.inherit(FlowchartLayout, go.Layout);
/*The rest of the code of FlowchartLayout*/
return FlowchartLayout;
}));
As demonstrated in that sample, there is a custom FlowchartLayout that implements the “drawing” of both (vertical) lanes and (horizontal) bands by overriding the commitLanes and commitLayers methods, respectively. So you need to see if you have something like that code in your app.
and for this one, I have another question apologies if I keep on asking, I need to have a border at the top of the table headers however only left and right are covered by the strokes
Hmmm, I’m not sure about what you should do when there are no layers at all.
Note that with all of those background Parts, they are being added programmatically to the Diagram, so they are not data-bound, which means there’s no point in having Bindings in there.
That is solved already thanks to your help again! :D
Apologies but I have another one that is related to the FlowchartLayout library, it’s when I try to go to another window then go back to generate some FlowchartLayout it will have this error
In FlowchartLayout.js the errors comes from here this.makeNetwork
Hope you can help me this time too since I don’t know what is the problem when I’m navigating to other window then go back to the window in generating the FlowchartLayout again :(