🎉 JointJS has new documentation! 🥳

JointJS+ RecordScrollbar

elementTools.RecordScrollbar

The RecordScrollbar element tool renders a scrollbar thumb on a standard.Record shape. The scrollbar is not visible if the record's size is large enough to show all items.

It accepts the following arguments which can be passed as an object to the element tool constructor:

width number The width of the scrollbar thumb. The default value is 8.
margin number A gap between the scrollbar thumb and sides of the record's content. The default value is 2.
rightAlign boolean Determines whether the scrollbar should be shown on the right side of the record's content. It is aligned to the left by default.

Example:

record1.setScrollTop(0);
const scrollbar = new joint.elementTools.RecordScrollbar({ width: 8 });
record1.findView(paper).addTools(new joint.dia.ToolsView({
    tools: [scrollbar]
}));