为 yfiles.canvas.Control 添加滚动条

Add a scrollbar to yfiles.canvas.Control

我有一个 yfiles.canvas.Control,里面有一些节点。但是,节点的数量越来越多,尽管高度减小了,但我需要添加一个滚动条以便垂直浏览它们。

我该怎么做?我看到 ScrollBar class 存在,但我不知道如何集成它。

yFiles for HTML 内置了滚动条。您可以 customize their visibility, but by default they will be shown as soon as the content rectangle is larger than the visible area. Maybe calling updateContentRect 是您的代码中缺少的全部吗?