paper.fitToContent and baseWidth do not work as expected #1680
Unanswered
mwanagosos
asked this question in
Q&A
Replies: 1 comment 11 replies
-
The new ui.PaperScroller({
// This is the size increment.
// If one paper is not enough to cover the whole graph,
// you lay more papers next to it until the whole graph fits. This one paper is the base.
// Note: it's an equivalent of `gridWidth` and `gridHeight` of `fitToContent()` method
baseWidth: 150,
baseHeight: 150,
contentOptions: {
// This is the minimum paper size regardless of content size.
minWidth: 1500,
minHeight: 1500,
/* ... any other option from fitToContent() */
}
/* ... any other option of PaperScroller */
}); |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using JointJS+ 3.5.
I have a paper that's very big.
I want to make it a lot smaller
and implement
on the paper scroller with
autoResizePaper
andscrollWhileDragging
.I want the initial size of the graph to be 1500x1500. When an element is dragged outside of the paper, I want it to stretch by 150 only.
Unfortunately, it dragging an element outside of a paper makes it bigger by 1500 instead.
It happens even though the documentation states to use
baseWidth
andbaseHeight
if we want to auto-resize the paper by a value different that thewidth
andheight
set in the Paper constructor.Also, I have a lot of old JSON files with exported graphs. I still want to support them.
I'm doing
to crop the paper on the graphs imported through
graph.fromJSON
.It seems to work fine until I move one of the blocks or call
paperScroller.zoomToFit()
. As soon as I do that, paper becomes very big again andpaper.fitToContent()
gets reverted.Is there something I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions