Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gl-error3d

Package Overview
Dependencies
Maintainers
19
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-error3d

Draws error bars around points

  • 1.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
decreased by-6.27%
Maintainers
19
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 15 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc