d3 add scrollbar to a svg element

1,377 views
Skip to first unread message

ND

unread,
Apr 5, 2017, 9:35:29 AM4/5/17
to d3-js
I am working on creating a context menu on d3 force layout. I am using rect to style the context menu. The problem I have at this point is the number of menu items is dynamic and can be longer than the svg height. Therefore I need to add a scrollbar to the rect element holding the menu items. Has anyone implemented similar scrolling element in d3? Can I get some suggestions on how to do it?

Curran

unread,
Apr 6, 2017, 8:56:39 AM4/6/17
to d3-js
There's a cool library called Scrollgrid that adds scroll bars to an SVG element.

https://github.com/PMSI-AlignAlytics/scrollgrid

There might be some good leads in there for how you can implement what you describe.
Reply all
Reply to author
Forward
0 new messages