Browse Source

Improve holdings mock data

pull/4323/head
Thomas Kaul 6 months ago
parent
commit
7ba27b2b8a
  1. 174
      libs/ui/src/lib/treemap-chart/treemap-chart.component.stories.ts

174
libs/ui/src/lib/treemap-chart/treemap-chart.component.stories.ts

@ -1,4 +1,5 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import '@angular/localize/init';
import { moduleMetadata } from '@storybook/angular'; import { moduleMetadata } from '@storybook/angular';
import type { Meta, StoryObj } from '@storybook/angular'; import type { Meta, StoryObj } from '@storybook/angular';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@ -19,6 +20,12 @@ export default {
type: 'select' type: 'select'
}, },
options: ['DARK', 'LIGHT'] options: ['DARK', 'LIGHT']
},
cursor: {
control: {
type: 'select'
},
options: ['', 'pointer']
} }
} }
} as Meta<GfTreemapChartComponent>; } as Meta<GfTreemapChartComponent>;
@ -29,15 +36,17 @@ export const Default: Story = {
args: { args: {
baseCurrency: 'USD', baseCurrency: 'USD',
colorScheme: 'LIGHT', colorScheme: 'LIGHT',
cursor: 'pointer', cursor: undefined,
dateRange: 'max', dateRange: 'mtd',
holdings: [ holdings: [
{ {
allocationInPercentage: 0.04297389794222121, allocationInPercentage: 0.042990776363386086,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'EOD_HISTORICAL_DATA', dataSource: 'YAHOO',
dateOfFirstActivity: new Date('2021-11-30T23:00:00.000Z'), dateOfFirstActivity: new Date('2021-12-01T00:00:00.000Z'),
dividend: 0, dividend: 0,
grossPerformance: 3856, grossPerformance: 3856,
grossPerformancePercent: 0.46047289228564603, grossPerformancePercent: 0.46047289228564603,
@ -49,20 +58,24 @@ export const Default: Story = {
name: 'Apple Inc', name: 'Apple Inc',
netPerformance: 3855, netPerformance: 3855,
netPerformancePercent: 0.460353475041796, netPerformancePercent: 0.460353475041796,
netPerformancePercentWithCurrencyEffect: 0.33517397382382147, netPerformancePercentWithCurrencyEffect: 0.036440677966101696,
netPerformanceWithCurrencyEffect: 3070.145, netPerformanceWithCurrencyEffect: 430,
quantity: 50, quantity: 50,
sectors: [], sectors: [],
symbol: 'AAPL.US', symbol: 'AAPL',
tags: [],
transactionCount: 1, transactionCount: 1,
url: 'https://www.apple.com',
valueInBaseCurrency: 12230 valueInBaseCurrency: 12230
}, },
{ {
allocationInPercentage: 0.02376468566885821, allocationInPercentage: 0.02377401948293552,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
countries: [], countries: [],
currency: 'EUR', currency: 'EUR',
dataSource: 'YAHOO', dataSource: 'YAHOO',
dateOfFirstActivity: new Date('2021-04-22T22:00:00.000Z'), dateOfFirstActivity: new Date('2021-04-23T00:00:00.000Z'),
dividend: 192, dividend: 192,
grossPerformance: 2226.700251889169, grossPerformance: 2226.700251889169,
grossPerformancePercent: 0.49083842309827874, grossPerformancePercent: 0.49083842309827874,
@ -74,16 +87,20 @@ export const Default: Story = {
name: 'Allianz SE', name: 'Allianz SE',
netPerformance: 2222.2921914357685, netPerformance: 2222.2921914357685,
netPerformancePercent: 0.48986674069961134, netPerformancePercent: 0.48986674069961134,
netPerformancePercentWithCurrencyEffect: 0.2758025127480495, netPerformancePercentWithCurrencyEffect: 0.034489367670592026,
netPerformanceWithCurrencyEffect: 1462.071288352983, netPerformanceWithCurrencyEffect: 225.48257403052068,
quantity: 20, quantity: 20,
sectors: [], sectors: [],
symbol: 'ALV.DE', symbol: 'ALV.DE',
tags: [],
transactionCount: 2, transactionCount: 2,
url: 'https://www.allianz.com',
valueInBaseCurrency: 6763.224181360202 valueInBaseCurrency: 6763.224181360202
}, },
{ {
allocationInPercentage: 0.08035381015067167, allocationInPercentage: 0.08038536990007467,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'YAHOO', dataSource: 'YAHOO',
@ -99,49 +116,57 @@ export const Default: Story = {
name: 'Amazon.com, Inc.', name: 'Amazon.com, Inc.',
netPerformance: 12677.26, netPerformance: 12677.26,
netPerformancePercent: 1.253938941339967, netPerformancePercent: 1.253938941339967,
netPerformancePercentWithCurrencyEffect: 0.3467608709659129, netPerformancePercentWithCurrencyEffect: -0.037866008722316276,
netPerformanceWithCurrencyEffect: 5887.99969482422, netPerformanceWithCurrencyEffect: -899.99926757812,
quantity: 100, quantity: 100,
sectors: [], sectors: [],
symbol: 'AMZN', symbol: 'AMZN',
tags: [],
transactionCount: 1, transactionCount: 1,
url: 'https://www.aboutamazon.com',
valueInBaseCurrency: 22868 valueInBaseCurrency: 22868
}, },
{ {
allocationInPercentage: 0.1924813257324291, allocationInPercentage: 0.19216416482928922,
assetClass: 'LIQUIDITY',
assetSubClass: 'CRYPTOCURRENCY',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'COINGECKO', dataSource: 'COINGECKO',
dateOfFirstActivity: new Date('2017-08-15T22:00:00.000Z'), dateOfFirstActivity: new Date('2017-08-16T00:00:00.000Z'),
dividend: 0, dividend: 0,
grossPerformance: 52778.5219966, grossPerformance: 52666.7898248,
grossPerformancePercent: 26.389260998300003, grossPerformancePercent: 26.333394912400003,
grossPerformancePercentWithCurrencyEffect: 26.389260998300003, grossPerformancePercentWithCurrencyEffect: 26.333394912400003,
grossPerformanceWithCurrencyEffect: 52778.5219966, grossPerformanceWithCurrencyEffect: 52666.7898248,
holdings: [], holdings: [],
investment: 1999.9999999999998, investment: 1999.9999999999998,
marketPrice: 97563, marketPrice: 97364,
name: 'Bitcoin', name: 'Bitcoin',
netPerformance: 52748.6219966, netPerformance: 52636.8898248,
netPerformancePercent: 26.3743109983, netPerformancePercent: 26.3184449124,
netPerformancePercentWithCurrencyEffect: 0.8863678327863547, netPerformancePercentWithCurrencyEffect: -0.04760906442310894,
netPerformanceWithCurrencyEffect: 25739.370117251725, netPerformanceWithCurrencyEffect: -2732.737808972287,
quantity: 0.5614682, quantity: 0.5614682,
sectors: [], sectors: [],
symbol: 'bitcoin', symbol: 'bitcoin',
tags: [],
transactionCount: 1, transactionCount: 1,
valueInBaseCurrency: 54778.5219966 url: null,
valueInBaseCurrency: 54666.7898248
}, },
{ {
allocationInPercentage: 0.007375755949366297, allocationInPercentage: 0.007378652850073097,
assetClass: 'FIXED_INCOME',
assetSubClass: 'BOND',
countries: [], countries: [],
currency: 'EUR', currency: 'EUR',
dataSource: 'MANUAL', dataSource: 'MANUAL',
dateOfFirstActivity: new Date('2021-01-31T23:00:00.000Z'), dateOfFirstActivity: new Date('2021-02-01T00:00:00.000Z'),
dividend: 11.45, dividend: 11.45,
grossPerformance: 0, grossPerformance: 0,
grossPerformancePercent: 0, grossPerformancePercent: 0,
grossPerformancePercentWithCurrencyEffect: -0.12473204800811313, grossPerformancePercentWithCurrencyEffect: -0.1247202380342517,
grossPerformanceWithCurrencyEffect: -258.2576430160448, grossPerformanceWithCurrencyEffect: -258.2576430160448,
holdings: [], holdings: [],
investment: 2099.0764063811926, investment: 2099.0764063811926,
@ -149,41 +174,49 @@ export const Default: Story = {
name: 'Bondora Go & Grow', name: 'Bondora Go & Grow',
netPerformance: 0, netPerformance: 0,
netPerformancePercent: 0, netPerformancePercent: 0,
netPerformancePercentWithCurrencyEffect: -0.02592359361880765, netPerformancePercentWithCurrencyEffect: 0.009445843828715519,
netPerformanceWithCurrencyEffect: -55.8637940282462, netPerformanceWithCurrencyEffect: 19.6420125363184,
quantity: 2000, quantity: 2000,
sectors: [], sectors: [],
symbol: 'BONDORA_GO_AND_GROW', symbol: 'BONDORA_GO_AND_GROW',
tags: [],
transactionCount: 5, transactionCount: 5,
url: null,
valueInBaseCurrency: 2099.0764063811926 valueInBaseCurrency: 2099.0764063811926
}, },
{ {
allocationInPercentage: 0.07784474266697115, allocationInPercentage: 0.07787531695543741,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
countries: [], countries: [],
currency: 'CHF', currency: 'CHF',
dataSource: 'MANUAL', dataSource: 'MANUAL',
dateOfFirstActivity: new Date('2021-04-01T00:00:00.000Z'), dateOfFirstActivity: new Date('2021-04-01T00:00:00.000Z'),
dividend: 0, dividend: 0,
grossPerformance: 4550.843985045582, grossPerformance: 4550.843985045582,
grossPerformancePercent: 0.3632455413393694, grossPerformancePercent: 0.3631417324494093,
grossPerformancePercentWithCurrencyEffect: 0.4204922012941791, grossPerformancePercentWithCurrencyEffect: 0.42037247857285137,
grossPerformanceWithCurrencyEffect: 5107.057936556927, grossPerformanceWithCurrencyEffect: 5107.057936556927,
holdings: [], holdings: [],
investment: 17603.097090932337, investment: 17603.097090932337,
marketPrice: 188.22, marketPrice: 188.22,
name: 'frankly Extreme 95 Index', name: 'frankly Extreme 95 Index',
netPerformance: 4550.843985045582, netPerformance: 4550.843985045582,
netPerformancePercent: 0.3632455413393694, netPerformancePercent: 0.3631417324494093,
netPerformancePercentWithCurrencyEffect: 0.15268708552686547, netPerformancePercentWithCurrencyEffect: 0.026190604904358043,
netPerformanceWithCurrencyEffect: 2934.5524369077702, netPerformanceWithCurrencyEffect: 565.4165171873152,
quantity: 105.87328656807, quantity: 105.87328656807,
sectors: [], sectors: [],
symbol: 'FRANKLY95P', symbol: 'FRANKLY95P',
tags: [],
transactionCount: 6, transactionCount: 6,
url: 'https://www.frankly.ch',
valueInBaseCurrency: 22153.941075977917 valueInBaseCurrency: 22153.941075977917
}, },
{ {
allocationInPercentage: 0.043054364194296174, allocationInPercentage: 0.04307127421937313,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'YAHOO', dataSource: 'YAHOO',
@ -199,16 +232,20 @@ export const Default: Story = {
name: 'Microsoft Corporation', name: 'Microsoft Corporation',
netPerformance: 5065.5, netPerformance: 5065.5,
netPerformancePercent: 0.7047750229568411, netPerformancePercent: 0.7047750229568411,
netPerformancePercentWithCurrencyEffect: 0.004599573132220648, netPerformancePercentWithCurrencyEffect: -0.015973588391056275,
netPerformanceWithCurrencyEffect: 56.100073242186, netPerformanceWithCurrencyEffect: -198.899926757814,
quantity: 30, quantity: 30,
sectors: [], sectors: [],
symbol: 'MSFT', symbol: 'MSFT',
tags: [],
transactionCount: 1, transactionCount: 1,
url: 'https://www.microsoft.com',
valueInBaseCurrency: 12252.9 valueInBaseCurrency: 12252.9
}, },
{ {
allocationInPercentage: 0.18755312972722804, allocationInPercentage: 0.18762679306394897,
assetClass: 'EQUITY',
assetSubClass: 'STOCK',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'YAHOO', dataSource: 'YAHOO',
@ -224,66 +261,78 @@ export const Default: Story = {
name: 'Tesla, Inc.', name: 'Tesla, Inc.',
netPerformance: 51197.500000005, netPerformance: 51197.500000005,
netPerformancePercent: 23.829415871596066, netPerformancePercent: 23.829415871596066,
netPerformancePercentWithCurrencyEffect: 0.7752058140059775, netPerformancePercentWithCurrencyEffect: -0.12051410125545206,
netPerformanceWithCurrencyEffect: 23308.50045776367, netPerformanceWithCurrencyEffect: -7314.00091552734,
quantity: 150, quantity: 150,
sectors: [], sectors: [],
symbol: 'TSLA', symbol: 'TSLA',
tags: [],
transactionCount: 1, transactionCount: 1,
url: 'https://www.tesla.com',
valueInBaseCurrency: 53376 valueInBaseCurrency: 53376
}, },
{ {
allocationInPercentage: 0.05303042254652514, allocationInPercentage: 0.053051250766657634,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'YAHOO', dataSource: 'YAHOO',
dateOfFirstActivity: new Date('2019-03-01T00:00:00.000Z'), dateOfFirstActivity: new Date('2019-03-01T00:00:00.000Z'),
dividend: 0, dividend: 0,
grossPerformance: 6845.8, grossPerformance: 6845.8,
grossPerformancePercent: 1.0165805525150873, grossPerformancePercent: 1.0164758094605268,
grossPerformancePercentWithCurrencyEffect: 1.0165805525150873, grossPerformancePercentWithCurrencyEffect: 1.0164758094605268,
grossPerformanceWithCurrencyEffect: 6845.8, grossPerformanceWithCurrencyEffect: 6845.8,
holdings: [], holdings: [],
investment: 8246.2, investment: 8246.2,
marketPrice: 301.84, marketPrice: 301.84,
name: 'Vanguard Total Stock Market Index Fund ETF Shares', name: 'Vanguard Total Stock Market Index Fund ETF Shares',
netPerformance: 6746.3, netPerformance: 6746.3,
netPerformancePercent: 1.0018051040685578, netPerformancePercent: 1.0017018833976383,
netPerformancePercentWithCurrencyEffect: 0.208471773378915, netPerformancePercentWithCurrencyEffect: 0.01085061564051406,
netPerformanceWithCurrencyEffect: 2603.499786376955, netPerformanceWithCurrencyEffect: 161.99969482422,
quantity: 50, quantity: 50,
sectors: [], sectors: [],
symbol: 'VTI', symbol: 'VTI',
tags: [],
transactionCount: 5, transactionCount: 5,
url: 'https://www.vanguard.com',
valueInBaseCurrency: 15092 valueInBaseCurrency: 15092
}, },
{ {
allocationInPercentage: 0.08362477479211206, allocationInPercentage: 0.0836576192450555,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
countries: [], countries: [],
currency: 'CHF', currency: 'CHF',
dataSource: 'YAHOO', dataSource: 'YAHOO',
dateOfFirstActivity: new Date('2018-03-01T00:00:00.000Z'), dateOfFirstActivity: new Date('2018-03-01T00:00:00.000Z'),
dividend: 0, dividend: 0,
grossPerformance: 6462.42356864925, grossPerformance: 6462.42356864925,
grossPerformancePercent: 0.5464045087628423, grossPerformancePercent: 0.5463044783973836,
grossPerformancePercentWithCurrencyEffect: 0.6283507532327138, grossPerformancePercentWithCurrencyEffect: 0.6282343505275325,
grossPerformanceWithCurrencyEffect: 7121.935580698947, grossPerformanceWithCurrencyEffect: 7121.935580698947,
holdings: [], holdings: [],
investment: 17336.464702612564, investment: 17336.464702612564,
marketPrice: 129.74, marketPrice: 129.74,
name: 'Vanguard FTSE All-World UCITS ETF', name: 'Vanguard FTSE All-World UCITS ETF',
netPerformance: 6373.040578098944, netPerformance: 6373.040578098944,
netPerformancePercent: 0.5388470856808387, netPerformancePercent: 0.5387484388540966,
netPerformancePercentWithCurrencyEffect: 0.17446772990637183, netPerformancePercentWithCurrencyEffect: 0.008409682389650015,
netPerformanceWithCurrencyEffect: 3535.3359698639256, netPerformanceWithCurrencyEffect: 198.47200506226807,
quantity: 165, quantity: 165,
sectors: [], sectors: [],
symbol: 'VWRL.SW', symbol: 'VWRL.SW',
tags: [],
transactionCount: 5, transactionCount: 5,
url: 'https://www.vanguard.com',
valueInBaseCurrency: 23798.888271261814 valueInBaseCurrency: 23798.888271261814
}, },
{ {
allocationInPercentage: 0.03263910303018637, allocationInPercentage: 0.03265192235898284,
assetClass: 'EQUITY',
assetSubClass: 'ETF',
countries: [], countries: [],
currency: 'EUR', currency: 'EUR',
dataSource: 'YAHOO', dataSource: 'YAHOO',
@ -299,16 +348,20 @@ export const Default: Story = {
name: 'Xtrackers MSCI World UCITS ETF 1C', name: 'Xtrackers MSCI World UCITS ETF 1C',
netPerformance: 3081.4179261125105, netPerformance: 3081.4179261125105,
netPerformancePercent: 0.4989336392216841, netPerformancePercent: 0.4989336392216841,
netPerformancePercentWithCurrencyEffect: 0.20279057467326012, netPerformancePercentWithCurrencyEffect: 0.006460676966633529,
netPerformanceWithCurrencyEffect: 1566.0934524503903, netPerformanceWithCurrencyEffect: 59.626750161726044,
quantity: 75, quantity: 75,
sectors: [], sectors: [],
symbol: 'XDWD.DE', symbol: 'XDWD.DE',
tags: [],
transactionCount: 1, transactionCount: 1,
url: null,
valueInBaseCurrency: 9288.806675062973 valueInBaseCurrency: 9288.806675062973
}, },
{ {
allocationInPercentage: 0.17530398759913457, allocationInPercentage: 0.17537283996478595,
assetClass: 'LIQUIDITY',
assetSubClass: 'CASH',
countries: [], countries: [],
currency: 'USD', currency: 'USD',
dataSource: 'MANUAL', dataSource: 'MANUAL',
@ -329,6 +382,7 @@ export const Default: Story = {
quantity: 0, quantity: 0,
sectors: [], sectors: [],
symbol: 'USD', symbol: 'USD',
tags: [],
transactionCount: 0, transactionCount: 0,
valueInBaseCurrency: 49890 valueInBaseCurrency: 49890
} }

Loading…
Cancel
Save