Home /  Sketchbook /  p5.js - Common Examples - Voronoi 2
  • Info

Overview

This is a p5.js sketch to demonstrate the a revised version of p5.voronoi library which enables having multiple diagrams in parallel with each other; and allows for the reliance / utilization of p5.js styling control for all but the sites.

Of note, used Chrome Performance Tools to do some performance profiling and fine tuning, but will leave some of those optimizations to the next iteration of this sketch.

Controls

Mouse

  • hover Moving the mouse around will highlight the cell under the mouse cursor;

Touch

  • press Touching anywhere (and pressing and moving around) will highlight the cell under touch point.

References:

  • [p5.voronoi.js][p5_voronoi] - The main p5.js extension that enables drawing of of a Voronoi diagram.
  • gorhill-voronoi - The primary underlying implementation of the Voronoi algorithm in Javascript.
  • Chrome Performance Tools

Links:

  • Live View
  • Source on Github

Screenshot:

screenshot