|
|
|
@ -1,4 +1,8 @@ |
|
|
|
import { getLocale, getNumberFormatGroup } from '@ghostfolio/common/helper'; |
|
|
|
import { |
|
|
|
getCountryName, |
|
|
|
getLocale, |
|
|
|
getNumberFormatGroup |
|
|
|
} from '@ghostfolio/common/helper'; |
|
|
|
|
|
|
|
import { |
|
|
|
ChangeDetectionStrategy, |
|
|
|
@ -25,7 +29,7 @@ export class GfWorldMapChartComponent implements OnChanges, OnDestroy { |
|
|
|
@Input() locale = getLocale(); |
|
|
|
|
|
|
|
public isLoading = true; |
|
|
|
public svgMapElement; |
|
|
|
public svgMapElement: any; |
|
|
|
|
|
|
|
public constructor(private changeDetectorRef: ChangeDetectorRef) {} |
|
|
|
|
|
|
|
@ -88,6 +92,14 @@ export class GfWorldMapChartComponent implements OnChanges, OnDestroy { |
|
|
|
targetElementID: 'svgMap' |
|
|
|
}); |
|
|
|
|
|
|
|
this.svgMapElement.options.countryNames = Object.keys( |
|
|
|
this.svgMapElement.countries |
|
|
|
).reduce<{ [code: string]: string }>((names, code) => { |
|
|
|
names[code] = getCountryName({ code, locale: this.locale }); |
|
|
|
|
|
|
|
return names; |
|
|
|
}, {}); |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
this.isLoading = false; |
|
|
|
|
|
|
|
|