gl-line3d
A 3D WebGL line plot
Example
var createScene = var createLine = //Create the scenevar scene = //Create a helixvar polyline = forvar i=0; i<100; ++i var theta = i / 1000 * MathPI polyline //Create the line plotvar lines = //Add the lines to the scenescene
Install
npm install gl-line3d
Basic interface
Constructor
`var lines = require('gl-line3d')(options)
Creates a new line plot
options.gl
A WebGL contextoptions.position
An array of position values for the points on the curveoptions.color
An array of color values (or a singular color) for the curveoptions.pickId
The selection ID for the line plotoptions.lineWidth
The width of the lineoptions.dashes
An array of dash patterns representing the dash pattern. For example,[0.5,0.5,0.5]
options.dashScale
The number of times to repeat the dash patternoptions.opacity
The opacity of the lines
Updating
lines.update(options)
Updates the plot. options
has the same properties as in the constructor
Properties
lines.lineWidth
The width of the lines
example
directory
Included example in the To run it, follow these steps:
git clone https://github.com/gl-vis/gl-line3d.git
cd gl-line3d
mkdir dist
browserify lines.js -o dist/bundle.js
browserify example/simple.js -o dist/simple_example_bundle.js
then open simple.html
in the example
directory.
Credits
(c) 2014 Mikola Lysenko. MIT License