簡體   English   中英

展開后的 GoJs 圖正在更改滾動 position

[英]GoJs Diagram after expanding is changing the scroll position

我有一個展開按鈕,點擊它可以將圖表展開到全尺寸。 但是滾動后,滾動條會自動向下滾動到圖表的中間。 展開圖表后,我希望第一個節點在屏幕上可見。

在頁面加載圖像看起來像這樣 - 在此處輸入圖像描述

單擊右上角的“全視圖”按鈕后,圖像如下所示- 在此處輸入圖像描述

滾動條自動移動到圖表的中心。 我需要在單擊“全視圖”按鈕時顯示圖表的最頂部節點。

您可以按照您想要的方式設置Diagram.scale ,然后調用CommandHandler.scrollToPart

  var node = ...;  // what you want to be sure to show
  myDiagram.commandHandler.scrollToPart(node);

Examples are at: https://gojs.net/latest/samples/orgChartEditor.html https://gojs.net/latest/samples/flowgrammer.html https://gojs.net/latest/samples/orgChartStatic.html (但被注釋掉了)

一個更好的例子是: https://gojs.net/latest/samples/animatedFocus.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM