From 2a7f298eece95ce954a70b87a93572a2fbbf0f68 Mon Sep 17 00:00:00 2001 From: sebastian-raubach Date: Fri, 26 Apr 2024 10:52:18 +0100 Subject: [PATCH] - ADD: Added color palette selector from pre-defined list. - CHG: Updated footer link to new GridScore website. - --- src/App.vue | 2 +- src/components/MarkerSetup.vue | 2 +- src/components/charts/FieldHeatmap.vue | 5 +-- src/components/charts/GermplasmRepHeatmap.vue | 5 +-- src/components/modals/EditPeopleModal.vue | 8 ++--- .../modals/TrialPersonSelectModal.vue | 8 ++--- src/plugins/changelog/de_DE.json | 5 +++ src/plugins/changelog/en_GB.json | 5 +++ src/plugins/color.js | 12 ++++++- src/plugins/i18n/de_DE.json | 3 ++ src/plugins/i18n/en_GB.json | 3 ++ src/plugins/misc.js | 3 -- src/views/DataStatistics.vue | 16 ++++----- src/views/SettingsView.vue | 33 +++++++++++++++++-- src/views/TrialSetupView.vue | 8 ++--- 15 files changed, 86 insertions(+), 32 deletions(-) diff --git a/src/App.vue b/src/App.vue index a092f76..113b889 100644 --- a/src/App.vue +++ b/src/App.vue @@ -69,7 +69,7 @@ diff --git a/src/components/MarkerSetup.vue b/src/components/MarkerSetup.vue index dcb54f4..c9bdebb 100644 --- a/src/components/MarkerSetup.vue +++ b/src/components/MarkerSetup.vue @@ -187,7 +187,7 @@ export default { } // Draw the circle - this.ctx.fillStyle = this.storeTraitColors[1] + this.ctx.fillStyle = this.storeTraitColors[1 % this.storeTraitColors.length] this.ctx.beginPath() this.ctx.arc(finalX, finalY, 6, 0, 2 * Math.PI) this.ctx.fill() diff --git a/src/components/charts/FieldHeatmap.vue b/src/components/charts/FieldHeatmap.vue index edd75b7..646a02c 100644 --- a/src/components/charts/FieldHeatmap.vue +++ b/src/components/charts/FieldHeatmap.vue @@ -38,7 +38,8 @@ import { mapGetters } from 'vuex' import { getTrialDataCached } from '@/plugins/datastore' import { CELL_CATEGORY_CONTROL, DISPLAY_ORDER_LEFT_TO_RIGHT, DISPLAY_ORDER_TOP_TO_BOTTOM } from '@/plugins/constants' -import { categoryColors, invertHex, toLocalDateString } from '@/plugins/misc' +import { invertHex, toLocalDateString } from '@/plugins/misc' +import { categoricalColors } from '@/plugins/color' import PlotDataSection from '@/components/PlotDataSection' const emitter = require('tiny-emitter/instance') @@ -298,7 +299,7 @@ export default { colorscale: this.selectedTrait.dataType === 'categorical' ? restrictions.categories.map((_, i) => { const l = restrictions.categories.length - const c = categoryColors[i % categoryColors.length] + const c = categoricalColors.D3schemeCategory10[i % categoricalColors.D3schemeCategory10.length] return [[i / l, c], [(i + 1) / l, c]] }).flat() : [[0, this.storeDarkMode ? '#444444' : '#dddddd'], [1, this.selectedTrait.color]], diff --git a/src/components/charts/GermplasmRepHeatmap.vue b/src/components/charts/GermplasmRepHeatmap.vue index cbfabdf..df38c8c 100644 --- a/src/components/charts/GermplasmRepHeatmap.vue +++ b/src/components/charts/GermplasmRepHeatmap.vue @@ -35,7 +35,8 @@