Skip to content

Commit

Permalink
Merge pull request #455 from CyclingNinja/histogram_ui
Browse files Browse the repository at this point in the history
Add histogram bin adjustment ui
  • Loading branch information
astrofrog authored Jan 16, 2025
2 parents e257fc8 + 52a3c29 commit 2009c16
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
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

0 comments on commit 2009c16

Please # to comment.