Browse Source
Task/refactor input in world map chart component (#6692)
Refactor input to isInPercentage
pull/6695/head
Thomas Kaul
1 week ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
6 additions and
6 deletions
-
apps/client/src/app/pages/portfolio/allocations/allocations-page.html
-
apps/client/src/app/pages/public/public-page.html
-
libs/ui/src/lib/world-map-chart/world-map-chart.component.stories.ts
-
libs/ui/src/lib/world-map-chart/world-map-chart.component.ts
|
|
|
@ -204,7 +204,7 @@ |
|
|
|
<gf-world-map-chart |
|
|
|
[countries]="countries" |
|
|
|
[format]="worldMapChartFormat" |
|
|
|
[isInPercent]="showValuesInPercentage()" |
|
|
|
[isInPercentage]="showValuesInPercentage()" |
|
|
|
[locale]="user?.settings?.locale" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -154,7 +154,7 @@ |
|
|
|
<gf-world-map-chart |
|
|
|
format="{0}%" |
|
|
|
[countries]="countries" |
|
|
|
[isInPercent]="true" |
|
|
|
[isInPercentage]="true" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="row"> |
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ export const Default: Story = { |
|
|
|
}) |
|
|
|
), |
|
|
|
format: `{0} ${DEFAULT_CURRENCY}`, |
|
|
|
isInPercent: false |
|
|
|
isInPercentage: false |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
@ -52,6 +52,6 @@ export const InPercentage: Story = { |
|
|
|
args: { |
|
|
|
countries: VWRL_COUNTRY_ALLOCATION, |
|
|
|
format: '{0}%', |
|
|
|
isInPercent: true |
|
|
|
isInPercentage: true |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ import svgMap from 'svgmap'; |
|
|
|
export class GfWorldMapChartComponent implements OnChanges, OnDestroy { |
|
|
|
@Input() countries: { [code: string]: { name?: string; value: number } }; |
|
|
|
@Input() format: string; |
|
|
|
@Input() isInPercent = false; |
|
|
|
@Input() isInPercentage = false; |
|
|
|
@Input() locale = getLocale(); |
|
|
|
|
|
|
|
public isLoading = true; |
|
|
|
@ -47,7 +47,7 @@ export class GfWorldMapChartComponent implements OnChanges, OnDestroy { |
|
|
|
} |
|
|
|
|
|
|
|
private initialize() { |
|
|
|
if (this.isInPercent) { |
|
|
|
if (this.isInPercentage) { |
|
|
|
// Convert value of countries to percentage
|
|
|
|
let sum = 0; |
|
|
|
Object.keys(this.countries).map((country) => { |
|
|
|
|