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
5 changes: 5 additions & 0 deletions glue_jupyter/common/state_widgets/viewer_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from ...state_traitlets_helpers import GlueState
from ...vuetify_helpers import link_glue_choices


__all__ = ['HistogramViewerStateWidget']


Expand All @@ -18,3 +19,7 @@
self.glue_state = viewer_state

link_glue_choices(self, viewer_state, 'x_att')

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

Check warning on line 25 in glue_jupyter/common/state_widgets/viewer_histogram.py

View check run for this annotation

Codecov / codecov/patch

glue_jupyter/common/state_widgets/viewer_histogram.py#L24-L25

Added lines #L24 - L25 were not covered by tests
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?

37 changes: 24 additions & 13 deletions glue_jupyter/common/state_widgets/viewer_histogram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,39 @@
<v-select :items="x_att_items" label="x axis" v-model="x_att_selected"/>
</div>
<div>
<v-btn-toggle dense multiple :value="modeSet" @change="modeSetChange">

<v-tooltip bottom>
<v-text-field type="number" step="1" label="number of bins" v-model="glue_state.hist_n_bin" />
</div>
<div>
<glue-float-field label="x-min" :value.sync="glue_state.hist_x_min" />-->
</div>
<div>
<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-toolbar-items>
<v-tooltip>
<template v-slot:activator="{ on }">
<v-btn v-on="on" small value="normalize">
<v-icon>unfold_more</v-icon>
</v-btn>
</template>
<v-btn v-on="on" small value="normalize">
<v-icon>unfold_more</v-icon>
</v-btn>
</template>
<span>normalize</span>
</v-tooltip>

<v-tooltip bottom>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn v-on="on" small value="cumulative">
<v-icon>trending_up</v-icon>
</v-btn>
</template>
<span>cumulative</span>
</v-tooltip>
</v-btn-toggle>
</div>
</v-tooltip>

<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.

</v-btn>
</v-toolbar-items>
</div>
<v-switch v-model="glue_state.show_axes" label="Show axes" hide-details/>
</div>
</template>
Expand Down