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

Merged
merged 8 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 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,6 @@ def __init__(self, viewer_state):
self.glue_state = viewer_state

link_glue_choices(self, viewer_state, 'x_att')

def vue_bins_to_axis(self, *args):
self.glue_state.update_bins_to_view()
38 changes: 24 additions & 14 deletions glue_jupyter/common/state_widgets/viewer_histogram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,38 @@
<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 density="compact" >
<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" size="x-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-btn v-on="on" size="x-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" size="x-small" @click="bins_to_axes">
Fit Bins to Axes
</v-btn>
</v-toolbar>
</div>
<v-switch v-model="glue_state.show_axes" label="Show axes" hide-details/>
</div>
</template>
Expand Down
Loading