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 211 forks source link

Expose isBrushed #297

Open Schamper opened 8 years ago

Schamper commented 8 years ago

I feel like this function is useful enough to warrant public availability, especially since I can't seem to find any other solid method of determining if a brush is currently active.

https://github.com/syntagmatic/parallel-coordinates/blob/a022b81a349c880161cf3516f66a6bdbbd8015a6/src/render.js#L23

syntagmatic commented 8 years ago

This would be useful. It would also be useful to get an object containing the current brush state (all active brushes, rather than having to use this test for each one).

dehli commented 8 years ago

I'm trying to work on a way to get all of the current brushes (and also a way to set them). That way if you wanted to save what's brushed (or programmatically set the brush extents) you could do that.

BroHammie commented 8 years ago

@dehli this is already possible if you call brushExtents with or with out parameters. Let me know if you need an example.

dehli commented 8 years ago

Thanks @mcwillso. I just discovered that functionality, so I'm trying to figure out how to use it. I'll let you know if I can't figure it out :)

dehli commented 8 years ago

Actually, I'm having some troubles with this. Hopefully it's an easy fix :)

I'm retrieving the extents by calling:

var extents = parcoords.brushExtents();

It returns the appropriate object: { Year: [1999, 2005] }

However, if I then try to call parcoords.brushExtents({ Year: [1999, 2005] });, the same extents aren't produced. Am I missing a step? I also tried adding parcoords.renderBrushed(); afterwards to see if that was needed.

It's because I was using an old version of the parallel coordinates, oops. Thanks!