Skip to content

Commit

Permalink
fixed color problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ArielMant0 committed Dec 6, 2023
1 parent 1685965 commit b5f7547
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/components/TimeSeriesCollectionViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div v-for="(ts, index) in collection.series" :key="ts.id" class="mb-2">
<v-sheet class="pa-2" rounded>
<TimeSeriesTitle :timeseries="ts"
<TimeSeriesTitle :timeseries="ts" :key="ts.id"
@remove="remove"
@copy="copy"/>
</v-sheet>
Expand Down Expand Up @@ -58,14 +58,14 @@
try {
props.collection.addTimeSeries();
} catch(e) {
comms.error(e.message);
comms.error(e.toString());
}
}
function remove(id) {
try {
props.collection.removeTimeSeries(id);
} catch(e) {
comms.error(e.message);
comms.error(e.toString());
}
}
function copy(id) {
Expand All @@ -75,7 +75,7 @@
// tsCopy.randomSeed();
props.collection.addTimeSeries(ts.copy());
} catch(e) {
comms.error(e.message);
comms.error(e.toString());
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/TimeSeriesTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</template>

<script setup>
import { ref, computed, watch } from 'vue';
import { ref, watch } from 'vue';
import { useApp } from '@/store/app';
import TimeSeries from '@/use/time-series.js';
Expand All @@ -76,7 +76,7 @@
const instances = ref(props.timeseries.instances);
const name = ref(props.timeseries.name);
const editName = ref(false);
const tsColor = computed(() => app.tscColorScale(props.timeseries.id))
const tsColor = ref(app.tscColorScale(props.timeseries.id))
function toggleEdit() {
if (editName.value) {
Expand Down Expand Up @@ -111,5 +111,6 @@
if (props.timeseries.name !== name.value) {
name.value = props.timeseries.name;
}
tsColor.value = app.tscColorScale(props.timeseries.id);
})
</script>
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
}
onMounted(function() {
app.setTSDomain(tsc.series.map(d => d.id));
app.setTSCDomain(tsc.series.map(d => d.id));
app.setTSDomain(["result"].concat(Object.values(GENERATOR_TYPES)))
update();
})
Expand Down

0 comments on commit b5f7547

Please sign in to comment.