-
Notifications
You must be signed in to change notification settings - Fork 39
Adds template to control axes bounds #497
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?
Conversation
a668fa0 to
75a11bb
Compare
75a11bb to
5f0d0be
Compare
|
@mariobuikhuizen hi there, @astrofrog mentioned you might be able to help us here. I'm trying to create a template to apply to all state widgets (that need it) that adjusts the bounds of an axis. its working, but its not populating with the initial values from the to ensure that I'd really appreciate your thoughts/help |
|
Hi @CyclingNinja there are a few issues:
See: https://github.com/CyclingNinja/glue-jupyter/pull/1/files |
fix: initial glue_state not set
|
Hi @mariobuikhuizen thanks so much for you help, i'll pick this apart so my brain understands it and go forward from there, should be some more things to follow |
f271f55 to
3f12181
Compare
3f12181 to
9e9e05c
Compare
|
Now at a point where its functioning in the scatter_viewer. If this acceptable, i'll roll it out to the other viewers |
also adds validation for axes limits
|
@mariobuikhuizen could you take a look at the additions i've made. I've tried to add some validation for text boxes on axes limit and a sensible precision implementation. Also i'm trying to implement ticklabel adjustment in Bqplot, what I've done should be working if my interpretation of the docs is right, but it is not. |
|
Hi @CyclingNinja, I think it would be better to do the precision part in note there is a stray |
|
This should fix the Bqplot issue for the x-axis (the line you uncommented was wrong to begin with): diff --git a/glue_jupyter/bqplot/common/viewer.py b/glue_jupyter/bqplot/common/viewer.py
index 1527083..527ac01 100644
--- a/glue_jupyter/bqplot/common/viewer.py
+++ b/glue_jupyter/bqplot/common/viewer.py
@@ -69,7 +69,7 @@ class BqplotBaseView(IPyWidgetView):
self.state.add_callback('x_axislabel', self.update_x_axislabel)
# self.state.add_callback('x_axislabel_weight', self.update_x_axislabel)
- self.state.add_callback('x_axislabel_size', self.update_x_axislabel)
+ self.state.add_callback('x_ticklabel_size', self.update_x_ticksize)
self.state.add_callback('y_axislabel', self.update_y_axislabel)
# self.state.add_callback('y_axislabel_weight', self.update_y_axislabel)
@@ -97,7 +97,7 @@ class BqplotBaseView(IPyWidgetView):
self.axis_y.label = self.state.y_axislabel
def update_x_ticksize(self, *event):
- self.axis_x.tick_style = {'font-size': self.state.x_ticklabel_size}
+ self.axis_x.tick_style = {'font-size': str(self.state.x_ticklabel_size) + "px"}
def update_y_ticksize(self, *event):
self.axis_y.tick_style = {'font-size': self.state.y_ticklabel_size} |
|
Ah thank you, it was the string and 'px' I was missing (trying a lot locally, didn't want to muddy the waters). Also thanks for the precision point, I'll add that too. Is there a method for not having the 'up/down' integer arrows not appear when using it? its quite clunky when used in this context. |
We could make this configurable via props:
|
No description provided.