| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
|
||
| typedRange(values) { | ||
| return new Int32Array(values.map(Number)); | ||
| return new Int32Array(values.map((value) => this.domain.indexOf(value))); |
There was a problem hiding this comment.
could it just be:
return new Int32Array(values.map(this.domain.indexOf));this would avoid allocating a new function/scope each time... though maybe the this shenanigans come into play...
Sorry, something went wrong.
There was a problem hiding this comment.
I originally tried that, but it was throwing errors... probably due to this shenanigans.
Sorry, something went wrong.
There was a problem hiding this comment.
k, how about:
return new Int32Array(values.map(this.domain.indexOf, this.domain));
Sorry, something went wrong.
There was a problem hiding this comment.
Yes that behaves and pushed the change.
Sorry, something went wrong.
|
W.r.t. the test, the closest PR I can find didn't add a test, and looking through the existing tests, I'm not sure how we would add a test for this. Maybe @martinRenou or @maartenbreddels can you point us to a PR that did something similar and had a test for it? The process for producing the error is here, but it requires manual brushing. |
Sorry, something went wrong.
|
Since recently we added galata tests in bqplot. Galata should have everything for "manually" testing the brush and checking that it renders properly. But that requires good knowledge of galata which I don't have... Can this be bug be triggered programmatically from Python? That should help create a visual test. I can look into it. |
Sorry, something went wrong.
|
Thanks @martinRenou, it looks like that should work. However, in investigating programmatically setting the brush selected_y values another concern popped up. This PR originally introduces using the domain index for the values in the brush's selected traits which is different than the existing behavior which uses the domain values itself. It might be more consistent to deal with the indices in the domain, however to minimize changes to other users it looks like the: typedRange(values) {
return new Int32Array(values.map(this.domain.indexOf, this.domain));
}could be replaced with: typedRange(values) {
return values;
}There is also a new galata test notebook ordinal_scale.ipynb which tests two different figures. One figure uses the ordinal scale with strings while the other uses the ordinal scale with integers. The test notebook also programatically sets the brush's selected values and captures the output screenshots. |
Sorry, something went wrong.
@martinRenou : @dfreeman06 added a test using Galata that we believe is working and testing the brushes programmatically, at least locally it is passing, would it be possible to run the workflow to see if everything is on the up and up? |
Sorry, something went wrong.
|
Just a friendly ping to the BQPlot team to see if there is something else we should do for this PR. Also curious if @maartenbreddels has any issues with this as per his PR. |
Sorry, something went wrong.
|
|
||
| typedRange(values) { | ||
| return new Int32Array(values.map(Number)); | ||
| return values; |
There was a problem hiding this comment.
As per @bollwyvl 's recommendation, this could be:
return new Int32Array(values.map(this.domain.indexOf, this.domain));Which would make the scale work with the indeces of the domain (I believe that is what is meant by range here, @maartenbreddels please don't hesitate to let us know if we misunderstood what was intended by range).
We went with the values instead because otherwise it could break other people's code, but we acknowledge it would probably be better to use the line above.
Sorry, something went wrong.
|
y'all let me know if there's anything i can do to push this forward... |
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure non-contributor reviews matter, but in case it does, here is my approval.
Sorry, something went wrong.
|
Thanks for adding tests. Ideally, we would add a galata test that simulates a selection with the mouse and test that the selected_y attribute gets changed properly. But I don't know yet how to do that, so let's merge and see later! Thanks! |
Sorry, something went wrong.
|
Everybody's real busy, for sure, but Is there a timeline for a .30 release? Anything we can do to help? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Attempt to address #1378. Mapping the Ordinal selected values from a brush through their index position in the domain.