remove chart until real usage
This commit is contained in:
@@ -4,7 +4,6 @@ import FlowHypothesis from '@/modules/article/FlowHypothesis.vue'
|
|||||||
import FlowIntro from '@/modules/article/FlowIntro.vue'
|
import FlowIntro from '@/modules/article/FlowIntro.vue'
|
||||||
import FeatureSteps from '@/modules/feature/FeatureSteps.vue'
|
import FeatureSteps from '@/modules/feature/FeatureSteps.vue'
|
||||||
import FlowDashboard from '@/modules/feature/FlowDashboard.vue'
|
import FlowDashboard from '@/modules/feature/FlowDashboard.vue'
|
||||||
import SimulationChart from '@/modules/simulation/SimulationChart.vue'
|
|
||||||
import SimulationControls from '@/modules/simulation/SimulationControls.vue'
|
import SimulationControls from '@/modules/simulation/SimulationControls.vue'
|
||||||
import SimulationDashboard from '@/modules/simulation/SimulationDashboard.vue'
|
import SimulationDashboard from '@/modules/simulation/SimulationDashboard.vue'
|
||||||
</script>
|
</script>
|
||||||
@@ -22,7 +21,6 @@ import SimulationDashboard from '@/modules/simulation/SimulationDashboard.vue'
|
|||||||
<SeparatorIcon />
|
<SeparatorIcon />
|
||||||
<SimulationControls />
|
<SimulationControls />
|
||||||
<SimulationDashboard />
|
<SimulationDashboard />
|
||||||
<SimulationChart />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -6,20 +6,25 @@ import { onMounted, ref, watch } from 'vue'
|
|||||||
|
|
||||||
const simulationStore = useSimulationStore()
|
const simulationStore = useSimulationStore()
|
||||||
const SAMPLE = 15
|
const SAMPLE = 15
|
||||||
|
const svgElement = ref<HTMLInputElement | null>(null)
|
||||||
const isChartInit = ref(false)
|
const isChartInit = ref(false)
|
||||||
|
|
||||||
const reloadGraph = () => {
|
const reloadGraph = () => {
|
||||||
if (simulationStore.dashboards.length === 0) {
|
if (simulationStore.dashboards.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
isChartInit.value = true
|
isChartInit.value = true
|
||||||
|
|
||||||
|
if (!svgElement.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const samples = popNElement(
|
const samples = popNElement(
|
||||||
[...simulationStore.dashboards],
|
[...simulationStore.dashboards],
|
||||||
SAMPLE
|
SAMPLE
|
||||||
).toReversed()
|
).toReversed()
|
||||||
|
|
||||||
const svg = document.querySelector('svg.chart')
|
|
||||||
const config = {
|
const config = {
|
||||||
title: `${SAMPLE} simulations`,
|
title: `${SAMPLE} simulations`,
|
||||||
xLabel: 'days',
|
xLabel: 'days',
|
||||||
@@ -43,31 +48,35 @@ const reloadGraph = () => {
|
|||||||
fontFamily: 'Noto Serif'
|
fontFamily: 'Noto Serif'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new chartXkcd.Line(svg, config)
|
new chartXkcd.Line(svgElement.value, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => simulationStore.hasSimulationFinished, reloadGraph)
|
watch(() => simulationStore.hasSimulationFinished, reloadGraph)
|
||||||
|
watch(svgElement, reloadGraph)
|
||||||
onMounted(reloadGraph)
|
onMounted(reloadGraph)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="simulation-chart">
|
<div class="simulation-chart">
|
||||||
<svg class="chart"></svg>
|
|
||||||
<div v-if="!isChartInit" class="chart no-init">
|
<div v-if="!isChartInit" class="chart no-init">
|
||||||
Chart appears once every simulations resume
|
Chart appears once every simulations resume
|
||||||
</div>
|
</div>
|
||||||
|
<svg ref="svgElement" v-else class="chart"></svg>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.simulation-chart {
|
||||||
|
--chart-height: 80vh;
|
||||||
|
height: var(--chart-height);
|
||||||
|
}
|
||||||
|
|
||||||
.chart {
|
.chart {
|
||||||
width: 80vw;
|
width: 80vw;
|
||||||
height: 100vh;
|
height: var(--chart-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-init {
|
.no-init {
|
||||||
position: relative;
|
|
||||||
top: -100vh;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user