|
|
@ -7,8 +7,6 @@ import {
|
|
|
|
OnDestroy,
|
|
|
|
OnDestroy,
|
|
|
|
OnInit
|
|
|
|
OnInit
|
|
|
|
} from '@angular/core';
|
|
|
|
} from '@angular/core';
|
|
|
|
import { primaryColorHex } from '@ghostfolio/common/config';
|
|
|
|
|
|
|
|
import { getCssVariable, getTextColor } from '@ghostfolio/common/helper';
|
|
|
|
|
|
|
|
import { Currency } from '@prisma/client';
|
|
|
|
import { Currency } from '@prisma/client';
|
|
|
|
import svgMap from 'svgmap';
|
|
|
|
import svgMap from 'svgmap';
|
|
|
|
|
|
|
|
|
|
|
@ -31,6 +29,8 @@ export class WorldMapChartComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
public ngOnChanges() {
|
|
|
|
public ngOnChanges() {
|
|
|
|
if (this.countries) {
|
|
|
|
if (this.countries) {
|
|
|
|
|
|
|
|
this.isLoading = true;
|
|
|
|
|
|
|
|
|
|
|
|
this.destroySvgMap();
|
|
|
|
this.destroySvgMap();
|
|
|
|
|
|
|
|
|
|
|
|
this.initialize();
|
|
|
|
this.initialize();
|
|
|
@ -43,11 +43,9 @@ export class WorldMapChartComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
private initialize() {
|
|
|
|
private initialize() {
|
|
|
|
this.svgMapElement = new svgMap({
|
|
|
|
this.svgMapElement = new svgMap({
|
|
|
|
colorMax: primaryColorHex,
|
|
|
|
colorMax: '#22bdb9',
|
|
|
|
colorMin: '#d3f4f3',
|
|
|
|
colorMin: '#c3f1f0',
|
|
|
|
colorNoData: `rgba(${getTextColor()}, ${getCssVariable(
|
|
|
|
colorNoData: 'transparent',
|
|
|
|
'--palette-foreground-divider-alpha'
|
|
|
|
|
|
|
|
)})`,
|
|
|
|
|
|
|
|
data: {
|
|
|
|
data: {
|
|
|
|
applyData: 'value',
|
|
|
|
applyData: 'value',
|
|
|
|
data: {
|
|
|
|
data: {
|
|
|
|