reverted some color values because EChart breaks
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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<string[]>([]);
|
||||
readonly timespan = signal<{ from: number; to: number } | null>(null);
|
||||
@@ -143,6 +144,7 @@ export class CompareAuthorsComponent implements OnInit {
|
||||
readonly summary = computed<AuthorSummary[]>(() => {
|
||||
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),
|
||||
},
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
display: block;
|
||||
height: 100%;
|
||||
border-radius: inherit;
|
||||
background: var(--sg-primary);
|
||||
background: #7255d9;
|
||||
transition: width 220ms ease;
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user