From 622bb8b0cf426811a5a319abbd8d9a8899babe22 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 24 Jul 2023 20:04:34 +0200 Subject: [PATCH] Feature/add allocations by market chart (#2171) * Add allocations by (advanced) market * Fix public page * Update changelog --- CHANGELOG.md | 10 ++ .../src/app/portfolio/portfolio.controller.ts | 3 + .../src/app/portfolio/portfolio.service.ts | 57 +++++++- .../countries/asia-pacific-markets.json | 1 + .../src/assets/countries/europe-markets.json | 19 +++ .../allocations/allocations-page.component.ts | 131 ++++++++++++++--- .../allocations/allocations-page.html | 30 +++- .../app/pages/public/public-page.component.ts | 18 +-- apps/client/src/locales/messages.de.xlf | 136 ++++++++++-------- apps/client/src/locales/messages.es.xlf | 136 ++++++++++-------- apps/client/src/locales/messages.fr.xlf | 136 ++++++++++-------- apps/client/src/locales/messages.it.xlf | 136 ++++++++++-------- apps/client/src/locales/messages.nl.xlf | 136 ++++++++++-------- apps/client/src/locales/messages.pt.xlf | 136 ++++++++++-------- apps/client/src/locales/messages.xlf | 133 +++++++++-------- .../portfolio-position.interface.ts | 3 +- libs/common/src/lib/types/index.ts | 2 + .../src/lib/types/market-advanced.type.ts | 7 + libs/ui/src/lib/i18n.ts | 2 + .../portfolio-proportion-chart.component.ts | 107 +++++++------- 20 files changed, 860 insertions(+), 479 deletions(-) create mode 100644 apps/api/src/assets/countries/asia-pacific-markets.json create mode 100644 apps/api/src/assets/countries/europe-markets.json create mode 100644 libs/common/src/lib/types/market-advanced.type.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 24bf6d44..9764963f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +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/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Introduced the allocations by market chart on the allocations page + +### Fixed + +- Fixed an issue in the public page + ## 1.291.0 - 2023-07-23 ### Added diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 6a810250..93af43ed 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -179,6 +179,9 @@ export class PortfolioController { countries: hasDetails ? portfolioPosition.countries : [], currency: hasDetails ? portfolioPosition.currency : undefined, markets: hasDetails ? portfolioPosition.markets : undefined, + marketsAdvanced: hasDetails + ? portfolioPosition.marketsAdvanced + : undefined, sectors: hasDetails ? portfolioPosition.sectors : [] }; } diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 4f96d271..859a2dd1 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -42,7 +42,6 @@ import type { AccountWithValue, DateRange, GroupBy, - Market, OrderWithAccount, RequestWithUser, UserWithSettings @@ -84,8 +83,10 @@ import { import { PortfolioCalculator } from './portfolio-calculator'; import { RulesService } from './rules.service'; +const asiaPacificMarkets = require('../../assets/countries/asia-pacific-markets.json'); const developedMarkets = require('../../assets/countries/developed-markets.json'); const emergingMarkets = require('../../assets/countries/emerging-markets.json'); +const europeMarkets = require('../../assets/countries/europe-markets.json'); @Injectable() export class PortfolioService { @@ -538,11 +539,19 @@ export class PortfolioService { const symbolProfile = symbolProfileMap[item.symbol]; const dataProviderResponse = dataProviderResponses[item.symbol]; - const markets: { [key in Market]: number } = { + const markets: PortfolioPosition['markets'] = { developedMarkets: 0, emergingMarkets: 0, otherMarkets: 0 }; + const marketsAdvanced: PortfolioPosition['marketsAdvanced'] = { + asiaPacific: 0, + emergingMarkets: 0, + europe: 0, + japan: 0, + northAmerica: 0, + otherMarkets: 0 + }; for (const country of symbolProfile.countries) { if (developedMarkets.includes(country.code)) { @@ -558,10 +567,39 @@ export class PortfolioService { .plus(country.weight) .toNumber(); } + + if (country.code === 'JP') { + marketsAdvanced.japan = new Big(marketsAdvanced.japan) + .plus(country.weight) + .toNumber(); + } else if (country.code === 'CA' || country.code === 'US') { + marketsAdvanced.northAmerica = new Big(marketsAdvanced.northAmerica) + .plus(country.weight) + .toNumber(); + } else if (asiaPacificMarkets.includes(country.code)) { + marketsAdvanced.asiaPacific = new Big(marketsAdvanced.asiaPacific) + .plus(country.weight) + .toNumber(); + } else if (emergingMarkets.includes(country.code)) { + marketsAdvanced.emergingMarkets = new Big( + marketsAdvanced.emergingMarkets + ) + .plus(country.weight) + .toNumber(); + } else if (europeMarkets.includes(country.code)) { + marketsAdvanced.europe = new Big(marketsAdvanced.europe) + .plus(country.weight) + .toNumber(); + } else { + marketsAdvanced.otherMarkets = new Big(marketsAdvanced.otherMarkets) + .plus(country.weight) + .toNumber(); + } } holdings[item.symbol] = { markets, + marketsAdvanced, allocationInPercentage: filteredValueInBaseCurrency.eq(0) ? 0 : value.div(filteredValueInBaseCurrency).toNumber(), @@ -1497,7 +1535,13 @@ export class PortfolioService { ); } - private getLiabilities(activities: OrderWithAccount[]) { + private getLiabilities({ + activities, + userCurrency + }: { + activities: OrderWithAccount[]; + userCurrency: string; + }) { return activities .filter(({ type }) => { return type === TypeOfOrder.LIABILITY; @@ -1506,7 +1550,7 @@ export class PortfolioService { return this.exchangeRateDataService.toCurrency( new Big(quantity).mul(unitPrice).toNumber(), SymbolProfile.currency, - this.request.user.Settings.settings.baseCurrency + userCurrency ); }) .reduce( @@ -1616,7 +1660,10 @@ export class PortfolioService { const fees = this.getFees({ activities, userCurrency }).toNumber(); const firstOrderDate = activities[0]?.date; const items = this.getItems(activities).toNumber(); - const liabilities = this.getLiabilities(activities).toNumber(); + const liabilities = this.getLiabilities({ + activities, + userCurrency + }).toNumber(); const totalBuy = this.getTotalByType(activities, userCurrency, 'BUY'); const totalSell = this.getTotalByType(activities, userCurrency, 'SELL'); diff --git a/apps/api/src/assets/countries/asia-pacific-markets.json b/apps/api/src/assets/countries/asia-pacific-markets.json new file mode 100644 index 00000000..adbb0750 --- /dev/null +++ b/apps/api/src/assets/countries/asia-pacific-markets.json @@ -0,0 +1 @@ +["AU", "HK", "NZ", "SG"] diff --git a/apps/api/src/assets/countries/europe-markets.json b/apps/api/src/assets/countries/europe-markets.json new file mode 100644 index 00000000..26eb2176 --- /dev/null +++ b/apps/api/src/assets/countries/europe-markets.json @@ -0,0 +1,19 @@ +[ + "AT", + "BE", + "CH", + "DE", + "DK", + "ES", + "FI", + "FR", + "GB", + "IE", + "IL", + "IT", + "LU", + "NL", + "NO", + "PT", + "SE" +] diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts index 8696d6ac..7266032a 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts @@ -18,7 +18,7 @@ import { User } from '@ghostfolio/common/interfaces'; import { hasPermission, permissions } from '@ghostfolio/common/permissions'; -import { Market } from '@ghostfolio/common/types'; +import { Market, MarketAdvanced } from '@ghostfolio/common/types'; import { translate } from '@ghostfolio/ui/i18n'; import { Account, AssetClass, DataSource, Platform } from '@prisma/client'; import { isNumber } from 'lodash'; @@ -54,6 +54,13 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { public markets: { [key in Market]: { name: string; value: number }; }; + public marketsAdvanced: { + [key in MarketAdvanced]: { + id: MarketAdvanced; + name: string; + value: number; + }; + }; public placeholder = ''; public platforms: { [id: string]: Pick & { @@ -235,6 +242,38 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { value: undefined } }; + this.marketsAdvanced = { + asiaPacific: { + id: 'asiaPacific', + name: translate('Asia-Pacific'), + value: 0 + }, + emergingMarkets: { + id: 'emergingMarkets', + name: translate('Emerging Markets'), + value: 0 + }, + europe: { + id: 'europe', + name: translate('Europe'), + value: 0 + }, + japan: { + id: 'japan', + name: translate('Japan'), + value: 0 + }, + northAmerica: { + id: 'northAmerica', + name: translate('North America'), + value: 0 + }, + otherMarkets: { + id: 'otherMarkets', + name: translate('Other Markets'), + value: 0 + } + }; this.platforms = {}; this.portfolioDetails = { accounts: {}, @@ -318,45 +357,96 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { } this.markets.developedMarkets.value += - position.markets.developedMarkets * position.valueInBaseCurrency; + position.markets.developedMarkets * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); this.markets.emergingMarkets.value += - position.markets.emergingMarkets * position.valueInBaseCurrency; + position.markets.emergingMarkets * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); this.markets.otherMarkets.value += - position.markets.otherMarkets * position.valueInBaseCurrency; + position.markets.otherMarkets * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); + + this.marketsAdvanced.asiaPacific.value += + position.marketsAdvanced.asiaPacific * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); + this.marketsAdvanced.emergingMarkets.value += + position.marketsAdvanced.emergingMarkets * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); + this.marketsAdvanced.europe.value += + position.marketsAdvanced.europe * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); + this.marketsAdvanced.japan.value += + position.marketsAdvanced.japan * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); + this.marketsAdvanced.northAmerica.value += + position.marketsAdvanced.northAmerica * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); for (const country of position.countries) { const { code, continent, name, weight } = country; if (this.continents[continent]?.value) { this.continents[continent].value += - weight * position.valueInBaseCurrency; + weight * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); } else { this.continents[continent] = { name: continent, value: weight * - this.portfolioDetails.holdings[symbol].valueInBaseCurrency + (isNumber(position.valueInBaseCurrency) + ? this.portfolioDetails.holdings[symbol].valueInBaseCurrency + : this.portfolioDetails.holdings[symbol].valueInPercentage) }; } if (this.countries[code]?.value) { this.countries[code].value += - weight * position.valueInBaseCurrency; + weight * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); } else { this.countries[code] = { name, value: weight * - this.portfolioDetails.holdings[symbol].valueInBaseCurrency + (isNumber(position.valueInBaseCurrency) + ? this.portfolioDetails.holdings[symbol].valueInBaseCurrency + : this.portfolioDetails.holdings[symbol].valueInPercentage) }; } } } else { - this.continents[UNKNOWN_KEY].value += - this.portfolioDetails.holdings[symbol].valueInBaseCurrency; + this.continents[UNKNOWN_KEY].value += isNumber( + position.valueInBaseCurrency + ) + ? this.portfolioDetails.holdings[symbol].valueInBaseCurrency + : this.portfolioDetails.holdings[symbol].valueInPercentage; - this.countries[UNKNOWN_KEY].value += - this.portfolioDetails.holdings[symbol].valueInBaseCurrency; + this.countries[UNKNOWN_KEY].value += isNumber( + position.valueInBaseCurrency + ) + ? this.portfolioDetails.holdings[symbol].valueInBaseCurrency + : this.portfolioDetails.holdings[symbol].valueInPercentage; } if (position.sectors.length > 0) { @@ -364,19 +454,28 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { const { name, weight } = sector; if (this.sectors[name]?.value) { - this.sectors[name].value += weight * position.valueInBaseCurrency; + this.sectors[name].value += + weight * + (isNumber(position.valueInBaseCurrency) + ? position.valueInBaseCurrency + : position.valueInPercentage); } else { this.sectors[name] = { name, value: weight * - this.portfolioDetails.holdings[symbol].valueInBaseCurrency + (isNumber(position.valueInBaseCurrency) + ? this.portfolioDetails.holdings[symbol].valueInBaseCurrency + : this.portfolioDetails.holdings[symbol].valueInPercentage) }; } } } else { - this.sectors[UNKNOWN_KEY].value += - this.portfolioDetails.holdings[symbol].valueInBaseCurrency; + this.sectors[UNKNOWN_KEY].value += isNumber( + position.valueInBaseCurrency + ) + ? this.portfolioDetails.holdings[symbol].valueInBaseCurrency + : this.portfolioDetails.holdings[symbol].valueInPercentage; } } diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html index ab78c193..90a5dd3c 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html @@ -174,7 +174,7 @@ By CountryBy Market @@ -250,6 +248,30 @@
+
+ + + By Country + + + + + +
diff --git a/apps/client/src/app/pages/public/public-page.component.ts b/apps/client/src/app/pages/public/public-page.component.ts index 54ff0cf1..bb333390 100644 --- a/apps/client/src/app/pages/public/public-page.component.ts +++ b/apps/client/src/app/pages/public/public-page.component.ts @@ -33,19 +33,11 @@ export class PublicPageComponent implements OnInit { }; public portfolioPublicDetails: PortfolioPublicDetails; public positions: { - [symbol: string]: Pick< - PortfolioPosition, - 'currency' | 'name' | 'valueInBaseCurrency' - >; + [symbol: string]: Pick & { + value: number; + }; }; - public positionsArray: Pick< - PortfolioPosition, - | 'currency' - | 'name' - | 'netPerformancePercent' - | 'symbol' - | 'valueInBaseCurrency' - >[]; + public positionsArray: PortfolioPublicDetails['holdings'][string][]; public sectors: { [name: string]: { name: string; value: number }; }; @@ -142,7 +134,7 @@ export class PublicPageComponent implements OnInit { const value = position.allocationInPercentage; this.positions[symbol] = { - valueInBaseCurrency: value, + value, currency: position.currency, name: position.name }; diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf index c3f0c9bb..a44079f7 100644 --- a/apps/client/src/locales/messages.de.xlf +++ b/apps/client/src/locales/messages.de.xlf @@ -1954,7 +1954,7 @@ Nach Konto apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -2002,7 +2002,7 @@ Nach Land apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 @@ -2010,7 +2010,7 @@ Regionen apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -2150,7 +2150,7 @@ Verkauf libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2650,7 +2650,7 @@ Entwickelte Länder apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2662,7 +2662,7 @@ Schwellenländer apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2674,7 +2674,7 @@ Andere Länder apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2782,7 +2782,7 @@ Filtern nach Konto oder Tag... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2946,7 +2946,7 @@ Anlageklasse libs/ui/src/lib/i18n.ts - 5 + 6 @@ -2954,7 +2954,7 @@ Symbol libs/ui/src/lib/i18n.ts - 23 + 25 @@ -2962,7 +2962,7 @@ Tag libs/ui/src/lib/i18n.ts - 24 + 26 @@ -2970,7 +2970,7 @@ Bargeld libs/ui/src/lib/i18n.ts - 36 + 38 @@ -2978,7 +2978,7 @@ Rohstoff libs/ui/src/lib/i18n.ts - 37 + 39 @@ -2986,7 +2986,7 @@ Beteiligungskapital libs/ui/src/lib/i18n.ts - 38 + 40 @@ -2994,7 +2994,7 @@ Feste Einkünfte libs/ui/src/lib/i18n.ts - 39 + 41 @@ -3002,7 +3002,7 @@ Immobilien libs/ui/src/lib/i18n.ts - 40 + 42 @@ -3010,7 +3010,7 @@ Anleihe libs/ui/src/lib/i18n.ts - 43 + 45 @@ -3018,7 +3018,7 @@ Kryptowährung libs/ui/src/lib/i18n.ts - 44 + 46 @@ -3026,7 +3026,7 @@ ETF libs/ui/src/lib/i18n.ts - 45 + 47 @@ -3034,7 +3034,7 @@ Investmentfonds libs/ui/src/lib/i18n.ts - 46 + 48 @@ -3042,7 +3042,7 @@ Edelmetall libs/ui/src/lib/i18n.ts - 47 + 49 @@ -3050,7 +3050,7 @@ Privates Beteiligungskapital libs/ui/src/lib/i18n.ts - 48 + 50 @@ -3058,7 +3058,7 @@ Aktie libs/ui/src/lib/i18n.ts - 49 + 51 @@ -3066,7 +3066,7 @@ Notfallfonds libs/ui/src/lib/i18n.ts - 11 + 12 @@ -3074,11 +3074,11 @@ Andere libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 @@ -3086,11 +3086,11 @@ Keine Daten verfügbar libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 @@ -3098,7 +3098,7 @@ Nordamerika libs/ui/src/lib/i18n.ts - 55 + 57 @@ -3106,7 +3106,7 @@ Afrika libs/ui/src/lib/i18n.ts - 52 + 54 @@ -3114,7 +3114,7 @@ Asien libs/ui/src/lib/i18n.ts - 53 + 55 @@ -3122,7 +3122,7 @@ Europa libs/ui/src/lib/i18n.ts - 54 + 56 @@ -3130,7 +3130,7 @@ Ozeanien libs/ui/src/lib/i18n.ts - 56 + 58 @@ -3138,7 +3138,7 @@ Südamerika libs/ui/src/lib/i18n.ts - 57 + 59 @@ -3242,7 +3242,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -3250,7 +3250,7 @@ Anlageunterklasse libs/ui/src/lib/i18n.ts - 6 + 7 @@ -3286,7 +3286,7 @@ Wertschriften libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3382,7 +3382,7 @@ Kern libs/ui/src/lib/i18n.ts - 7 + 8 @@ -3390,7 +3390,7 @@ Zuwendung libs/ui/src/lib/i18n.ts - 12 + 13 @@ -3398,7 +3398,7 @@ Höheres Risiko libs/ui/src/lib/i18n.ts - 13 + 14 @@ -3406,7 +3406,7 @@ Geringeres Risiko libs/ui/src/lib/i18n.ts - 15 + 17 @@ -3414,7 +3414,7 @@ Altersvorsorge libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3422,7 +3422,7 @@ Satellit libs/ui/src/lib/i18n.ts - 21 + 23 @@ -3726,7 +3726,7 @@ Einfacher Wechsel zu Ghostfolio Premium libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3750,7 +3750,7 @@ Einfacher Wechsel zu Ghostfolio Premium oder Ghostfolio Open Source libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3758,7 +3758,7 @@ Einfacher Wechsel zu Ghostfolio Open Source oder Ghostfolio Basic libs/ui/src/lib/i18n.ts - 10 + 11 @@ -3870,7 +3870,7 @@ Nach ETF-Anbieter apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3990,7 +3990,7 @@ Diese Aktivität existiert bereits. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -4102,7 +4102,7 @@ Monate libs/ui/src/lib/i18n.ts - 17 + 19 @@ -4110,7 +4110,7 @@ Jahre libs/ui/src/lib/i18n.ts - 26 + 28 @@ -4118,7 +4118,7 @@ Monat libs/ui/src/lib/i18n.ts - 16 + 18 @@ -4126,7 +4126,7 @@ Jahr libs/ui/src/lib/i18n.ts - 25 + 27 @@ -4282,7 +4282,7 @@ Verbindlichkeit libs/ui/src/lib/i18n.ts - 32 + 34 @@ -7018,7 +7018,7 @@ Kauf libs/ui/src/lib/i18n.ts - 29 + 31 @@ -7026,7 +7026,7 @@ Wertsache libs/ui/src/lib/i18n.ts - 31 + 33 @@ -7058,7 +7058,31 @@ Filtervorlage libs/ui/src/lib/i18n.ts - 19 + 21 + + + + By Market + Nach Markt + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + Asien-Pazifik + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + Japan + + libs/ui/src/lib/i18n.ts + 16 diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf index f1c7d62e..998b8926 100644 --- a/apps/client/src/locales/messages.es.xlf +++ b/apps/client/src/locales/messages.es.xlf @@ -1955,7 +1955,7 @@ Por cuenta apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -2003,7 +2003,7 @@ Por país apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 @@ -2011,7 +2011,7 @@ Regiones apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -2151,7 +2151,7 @@ Venta libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2571,7 +2571,7 @@ Mercados desarrollados apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2619,7 +2619,7 @@ Otros mercados apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2631,7 +2631,7 @@ Mercados emergentes apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2775,7 +2775,7 @@ Filtrar por cuenta o etiqueta... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2947,7 +2947,7 @@ Tipo de activo libs/ui/src/lib/i18n.ts - 5 + 6 @@ -2955,7 +2955,7 @@ Símbolo libs/ui/src/lib/i18n.ts - 23 + 25 @@ -2963,7 +2963,7 @@ Etiqueta libs/ui/src/lib/i18n.ts - 24 + 26 @@ -2971,7 +2971,7 @@ Efectivo libs/ui/src/lib/i18n.ts - 36 + 38 @@ -2979,7 +2979,7 @@ Bien libs/ui/src/lib/i18n.ts - 37 + 39 @@ -2987,7 +2987,7 @@ Capital libs/ui/src/lib/i18n.ts - 38 + 40 @@ -2995,7 +2995,7 @@ Renta fija libs/ui/src/lib/i18n.ts - 39 + 41 @@ -3003,7 +3003,7 @@ Propiedad inmobiliaria libs/ui/src/lib/i18n.ts - 40 + 42 @@ -3011,7 +3011,7 @@ Bono libs/ui/src/lib/i18n.ts - 43 + 45 @@ -3019,7 +3019,7 @@ Criptomoneda libs/ui/src/lib/i18n.ts - 44 + 46 @@ -3027,7 +3027,7 @@ ETF libs/ui/src/lib/i18n.ts - 45 + 47 @@ -3035,7 +3035,7 @@ Fondo de inversión libs/ui/src/lib/i18n.ts - 46 + 48 @@ -3043,7 +3043,7 @@ Metal precioso libs/ui/src/lib/i18n.ts - 47 + 49 @@ -3051,7 +3051,7 @@ Capital riesgo libs/ui/src/lib/i18n.ts - 48 + 50 @@ -3059,7 +3059,7 @@ Acción libs/ui/src/lib/i18n.ts - 49 + 51 @@ -3067,7 +3067,7 @@ Fondo de emergencia libs/ui/src/lib/i18n.ts - 11 + 12 @@ -3075,11 +3075,11 @@ Otros libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 @@ -3087,11 +3087,11 @@ Sin datos disponibles libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 @@ -3099,7 +3099,7 @@ América del Norte libs/ui/src/lib/i18n.ts - 55 + 57 @@ -3107,7 +3107,7 @@ África libs/ui/src/lib/i18n.ts - 52 + 54 @@ -3115,7 +3115,7 @@ Asia libs/ui/src/lib/i18n.ts - 53 + 55 @@ -3123,7 +3123,7 @@ Europa libs/ui/src/lib/i18n.ts - 54 + 56 @@ -3131,7 +3131,7 @@ Oceanía libs/ui/src/lib/i18n.ts - 56 + 58 @@ -3139,7 +3139,7 @@ América del Sur libs/ui/src/lib/i18n.ts - 57 + 59 @@ -3235,7 +3235,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -3251,7 +3251,7 @@ Subtipo de activo libs/ui/src/lib/i18n.ts - 6 + 7 @@ -3287,7 +3287,7 @@ Securities libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3383,7 +3383,7 @@ Core libs/ui/src/lib/i18n.ts - 7 + 8 @@ -3391,7 +3391,7 @@ Grant libs/ui/src/lib/i18n.ts - 12 + 13 @@ -3399,7 +3399,7 @@ Higher Risk libs/ui/src/lib/i18n.ts - 13 + 14 @@ -3407,7 +3407,7 @@ Lower Risk libs/ui/src/lib/i18n.ts - 15 + 17 @@ -3415,7 +3415,7 @@ Retirement Provision libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3423,7 +3423,7 @@ Satellite libs/ui/src/lib/i18n.ts - 21 + 23 @@ -3727,7 +3727,7 @@ Switch to Ghostfolio Premium easily libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3751,7 +3751,7 @@ Switch to Ghostfolio Premium or Ghostfolio Open Source easily libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3759,7 +3759,7 @@ Switch to Ghostfolio Open Source or Ghostfolio Basic easily libs/ui/src/lib/i18n.ts - 10 + 11 @@ -3871,7 +3871,7 @@ By ETF Provider apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3991,7 +3991,7 @@ This activity already exists. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -4103,7 +4103,7 @@ Months libs/ui/src/lib/i18n.ts - 17 + 19 @@ -4111,7 +4111,7 @@ Years libs/ui/src/lib/i18n.ts - 26 + 28 @@ -4119,7 +4119,7 @@ Month libs/ui/src/lib/i18n.ts - 16 + 18 @@ -4127,7 +4127,7 @@ Year libs/ui/src/lib/i18n.ts - 25 + 27 @@ -4283,7 +4283,7 @@ Liability libs/ui/src/lib/i18n.ts - 32 + 34 @@ -7019,7 +7019,7 @@ Buy libs/ui/src/lib/i18n.ts - 29 + 31 @@ -7027,7 +7027,7 @@ Valuable libs/ui/src/lib/i18n.ts - 31 + 33 @@ -7059,7 +7059,31 @@ Preset libs/ui/src/lib/i18n.ts - 19 + 21 + + + + By Market + By Market + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + Asia-Pacific + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + Japan + + libs/ui/src/lib/i18n.ts + 16 diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf index 734ff183..7f745a6b 100644 --- a/apps/client/src/locales/messages.fr.xlf +++ b/apps/client/src/locales/messages.fr.xlf @@ -2398,7 +2398,7 @@ Vente libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2526,7 +2526,7 @@ Filtrer par compte ou étiquette... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2558,7 +2558,7 @@ Par Compte apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -2606,7 +2606,7 @@ Par Pays apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 @@ -2614,7 +2614,7 @@ Régions apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -2626,7 +2626,7 @@ Marchés Développés apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2638,7 +2638,7 @@ Marchés Émergents apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2650,7 +2650,7 @@ Autres marchés apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2678,7 +2678,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -3118,7 +3118,7 @@ Classe d'Actifs libs/ui/src/lib/i18n.ts - 5 + 6 @@ -3126,7 +3126,7 @@ Sous-classe d'Actifs libs/ui/src/lib/i18n.ts - 6 + 7 @@ -3134,7 +3134,7 @@ Fonds d'Urgence libs/ui/src/lib/i18n.ts - 11 + 12 @@ -3142,11 +3142,11 @@ Autre libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 @@ -3154,7 +3154,7 @@ Titres libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3162,7 +3162,7 @@ Symbole libs/ui/src/lib/i18n.ts - 23 + 25 @@ -3170,7 +3170,7 @@ Étiquette libs/ui/src/lib/i18n.ts - 24 + 26 @@ -3178,7 +3178,7 @@ Cash libs/ui/src/lib/i18n.ts - 36 + 38 @@ -3186,7 +3186,7 @@ Marchandise libs/ui/src/lib/i18n.ts - 37 + 39 @@ -3194,7 +3194,7 @@ Capital libs/ui/src/lib/i18n.ts - 38 + 40 @@ -3202,7 +3202,7 @@ Revenu Fixe libs/ui/src/lib/i18n.ts - 39 + 41 @@ -3210,7 +3210,7 @@ Immobilier libs/ui/src/lib/i18n.ts - 40 + 42 @@ -3218,7 +3218,7 @@ Obligation libs/ui/src/lib/i18n.ts - 43 + 45 @@ -3226,7 +3226,7 @@ Cryptomonnaie libs/ui/src/lib/i18n.ts - 44 + 46 @@ -3234,7 +3234,7 @@ ETF libs/ui/src/lib/i18n.ts - 45 + 47 @@ -3242,7 +3242,7 @@ SICAV libs/ui/src/lib/i18n.ts - 46 + 48 @@ -3250,7 +3250,7 @@ Métal Précieux libs/ui/src/lib/i18n.ts - 47 + 49 @@ -3258,7 +3258,7 @@ Capital Propre libs/ui/src/lib/i18n.ts - 48 + 50 @@ -3266,7 +3266,7 @@ Action libs/ui/src/lib/i18n.ts - 49 + 51 @@ -3274,7 +3274,7 @@ Afrique libs/ui/src/lib/i18n.ts - 52 + 54 @@ -3282,7 +3282,7 @@ Asie libs/ui/src/lib/i18n.ts - 53 + 55 @@ -3290,7 +3290,7 @@ Europe libs/ui/src/lib/i18n.ts - 54 + 56 @@ -3298,7 +3298,7 @@ Amérique du Nord libs/ui/src/lib/i18n.ts - 55 + 57 @@ -3306,7 +3306,7 @@ Océanie libs/ui/src/lib/i18n.ts - 56 + 58 @@ -3314,7 +3314,7 @@ Amérique du Sud libs/ui/src/lib/i18n.ts - 57 + 59 @@ -3330,11 +3330,11 @@ Pas de données disponibles libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 @@ -3382,7 +3382,7 @@ Core libs/ui/src/lib/i18n.ts - 7 + 8 @@ -3390,7 +3390,7 @@ Donner libs/ui/src/lib/i18n.ts - 12 + 13 @@ -3398,7 +3398,7 @@ Risque élevé libs/ui/src/lib/i18n.ts - 13 + 14 @@ -3406,7 +3406,7 @@ Risque faible libs/ui/src/lib/i18n.ts - 15 + 17 @@ -3414,7 +3414,7 @@ Réserve pour retraite libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3422,7 +3422,7 @@ Satellite libs/ui/src/lib/i18n.ts - 21 + 23 @@ -3726,7 +3726,7 @@ Passez à Ghostfolio Premium facilement libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3750,7 +3750,7 @@ Passez à Ghostfolio Premium ou Ghostfolio Open Source facilement libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3758,7 +3758,7 @@ Passez à Ghostfolio Open Source ou Ghostfolio Basic facilement libs/ui/src/lib/i18n.ts - 10 + 11 @@ -3870,7 +3870,7 @@ Par Émetteur d'ETF apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3990,7 +3990,7 @@ Cette activité existe déjà. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -4102,7 +4102,7 @@ Mois libs/ui/src/lib/i18n.ts - 17 + 19 @@ -4110,7 +4110,7 @@ Années libs/ui/src/lib/i18n.ts - 26 + 28 @@ -4118,7 +4118,7 @@ Mois libs/ui/src/lib/i18n.ts - 16 + 18 @@ -4126,7 +4126,7 @@ Année libs/ui/src/lib/i18n.ts - 25 + 27 @@ -4282,7 +4282,7 @@ Dette libs/ui/src/lib/i18n.ts - 32 + 34 @@ -7018,7 +7018,7 @@ Buy libs/ui/src/lib/i18n.ts - 29 + 31 @@ -7026,7 +7026,7 @@ Valuable libs/ui/src/lib/i18n.ts - 31 + 33 @@ -7058,7 +7058,31 @@ Preset libs/ui/src/lib/i18n.ts - 19 + 21 + + + + By Market + By Market + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + Asia-Pacific + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + Japan + + libs/ui/src/lib/i18n.ts + 16 diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf index 2286a61f..4c5f6b1a 100644 --- a/apps/client/src/locales/messages.it.xlf +++ b/apps/client/src/locales/messages.it.xlf @@ -1955,7 +1955,7 @@ Per account apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -2003,7 +2003,7 @@ Per paese apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 @@ -2011,7 +2011,7 @@ Regioni apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -2151,7 +2151,7 @@ Vendi libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2571,7 +2571,7 @@ Mercati sviluppati apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2619,7 +2619,7 @@ Altri mercati apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2631,7 +2631,7 @@ Mercati emergenti apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2775,7 +2775,7 @@ Filtra per account o tag... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2947,7 +2947,7 @@ Asset Class libs/ui/src/lib/i18n.ts - 5 + 6 @@ -2955,7 +2955,7 @@ Symbol libs/ui/src/lib/i18n.ts - 23 + 25 @@ -2963,7 +2963,7 @@ Tag libs/ui/src/lib/i18n.ts - 24 + 26 @@ -2971,7 +2971,7 @@ Cash libs/ui/src/lib/i18n.ts - 36 + 38 @@ -2979,7 +2979,7 @@ Commodity libs/ui/src/lib/i18n.ts - 37 + 39 @@ -2987,7 +2987,7 @@ Equity libs/ui/src/lib/i18n.ts - 38 + 40 @@ -2995,7 +2995,7 @@ Fixed Income libs/ui/src/lib/i18n.ts - 39 + 41 @@ -3003,7 +3003,7 @@ Real Estate libs/ui/src/lib/i18n.ts - 40 + 42 @@ -3011,7 +3011,7 @@ Bond libs/ui/src/lib/i18n.ts - 43 + 45 @@ -3019,7 +3019,7 @@ Cryptocurrency libs/ui/src/lib/i18n.ts - 44 + 46 @@ -3027,7 +3027,7 @@ ETF libs/ui/src/lib/i18n.ts - 45 + 47 @@ -3035,7 +3035,7 @@ Mutual Fund libs/ui/src/lib/i18n.ts - 46 + 48 @@ -3043,7 +3043,7 @@ Precious Metal libs/ui/src/lib/i18n.ts - 47 + 49 @@ -3051,7 +3051,7 @@ Private Equity libs/ui/src/lib/i18n.ts - 48 + 50 @@ -3059,7 +3059,7 @@ Stock libs/ui/src/lib/i18n.ts - 49 + 51 @@ -3067,7 +3067,7 @@ Emergency Fund libs/ui/src/lib/i18n.ts - 11 + 12 @@ -3075,11 +3075,11 @@ Other libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 @@ -3087,11 +3087,11 @@ No data available libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 @@ -3099,7 +3099,7 @@ North America libs/ui/src/lib/i18n.ts - 55 + 57 @@ -3107,7 +3107,7 @@ Africa libs/ui/src/lib/i18n.ts - 52 + 54 @@ -3115,7 +3115,7 @@ Asia libs/ui/src/lib/i18n.ts - 53 + 55 @@ -3123,7 +3123,7 @@ Europe libs/ui/src/lib/i18n.ts - 54 + 56 @@ -3131,7 +3131,7 @@ Oceania libs/ui/src/lib/i18n.ts - 56 + 58 @@ -3139,7 +3139,7 @@ South America libs/ui/src/lib/i18n.ts - 57 + 59 @@ -3235,7 +3235,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -3251,7 +3251,7 @@ Sub-asset class libs/ui/src/lib/i18n.ts - 6 + 7 @@ -3287,7 +3287,7 @@ Securities libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3383,7 +3383,7 @@ Core libs/ui/src/lib/i18n.ts - 7 + 8 @@ -3391,7 +3391,7 @@ Grant libs/ui/src/lib/i18n.ts - 12 + 13 @@ -3399,7 +3399,7 @@ Higher Risk libs/ui/src/lib/i18n.ts - 13 + 14 @@ -3407,7 +3407,7 @@ Lower Risk libs/ui/src/lib/i18n.ts - 15 + 17 @@ -3415,7 +3415,7 @@ Retirement Provision libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3423,7 +3423,7 @@ Satellite libs/ui/src/lib/i18n.ts - 21 + 23 @@ -3727,7 +3727,7 @@ Switch to Ghostfolio Premium easily libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3751,7 +3751,7 @@ Switch to Ghostfolio Premium or Ghostfolio Open Source easily libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3759,7 +3759,7 @@ Switch to Ghostfolio Open Source or Ghostfolio Basic easily libs/ui/src/lib/i18n.ts - 10 + 11 @@ -3871,7 +3871,7 @@ By ETF Provider apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3991,7 +3991,7 @@ This activity already exists. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -4103,7 +4103,7 @@ Months libs/ui/src/lib/i18n.ts - 17 + 19 @@ -4111,7 +4111,7 @@ Years libs/ui/src/lib/i18n.ts - 26 + 28 @@ -4119,7 +4119,7 @@ Month libs/ui/src/lib/i18n.ts - 16 + 18 @@ -4127,7 +4127,7 @@ Year libs/ui/src/lib/i18n.ts - 25 + 27 @@ -4283,7 +4283,7 @@ Liability libs/ui/src/lib/i18n.ts - 32 + 34 @@ -7019,7 +7019,7 @@ Buy libs/ui/src/lib/i18n.ts - 29 + 31 @@ -7027,7 +7027,7 @@ Valuable libs/ui/src/lib/i18n.ts - 31 + 33 @@ -7059,7 +7059,31 @@ Preset libs/ui/src/lib/i18n.ts - 19 + 21 + + + + By Market + By Market + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + Asia-Pacific + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + Japan + + libs/ui/src/lib/i18n.ts + 16 diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf index b58da746..50d64b9d 100644 --- a/apps/client/src/locales/messages.nl.xlf +++ b/apps/client/src/locales/messages.nl.xlf @@ -1954,7 +1954,7 @@ Per rekening apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -2002,7 +2002,7 @@ Per land apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 @@ -2010,7 +2010,7 @@ Regio's apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -2150,7 +2150,7 @@ Verkopen libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2570,7 +2570,7 @@ Ontwikkelde markten apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2618,7 +2618,7 @@ Andere markten apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2630,7 +2630,7 @@ Opkomende markten apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2774,7 +2774,7 @@ Filter op account of tag... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2946,7 +2946,7 @@ Activaklasse libs/ui/src/lib/i18n.ts - 5 + 6 @@ -2954,7 +2954,7 @@ Symbool libs/ui/src/lib/i18n.ts - 23 + 25 @@ -2962,7 +2962,7 @@ Label libs/ui/src/lib/i18n.ts - 24 + 26 @@ -2970,7 +2970,7 @@ Contant geld libs/ui/src/lib/i18n.ts - 36 + 38 @@ -2978,7 +2978,7 @@ Commodity libs/ui/src/lib/i18n.ts - 37 + 39 @@ -2986,7 +2986,7 @@ Equity libs/ui/src/lib/i18n.ts - 38 + 40 @@ -2994,7 +2994,7 @@ Vast inkomen libs/ui/src/lib/i18n.ts - 39 + 41 @@ -3002,7 +3002,7 @@ Vastgoed libs/ui/src/lib/i18n.ts - 40 + 42 @@ -3010,7 +3010,7 @@ Obligatie libs/ui/src/lib/i18n.ts - 43 + 45 @@ -3018,7 +3018,7 @@ Cryptovaluta libs/ui/src/lib/i18n.ts - 44 + 46 @@ -3026,7 +3026,7 @@ ETF libs/ui/src/lib/i18n.ts - 45 + 47 @@ -3034,7 +3034,7 @@ Beleggingsfonds libs/ui/src/lib/i18n.ts - 46 + 48 @@ -3042,7 +3042,7 @@ Edel metaal libs/ui/src/lib/i18n.ts - 47 + 49 @@ -3050,7 +3050,7 @@ Private equity libs/ui/src/lib/i18n.ts - 48 + 50 @@ -3058,7 +3058,7 @@ Aandeel libs/ui/src/lib/i18n.ts - 49 + 51 @@ -3066,7 +3066,7 @@ Noodfonds libs/ui/src/lib/i18n.ts - 11 + 12 @@ -3074,11 +3074,11 @@ Anders libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 @@ -3086,11 +3086,11 @@ Geen gegevens beschikbaar libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 @@ -3098,7 +3098,7 @@ Noord Amerika libs/ui/src/lib/i18n.ts - 55 + 57 @@ -3106,7 +3106,7 @@ Afrika libs/ui/src/lib/i18n.ts - 52 + 54 @@ -3114,7 +3114,7 @@ Azië libs/ui/src/lib/i18n.ts - 53 + 55 @@ -3122,7 +3122,7 @@ Europa libs/ui/src/lib/i18n.ts - 54 + 56 @@ -3130,7 +3130,7 @@ Oceanië libs/ui/src/lib/i18n.ts - 56 + 58 @@ -3138,7 +3138,7 @@ Zuid Amerika libs/ui/src/lib/i18n.ts - 57 + 59 @@ -3234,7 +3234,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -3250,7 +3250,7 @@ Activa Subklasse libs/ui/src/lib/i18n.ts - 6 + 7 @@ -3286,7 +3286,7 @@ Effecten libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3382,7 +3382,7 @@ Core libs/ui/src/lib/i18n.ts - 7 + 8 @@ -3390,7 +3390,7 @@ Grant libs/ui/src/lib/i18n.ts - 12 + 13 @@ -3398,7 +3398,7 @@ Higher Risk libs/ui/src/lib/i18n.ts - 13 + 14 @@ -3406,7 +3406,7 @@ Lower Risk libs/ui/src/lib/i18n.ts - 15 + 17 @@ -3414,7 +3414,7 @@ Retirement Provision libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3422,7 +3422,7 @@ Satellite libs/ui/src/lib/i18n.ts - 21 + 23 @@ -3726,7 +3726,7 @@ Switch to Ghostfolio Premium easily libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3750,7 +3750,7 @@ Switch to Ghostfolio Premium or Ghostfolio Open Source easily libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3758,7 +3758,7 @@ Switch to Ghostfolio Open Source or Ghostfolio Basic easily libs/ui/src/lib/i18n.ts - 10 + 11 @@ -3870,7 +3870,7 @@ By ETF Provider apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3990,7 +3990,7 @@ This activity already exists. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -4102,7 +4102,7 @@ Months libs/ui/src/lib/i18n.ts - 17 + 19 @@ -4110,7 +4110,7 @@ Years libs/ui/src/lib/i18n.ts - 26 + 28 @@ -4118,7 +4118,7 @@ Month libs/ui/src/lib/i18n.ts - 16 + 18 @@ -4126,7 +4126,7 @@ Year libs/ui/src/lib/i18n.ts - 25 + 27 @@ -4282,7 +4282,7 @@ Liability libs/ui/src/lib/i18n.ts - 32 + 34 @@ -7018,7 +7018,7 @@ Buy libs/ui/src/lib/i18n.ts - 29 + 31 @@ -7026,7 +7026,7 @@ Valuable libs/ui/src/lib/i18n.ts - 31 + 33 @@ -7058,7 +7058,31 @@ Preset libs/ui/src/lib/i18n.ts - 19 + 21 + + + + By Market + By Market + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + Asia-Pacific + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + Japan + + libs/ui/src/lib/i18n.ts + 16 diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf index d61c8880..66cfd40f 100644 --- a/apps/client/src/locales/messages.pt.xlf +++ b/apps/client/src/locales/messages.pt.xlf @@ -2322,7 +2322,7 @@ Venda libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2446,7 +2446,7 @@ Filtrar por conta ou marcador... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2478,7 +2478,7 @@ Por Conta apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -2526,7 +2526,7 @@ Por País apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 @@ -2534,7 +2534,7 @@ Regiões apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -2546,7 +2546,7 @@ Mercados Desenvoldidos apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2558,7 +2558,7 @@ Mercados Emergentes apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2570,7 +2570,7 @@ Outros Mercados apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2990,7 +2990,7 @@ Classe de Ativo libs/ui/src/lib/i18n.ts - 5 + 6 @@ -2998,7 +2998,7 @@ Fundo de Emergência libs/ui/src/lib/i18n.ts - 11 + 12 @@ -3006,11 +3006,11 @@ Outro libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 @@ -3018,7 +3018,7 @@ Símbolo libs/ui/src/lib/i18n.ts - 23 + 25 @@ -3026,7 +3026,7 @@ Marcador libs/ui/src/lib/i18n.ts - 24 + 26 @@ -3034,7 +3034,7 @@ Dinheiro libs/ui/src/lib/i18n.ts - 36 + 38 @@ -3042,7 +3042,7 @@ Matéria-prima libs/ui/src/lib/i18n.ts - 37 + 39 @@ -3050,7 +3050,7 @@ Ações libs/ui/src/lib/i18n.ts - 38 + 40 @@ -3058,7 +3058,7 @@ Rendimento Fixo libs/ui/src/lib/i18n.ts - 39 + 41 @@ -3066,7 +3066,7 @@ Imobiliário libs/ui/src/lib/i18n.ts - 40 + 42 @@ -3074,7 +3074,7 @@ Obrigação libs/ui/src/lib/i18n.ts - 43 + 45 @@ -3082,7 +3082,7 @@ Criptomoedas libs/ui/src/lib/i18n.ts - 44 + 46 @@ -3090,7 +3090,7 @@ ETF libs/ui/src/lib/i18n.ts - 45 + 47 @@ -3098,7 +3098,7 @@ Fundo de Investimento libs/ui/src/lib/i18n.ts - 46 + 48 @@ -3106,7 +3106,7 @@ Metal Precioso libs/ui/src/lib/i18n.ts - 47 + 49 @@ -3114,7 +3114,7 @@ Private Equity libs/ui/src/lib/i18n.ts - 48 + 50 @@ -3122,7 +3122,7 @@ Ação libs/ui/src/lib/i18n.ts - 49 + 51 @@ -3130,7 +3130,7 @@ África libs/ui/src/lib/i18n.ts - 52 + 54 @@ -3138,7 +3138,7 @@ Ásia libs/ui/src/lib/i18n.ts - 53 + 55 @@ -3146,7 +3146,7 @@ Europa libs/ui/src/lib/i18n.ts - 54 + 56 @@ -3154,7 +3154,7 @@ América do Norte libs/ui/src/lib/i18n.ts - 55 + 57 @@ -3162,7 +3162,7 @@ Oceânia libs/ui/src/lib/i18n.ts - 56 + 58 @@ -3170,7 +3170,7 @@ América do Sul libs/ui/src/lib/i18n.ts - 57 + 59 @@ -3186,11 +3186,11 @@ Sem dados disponíveis libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 @@ -3310,7 +3310,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -3326,7 +3326,7 @@ Subclasse de Ativos libs/ui/src/lib/i18n.ts - 6 + 7 @@ -3334,7 +3334,7 @@ Títulos libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3382,7 +3382,7 @@ Núcleo libs/ui/src/lib/i18n.ts - 7 + 8 @@ -3390,7 +3390,7 @@ Conceder libs/ui/src/lib/i18n.ts - 12 + 13 @@ -3398,7 +3398,7 @@ Risco mais Elevado libs/ui/src/lib/i18n.ts - 13 + 14 @@ -3406,7 +3406,7 @@ Risco menos Elevado libs/ui/src/lib/i18n.ts - 15 + 17 @@ -3414,7 +3414,7 @@ Provisão de Reforma libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3422,7 +3422,7 @@ Satélite libs/ui/src/lib/i18n.ts - 21 + 23 @@ -3726,7 +3726,7 @@ Mude para o Ghostfolio Premium facilmente libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3750,7 +3750,7 @@ Mude para o Ghostfolio Premium ou Ghostfolio Open Source facilmente libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3758,7 +3758,7 @@ Mude para o Ghostfolio Open Source ou Ghostfolio Basic facilmente libs/ui/src/lib/i18n.ts - 10 + 11 @@ -3870,7 +3870,7 @@ Por Prestador de ETF apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3990,7 +3990,7 @@ Essa atividade já existe. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -4102,7 +4102,7 @@ Meses libs/ui/src/lib/i18n.ts - 17 + 19 @@ -4110,7 +4110,7 @@ Anos libs/ui/src/lib/i18n.ts - 26 + 28 @@ -4118,7 +4118,7 @@ Mês libs/ui/src/lib/i18n.ts - 16 + 18 @@ -4126,7 +4126,7 @@ Ano libs/ui/src/lib/i18n.ts - 25 + 27 @@ -4282,7 +4282,7 @@ Liability libs/ui/src/lib/i18n.ts - 32 + 34 @@ -7018,7 +7018,7 @@ Buy libs/ui/src/lib/i18n.ts - 29 + 31 @@ -7026,7 +7026,7 @@ Valuable libs/ui/src/lib/i18n.ts - 31 + 33 @@ -7058,7 +7058,31 @@ Preset libs/ui/src/lib/i18n.ts - 19 + 21 + + + + By Market + By Market + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + Asia-Pacific + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + Japan + + libs/ui/src/lib/i18n.ts + 16 diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf index 0b84474c..c591ef78 100644 --- a/apps/client/src/locales/messages.xlf +++ b/apps/client/src/locales/messages.xlf @@ -1792,7 +1792,7 @@ By Account apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 256 + 278 @@ -1834,14 +1834,14 @@ By Country apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 177 + 255 Regions apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 203 + 201 apps/client/src/app/pages/public/public-page.html @@ -1967,7 +1967,7 @@ Sell libs/ui/src/lib/i18n.ts - 33 + 35 @@ -2344,7 +2344,7 @@ Developed Markets apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 226 + 224 apps/client/src/app/pages/public/public-page.html @@ -2388,7 +2388,7 @@ Other Markets apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 244 + 242 apps/client/src/app/pages/public/public-page.html @@ -2399,7 +2399,7 @@ Emerging Markets apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 235 + 233 apps/client/src/app/pages/public/public-page.html @@ -2528,7 +2528,7 @@ Filter by account or tag... apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts - 139 + 141 apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -2673,35 +2673,35 @@ Precious Metal libs/ui/src/lib/i18n.ts - 47 + 49 Tag libs/ui/src/lib/i18n.ts - 24 + 26 Equity libs/ui/src/lib/i18n.ts - 38 + 40 Real Estate libs/ui/src/lib/i18n.ts - 40 + 42 Cryptocurrency libs/ui/src/lib/i18n.ts - 44 + 46 @@ -2715,141 +2715,141 @@ Stock libs/ui/src/lib/i18n.ts - 49 + 51 Private Equity libs/ui/src/lib/i18n.ts - 48 + 50 Asset Class libs/ui/src/lib/i18n.ts - 5 + 6 Mutual Fund libs/ui/src/lib/i18n.ts - 46 + 48 Cash libs/ui/src/lib/i18n.ts - 36 + 38 Symbol libs/ui/src/lib/i18n.ts - 23 + 25 Commodity libs/ui/src/lib/i18n.ts - 37 + 39 Bond libs/ui/src/lib/i18n.ts - 43 + 45 ETF libs/ui/src/lib/i18n.ts - 45 + 47 Fixed Income libs/ui/src/lib/i18n.ts - 39 + 41 No data available libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 375 + 386 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 388 + 399 Emergency Fund libs/ui/src/lib/i18n.ts - 11 + 12 Other libs/ui/src/lib/i18n.ts - 18 + 20 libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts - 373 + 384 North America libs/ui/src/lib/i18n.ts - 55 + 57 Africa libs/ui/src/lib/i18n.ts - 52 + 54 Oceania libs/ui/src/lib/i18n.ts - 56 + 58 Asia libs/ui/src/lib/i18n.ts - 53 + 55 South America libs/ui/src/lib/i18n.ts - 57 + 59 Europe libs/ui/src/lib/i18n.ts - 54 + 56 @@ -2940,7 +2940,7 @@ Asset Sub Class libs/ui/src/lib/i18n.ts - 6 + 7 @@ -2951,7 +2951,7 @@ libs/ui/src/lib/i18n.ts - 30 + 32 @@ -2965,7 +2965,7 @@ Securities libs/ui/src/lib/i18n.ts - 22 + 24 @@ -3062,42 +3062,42 @@ Higher Risk libs/ui/src/lib/i18n.ts - 13 + 14 Lower Risk libs/ui/src/lib/i18n.ts - 15 + 17 Grant libs/ui/src/lib/i18n.ts - 12 + 13 Core libs/ui/src/lib/i18n.ts - 7 + 8 Satellite libs/ui/src/lib/i18n.ts - 21 + 23 Retirement Provision libs/ui/src/lib/i18n.ts - 20 + 22 @@ -3366,7 +3366,7 @@ Switch to Ghostfolio Premium easily libs/ui/src/lib/i18n.ts - 9 + 10 @@ -3388,14 +3388,14 @@ Switch to Ghostfolio Open Source or Ghostfolio Basic easily libs/ui/src/lib/i18n.ts - 10 + 11 Switch to Ghostfolio Premium or Ghostfolio Open Source easily libs/ui/src/lib/i18n.ts - 8 + 9 @@ -3487,7 +3487,7 @@ By ETF Provider apps/client/src/app/pages/portfolio/allocations/allocations-page.html - 276 + 298 @@ -3614,7 +3614,7 @@ This activity already exists. libs/ui/src/lib/i18n.ts - 14 + 15 @@ -3706,14 +3706,14 @@ Months libs/ui/src/lib/i18n.ts - 17 + 19 Years libs/ui/src/lib/i18n.ts - 26 + 28 @@ -3727,14 +3727,14 @@ Year libs/ui/src/lib/i18n.ts - 25 + 27 Month libs/ui/src/lib/i18n.ts - 16 + 18 @@ -3865,7 +3865,7 @@ Liability libs/ui/src/lib/i18n.ts - 32 + 34 @@ -6567,14 +6567,14 @@ Buy libs/ui/src/lib/i18n.ts - 29 + 31 Valuable libs/ui/src/lib/i18n.ts - 31 + 33 @@ -6613,7 +6613,7 @@ Preset libs/ui/src/lib/i18n.ts - 19 + 21 @@ -6623,6 +6623,27 @@ 184 + + By Market + + apps/client/src/app/pages/portfolio/allocations/allocations-page.html + 177 + + + + Asia-Pacific + + libs/ui/src/lib/i18n.ts + 5 + + + + Japan + + libs/ui/src/lib/i18n.ts + 16 + + diff --git a/libs/common/src/lib/interfaces/portfolio-position.interface.ts b/libs/common/src/lib/interfaces/portfolio-position.interface.ts index a398c8c9..76334ea0 100644 --- a/libs/common/src/lib/interfaces/portfolio-position.interface.ts +++ b/libs/common/src/lib/interfaces/portfolio-position.interface.ts @@ -1,6 +1,6 @@ import { AssetClass, AssetSubClass, DataSource, Tag } from '@prisma/client'; -import { Market, MarketState } from '../types'; +import { Market, MarketAdvanced, MarketState } from '../types'; import { Country } from './country.interface'; import { Sector } from './sector.interface'; @@ -20,6 +20,7 @@ export interface PortfolioPosition { marketChangePercent?: number; marketPrice: number; markets?: { [key in Market]: number }; + marketsAdvanced?: { [key in MarketAdvanced]: number }; marketState: MarketState; name: string; netPerformance: number; diff --git a/libs/common/src/lib/types/index.ts b/libs/common/src/lib/types/index.ts index 063bea05..2af65d40 100644 --- a/libs/common/src/lib/types/index.ts +++ b/libs/common/src/lib/types/index.ts @@ -5,6 +5,7 @@ import type { ColorScheme } from './color-scheme.type'; import type { DateRange } from './date-range.type'; import type { Granularity } from './granularity.type'; import type { GroupBy } from './group-by.type'; +import type { MarketAdvanced } from './market-advanced.type'; import type { MarketDataPreset } from './market-data-preset.type'; import type { MarketState } from './market-state.type'; import type { Market } from './market.type'; @@ -24,6 +25,7 @@ export type { Granularity, GroupBy, Market, + MarketAdvanced, MarketDataPreset, MarketState, OrderWithAccount, diff --git a/libs/common/src/lib/types/market-advanced.type.ts b/libs/common/src/lib/types/market-advanced.type.ts new file mode 100644 index 00000000..0d30a8ea --- /dev/null +++ b/libs/common/src/lib/types/market-advanced.type.ts @@ -0,0 +1,7 @@ +export type MarketAdvanced = + | 'asiaPacific' + | 'emergingMarkets' + | 'europe' + | 'japan' + | 'northAmerica' + | 'otherMarkets'; diff --git a/libs/ui/src/lib/i18n.ts b/libs/ui/src/lib/i18n.ts index cf36e99b..fc622c07 100644 --- a/libs/ui/src/lib/i18n.ts +++ b/libs/ui/src/lib/i18n.ts @@ -2,6 +2,7 @@ import '@angular/localize/init'; const locales = { ACCOUNT: $localize`Account`, + 'Asia-Pacific': $localize`Asia-Pacific`, ASSET_CLASS: $localize`Asset Class`, ASSET_SUB_CLASS: $localize`Asset Sub Class`, CORE: $localize`Core`, @@ -12,6 +13,7 @@ const locales = { GRANT: $localize`Grant`, HIGHER_RISK: $localize`Higher Risk`, IMPORT_ACTIVITY_ERROR_IS_DUPLICATE: $localize`This activity already exists.`, + Japan: $localize`Japan`, LOWER_RISK: $localize`Lower Risk`, MONTH: $localize`Month`, MONTHS: $localize`Months`, diff --git a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index ec0a63ee..dfb2a2c9 100644 --- a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -90,7 +90,7 @@ export class PortfolioProportionChartComponent [symbol: string]: { color?: string; name: string; - subCategory: { [symbol: string]: { value: Big } }; + subCategory?: { [symbol: string]: { value: Big } }; value: Big; }; } = {}; @@ -99,65 +99,76 @@ export class PortfolioProportionChartComponent [UNKNOWN_KEY]: `rgba(${getTextColor(this.colorScheme)}, 0.12)` }; - Object.keys(this.positions).forEach((symbol) => { - if (this.positions[symbol][this.keys[0]]?.toUpperCase()) { - if (chartData[this.positions[symbol][this.keys[0]].toUpperCase()]) { - chartData[this.positions[symbol][this.keys[0]].toUpperCase()].value = + if (this.keys.length > 0) { + Object.keys(this.positions).forEach((symbol) => { + if (this.positions[symbol][this.keys[0]]?.toUpperCase()) { + if (chartData[this.positions[symbol][this.keys[0]].toUpperCase()]) { chartData[ this.positions[symbol][this.keys[0]].toUpperCase() + ].value = chartData[ + this.positions[symbol][this.keys[0]].toUpperCase() ].value.plus(this.positions[symbol].value); - if ( - chartData[this.positions[symbol][this.keys[0]].toUpperCase()] - .subCategory[this.positions[symbol][this.keys[1]]] - ) { - chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory[this.positions[symbol][this.keys[1]]].value = + if ( + chartData[this.positions[symbol][this.keys[0]].toUpperCase()] + .subCategory[this.positions[symbol][this.keys[1]]] + ) { chartData[ this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory[this.positions[symbol][this.keys[1]]].value.plus( - this.positions[symbol].value - ); + ].subCategory[this.positions[symbol][this.keys[1]]].value = + chartData[ + this.positions[symbol][this.keys[0]].toUpperCase() + ].subCategory[this.positions[symbol][this.keys[1]]].value.plus( + this.positions[symbol].value + ); + } else { + chartData[ + this.positions[symbol][this.keys[0]].toUpperCase() + ].subCategory[ + this.positions[symbol][this.keys[1]] ?? UNKNOWN_KEY + ] = { value: new Big(this.positions[symbol].value) }; + } } else { - chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory[this.positions[symbol][this.keys[1]] ?? UNKNOWN_KEY] = - { value: new Big(this.positions[symbol].value) }; + chartData[this.positions[symbol][this.keys[0]].toUpperCase()] = { + name: this.positions[symbol][this.keys[0]], + subCategory: {}, + value: new Big(this.positions[symbol].value ?? 0) + }; + + if (this.positions[symbol][this.keys[1]]) { + chartData[ + this.positions[symbol][this.keys[0]].toUpperCase() + ].subCategory = { + [this.positions[symbol][this.keys[1]]]: { + value: new Big(this.positions[symbol].value) + } + }; + } } } else { - chartData[this.positions[symbol][this.keys[0]].toUpperCase()] = { - name: this.positions[symbol][this.keys[0]], - subCategory: {}, - value: new Big(this.positions[symbol].value ?? 0) - }; - - if (this.positions[symbol][this.keys[1]]) { - chartData[ - this.positions[symbol][this.keys[0]].toUpperCase() - ].subCategory = { - [this.positions[symbol][this.keys[1]]]: { - value: new Big(this.positions[symbol].value) - } + if (chartData[UNKNOWN_KEY]) { + chartData[UNKNOWN_KEY].value = chartData[UNKNOWN_KEY].value.plus( + this.positions[symbol].value + ); + } else { + chartData[UNKNOWN_KEY] = { + name: this.positions[symbol].name, + subCategory: this.keys[1] + ? { [this.keys[1]]: { value: new Big(0) } } + : undefined, + value: new Big(this.positions[symbol].value) }; } } - } else { - if (chartData[UNKNOWN_KEY]) { - chartData[UNKNOWN_KEY].value = chartData[UNKNOWN_KEY].value.plus( - this.positions[symbol].value - ); - } else { - chartData[UNKNOWN_KEY] = { - name: this.positions[symbol].name, - subCategory: this.keys[1] - ? { [this.keys[1]]: { value: new Big(0) } } - : undefined, - value: new Big(this.positions[symbol].value) - }; - } - } - }); + }); + } else { + Object.keys(this.positions).forEach((symbol) => { + chartData[symbol] = { + name: this.positions[symbol].name, + value: new Big(this.positions[symbol].value) + }; + }); + } let chartDataSorted = Object.entries(chartData) .sort((a, b) => {