Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gl-spikes2d with all npm packages installed. Try it out:

var glSpikes2d = require("gl-spikes2d")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gl-spikes2d v1.0.2

Axes spikes for 2d webgl plots


Draws axis spikes for 2D plots


Check back later


npm i gl-spikes2d



var spikes = require('gl-spikes2d')(plot, options)

Creates a new spike overlay for the given 2d plot

  • plot is a gl-plot2d instance
  • options is an object with a set of properties for the spike object

The properties of the options object are as follows:

  • enable Enables rendering of the spikes for each axis
  • width The width of each spike
  • color Color of each spike
  • center Center of spikes



Updates the spike object in place. Similar behavior to constructor.


Destroys the spikes object


(c) 2015 Mikola Lysenko. MIT License

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free