Skip to content
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
537 changes: 353 additions & 184 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"*.js"
],
"dependencies": {
"@abi-software/map-utilities": "^1.15.0",
"@abi-software/svg-sprite": "1.4.0",
"css-element-queries": "^1.2.3",
"element-plus": "^2.14.5",
Expand Down
48 changes: 48 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
<template>
<div id="app">
<div v-if="$route.name !== 'Home'" class="help-mode-buttons">
<button @click="startHelpTour">Help Tour</button>
<button @click="startHelpHover">Hover Help</button>
</div>
<router-view />
<HelpModeTour v-model="helpTourOpen" :steps="helpSteps" />
<HelpModeHover v-model="helpHoverOpen" :steps="helpSteps" />
</div>
</template>

<script>
import { collectHelpModeSteps, HelpModeHover, HelpModeTour } from '@abi-software/map-utilities';
import '@abi-software/map-utilities/dist/style.css';

export default {
name: 'App',
components: {
HelpModeTour,
HelpModeHover,
},
data: function () {
return {
helpSteps: [],
helpTourOpen: false,
helpHoverOpen: false,
};
},
methods: {
// The test pages show one or more plots, collect the steps of the whole page
getHelpSteps: function () {
return collectHelpModeSteps(this.$el);
},
startHelpTour: function () {
this.helpSteps = this.getHelpSteps();
this.helpTourOpen = true;
},
startHelpHover: function () {
this.helpSteps = this.getHelpSteps();
this.helpHoverOpen = true;
},
},
};
</script>

<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
Expand All @@ -15,6 +55,14 @@
width: 100%;
position: absolute;
}
.help-mode-buttons {
position: absolute;
top: 8px;
right: 8px;
z-index: 10;
display: flex;
gap: 4px;
}
.url-input {
width: 250px;
}
Expand Down
42 changes: 40 additions & 2 deletions src/components/HeatmapPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<el-select
v-model="filterX"
class="channel-select"
v-help-mode="{
id: 'plot-column-select',
area: 'plot-filter',
title: 'Columns',
description: 'Choose the columns to show. You can type to search the list.',
placement: 'bottom',
Comment thread
akhuoa marked this conversation as resolved.
Resolved
}"
multiple
filterable
collapse-tags
Expand All @@ -24,6 +31,13 @@
<el-select
v-model="filterY"
class="channel-select"
v-help-mode="{
id: 'plot-row-select',
area: 'plot-filter',
title: 'Rows',
description: 'Choose the rows to show. You can type to search the list.',
placement: 'bottom',
}"
multiple
filterable
collapse-tags
Expand All @@ -34,10 +48,34 @@
</el-select>
</span>
<span>
<el-button class="view-heatmap-button" @click="filterPlot">Filter plot</el-button>
<el-button
class="view-heatmap-button"
v-help-mode="{
id: 'plot-filter-apply',
area: 'plot-filter',
title: 'Filter plot',
description: 'Update the plot to show only the chosen rows and columns.',
placement: 'bottom',
}"
@click="filterPlot"
>
Filter plot
</el-button>
</span>
<span v-if="logScaleEnabled">
<el-button class="view-heatmap-button" @click="logToggle">Toggle log</el-button>
<el-button
class="view-heatmap-button"
v-help-mode="{
id: 'plot-log-toggle',
area: 'plot-filter',
title: 'Toggle log',
description: 'Switch the values between a linear and a log scale.',
placement: 'bottom',
}"
@click="logToggle"
>
Toggle log
</el-button>
</span>
</div>
</div>
Expand Down
91 changes: 45 additions & 46 deletions src/components/PlotControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,52 @@
<map-svg-sprite-color />
<div ref="zoomControls" :class="{ inactive: !controlsEnabled }" class="bottom-right-control">
<el-popover
v-model="hoverVisibilities[0].value"
content="Zoom in"
placement="left"
:teleported="false"
trigger="manual"
trigger="hover"
width="max-content"
:show-after="tooltipDelay"
:hide-after="tooltipDelay"
popper-class="plot-popper"
>
<template #reference>
<map-svg-icon
icon="zoomIn"
class="icon-button zoomIn"
v-help-mode="{
id: 'plot-zoom-in',
area: 'zoom',
title: 'Zoom in',
description: 'Zoom in to see more detail. You can also scroll on the plot.',
placement: 'left',
Comment thread
akhuoa marked this conversation as resolved.
Resolved
}"
@click="zoomIn()"
@mouseover="showToolitip(0)"
@mouseout="hideToolitip(0)"
/>
</template>
</el-popover>
<el-popover
v-model="hoverVisibilities[1].value"
content="Zoom out"
placement="top-end"
:teleported="false"
trigger="manual"
trigger="hover"
width="max-content"
:show-after="tooltipDelay"
:hide-after="tooltipDelay"
popper-class="plot-popper popper-zoomout"
>
<template #reference>
<map-svg-icon
icon="zoomOut"
class="icon-button zoomOut"
v-help-mode="{
id: 'plot-zoom-out',
area: 'zoom',
title: 'Zoom out',
description: 'Zoom out to see more. You can also scroll on the plot.',
placement: 'top',
}"
@click="zoomOut()"
@mouseover="showToolitip(1)"
@mouseout="hideToolitip(1)"
/>
</template>
</el-popover>
Expand All @@ -44,6 +58,13 @@
v-model="selectZoom"
placeholder="100%"
class="zoomSelect"
v-help-mode="{
id: 'plot-zoom-level',
area: 'zoom',
title: 'Zoom level',
description: 'Choose a zoom level for the plot.',
placement: 'top',
}"
@change="selectZoomChange"
>
<el-option
Expand All @@ -55,20 +76,27 @@
</el-select>
<!-- The commented part remains unchanged -->
<el-popover
v-model="hoverVisibilities[2].value"
content="Reset"
placement="top"
:teleported="false"
trigger="manual"
trigger="hover"
width="max-content"
:show-after="tooltipDelay"
:hide-after="tooltipDelay"
popper-class="plot-popper"
>
<template #reference>
<map-svg-icon
icon="resetZoom"
class="icon-button resetView"
v-help-mode="{
id: 'plot-zoom-reset',
area: 'zoom',
title: 'Reset zoom',
description: 'Reset the zoom and position so the whole plot fits in this view.',
placement: 'top',
}"
@click="resetView()"
@mouseover="showToolitip(2)"
@mouseout="hideToolitip(2)"
/>
</template>
</el-popover>
Expand All @@ -78,13 +106,17 @@

<script>
import { MapSvgSpriteColor, MapSvgIcon } from '@abi-software/svg-sprite';
import { helpModeDirective } from '@abi-software/map-utilities';

export default {
name: 'PlotControls',
components: {
MapSvgSpriteColor,
MapSvgIcon,
},
directives: {
helpMode: helpModeDirective,
},
props: {
parentElement: {
type: Object,
Expand All @@ -97,13 +129,7 @@ export default {
},
data: function () {
return {
hoverVisibilities: [
{ value: false },
{ value: false },
{ value: false },
{ value: false },
{ value: false },
],
tooltipDelay: 500,
zoomSelect: [
{
value: '1',
Expand Down Expand Up @@ -183,33 +209,6 @@ export default {
});
}
},
setHelpMode: function (helpMode) {
if (helpMode) {
this.inHelp = true;
this.hoverVisibilities.forEach((item) => {
item.value = true;
});
} else {
this.inHelp = false;
this.hoverVisibilities.forEach((item) => {
item.value = false;
});
}
},
showToolitip: function (tooltipNumber) {
if (!this.inHelp) {
this.hoverVisibilities[tooltipNumber].value = true;
this.tooltipWait = setTimeout(() => {
this.hoverVisibilities[tooltipNumber].value = true;
}, 1000);
}
},
hideToolitip: function (tooltipNumber) {
if (!this.inHelp) {
this.hoverVisibilities[tooltipNumber].value = false;
clearInterval(this.tooltipWait);
}
},
handleWheel: function (event) {
let change = Math.round(event.deltaY / 7);
this.zoom = this.zoom - change;
Expand Down
21 changes: 13 additions & 8 deletions src/components/PlotVuer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="plotvuer_parent">
<div class="plotvuer_parent" data-help-scope>
<template v-if="plotType != '-plot'">
<component
:is="plotType"
Expand All @@ -17,6 +17,7 @@
<script>
import TimeseriesPlot from './TimeseriesPlot.vue';
import HeatmapPlot from './HeatmapPlot.vue';
import { collectHelpModeSteps } from '@abi-software/map-utilities';
const KNOWN_VERSIONS = ['1.2.0', '1.1.0'];

export default {
Expand Down Expand Up @@ -97,13 +98,6 @@ export default {
type: Array,
default: () => [],
},
/**
* The option to choose helpMode.
*/
helpMode: {
type: Boolean,
default: false,
},
/**
* The option to show the selector UI.
*/
Expand All @@ -128,6 +122,17 @@ export default {
return layout;
},
},
methods: {
/**
* @public
* Function to get the help mode steps of this plot, from the elements with ``v-help-mode``,
* to be used with ``HelpModeTour`` and ``HelpModeHover`` from ``@abi-software/map-utilities``.
* @returns {Array} The list of help steps.
*/
getHelpModeSteps: function () {
return collectHelpModeSteps(this.$el);
},
},
};
</script>

Expand Down
21 changes: 20 additions & 1 deletion src/components/TimeseriesPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
ref="selectBox"
v-model="filterX"
class="channel-select"
v-help-mode="{
id: 'plot-channel-select',
area: 'plot-filter',
title: 'Channels',
description: 'Choose the channels to show. You can type to search the list.',
placement: 'bottom',
Comment thread
akhuoa marked this conversation as resolved.
Resolved
}"
size="large"
multiple
filterable
Expand All @@ -19,7 +26,19 @@
</el-select>
</span>
<span>
<el-button class="view-heatmap-button" @click="filterPlot">Filter plot</el-button>
<el-button
class="view-heatmap-button"
v-help-mode="{
id: 'plot-filter-apply',
area: 'plot-filter',
title: 'Filter plot',
description: 'Update the plot to show only the chosen channels.',
placement: 'bottom',
}"
@click="filterPlot"
>
Filter plot
</el-button>
</span>
</div>
</div>
Expand Down
Loading
Loading