Please forgive me for not being able to speak English well.
Q1. We need fixed swimlane Header. when scrolling Right and left.
I tried Diagram.addDiagramListener(“ViewportBoundsChanged”) , but I don’t know how to give the position value.
myDiagram.addDiagramListener("ViewportBoundsChanged", e => {
e.diagram.commit(dia => {
dia.groupTemplateMap.each(group => {
// what logic for header fixed ... ?
})
}, null); // set skipsUndoManager to true, to avoid recording these changes
});
// Left side Group Panel (Header) Area
myDiagram.groupTemplateMap.add("Pool",
$(go.Group, "Auto", groupStyle(),
{ // use a simple layout that ignores links to stack the "lane" Groups on top of each other
layout: $(PoolLayout, { spacing: new go.Size(0, 0) }), // no space between lanes
},
$(go.Panel, "Table", { margin: 8 },
$(go.Shape, "RoundedRectangle", roundedRectangleParams,
{
strokeWidth: 0,
column: 0,
margin: 4,
stretch: go.GraphObject.Fill,
},
new go.Binding("fill", "color"),
),
$(go.Panel, "Horizontal",
$(go.TextBlock,
{
// font: "bold 16pt sans-serif",
font: "16px noto-sans",
stroke: "white", // fontColor
textAlign: "center",
margin: 8,
maxSize: new go.Size(120, NaN),
minSize: new go.Size(120, NaN),
// margin: new go.Margin(2, 30, 0, 0),
// strokeWidth: 0,
// fill: "#2E8DEF",
// stretch: go.GraphObject.Fill
// stretch: go.GraphObject.Vertical
},
new go.Binding("text").makeTwoWay()),
// new go.Binding("isFixed", "isFixed"), // delete soon
),
$(go.Placeholder,
{ column: 1 })
)
));
→ environment : react, gojs 2.3.*
→ layout : PoolLayout
→ structure : Group, Lane
Q2. Links must pass through empty nodes But Non-empty nodes must not be traversed.
I want the link (going across the node) to move towards the left link.
(In the picture, blue circle on the right)
→ my link options.
linkTemplate = $(go.Link, {
routing: go.Link.AvoidsNodes,
fromSpot: go.Spot.Bottom,
toSpot: go.Spot.Top,
...
})
Any advice, thanks!