-
Notifications
You must be signed in to change notification settings - Fork 55
Allow use of add_*_selector
methods in ScatterGraphic
#883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Allow use of add_*_selector
methods in ScatterGraphic
#883
Conversation
- move these existing methods from `LineGraphic` to common base clase `PositionsGraphic` - regenerate docs
Hi thanks for your PR! Supporting selections for scatters will also require implementing the methods to get data from the selections, for example with the rectangle selector:
I'm not sure what a linear or linear region selector means for a scatter, do you have a use case example? I can maybe see the usecase for exploring regression plots. |
Thanks for your feedback - and for this very nice library! I'll look into updating these methods.
I guess if one axis in the scatter is time it could make sense to select a time range of data using the linear region selector. plots.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lkeegan
Thanks again for making a PR! I had a few small questions/tweaks. I'm sure @kushalkolar will also want to take a look. I checked out your examples, and they look great!
|
||
# min/max limits | ||
limits = (x_axis_vals[0], x_axis_vals[-1], ymin * 1.5, ymax * 1.5) | ||
limits = (xmin, xmax, ymin, ymax) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the ymin * 1.5
and ymax * 1.5
? I think we had that there to allow the selector to go a little bit above and below the graphic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry - I removed it because with positive ymin the limits didn't allow you to select all the data, restored in 75b7d73
axis_vals_min = np.floor(axis_vals.min()).astype(int) | ||
axis_vals_max = np.floor(axis_vals.max()).astype(int) | ||
|
||
bounds_init = axis_vals_min, axis_vals_min + 0.25 * ( | ||
axis_vals_max - axis_vals_min | ||
) | ||
limits = axis_vals_min, axis_vals_max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add code comments here?
…e unused variables
…rk when ymin is positive
@kushalkolar LGTM as long as the examples pass |
I'm going to wait until #837 is merged first since that changes some things with selectors. |
LineGraphic
to common base clasePositionsGraphic