My requirement is to create a rectangular box which extends from -infinity to +infinity, or in other words, when i drag the diagram either sides, i shouldn’t see the either sides of the rectangle, but only the upper and lower side should be visible every time from -infinity to +infinity.
You might be able to get such a result using the Diagram.grid if you are not already using it for something else.
Another possibility is to implement a “ViewportBoundsChanged” DiagramEvent listener that moves and resizes a node so that it always appears to cover the width of the viewport. GoJS Legends and Titles -- Northwoods Software
I tried to keep the Y value same, but still am not able to scroll the “static part”.
Code is as follows:
myDiagram.addDiagramListener("ViewportBoundsChanged", function(e) {
var dia = e.diagram;
dia.startTransaction("fix Parts");
// only iterates through simple Parts in the diagram, not Nodes or Links
dia.parts.each(function(part) {
// and only on those that have the "_viewPosition" property set to a Point
if (part._viewPosition) {
partYposition = part.position.y;
part.position = dia.transformViewToDoc(part._viewPosition);
part.position.y = partYposition;
part.scale = 1/dia.scale;
}
});
dia.commitTransaction("fix Parts");
});
Rather than answering your specific questions, I have created a new sample that demonstrates a timeline editor that is somewhat similar to what I think you are asking for: Basic Day/Hour Infinite Timeline