Hi,
I am trying to render a “second grid”, that is independent of the base GoJS Grid in the “Grid” Layer.
For that I added an extra layer.
const secondGrid= new go.Layer({
name: 'SecondGrid',
isTemporary: true
});
const gridLayer = this.diagram.findLayer('Grid')!;
diagram.addLayerAfter(secondGrid, gridLayer);
Then I add a node via ‘diagram.add()’ which acts as the secondGrid.
Template for the secondGrid:
$(
go.Node,
'Auto',
{
layerName: 'SecondGrid',
},
$(
go.Panel,
go.Panel.Grid,
{ gridCellSize: new go.Size(1, 1) },
$(
go.Shape,
'LineH',
{ stroke: 'blue', strokeWidth: 0.5, interval: 5 }
),
$(
go.Shape,
'LineV',
{ stroke: 'blue', strokeWidth: 0.5, interval: 5 }
)
)
);
The problem is that the node wont render, it is not visible.
The node renders just fine, in layers (existing or new) where the ‘isTemporary’ flag is set to false.
What could the reason for that be?