-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ViewerSelect: support toggling multi-select * LayerSelect with supported multiselect * only shows most-used plot options and sorted into categories * mixed state logic when multi-select enabled * re-factor uncertainties logic to work with new infrastructure (hidden in cubeviz for now) example in cubeviz of using API with multiselect: ``` po = viz.app.get_tray_item_from_name('g-plot-options') po.viewer.multiselect = True po.viewer.selected = ['flux-viewer', 'uncert-viewer'] po.show_axes.value = False ```
- Loading branch information
Showing
15 changed files
with
1,216 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div v-if="sync.in_subscribed_states" style="display: grid; padding-top: 4px; padding-bottom: 4px"> <!-- overlay container --> | ||
<div style="grid-area: 1/1"> | ||
<v-row class="row-no-outside-padding"> | ||
<v-col :cols="multiselect ? '8' : '12'" style="padding: 0"> | ||
<div style="grid-area: 1/1"> | ||
<slot></slot> | ||
</div> | ||
</v-col> | ||
<v-col v-if="multiselect" cols="4" style="text-align: center; padding: 0"> | ||
<v-icon v-for="icon in sync.icons">{{icon}}</v-icon> | ||
</v-col> | ||
</v-row> | ||
</div> | ||
<j-tooltip v-if="sync.mixed" tipid='plugin-plot-options-mixed-state' span_style="display: grid; grid-area: 1/1"> | ||
<div | ||
@click="() => {$emit('unmix-state')}" | ||
class="text-center" | ||
style="z-index:2; | ||
margin-left: -24px; | ||
margin-right: -24px; | ||
cursor: pointer; | ||
border: 2px solid #00617E; | ||
background-color: rgb(245 245 245 / 70%);"> | ||
<v-icon | ||
large | ||
dark | ||
color="#00617E" | ||
style="height: 100%" | ||
>mdi-link-off</v-icon> | ||
</div> | ||
</j-tooltip> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
module.exports = { | ||
props: ['sync', 'multiselect'] | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<template> | ||
<div> | ||
<v-row v-if="items.length > 1 || show_if_single_entry"> | ||
<v-select | ||
:items="items" | ||
v-model="selected" | ||
@change="$emit('update:selected', $event)" | ||
:label="label ? label : 'Layer'" | ||
:hint="hint ? hint : 'Select layer.'" | ||
:rules="rules ? rules : []" | ||
:multiple="multiselect" | ||
:chips="multiselect" | ||
item-text="label" | ||
item-value="label" | ||
persistent-hint | ||
> | ||
<template slot="selection" slot-scope="data"> | ||
<div class="single-line" style="width: 100%"> | ||
<v-chip v-if="multiselect" style="width: calc(100% - 20px)"> | ||
<span> | ||
<v-icon style='margin-left: -10px; margin-right: 2px'>{{ data.item.icon }}</v-icon> | ||
{{ data.item.label }} | ||
</span> | ||
</v-chip> | ||
<span v-else> | ||
{{ data.item.label }} | ||
</span> | ||
</div> | ||
</template> | ||
<template v-slot:prepend-item v-if="multiselect"> | ||
<v-list-item | ||
ripple | ||
@mousedown.prevent | ||
@click="() => {if (selected.length < items.length) { $emit('update:selected', items.map((item) => item.label))} else {$emit('update:selected', [])}}" | ||
> | ||
<v-list-item-action> | ||
<v-icon> | ||
{{ selected.length == items.length ? 'mdi-close-box' : selected.length ? 'mdi-minus-box' : 'mdi-checkbox-blank-outline' }} | ||
</v-icon> | ||
</v-list-item-action> | ||
<v-list-item-content> | ||
<v-list-item-title> | ||
{{ selected.length < items.length ? "Select All" : "Clear All" }} | ||
</v-list-item-title> | ||
</v-list-item-content> | ||
</v-list-item> | ||
<v-divider class="mt-2"></v-divider> | ||
</template> | ||
<template slot="item" slot-scope="data"> | ||
<div class="single-line"> | ||
<span> | ||
{{ data.item.label }} | ||
</span> | ||
</div> | ||
</template> | ||
</v-select> | ||
</v-row> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
module.exports = { | ||
props: ['items', 'selected', 'label', 'hint', 'rules', 'show_if_single_entry', 'multiselect'] | ||
}; | ||
</script> | ||
|
||
<style> | ||
.single-line { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.