Adapted from Mike Bostock's Zoomable Sunburst to include arc labels.
Click on any arc to zoom in. Click on the center circle to zoom out. Click on canvas background to reset zoom.
Also packaged as a reusable component at sunburst-chart.
license: mit |
Adapted from Mike Bostock's Zoomable Sunburst to include arc labels.
Click on any arc to zoom in. Click on the center circle to zoom out. Click on canvas background to reset zoom.
Also packaged as a reusable component at sunburst-chart.
license: gpl-3.0 |
d3-jetpack's d3.conventions can now create canvas and html elements. Here d3.conventions({layers: 'csd'})
makes an canvas ctx, svg and div with a shared coordinate system. Yellow shapes are drawn on canvas, cyan on svg and purple on html.
Layers are position absolutely on top of each other in the order listed in the layer string. To create an svg with two canvas elements on top:
var {layers: [svg, bg_ctx, fg_ctx]} = d3.conventions({layers: 'scc'})
Hurricane How-To describes using multiple renders for something more practical than bouncing circles.
license: mit |
Converting an SVG animation to a video with the MediaRecorder API and a hidden canvas.
Drawing frames from img
elements can introduce an extra delay, so this version generates all the frames upfront and then renders them in a loop with requestAnimationFrame()
.
See also: Canvas animation to video
license: mit |
Show direction with dots.
Idea stolen from https://bl.ocks.org/emeeks/21f99959d48dd0d0c746
license: mit |
mask
lets you draw an area with multiple colors using just one path
.