lightning-viz / lightning.js

Javascript client for the Lightning data visualization server.
http://lightning-viz.org
42 stars 2 forks source link

Update readme to include example of settings #3

Closed andrewheusser closed 8 years ago

andrewheusser commented 8 years ago

First off, this project is awesome!! I'm having some trouble figuring out how to pass custom settings i.e. color, line thickness etc to the js lightning object. Could you give an example of how this works? Also, is there a location with all available options for each visualization? I wasn't able to find it on the website. Thanks!

mathisonian commented 8 years ago

Hey @andyh616 -

all of the plotting methods take an optional last argument where these additional options can be passed. For example to do color:

var myOpts = {
    color: [255, 0, 0] // rgb
}
lightning
    .line([1,1,2,3,5,8,13,21], myOpts)
    .then(function(viz) {
    });

and setting transparency in a scatterplot.

var x = _.range(100);
var y = _.map(_.range(100), Math.random);
var myOpts = {
    alpha: 0.5 
}
lightning
    .scatter(x, y, myOpts)
    .then(function(viz) {
    });

I'll update the README by adding this and the available parameters. (sorry this is not ideal but) for now, the available options can be seen by either:

andrewheusser commented 8 years ago

no worries! thanks for the info, this is exactly what I was looking for.

I am working with a few others to develop an open-source platform to run EEG psychology/neuroscience experiments in the browser/within electron. We are thinking about using lightning as a visualization server within the app to stream real-time EEG data, plot topographies and a fourier plot. I think we'll be creating some custom plots in the near future that might be of use to the community :)

Thanks for the info!

mathisonian commented 8 years ago

Awesome! Feel free to open more issues as you come across anything, and our chatroom on gitter is a good place for quick feedback: https://gitter.im/lightning-viz/lightning

andrewheusser commented 8 years ago

great, thanks, I will check it out :).

it looks like 'thickness' is not implemented as an option, as it is in python. Or maybe 'size' refers to thickness? In either case, I can't seem to get my streaming lines to vary in thickness.

mathisonian commented 8 years ago

Ahh yeah - we renamed that property. I'll update the js library to match

andrewheusser commented 8 years ago

awesome, thanks