Skip to content

Instantly share code, notes, and snippets.

View devgru's full-sized avatar

Dima Semyushkin devgru

View GitHub Profile
@devgru
devgru / .block
Last active October 23, 2019 20:16 — forked from mbostock/.block
Solar Path
license: gpl-3.0
@devgru
devgru / .block
Created March 27, 2018 13:06 — forked from mbostock/.block
Brush Handles
license: gpl-3.0
@devgru
devgru / .block
Created March 27, 2018 07:44 — forked from mbostock/.block
Gradient Encoding
license: gpl-3.0
@devgru
devgru / README.md
Last active March 19, 2018 15:49 — forked from veltman/README.md
Centerline label placement

Forked from https://gist.github.com/veltman/403f95aee728d4a043b142c52c113f82

Implementing a variation of Joachim Ungar's curved label placement method described here. The basic process is:

  1. Turn the shape into a polygon of evenly-spaced points.
  2. Generate a Voronoi diagram of those points.
  3. Clip the edges.
  4. Turn the edges into a graph.
  5. Find the "longest shortest path" between any pair of perimeter nodes.
  6. Smooth/simplify that path a bit.
@devgru
devgru / README.md
Created June 24, 2013 17:22 — forked from mbostock/.block

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.