Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Access to d3.js?

1457049598

Edited 1457050481
plexsoup
Marketplace Creator
Sheet Author
API Scripter
Is there a way to access d3.js in the API for drawing on the map layer? Something like this&nbsp; isometric tile example would be pretty cool. It'd be fun to put a&nbsp; force-directed-graph in the campaign handouts too. Great for relationship mapping! Or&nbsp; dynamic hex-tiles for volcano eruptions and floods. Here's a&nbsp; Hex Mapper example. Nice&nbsp; Minecraft Overviewer . There's a whole load of other examples: (mostly for visualizing data, but there's a few maps) <a href="http://bl.ocks.org/mbostock" rel="nofollow">http://bl.ocks.org/mbostock</a>
1457056757
The Aaron
Pro
API Scripter
This is not possible in the API currently. &nbsp;Something like this would probably need to go to the Suggestions Forum.
1457070099
Lithl
Pro
Sheet Author
API Scripter
The API runs on the server, not the client, and so it cannot have access to the DOM. That includes access to the canvas for creating SVGs. However, you can &nbsp;create path objects, which are ultimately Bézier curves drawn on the canvas. Most of the examples you linked would be technically possible now, even if a bit trickier to code than with d3. However, animating it would absolutely be awkward due to the limited refresh rate obtainable in the API server-&gt;VTT loop.