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-error3d with all npm packages installed. Try it out:

var glError3d = require("gl-error3d")

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

gl-error3d v1.0.14

Draws error bars around points


Draws error bars around data points


var createScene = require('gl-plot3d')
var createScatter = require('gl-scatter3d')
var createErrorBars = require('gl-error3d')

var points = [ [0,0,0], [1,1,1], [-1, 2, -3] ]
var errors = [ 

var scene = createScene()

var scatter = createScatter({
  gl: ,
  position:     points,
  size:         20,
  orthographic: true,
  lineColor:    [0,0,0],
  color:        [0.7,0.8,0.4],
  lineWidth:    1

var errorBars = createErrorBars({
  position: points,
  error:    errors,
  color:    [0.9, 0.3, 0.3]



var errorBars = require('gl-error3d')(options)

Creates a new error bar object.

  • gl is a WebGL context
  • position is the position of each point in the plot
  • error is an array of error bounds represented as [lo,hi] for each point
  • color a length 3 array of arrays giving the color of the error bars along each axis.
  • lineWidth is the width of the error bar lines in pixels
  • capSize is the size of the cap for error bars
  • clipBounds is a box to which all error bars will be clipped

Returns A new error bar object


Updates the error bar object


Destroy the error bars and release all associated resources


(c) 2014-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