Skip to content

Commit

Permalink
Graphs separated to base, mean and count.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed May 14, 2024
1 parent 85f59ce commit 5d33205
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lib/analysis/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class SummaryManager implements SummaryManagerInterface {
this.finishMean('ATOMS_MEAN_SPEED', this.stepManager.buffer.ATOMS_COUNT);
this.finishArrayMean('ATOMS_TYPE_MEAN_SPEED', this.stepManager.buffer.ATOMS_TYPE_COUNT);

this.stepManager.buffer.ATOMS_TYPE_LINKS_MEAN_COUNT = this.stepManager.buffer.ATOMS_TYPE_LINKS_COUNT;
this.stepManager.buffer.ATOMS_TYPE_LINKS_MEAN_COUNT = [...this.stepManager.buffer.ATOMS_TYPE_LINKS_COUNT];
this.finishArrayMean('ATOMS_TYPE_LINKS_MEAN_COUNT', this.stepManager.buffer.ATOMS_TYPE_COUNT);

this.stepManager.buffer.LINKS_CREATED_MEAN = [...this.stepManager.buffer.LINKS_CREATED];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<script setup lang="ts">
import { computed, type ComputedRef, ref, type Ref } from 'vue';
import ConfigSection from '@/web/components/config-editor/components/containers/config-section.vue';
import { useSimulationStore } from '@/web/store/simulation';
import type { TimeSeriesConfig } from "@/web/components/config-editor/components/widgets/chart.vue";
import Chart from "@/web/components/config-editor/components/widgets/chart.vue";
import Flag from '@/web/components/config-editor/components/inputs/flag.vue';
const { getCurrentSimulation } = useSimulationStore();
const showMean: Ref<boolean> = ref(false);
type ChartConfig = {
id: string;
name: string;
Expand Down Expand Up @@ -225,17 +229,22 @@ const timeSeriesLinksTypeDeletedMeanConfig = {
}),
}
const timeSeriesConfig: ChartConfig[] = [
const timeSeriesConfigBase: ChartConfig[] = [
timeSeriesFpsConfig,
timeSeriesLinksCountConfig,
timeSeriesAtomsMeanSpeedConfig,
timeSeriesAtomsTypeMeanSpeedConfig,
timeSeriesLinksCountConfig,
];
const timeSeriesConfigCount: ChartConfig[] = [
timeSeriesAtomsTypeLinksCountConfig,
timeSeriesAtomsTypeLinksMeanCountConfig,
timeSeriesLinksCreatedDeletedConfig,
timeSeriesLinksCreatedDeletedMeanConfig,
timeSeriesLinksTypeCreatedConfig,
timeSeriesLinksTypeDeletedConfig,
];
const timeSeriesConfigMean: ChartConfig[] = [
timeSeriesAtomsTypeLinksMeanCountConfig,
timeSeriesLinksCreatedDeletedMeanConfig,
timeSeriesLinksTypeCreatedMeanConfig,
timeSeriesLinksTypeDeletedMeanConfig,
];
Expand All @@ -248,8 +257,32 @@ const timeSeriesConfig: ChartConfig[] = [
Summary
</template>
<template #body>
<br />
<div v-for="config in timeSeriesConfig">
<div>
<flag title="Mean" v-model="showMean" />
</div>
<div v-for="config in timeSeriesConfigBase">
<chart
:id="config.id"
:name="config.name"
:data="config.data"
:period="config.period ?? 100"
:width="config.width ?? 467"
:height="config.height ?? 100"
:config="config.config"
/>
</div>
<div v-for="config in timeSeriesConfigCount" v-if="!showMean">
<chart
:id="config.id"
:name="config.name"
:data="config.data"
:period="config.period ?? 100"
:width="config.width ?? 467"
:height="config.height ?? 100"
:config="config.config"
/>
</div>
<div v-for="config in timeSeriesConfigMean" v-else>
<chart
:id="config.id"
:name="config.name"
Expand Down

0 comments on commit 5d33205

Please sign in to comment.