Open jmgelman opened 9 years ago
Note we have multiple brushing types. For brushing on the axes you can get the extents but not set them currently. More generally, we want to get/restore brushing state functionality (also for strum or pinch brushes). This however requires a non-trivial amount of work. It's on my wish list, but I don't know if and/or when I find some time to work on this.
I'd love this enhancement! I have a great use case for it. I really am focused on 1D axis brushing. I might try to tinker with the code this weekend.
I think I got a working solution (for 1D axises). I'll try to submit a pull request later tonight. Unless you have a better solution/idea.
Alright. So I think I got a pull request put in place for 1D setting of extents: https://github.com/syntagmatic/parallel-coordinates/pull/126
Let me know if this worked....sorry but its my first pull request.
I have made a few changes to the brush setter. (only the 1D-axes brush mode so far) https://github.com/Git-me-outta-here/parallel-coordinates/commit/3ad20881d2e2fd400a023b103b68e5e62586a35f
brushExtents(extents)
now returns pc (for chaining)updateBrush(dimension, extent, duration)
can change extent on a single dimension, optionally with a transitionbrushReset()
renamed to resetBrushes(dimension)
, dimension parameter is optionalWhat do you think about these changes? If you like it, I can extend it to 1D-multi.
Here's a few code related questions I have
brushState()
?render.isBrushed()
do? I changed it to something simpler and it works as expected, doesn't it?@sbryfcz @mcwillso @syntagmatic @bbroeksema
When calling brushExtents()
with no params we definitely want to return the current extents, but when extents is passed brushExtents(extents)
I could see that returning pc would be fine, but somewhat unnecessary because setting extents would be something you would do last in the chain of functions.
Renaming the brushReset
function might not be the best option but I think using your code under the same function brushReset
could be appropriate.
brushState()
depends on which brush mode you are in. The render.isBrushed()
function might be able to include your change as I am seeing it return true when it shouldn't on 2d-strums. But would need thoroughly tested.
Ah, apparently this has also been done with other functions, e.g. brushMode("1D-axes")
returns pc, but brushMode()
returns a string. brushExtents(extents)
and brushExtents()
now work the same way.
Changed names back to brushReset()
and brushReset(dimension)
.
Should I keep updateBrush(dimension, extent, duration)
or incorporate that into brushExtents(extents)
?
https://github.com/Git-me-outta-here/parallel-coordinates/commit/b038b9b856365dcef9f229760d9652bead6e476b
This sound very interesting. Is it possible to see a working example of setting and retrieving the filter values?
Hi Torben, just look at my last commit [https://github.com/Git-me-outta-here/parallel-coordinates/commit/b038b9b856365dcef9f229760d9652bead6e476b] This is what we will call the functions. If no one objects. In the 'setterForBrushes.html' example you can see how to use them.
@Git-me-outta-here I tried you 'setterForBrushes.html' example. Though, I get this error in Chrome: Uncaught TypeError: pc.updateBrush is not a function
I followed you link to Git-me-outta-here@b038b9b and used your versions of the files: 1D.js, render.js and setterForBrushes.html. Did I do something wrong her? I can see you have added a function "install" which sets pc.updateBrush = updateBrush but I cannot see it being called anywhere. Maybe that's the reason?
Small question: is there a reason you've omitted at couple of values in data:
.data([
[0,-0,0,0,0,1],
[1,-1,1,2,1,1],
[2,,4,4,0.5,1],
[3,,9,6,,],
[4,-4,16,8,0.25,1]
])
sorry about that, updateBrush() has now been retired in favour of brushExtents(). https://github.com/syntagmatic/parallel-coordinates/pull/279
about the omitted data: there is no reason why I have null values here. Please participate in this discussion: https://github.com/syntagmatic/parallel-coordinates/issues/40 and https://github.com/syntagmatic/parallel-coordinates/pull/73 and [https://github.com/syntagmatic/parallel-coordinates/pull/128](finally here)
@TorbenOestergaard
@jmgelman It doesn't look like brushExtents() has been implemented for 1D-axes-multi brush mode like it has for 1D-axes mode. Care to implement it? Are there any special issues we need to consider implementing it for 1D-axes-multi mode?
Is there a way via the d3.parcoords.js API to get/set the brushing extents (i.e., the range of values that can be brushed for a particular axis)?