Browse Source

Refactor story

pull/5480/head
Thomas Kaul 2 months ago
parent
commit
2b2264551a
  1. 28
      libs/ui/src/lib/world-map-chart/world-map-chart.component.stories.ts

28
libs/ui/src/lib/world-map-chart/world-map-chart.component.stories.ts

@ -1,3 +1,5 @@
import { DEFAULT_CURRENCY } from '@ghostfolio/common/config';
import { moduleMetadata } from '@storybook/angular';
import type { Meta, StoryObj } from '@storybook/angular';
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@ -34,34 +36,22 @@ export default {
type Story = StoryObj<GfWorldMapChartComponent>;
export const Loading: Story = {
args: {
countries: VWRL_COUNTRY_ALLOCATION,
format: '{0}%',
isInPercent: false
}
};
export const Default: Story = {
args: {
countries: VWRL_COUNTRY_ALLOCATION,
format: '{0}%',
countries: Object.fromEntries(
Object.entries(VWRL_COUNTRY_ALLOCATION).map(([countryCode, country]) => {
return [countryCode, { ...country, value: 150 * country.value }];
})
),
format: `{0} ${DEFAULT_CURRENCY}`,
isInPercent: false
}
};
export const AsPercentage: Story = {
export const InPercentage: Story = {
args: {
countries: VWRL_COUNTRY_ALLOCATION,
format: '{0}%',
isInPercent: true
}
};
export const WithCustomFormat: Story = {
args: {
countries: VWRL_COUNTRY_ALLOCATION,
format: '{0}',
isInPercent: false
}
};

Loading…
Cancel
Save