Skip to content
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

Add histogram bin adjustment ui #455

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

CyclingNinja
Copy link

Adds user interface to handle bin adjustments and fixing the axis to new bin ranges

@@ -18,3 +18,5 @@ def __init__(self, viewer_state):
self.glue_state = viewer_state

link_glue_choices(self, viewer_state, 'x_att')

def axis_to_bins(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried including a vue_ prefix on this method?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I know I need to, but there's nothing behind the button just yet


def vue_axis_to_bins(self):
# self.glue_state.
MatplotlibHistogramMixin._update_axes(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to inherit from or use this mixin - there should be a method on the histogram viewer state class for syncing the bins to the current limits.

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.04%. Comparing base (1d9c74e) to head (4b09734).
Report is 10 commits behind head on main.

Files Patch % Lines
...e_jupyter/common/state_widgets/viewer_histogram.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #455   +/-   ##
=======================================
  Coverage   86.04%   86.04%           
=======================================
  Files          90       90           
  Lines        5224     5232    +8     
=======================================
+ Hits         4495     4502    +7     
- Misses        729      730    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


def vue_axis_to_bins(self, *args):
self.glue_state.update_bins_to_view()
print('Triggered axis to bins')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the print statement?

<glue-float-field label="x-max" :value.sync="glue_state.hist_x_max" />-->
</div>
<div>
<v-toolbar title="Toolbar">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to make the toolbar less imposing vertically?


<v-btn variant="outlined" small @click="axis_to_bins">
Fit Axes to Bins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be Update bins to view - it's the bins that are being updated not the axes. And this would then match the glue-qt wording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants