npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

regl-error2d

v2.0.12

Published

Render error bars for the set of points

Downloads

762,124

Readme

regl-error2d experimental

Draw error bars for a set of points with regl.

regl-error2d

Remake on gl-error2d:

  • color may define per-bar colors.
  • max number of points extended 40 times (from 1e5 to 4e6) via instanced draw.
  • lineWidth and capSize are adjusted to actual pixels.
  • enhanced performance via vertex shader.

Demo.

Usage

npm install regl-error2d

let regl = require('regl')({extensions: 'angle_instanced_arrays'})
let createError2d = require('regl-error2d')

let error2d = createError2d(regl)

error2d({
  positions: [0,0, .5,0, ...],
  errors: [.5,.5,.5,.6, .2,.3,.4,.1, ...],
  color: 'rgba(0, 100, 200, .75)'
})

createError2d(regl, options?)

Create new error2d instance from regl and initial options. Note that regl instance should have ANGLE_instanced_arrays extension enabled.

error2d(options|list?)

Draw errors, update options.

Option | Default | Description ---|---|--- positions, points, data | [] | An array of unrolled xy coordinates of the points as [x,y, x,y, ...] or array of points [[x,y], [x,y], ...]. errors, error | [] | Array with error values corresponding to the points [e0l,e0r,e0b,e0t, e1l,e1r,e1b,e1t, ...] capSize, cap | 5 | Error bar cap size, in pixels lineWidth, thickness | 1 | Error bar line width, in pixels color, colors | 'red' | Color or array with colors. Each color can be a css color string or an array with float 0..1 values. opacity | 1 | Error bars opacity. range, dataBox | null | Visible data range. viewport, viewBox | null | Output area within the canvas.

A list of options can be passed for batch rendering:

error2d([options1, options2, ...])

error2d.update(options|list)

Update options, not incurring redraw.

error2d.draw(id?)

Draw errors based on last options. id integer can specify a list item to redraw from batch update.

error2d.destroy()

Dispose error2d and associated resources.

License

(c) 2017 Dima Yv. MIT License

Development supported by plot.ly.