Giter Club home page Giter Club logo

gl-error3d's Introduction

gl-error3d

Draws error bars around data points

Example

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 = [ 
  [[-0.5,-0.5,-0.5],[0.5,0.5,0.5]], 
  [[-0.1,-1,-2],[0,0,0]], 
  [[-0.1,-0.1,-0.1],[0.1,0.1,0.1]] 
]

var scene = createScene()

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


var errorBars = createErrorBars({
  gl:       scene.gl,
  position: points,
  error:    errors,
  color:    [0.9, 0.3, 0.3]
})
scene.add(errorBars)

API

Constructor

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

errorBars.update(options)

Updates the error bar object

errorBars.dispose()

Destroy the error bars and release all associated resources

Credits

(c) 2014-2015 Mikola Lysenko. MIT License

gl-error3d's People

Contributors

archmoj avatar mikolalysenko avatar etpinard avatar dy avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.