Socket
Book a DemoInstallSign in
Socket

vega-webgl-renderer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-webgl-renderer

Vega WebGL renderer.

1.0.0-beta.2
latest
Source
npmnpm
Version published
Weekly downloads
378
0.27%
Maintainers
1
Weekly downloads
 
Created
Source

WebGL renderer for Vega

Demo

Major features

  • Implements nearly all Vega scene graph components as WebGL primitives. Falls back to 2D Canvas rendering for text and gradient fills, which are drawn to a WebGL texture and overlaid on the view.
  • Custom shaders for Rect and Symbol marks, enabling greater scalability (to the hundreds of thousands) beyond Canvas and SVG renderers. See the "scale" example in the demo (Note: Do not attempt that example with the SVG renderer, it will lock your browser for a while).

Usage

Use this scaffolding to get started using the WebGL renderer. Instead of being directly usable after loading Vega, as the SVG and Canvas renderers are, the WebGL renderer is a plugin which requires the inclusion of an additional JavaScript library.

The WebGL renderer requires Vega 3.0 (currently in beta).

<body>
  <script src="https://d3js.org/d3.v4.min.js"></script>
  <script src="https://unpkg.com/vega/build/vega.min.js" charset="utf-8"></script>
  <script src="https://unpkg.com/vega-webgl-renderer/build/vega-webgl-renderer.js" charset="utf-8"></script>

  <div id="vis"></div>
  <script>
    // Load in your own Vega spec here.
    d3.json('https://vega.github.io/vega-webgl-renderer/spec/bar-hover-label.vg.json', function (spec) {
      var view = new vega.View(vega.parse(spec))
        .initialize(document.querySelector('#vis'))
        .renderer('webgl')
        .run();
    });
  </script>
</body>

Build

npm install
npm run build

Test

Testing requires that the Selenium server is running with the Chrome driver installed. To run all tests:

npm run test

To just run the linter:

npm run lint

Contributing

Please try it out and let us know how it works for you. Bug reports, feature and improvement ideas, and PRs welcome.

This code is built and maintained by the Kitware Resonant team in collaboration with the UW Interactive Data Lab. The work is supported by the DARPA AFRL XDATA program.

Known issues

  • Line dashes are not supported (see "barley", "nested-plot", "map-bind" examples).
  • Triangulation of trails is known to be buggy and leave holes at internal nodes.
  • Custom symbol shapes are not supported.
  • Triangulation of geometry sometimes results in spurious offshoots.

Notes

There is one minor change to extrude-polyline which hacks in a way to close mitered strokes, which has not been merged upstream.

FAQs

Package last updated on 21 Dec 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.