Open Schamper opened 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).
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.
@dehli this is already possible if you call brushExtents
with or with out parameters. Let me know if you need an example.
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 :)
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!
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