Feature/improve world map chart (#152)

* Improve world map chart

* Update changelog
pull/154/head
Thomas 4 years ago committed by GitHub
parent beb7e6ec34
commit f74b00446c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,8 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Improved the global heat map to visualize investments by country
## 1.13.0 - 08.06.2021 ## 1.13.0 - 08.06.2021
### Added
- Added a global heat map to visualize investments by country - Added a global heat map to visualize investments by country
## 1.12.0 - 06.06.2021 ## 1.12.0 - 06.06.2021

@ -10,6 +10,10 @@
.svgMap-map-wrapper { .svgMap-map-wrapper {
background: transparent; background: transparent;
.svgMap-country {
stroke: #e5e5e5;
}
.svgMap-map-controls-wrapper { .svgMap-map-controls-wrapper {
display: none; display: none;
} }
@ -18,7 +22,11 @@
} }
:host-context(.is-dark-theme) { :host-context(.is-dark-theme) {
.svgMap-tooltip { ::ng-deep {
background: var(--dark-background); .svgMap-map-wrapper {
.svgMap-country {
stroke: #414141;
}
}
} }
} }

@ -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: {

@ -215,7 +215,7 @@
<div class="col-lg"> <div class="col-lg">
<mat-card class="mb-3"> <mat-card class="mb-3">
<mat-card-header class="w-100"> <mat-card-header class="w-100">
<mat-card-title i18n>Global Heat Map</mat-card-title> <mat-card-title i18n>Regions</mat-card-title>
<gf-toggle <gf-toggle
[defaultValue]="period" [defaultValue]="period"
[isLoading]="false" [isLoading]="false"
@ -237,7 +237,7 @@
<mat-card class="mb-3"> <mat-card class="mb-3">
<mat-card-header> <mat-card-header>
<mat-card-title class="align-items-center d-flex" i18n <mat-card-title class="align-items-center d-flex" i18n
>Investment</mat-card-title >Timeline</mat-card-title
> >
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>

@ -81,6 +81,14 @@ body {
color: rgba(var(--dark-primary-text)) !important; color: rgba(var(--dark-primary-text)) !important;
} }
} }
.svgMap-tooltip {
background: var(--dark-background);
.svgMap-tooltip-content table td span {
color: rgba(var(--light-primary-text));
}
}
} }
} }
@ -156,6 +164,14 @@ ngx-skeleton-loader {
min-width: unset !important; min-width: unset !important;
} }
.svgMap-tooltip {
border-bottom: none;
.svgMap-tooltip-pointer {
display: none;
}
}
.text-decoration-underline { .text-decoration-underline {
text-decoration: underline !important; text-decoration: underline !important;
} }

Loading…
Cancel
Save