From 9d8b287c13eea1ec18fdb7a1cc2d004e255d9400 Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Sat, 1 Aug 2026 19:09:08 +0200 Subject: [PATCH] reverted some color values because EChart breaks --- .../compare-authors/compare-authors-colors.ts | 25 ++++----- .../compare-authors.component.ts | 12 +++-- .../dashboard/dashboard.component.scss | 2 +- .../ui/topic-chip/topic-chip.component.ts | 54 +++++++------------ 4 files changed, 38 insertions(+), 55 deletions(-) diff --git a/webapp/src/app/modules/compare-authors/compare-authors-colors.ts b/webapp/src/app/modules/compare-authors/compare-authors-colors.ts index 06ff1ede..f217db85 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors-colors.ts +++ b/webapp/src/app/modules/compare-authors/compare-authors-colors.ts @@ -1,19 +1,14 @@ -export const AUTHOR_COLORS = [ - 'var(--sg-blue-highlight)', - 'var(--sg-warning)', - 'var(--sg-success)', - 'var(--sg-primary)', -]; +export const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd']; export const SUBFIELD_COLORS = [ - 'var(--sg-blue-highlight)', - 'var(--sg-success)', - 'var(--sg-warning)', - 'var(--sg-primary)', - 'var(--sg-blue-highlight)', - 'var(--sg-error)', - 'var(--sg-success-soft)', - 'var(--sg-warning-soft)', + '#2563eb', + '#16a34a', + '#d97706', + '#7c3aed', + '#0891b2', + '#db2777', + '#65a30d', + '#b45309', ]; -export const OTHER_COLOR = 'var(--sg-text-muted)'; +export const OTHER_COLOR = '#9ca3af'; diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.ts b/webapp/src/app/modules/compare-authors/compare-authors.component.ts index 1e95a8f5..0105d3f8 100644 --- a/webapp/src/app/modules/compare-authors/compare-authors.component.ts +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.ts @@ -19,6 +19,7 @@ import { AuthorResearchProfileComponent, ResearchProfileAuthor, } from './author-research-profile/author-research-profile.component'; +import { ChartThemeService } from '../../shared/services/chart-theme.service'; import { AUTHOR_COLORS, OTHER_COLOR, @@ -73,7 +74,6 @@ interface GroupSegment { label: string; colorClass: string; decimals: boolean; - // render the value as-is, without the number pipe (e.g. years) plain: boolean; } @@ -122,6 +122,7 @@ interface SegmentDef { export class CompareAuthorsComponent implements OnInit { private readonly route = inject(ActivatedRoute); private readonly rankingService = inject(RankingService); + private readonly chartTheme = inject(ChartThemeService); readonly keywords = signal([]); readonly timespan = signal<{ from: number; to: number } | null>(null); @@ -143,6 +144,7 @@ export class CompareAuthorsComponent implements OnInit { readonly summary = computed(() => { const topicById = new Map(this.topic().map((a) => [a.author_id, a])); const staticById = new Map(this.staticStats().map((a) => [a.author_id, a])); + const authorPalette = this.chartTheme.colors().authorColors; return this.authorIds().map((id, index) => { const t = topicById.get(id); @@ -153,7 +155,7 @@ export class CompareAuthorsComponent implements OnInit { const authorSummary: AuthorSummary = { authorId: id, name, - color: AUTHOR_COLORS[index % AUTHOR_COLORS.length], + color: authorPalette[index % authorPalette.length], totalWorks: t ? t.works_total : null, corresponding: t ? t.corresponding_count : null, avgPercentile: t ? t.avg_percentile : null, @@ -566,21 +568,21 @@ export class CompareAuthorsComponent implements OnInit { { name: 'Themen', type: 'bar', - itemStyle: { color: 'var(--sg-blue-highlight)' }, + itemStyle: { color: this.chartTheme.colors().blueHighlight }, label: { show: true, position: 'right' }, data: profiles.map((p) => p.distinct_topics), }, { name: 'Subfields', type: 'bar', - itemStyle: { color: 'var(--sg-warning)' }, + itemStyle: { color: this.chartTheme.colors().warning }, label: { show: true, position: 'right' }, data: profiles.map((p) => p.distinct_subfields), }, { name: 'Fields', type: 'bar', - itemStyle: { color: 'var(--sg-success)' }, + itemStyle: { color: this.chartTheme.colors().success }, label: { show: true, position: 'right' }, data: profiles.map((p) => p.distinct_fields), }, diff --git a/webapp/src/app/modules/dashboard/dashboard.component.scss b/webapp/src/app/modules/dashboard/dashboard.component.scss index 789bfee7..06a0013f 100644 --- a/webapp/src/app/modules/dashboard/dashboard.component.scss +++ b/webapp/src/app/modules/dashboard/dashboard.component.scss @@ -320,7 +320,7 @@ display: block; height: 100%; border-radius: inherit; - background: var(--sg-primary); + background: #7255d9; transition: width 220ms ease; } diff --git a/webapp/src/app/shared/ui/topic-chip/topic-chip.component.ts b/webapp/src/app/shared/ui/topic-chip/topic-chip.component.ts index 4ca5d0ed..e7c1e0a5 100644 --- a/webapp/src/app/shared/ui/topic-chip/topic-chip.component.ts +++ b/webapp/src/app/shared/ui/topic-chip/topic-chip.component.ts @@ -34,48 +34,34 @@ export const TOPIC_CHIP_COLORS: Record< TopicChipColorTokens > = { purple: { - border: - 'color-mix(in srgb, var(--sg-primary) 72%, var(--sg-color-mix-base))', - background: - 'color-mix(in srgb, var(--sg-primary) 8%, var(--sg-color-mix-base))', - activeBackground: - 'color-mix(in srgb, var(--sg-primary) 22%, var(--sg-color-mix-base))', - color: 'var(--sg-primary)', + border: '#dcd5f7', + background: '#f2effc', + activeBackground: '#e2daf9', + color: '#7255d9', }, blue: { - border: - 'color-mix(in srgb, var(--sg-blue-highlight) 72%, var(--sg-color-mix-base))', - background: - 'color-mix(in srgb, var(--sg-blue-highlight) 8%, var(--sg-color-mix-base))', - activeBackground: - 'color-mix(in srgb, var(--sg-blue-highlight) 22%, var(--sg-color-mix-base))', - color: 'var(--sg-blue-highlight)', + border: '#cde1fd', + background: '#edf4fe', + activeBackground: '#d7e7fe', + color: '#2678e8', }, green: { - border: - 'color-mix(in srgb, var(--sg-success) 72%, var(--sg-color-mix-base))', - background: - 'color-mix(in srgb, var(--sg-success) 8%, var(--sg-color-mix-base))', - activeBackground: - 'color-mix(in srgb, var(--sg-success) 22%, var(--sg-color-mix-base))', - color: 'var(--sg-success)', + border: '#c7edd9', + background: '#eef9f3', + activeBackground: '#d3f2e2', + color: '#39a96b', }, orange: { - border: - 'color-mix(in srgb, var(--sg-warning) 72%, var(--sg-color-mix-base))', - background: - 'color-mix(in srgb, var(--sg-warning) 8%, var(--sg-color-mix-base))', - activeBackground: - 'color-mix(in srgb, var(--sg-warning) 22%, var(--sg-color-mix-base))', - color: 'var(--sg-warning)', + border: '#fde5c7', + background: '#fff6eb', + activeBackground: '#fce9cf', + color: '#e08326', }, pink: { - border: 'color-mix(in srgb, var(--sg-error) 72%, var(--sg-color-mix-base))', - background: - 'color-mix(in srgb, var(--sg-error) 8%, var(--sg-color-mix-base))', - activeBackground: - 'color-mix(in srgb, var(--sg-error) 22%, var(--sg-color-mix-base))', - color: 'var(--sg-error)', + border: '#f9d2df', + background: '#fcf0f4', + activeBackground: '#f8dbe4', + color: '#e0527c', }, };