Skip to content
Draft
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 frontend/src/stores/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import chroma from 'chroma-js'
import { mdiCircle, mdiSquareRounded, mdiRectangle, mdiRhombus } from '@mdi/js'
import { useHydrologicStore } from '@/stores/hydrologic'
import { useAlertStore } from '@/stores/alerts'
import { useStatsStore } from './stats'
import { useRouter } from 'vue-router'

export const useChartsStore = defineStore(
Expand Down Expand Up @@ -916,6 +917,9 @@ export const useChartsStore = defineStore(
})
watch(activePlt, (pre, post) => {
console.log('Active PLT Changed', pre, post)
// refresh stats when the active plot changes
const statsStore = useStatsStore()
statsStore.toggleSeriesStatistics(showStatistics.value)
updateRouteAfterPlotChange()
})
watch(symbology, () => {
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/views/DistanceCharts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
<script setup>
import NodeChart from '@/components/NodeChart.vue'
import { useChartsStore } from '../stores/charts'
// import { useStatsStore } from '../stores/stats'
import { onMounted } from 'vue'
// import { watch } from 'vue'
import { useDisplay } from 'vuetify'
import PlotOptions from '@/components/PlotOptions.vue'
import PlotActions from '@/components/PlotActions.vue'
Expand All @@ -63,10 +65,17 @@ import { storeToRefs } from 'pinia'

const { lgAndUp } = useDisplay()
const chartStore = useChartsStore()
// const statsStore = useStatsStore()

const { activePlt, activeNodeChart, nodeChartData } = storeToRefs(chartStore)
// const { showStatistics } = storeToRefs(chartStore)

onMounted(() => {})
onMounted(() => {
// watch(activePlt, () => {
// // refresh stats when the active plot changes
// statsStore.toggleSeriesStatistics(showStatistics.value)
// })
})

const resetData = () => {
activeNodeChart.value.chart.data.datasets = nodeChartData.value.datasets
Expand Down