syntagmatic / parallel-coordinates

A d3-based parallel coordinates plot in canvas. This library is no longer actively developed.
http://syntagmatic.github.com/parallel-coordinates/
Other
511 stars 212 forks source link

parcoords.dimensions does not allow to plot my data #330

Closed Borreguin closed 7 years ago

Borreguin commented 7 years ago

Hello, I'm using a shared scale and I want to change the name of each dimension. I use the following code to do that, but when I introduce dimension in the chart, then is not working anymore:

//getting 7 dimensions, 1 per each day var days = json_list['days']; for(idx in days){ dimensions[days[idx]] = {type:"number"}; }; var pc = d3.parcoords()("#example") .data(json_list['V050_room202_temp']) .commonScale() .render() .dimensions(dimensions) .createAxes() .render() .brushMode("1D-axes") // enable brushing .interactive(); // command line mode;

If I dont include dimension then the charts. Thanks for your help. =)

syntagmatic commented 7 years ago

Not sure, but try adding .autoscale() after the .dimensions() call. It may be the domain just needs to be set on each dimension, and that should do it.

Borreguin commented 7 years ago

I tried, unfortunately is not working... There is a way to change the names of each dimensions? because I fit my data as an array, so the names of each axe is 0,1,2...6. Addionally... I would like to color each register based on an array of colors. I mean: my data = [[1,2,3,4],[-1,2,3,4],[5,2,3,3], etc] and my colors for each register: colors = [c1, c2, c3, etc.]. There is a way to this mapping? Thanks for your help.

syntagmatic commented 7 years ago

Numbers are acceptable dimension names. You may shape your data however you like, just provide the data as an array of homogenous objects.

The polylines can be colored using this method: https://github.com/syntagmatic/parallel-coordinates#parcoords_color

You can also style axes with CSS or use D3 to make modifications after they've been created.