@tectra-ng/charts 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bar-list/README.md +1 -1
- package/boxplot/README.md +1 -1
- package/bullet/README.md +1 -1
- package/candlestick/README.md +1 -1
- package/column/README.md +3 -3
- package/combo/README.md +1 -1
- package/core/README.md +8 -6
- package/fesm2022/tectra-ng-charts-candlestick.mjs +23 -7
- package/fesm2022/tectra-ng-charts-candlestick.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-column.mjs +1 -1
- package/fesm2022/tectra-ng-charts-column.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-core.mjs +81 -18
- package/fesm2022/tectra-ng-charts-core.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-funnel.mjs +29 -7
- package/fesm2022/tectra-ng-charts-funnel.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-gantt.mjs +487 -27
- package/fesm2022/tectra-ng-charts-gantt.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-gauge.mjs +79 -34
- package/fesm2022/tectra-ng-charts-gauge.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-org-chart.mjs +36 -8
- package/fesm2022/tectra-ng-charts-org-chart.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-pie.mjs +27 -9
- package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-radial-bar.mjs +5 -4
- package/fesm2022/tectra-ng-charts-radial-bar.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-range-area.mjs +113 -58
- package/fesm2022/tectra-ng-charts-range-area.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-rank-line.mjs +79 -31
- package/fesm2022/tectra-ng-charts-rank-line.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-sankey.mjs +99 -18
- package/fesm2022/tectra-ng-charts-sankey.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs +53 -7
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-sunburst.mjs +31 -3
- package/fesm2022/tectra-ng-charts-sunburst.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-waterfall.mjs +57 -20
- package/fesm2022/tectra-ng-charts-waterfall.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts.mjs +1 -1
- package/funnel/README.md +2 -2
- package/gantt/README.md +12 -8
- package/gauge/README.md +3 -3
- package/line/README.md +1 -1
- package/org-chart/README.md +1 -0
- package/package.json +5 -5
- package/pie/README.md +5 -4
- package/radar/README.md +1 -1
- package/radial-bar/README.md +2 -2
- package/range-area/README.md +2 -1
- package/rank-line/README.md +3 -2
- package/sankey/README.md +1 -1
- package/segmented-bar/README.md +2 -1
- package/treemap/README.md +1 -1
- package/types/tectra-ng-charts-bar-list.d.ts +1 -1
- package/types/tectra-ng-charts-boxplot.d.ts +1 -1
- package/types/tectra-ng-charts-bullet.d.ts +1 -1
- package/types/tectra-ng-charts-candlestick.d.ts +7 -3
- package/types/tectra-ng-charts-candlestick.d.ts.map +1 -1
- package/types/tectra-ng-charts-column.d.ts +3 -3
- package/types/tectra-ng-charts-combo.d.ts +1 -1
- package/types/tectra-ng-charts-core.d.ts +45 -10
- package/types/tectra-ng-charts-core.d.ts.map +1 -1
- package/types/tectra-ng-charts-funnel.d.ts +8 -2
- package/types/tectra-ng-charts-funnel.d.ts.map +1 -1
- package/types/tectra-ng-charts-gantt.d.ts +166 -10
- package/types/tectra-ng-charts-gantt.d.ts.map +1 -1
- package/types/tectra-ng-charts-gauge.d.ts +21 -6
- package/types/tectra-ng-charts-gauge.d.ts.map +1 -1
- package/types/tectra-ng-charts-line.d.ts +1 -1
- package/types/tectra-ng-charts-org-chart.d.ts +13 -2
- package/types/tectra-ng-charts-org-chart.d.ts.map +1 -1
- package/types/tectra-ng-charts-pie.d.ts +13 -4
- package/types/tectra-ng-charts-pie.d.ts.map +1 -1
- package/types/tectra-ng-charts-radar.d.ts +1 -1
- package/types/tectra-ng-charts-radial-bar.d.ts +3 -2
- package/types/tectra-ng-charts-radial-bar.d.ts.map +1 -1
- package/types/tectra-ng-charts-range-area.d.ts +12 -3
- package/types/tectra-ng-charts-range-area.d.ts.map +1 -1
- package/types/tectra-ng-charts-rank-line.d.ts +28 -10
- package/types/tectra-ng-charts-rank-line.d.ts.map +1 -1
- package/types/tectra-ng-charts-sankey.d.ts +36 -9
- package/types/tectra-ng-charts-sankey.d.ts.map +1 -1
- package/types/tectra-ng-charts-segmented-bar.d.ts +11 -2
- package/types/tectra-ng-charts-segmented-bar.d.ts.map +1 -1
- package/types/tectra-ng-charts-sunburst.d.ts +10 -0
- package/types/tectra-ng-charts-sunburst.d.ts.map +1 -1
- package/types/tectra-ng-charts-treemap.d.ts +1 -1
- package/types/tectra-ng-charts-waterfall.d.ts +25 -6
- package/types/tectra-ng-charts-waterfall.d.ts.map +1 -1
- package/types/tectra-ng-charts.d.ts +1 -1
- package/waterfall/README.md +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-charts-segmented-bar.mjs","names":[],"sources":["../../../../packages/charts/segmented-bar/src/segmented-bar-segments.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.icons.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.theme.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.component.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.component.html"],"sourcesContent":["import { TxChartValueFormatter } from '@tectra-ng/charts/core';\nimport { TxSegmentedBarItem, TxSegmentedBarSegment } from './segmented-bar.types';\n\n/**\n * Turns items into segments with shares and formatted value and percent texts; `percentFormat` defaults to `format`.\n */\nexport function segmentedBarSegments(\n items: readonly TxSegmentedBarItem[] | null | undefined,\n format: TxChartValueFormatter,\n percentFormat: TxChartValueFormatter = format,\n): TxSegmentedBarSegment[] {\n const list = items ?? [];\n const positive = (value: number) => (Number.isFinite(value) ? Math.max(value, 0) : 0);\n const total = list.reduce((sum, item) => sum + positive(item.value), 0);\n return list.map((item) => {\n const value = positive(item.value);\n const share = total ? (value / total) * 100 : 0;\n return {\n key: item.key,\n label: item.label,\n raw: value,\n value: format(value),\n share,\n percent: `${percentFormat(Math.round(share * 10) / 10)}%`,\n tone: item.tone ?? 'primary',\n isEmpty: value === 0,\n };\n });\n}\n","import { TxIconSet, txIconDot, txIconInfo, txIconList } from '@tectra-ng/icons';\n\nexport const SEGMENTED_BAR_ICON_DEFAULTS: TxIconSet = {\n dot: txIconDot,\n info: txIconInfo,\n list: txIconList,\n};\n","import { chartTokens } from '@tectra-ng/themes';\n\nexport const SEGMENTED_BAR_THEME = {\n chart: chartTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { TxChartValueFormat, chartNumberFormatter } from '@tectra-ng/charts/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraChartTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { segmentedBarSegments } from './segmented-bar-segments';\nimport { TxSegmentedBarItem, TxSegmentedBarPart, TxSegmentedBarSize } from './segmented-bar.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { SEGMENTED_BAR_ICON_DEFAULTS } from './segmented-bar.icons';\nimport { SEGMENTED_BAR_THEME } from './segmented-bar.theme';\n\n@Component({\n selector: 'tx-segmented-bar',\n templateUrl: './segmented-bar.component.html',\n styleUrl: './segmented-bar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-segmented-bar',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[class.tx-segmented-bar--mono]': 'monoLabels()',\n },\n viewProviders: [provideTxIconDefaults(SEGMENTED_BAR_ICON_DEFAULTS)],\n})\nexport class TxSegmentedBar {\n private readonly segmentedBarTheme = injectTokens(SEGMENTED_BAR_THEME);\n\n private locale = inject(TxLocaleService);\n\n readonly items = input<readonly TxSegmentedBarItem[] | null | undefined>([]);\n readonly size = input<TxSegmentedBarSize>('small');\n readonly showLegend = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly showValue = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly showPercent = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly hideEmptyInLegend = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly monoLabels = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly valueFormat = input<TxChartValueFormat>('number');\n readonly ariaLabel = input('');\n readonly dt = input<TectraDeepPartial<TectraChartTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxSegmentedBarPart, TxSegmentedBar> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('segmentedBar', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-chart'), ...this.passThrough().root?.style }));\n\n private readonly intl = computed(() => this.locale.locale().intl);\n readonly segments = computed(() =>\n segmentedBarSegments(this.items(), chartNumberFormatter(this.intl(), this.valueFormat()), chartNumberFormatter(this.intl())),\n );\n readonly barSegments = computed(() => this.segments().filter((segment) => !segment.isEmpty));\n readonly legendSegments = computed(() => (this.hideEmptyInLegend() ? this.barSegments() : this.segments()));\n readonly summary = computed(() => {\n const parts = this.segments().map((segment) => `${segment.label}: ${segment.value} (${segment.percent})`);\n return [this.ariaLabel(), ...parts].filter(Boolean).join(', ');\n });\n}\n","@let parts = passThrough();\n<div\n class=\"tx-segmented-bar__track\"\n [class]=\"parts.track?.class\"\n [style]=\"parts.track?.style\"\n [attr.role]=\"showLegend() ? null : 'img'\"\n [attr.aria-label]=\"showLegend() ? null : summary()\"\n [attr.aria-hidden]=\"showLegend() || null\"\n>\n @for (segment of barSegments(); track segment.key) {\n <span\n class=\"tx-segmented-bar__segment\"\n [class]=\"parts.segment?.class\"\n [style]=\"parts.segment?.style\"\n [attr.data-tone]=\"segment.tone\"\n [style.width.%]=\"segment.share\"\n [title]=\"segment.label + ': ' + segment.value\"\n >\n @if (size() === 'large') {\n {{ segment.percent }}\n }\n </span>\n }\n</div>\n\n@if (showLegend()) {\n <div class=\"tx-segmented-bar__legend\" [class]=\"parts.legend?.class\" [style]=\"parts.legend?.style\" role=\"list\" [attr.aria-label]=\"ariaLabel() || null\">\n @for (segment of legendSegments(); track segment.key) {\n <span\n class=\"tx-segmented-bar__legend-item\"\n [class]=\"parts.legendItem?.class\"\n [style]=\"parts.legendItem?.style\"\n [attr.data-tone]=\"segment.tone\"\n role=\"listitem\"\n >\n <span class=\"tx-segmented-bar__dot\" [class]=\"parts.dot?.class\" [style]=\"parts.dot?.style\" aria-hidden=\"true\"></span>\n <span class=\"tx-segmented-bar__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">{{ segment.label }}</span>\n @if (showValue()) {\n <span class=\"tx-segmented-bar__value\" [class]=\"parts.value?.class\" [style]=\"parts.value?.style\">{{ segment.value }}</span>\n }\n @if (showPercent()) {\n <span class=\"tx-segmented-bar__percent\" [class]=\"parts.percent?.class\" [style]=\"parts.percent?.style\">{{ segment.percent }}</span>\n }\n </span>\n }\n <span class=\"tx-segmented-bar__aside\" [class]=\"parts.aside?.class\" [style]=\"parts.aside?.style\"><ng-content /></span>\n </div>\n}\n"],"mappings":";;;;;;;;AAMA,SAAgB,qBACd,OACA,QACA,gBAAuC,QAAM;CAE7C,MAAM,OAAO,SAAS,CAAA;CACtB,MAAM,YAAY,UAAmB,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,IAAI;CACnF,MAAM,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packages/charts/segmented-bar/src/segmented-bar-segments.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.icons.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.theme.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.component.ts","../../../../packages/charts/segmented-bar/src/segmented-bar.component.html"],"sourcesContent":["import { TxChartValueFormatter } from '@tectra-ng/charts/core';\nimport { TxSegmentedBarItem, TxSegmentedBarSegment } from './segmented-bar.types';\n\n/**\n * Turns items into segments with shares and formatted value and percent texts; `percentFormat` defaults to `format`.\n */\nexport function segmentedBarSegments(\n items: readonly TxSegmentedBarItem[] | null | undefined,\n format: TxChartValueFormatter,\n percentFormat: TxChartValueFormatter = format,\n): TxSegmentedBarSegment[] {\n const list = items ?? [];\n const positive = (value: number) => (Number.isFinite(value) ? Math.max(value, 0) : 0);\n const total = list.reduce((sum, item) => sum + positive(item.value), 0);\n return list.map((item) => {\n const value = positive(item.value);\n const share = total ? (value / total) * 100 : 0;\n return {\n key: item.key,\n label: item.label,\n raw: value,\n value: format(value),\n share,\n percent: `${percentFormat(Math.round(share * 10) / 10)}%`,\n tone: item.tone ?? 'primary',\n isEmpty: value === 0,\n };\n });\n}\n","import { TxIconSet, txIconDot, txIconInfo, txIconList } from '@tectra-ng/icons';\n\nexport const SEGMENTED_BAR_ICON_DEFAULTS: TxIconSet = {\n dot: txIconDot,\n info: txIconInfo,\n list: txIconList,\n};\n","import { chartTokens } from '@tectra-ng/themes';\n\nexport const SEGMENTED_BAR_THEME = {\n chart: chartTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { TxChartValueFormat, chartNumberFormatter } from '@tectra-ng/charts/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraChartTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxSkeleton } from '@tectra-ng/ui/skeleton';\nimport { segmentedBarSegments } from './segmented-bar-segments';\nimport { TxSegmentedBarItem, TxSegmentedBarPart, TxSegmentedBarSize } from './segmented-bar.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { SEGMENTED_BAR_ICON_DEFAULTS } from './segmented-bar.icons';\nimport { SEGMENTED_BAR_THEME } from './segmented-bar.theme';\n\nconst LEGEND_SKELETONS = 3;\n\n@Component({\n selector: 'tx-segmented-bar',\n imports: [TxSkeleton],\n templateUrl: './segmented-bar.component.html',\n styleUrl: './segmented-bar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-segmented-bar',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[class.tx-segmented-bar--mono]': 'monoLabels()',\n '[class.tx-segmented-bar--loading]': 'loading()',\n '[attr.aria-busy]': 'loading() || null',\n },\n viewProviders: [provideTxIconDefaults(SEGMENTED_BAR_ICON_DEFAULTS)],\n})\nexport class TxSegmentedBar {\n private readonly segmentedBarTheme = injectTokens(SEGMENTED_BAR_THEME);\n\n private locale = inject(TxLocaleService);\n readonly translations = injectTranslations();\n\n readonly items = input<readonly TxSegmentedBarItem[] | null | undefined>([]);\n readonly size = input<TxSegmentedBarSize>('small');\n readonly showLegend = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly showValue = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly showPercent = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly hideEmptyInLegend = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly monoLabels = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly valueFormat = input<TxChartValueFormat>('number');\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input('');\n readonly dt = input<TectraDeepPartial<TectraChartTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxSegmentedBarPart, TxSegmentedBar> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('segmentedBar', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-chart'), ...this.passThrough().root?.style }));\n\n private readonly intl = computed(() => this.locale.locale().intl);\n readonly segments = computed(() =>\n segmentedBarSegments(this.items(), chartNumberFormatter(this.intl(), this.valueFormat()), chartNumberFormatter(this.intl())),\n );\n readonly barSegments = computed(() => this.segments().filter((segment) => !segment.isEmpty));\n readonly legendSegments = computed(() => (this.hideEmptyInLegend() ? this.barSegments() : this.segments()));\n readonly skeletonItems = computed(() => Array.from({ length: Math.min(LEGEND_SKELETONS, this.segments().length || LEGEND_SKELETONS) }, (_, index) => index));\n readonly summary = computed(() => {\n const parts = this.segments().map((segment) => `${segment.label}: ${segment.value} (${segment.percent})`);\n return [this.ariaLabel(), ...parts].filter(Boolean).join(', ');\n });\n}\n","@let parts = passThrough();\n@if (loading()) {\n <div class=\"tx-segmented-bar__track\" [class]=\"parts.track?.class\" [style]=\"parts.track?.style\" role=\"img\" [attr.aria-label]=\"translations().chartLoading\">\n <tx-skeleton class=\"tx-segmented-bar__skeleton\" [class]=\"parts.skeleton?.class\" [style]=\"parts.skeleton?.style\" width=\"100%\" height=\"100%\" borderRadius=\"inherit\" />\n </div>\n @if (showLegend()) {\n <div class=\"tx-segmented-bar__legend\" [class]=\"parts.legend?.class\" [style]=\"parts.legend?.style\" aria-hidden=\"true\">\n @for (index of skeletonItems(); track index) {\n <span class=\"tx-segmented-bar__legend-item\" [class]=\"parts.legendItem?.class\" [style]=\"parts.legendItem?.style\">\n <tx-skeleton class=\"tx-segmented-bar__legend-skeleton\" [class]=\"parts.skeleton?.class\" [style]=\"parts.skeleton?.style\" width=\"5em\" height=\"1lh\" />\n </span>\n }\n </div>\n }\n} @else {\n <div\n class=\"tx-segmented-bar__track\"\n [class]=\"parts.track?.class\"\n [style]=\"parts.track?.style\"\n [attr.role]=\"showLegend() ? null : 'img'\"\n [attr.aria-label]=\"showLegend() ? null : summary()\"\n [attr.aria-hidden]=\"showLegend() || null\"\n >\n @for (segment of barSegments(); track segment.key) {\n <span\n class=\"tx-segmented-bar__segment\"\n [class]=\"parts.segment?.class\"\n [style]=\"parts.segment?.style\"\n [attr.data-tone]=\"segment.tone\"\n [style.width.%]=\"segment.share\"\n [title]=\"segment.label + ': ' + segment.value\"\n >\n @if (size() === 'large') {\n {{ segment.percent }}\n }\n </span>\n }\n </div>\n\n @if (showLegend()) {\n <div class=\"tx-segmented-bar__legend\" [class]=\"parts.legend?.class\" [style]=\"parts.legend?.style\" role=\"list\" [attr.aria-label]=\"ariaLabel() || null\">\n @for (segment of legendSegments(); track segment.key) {\n <span\n class=\"tx-segmented-bar__legend-item\"\n [class]=\"parts.legendItem?.class\"\n [style]=\"parts.legendItem?.style\"\n [attr.data-tone]=\"segment.tone\"\n role=\"listitem\"\n >\n <span class=\"tx-segmented-bar__dot\" [class]=\"parts.dot?.class\" [style]=\"parts.dot?.style\" aria-hidden=\"true\"></span>\n <span class=\"tx-segmented-bar__label\" [class]=\"parts.label?.class\" [style]=\"parts.label?.style\">{{ segment.label }}</span>\n @if (showValue()) {\n <span class=\"tx-segmented-bar__value\" [class]=\"parts.value?.class\" [style]=\"parts.value?.style\">{{ segment.value }}</span>\n }\n @if (showPercent()) {\n <span class=\"tx-segmented-bar__percent\" [class]=\"parts.percent?.class\" [style]=\"parts.percent?.style\">{{ segment.percent }}</span>\n }\n </span>\n }\n <span class=\"tx-segmented-bar__aside\" [class]=\"parts.aside?.class\" [style]=\"parts.aside?.style\"><ng-content /></span>\n </div>\n }\n}\n"],"mappings":";;;;;;;;;AAMA,SAAgB,qBACd,OACA,QACA,gBAAuC,QAAM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A;IAAA,kBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UCjC3B;EA+DA,QAAA,CAAA,+/JAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MD9CY;GAAU,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;EAAA,eAcL,CAAC,sBAAsB,2BAA2B,CAAC;EAAC,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAExD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAlB1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAkB,SACnB,CAAC,UAAU;GAAC,iBAGJ,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,oBAAoB;IACpB,kCAAkC;IAClC,qCAAqC;IACrC,oBAAoB;GACrB;GAAA,eACc,CAAC,sBAAsB,2BAA2B,CAAC;GAAC,UAAA;GAAA,QAAA,CAAA,+/JAAA;EAAA,CAAA"}
|
|
@@ -73,6 +73,30 @@ function sunburstArcAt(arcs, x, y, cx, cy) {
|
|
|
73
73
|
if (angle < 0) angle += TX_FULL_CIRCLE;
|
|
74
74
|
return arcs.find((arc) => distance >= arc.inner && distance <= arc.outer && angle >= arc.start && angle < arc.end) ?? null;
|
|
75
75
|
}
|
|
76
|
+
function sunburstLabelFits(arc, box, cx, cy, padding = 1) {
|
|
77
|
+
const halfWidth = box.width / 2 + padding;
|
|
78
|
+
const halfHeight = box.height / 2 + padding;
|
|
79
|
+
const fullCircle = arc.end - arc.start >= TX_FULL_CIRCLE - 1e-9;
|
|
80
|
+
const steps = 6;
|
|
81
|
+
for (let step = 0; step <= steps; step++) {
|
|
82
|
+
const along = -1 + 2 * step / steps;
|
|
83
|
+
const points = [
|
|
84
|
+
[box.x + along * halfWidth, box.y - halfHeight],
|
|
85
|
+
[box.x + along * halfWidth, box.y + halfHeight],
|
|
86
|
+
[box.x - halfWidth, box.y + along * halfHeight],
|
|
87
|
+
[box.x + halfWidth, box.y + along * halfHeight]
|
|
88
|
+
];
|
|
89
|
+
for (const [px, py] of points) {
|
|
90
|
+
const distance = Math.hypot(px - cx, py - cy);
|
|
91
|
+
if (distance < arc.inner || distance > arc.outer) return false;
|
|
92
|
+
if (fullCircle) continue;
|
|
93
|
+
let angle = Math.atan2(px - cx, -(py - cy));
|
|
94
|
+
if (angle < 0) angle += TX_FULL_CIRCLE;
|
|
95
|
+
if (angle < arc.start || angle > arc.end) return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
76
100
|
const SUNBURST_ICON_DEFAULTS = { "chart-pie": txIconChartPie };
|
|
77
101
|
const SUNBURST_THEME = { chart: chartTokens };
|
|
78
102
|
const DEFAULTS = {
|
|
@@ -180,8 +204,12 @@ var TxSunburstChart = class TxSunburstChart {
|
|
|
180
204
|
const middle = (arc.start + arc.end) / 2;
|
|
181
205
|
const radius = (arc.inner + arc.outer) / 2;
|
|
182
206
|
const at = polar(cx, cy, radius, middle);
|
|
183
|
-
const
|
|
184
|
-
|
|
207
|
+
const fits = this.showLabels() && sunburstLabelFits(arc, {
|
|
208
|
+
x: at.x,
|
|
209
|
+
y: at.y,
|
|
210
|
+
width: textWidth(arc.label, fontSize),
|
|
211
|
+
height: fontSize
|
|
212
|
+
}, cx, cy);
|
|
185
213
|
return {
|
|
186
214
|
...arc,
|
|
187
215
|
d: arcPath(cx, cy, arc.inner, arc.outer, arc.start, arc.end, corner),
|
|
@@ -734,6 +762,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
734
762
|
}]
|
|
735
763
|
}
|
|
736
764
|
});
|
|
737
|
-
export { TxSunburstChart, sunburstArcAt, sunburstArcs, sunburstFocus, sunburstValue };
|
|
765
|
+
export { TxSunburstChart, sunburstArcAt, sunburstArcs, sunburstFocus, sunburstLabelFits, sunburstValue };
|
|
738
766
|
|
|
739
767
|
//# sourceMappingURL=tectra-ng-charts-sunburst.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-charts-sunburst.mjs","names":[],"sources":["../../../../packages/charts/sunburst/src/sunburst-layout.ts","../../../../packages/charts/sunburst/src/sunburst.icons.ts","../../../../packages/charts/sunburst/src/sunburst.theme.ts","../../../../packages/charts/sunburst/src/sunburst-chart.component.ts","../../../../packages/charts/sunburst/src/sunburst-chart.component.html"],"sourcesContent":["import { TX_FULL_CIRCLE, seriesColor } from '@tectra-ng/charts/core';\nimport { TxSunburstArc, TxSunburstItem } from './sunburst-chart.types';\n\n/** Value of an item: its own value, or the sum of its children when it has none. */\nexport function sunburstValue(item: TxSunburstItem): number {\n const own = item.value !== null && item.value !== undefined && Number.isFinite(item.value) ? Math.max(0, item.value) : null;\n const children = (item.children ?? []).reduce((sum, child) => sum + sunburstValue(child), 0);\n return own ?? children;\n}\n\n/** Slices shown after zooming into an index path, and the items along that path. */\nexport function sunburstFocus(roots: readonly TxSunburstItem[], path: readonly number[]): { items: readonly TxSunburstItem[]; trail: TxSunburstItem[] } {\n let items = roots;\n const trail: TxSunburstItem[] = [];\n for (const index of path) {\n const item = items[index];\n if (!item) break;\n trail.push(item);\n items = item.children ?? [];\n }\n return { items, trail };\n}\n\n/** Settings of `sunburstArcs`. */\nexport interface TxSunburstOptions {\n /** Number of rings drawn. */\n levels: number;\n /** Outer radius, in px. */\n radius: number;\n /** Size of the empty centre as a share of the radius, 0 to 0.9. */\n hole: number;\n /** Index path of the slice zoomed into; empty shows the top level. */\n focus: readonly number[];\n}\n\n/** Lays out the visible rings of a sunburst as arcs; slices without a positive value are skipped. */\nexport function sunburstArcs(roots: readonly TxSunburstItem[], options: TxSunburstOptions): TxSunburstArc[] {\n const { items, trail } = sunburstFocus(roots, options.focus);\n const levels = Math.max(1, Math.floor(options.levels));\n const inner = options.radius * Math.min(0.9, Math.max(0, options.hole));\n const ring = (options.radius - inner) / levels;\n const sum = items.reduce((acc, item) => acc + sunburstValue(item), 0);\n const focused = trail[trail.length - 1];\n const total = focused ? Math.max(sunburstValue(focused), sum) : sum;\n const arcs: TxSunburstArc[] = [];\n const topIndex = options.focus[0];\n const inherited = trail.reduce<string | undefined>((color, item) => item.color ?? color, undefined);\n\n const walk = (list: readonly TxSunburstItem[], path: number[], start: number, span: number, depth: number, parentValue: number, color: string | undefined) => {\n let cursor = start;\n list.forEach((item, index) => {\n const value = sunburstValue(item);\n if (value <= 0) return;\n const sweep = parentValue > 0 ? (value / parentValue) * span : 0;\n const itemPath = [...path, index];\n const base = item.color ?? color ?? seriesColor(undefined, topIndex ?? itemPath[0]);\n arcs.push({\n key: itemPath.join('.'),\n path: itemPath,\n item,\n label: item.label,\n value,\n depth,\n start: cursor,\n end: cursor + sweep,\n inner: inner + (depth - 1) * ring,\n outer: inner + depth * ring,\n base,\n share: total ? value / total : 0,\n parentShare: parentValue ? value / parentValue : 0,\n hasChildren: !!item.children?.some((child) => sunburstValue(child) > 0),\n });\n if (depth < levels && item.children?.length) {\n walk(item.children, itemPath, cursor, sweep, depth + 1, Math.max(value, (item.children ?? []).reduce((sum, child) => sum + sunburstValue(child), 0)), item.color ?? color ?? base);\n }\n cursor += sweep;\n });\n };\n walk(items, [...options.focus], 0, TX_FULL_CIRCLE, 1, total, inherited);\n return arcs;\n}\n\n/** The arc under a point, or `null` outside all arcs. */\nexport function sunburstArcAt(arcs: readonly TxSunburstArc[], x: number, y: number, cx: number, cy: number): TxSunburstArc | null {\n const distance = Math.hypot(x - cx, y - cy);\n let angle = Math.atan2(x - cx, -(y - cy));\n if (angle < 0) angle += TX_FULL_CIRCLE;\n return arcs.find((arc) => distance >= arc.inner && distance <= arc.outer && angle >= arc.start && angle < arc.end) ?? null;\n}\n","import { TxIconSet, txIconChartPie } from '@tectra-ng/icons';\n\nexport const SUNBURST_ICON_DEFAULTS: TxIconSet = {\n 'chart-pie': txIconChartPie,\n};\n","import { chartTokens } from '@tectra-ng/themes';\n\nexport const SUNBURST_THEME = {\n chart: chartTokens,\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n TxChartFrame,\n TxChartHeight,\n TxChartPointerEvent,\n TxChartTooltipData,\n TxChartTooltipPlacement,\n TxChartTooltipTemplate,\n TxChartValueFormat,\n arcPath,\n chartNumberFormatter,\n initialChartSize,\n injectChartEntrance,\n polar,\n readTokenNumber,\n textWidth,\n} from '@tectra-ng/charts/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraChartTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { sunburstArcAt, sunburstArcs, sunburstFocus, sunburstValue } from './sunburst-layout';\nimport { TxSunburstArc, TxSunburstChartPart, TxSunburstEvent, TxSunburstItem } from './sunburst-chart.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { SUNBURST_ICON_DEFAULTS } from './sunburst.icons';\nimport { SUNBURST_THEME } from './sunburst.theme';\n\nconst DEFAULTS = { hole: 0.3, corner: 3, fontSize: 11 };\nconst PADDING = 6;\nconst CENTER = 'center';\n\n@Component({\n selector: 'tx-sunburst-chart',\n imports: [TxChartFrame],\n templateUrl: './sunburst-chart.component.html',\n styleUrl: './sunburst-chart.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-sunburst-chart',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-sunburst-chart--fill]': 'typeof height() === \"string\"',\n '[class.tx-sunburst-chart--entering]': 'entrance.active()',\n '[class.tx-sunburst-chart--active]': 'activeArc() !== null',\n },\n viewProviders: [provideTxIconDefaults(SUNBURST_ICON_DEFAULTS)],\n})\nexport class TxSunburstChart {\n private readonly sunburstTheme = injectTokens(SUNBURST_THEME);\n\n private locale = inject(TxLocaleService);\n private host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly translations = injectTranslations();\n\n readonly data = input<TxSunburstItem | readonly TxSunburstItem[] | null | undefined>([]);\n readonly levels = input(3);\n readonly height = input<TxChartHeight>(380);\n readonly showLabels = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly showTooltip = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly drill = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly totalLabel = input('');\n readonly valueFormat = input<TxChartValueFormat>('number');\n readonly toolbar = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input('');\n readonly dt = input<TectraDeepPartial<TectraChartTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxSunburstChartPart, TxSunburstChart> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly segmentClick = output<TxSunburstEvent>();\n readonly focusChange = output<string[]>();\n\n readonly tooltipTemplate = contentChild(TxChartTooltipTemplate);\n private readonly frame = viewChild(TxChartFrame);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('sunburstChart', this, this.pt, this.ptOptions);\n readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-chart'));\n readonly hostStyle = computed(() => ({ ...this.tokenStyle(), ...this.passThrough().root?.style }));\n readonly entrance = injectChartEntrance();\n readonly geometry = signal(DEFAULTS);\n\n private readonly intl = computed(() => this.locale.locale().intl);\n readonly roots = computed<readonly TxSunburstItem[]>(() => {\n const data = this.data();\n return !data ? [] : Array.isArray(data) ? data : [data as TxSunburstItem];\n });\n readonly focus = linkedSignal<readonly TxSunburstItem[], number[]>({ source: this.roots, computation: () => [] });\n readonly active = signal<string | null>(null);\n readonly size = linkedSignal(() => initialChartSize(this.height(), null, undefined, this.toolbar()));\n readonly isEmpty = computed(() => !this.roots().some((item) => sunburstValue(item) > 0));\n\n readonly fit = computed(() => {\n const { width, height } = this.size();\n return { cx: width / 2, cy: height / 2, radius: Math.max(10, Math.min(width, height) / 2 - PADDING) };\n });\n\n readonly arcs = computed(() => sunburstArcs(this.roots(), { levels: this.levels(), radius: this.fit().radius, hole: this.geometry().hole, focus: this.focus() }));\n readonly inner = computed(() => this.fit().radius * Math.min(0.9, Math.max(0, this.geometry().hole)));\n readonly holeRadius = computed(() => Math.max(0, this.inner() - 2));\n readonly trail = computed(() => sunburstFocus(this.roots(), this.focus()).trail);\n readonly activeArc = computed(() => {\n const key = this.active();\n return key && key !== CENTER ? (this.arcs().find((arc) => arc.key === key) ?? null) : null;\n });\n\n readonly valueFormatter = computed(() => chartNumberFormatter(this.intl(), this.valueFormat()));\n readonly percentFormatter = computed(() => {\n const format = chartNumberFormatter(this.intl(), 'percent');\n return (share: number) => format(Number((share * 100).toFixed(1)));\n });\n\n readonly segments = computed(() => {\n const { cx, cy } = this.fit();\n const corner = this.geometry().corner;\n const fontSize = this.geometry().fontSize;\n return this.arcs().map((arc) => {\n const middle = (arc.start + arc.end) / 2;\n const radius = (arc.inner + arc.outer) / 2;\n const at = polar(cx, cy, radius, middle);\n const room = (arc.end - arc.start) * radius;\n const fits = this.showLabels() && room >= textWidth(arc.label, fontSize) + 8 && arc.outer - arc.inner >= fontSize + 6;\n return {\n ...arc,\n d: arcPath(cx, cy, arc.inner, arc.outer, arc.start, arc.end, corner),\n fill: arc.depth > 1 ? `color-mix(in srgb, ${arc.base} calc(100% - ${arc.depth - 1} * var(--tx-chart-sunburst-level-fade, 22%)), var(--tx-chart-sunburst-fade-base, transparent))` : arc.base,\n labelX: at.x,\n labelY: at.y,\n text: fits ? arc.label : null,\n };\n });\n });\n\n readonly center = computed(() => {\n const t = this.translations();\n const trail = this.trail();\n const focused = trail[trail.length - 1];\n const value = focused ? sunburstValue(focused) : this.roots().reduce((sum, item) => sum + sunburstValue(item), 0);\n return { label: focused?.label ?? (this.totalLabel() || t.chartTotal), value: this.valueFormatter()(value), canGoUp: trail.length > 0 && this.drill() };\n });\n\n readonly centerFont = computed(() => {\n const inner = this.inner();\n return { value: Math.max(12, Math.min(24, inner * 0.32)), label: Math.max(10, Math.min(13, inner * 0.17)) };\n });\n\n readonly tooltip = computed<TxChartTooltipData | null>(() => {\n const arc = this.activeArc();\n if (!arc || !this.showTooltip()) return null;\n const t = this.translations();\n const { cx, cy } = this.fit();\n const middle = (arc.start + arc.end) / 2;\n const at = polar(cx, cy, arc.outer + 2, middle);\n const sin = Math.sin(middle);\n const cos = Math.cos(middle);\n const placement: TxChartTooltipPlacement = Math.abs(sin) >= Math.SQRT1_2 ? (sin > 0 ? 'right' : 'left') : cos > 0 ? 'top' : 'bottom';\n const names = this.names(arc.path);\n return {\n title: names.slice(0, -1).join(' / '),\n rows: [\n { label: arc.label, value: this.valueFormatter()(arc.value), color: arc.base, raw: arc.value, seriesIndex: 0, active: true },\n ...(arc.depth > 1 || this.focus().length ? [{ label: t.chartOfParent, value: this.percentFormatter()(arc.parentShare), color: 'transparent', raw: arc.parentShare, seriesIndex: 1 }] : []),\n { label: t.chartOfTotal, value: this.percentFormatter()(arc.share), color: 'transparent', raw: arc.share, seriesIndex: 2 },\n ],\n index: 0,\n x: at.x,\n y: at.y,\n placement,\n };\n });\n\n readonly summary = computed(() => {\n const t = this.translations();\n const top = this.arcs().filter((arc) => arc.depth === 1);\n const parts = top.map((arc) => `${arc.label} ${this.percentFormatter()(arc.share)}`);\n const text = `${t.chartSunburst}, ${this.center().label} ${this.center().value}: ${parts.join(', ')}`;\n return this.ariaLabel() ? `${this.ariaLabel()}. ${text}` : text;\n });\n\n readonly dataTable = computed(() => {\n const t = this.translations();\n return {\n columns: [\n { key: 'value', label: t.chartValue },\n { key: 'share', label: t.chartOfTotal },\n ],\n rows: this.arcs().map((arc) => ({ label: this.names(arc.path).join(' / '), cells: [this.valueFormatter()(arc.value), this.percentFormatter()(arc.share)] })),\n };\n });\n\n constructor() {\n afterRenderEffect(() => {\n this.dt();\n this.readGeometry();\n });\n }\n\n isLit(key: string): boolean {\n const active = this.activeArc();\n return !active || active.key === key || active.key.startsWith(`${key}.`);\n }\n\n onPointer(event: TxChartPointerEvent): void {\n if (event.type === 'leave') {\n this.active.set(null);\n return;\n }\n const { cx, cy } = this.fit();\n const inCenter = Math.hypot(event.x - cx, event.y - cy) < this.inner();\n const arc = inCenter ? null : sunburstArcAt(this.arcs(), event.x, event.y, cx, cy);\n this.active.set(inCenter && this.center().canGoUp ? CENTER : (arc?.key ?? null));\n if (event.type !== 'click') return;\n if (inCenter) this.up();\n else if (arc) this.select(arc);\n }\n\n onNavigate(event: KeyboardEvent): void {\n const arcs = this.arcs();\n if (!arcs.length) return;\n const current = this.activeArc();\n if (event.key === 'Escape' || event.key === 'Backspace') {\n if (current) this.active.set(null);\n else this.up();\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n if (current) this.select(current);\n return;\n }\n let next: TxSunburstArc | undefined;\n if (!current) {\n next = arcs.find((arc) => arc.depth === 1);\n } else if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {\n const siblings = arcs.filter((arc) => arc.depth === current.depth && arc.path.slice(0, -1).join('.') === current.path.slice(0, -1).join('.'));\n const at = siblings.indexOf(current);\n next = siblings[(at + (event.key === 'ArrowRight' ? 1 : -1) + siblings.length) % siblings.length];\n } else if (event.key === 'ArrowDown') {\n next = arcs.find((arc) => arc.depth === current.depth + 1 && arc.key.startsWith(`${current.key}.`)) ?? current;\n } else if (event.key === 'ArrowUp') {\n next = arcs.find((arc) => arc.key === current.path.slice(0, -1).join('.')) ?? current;\n } else if (event.key === 'Home' || event.key === 'End') {\n const top = arcs.filter((arc) => arc.depth === 1);\n next = event.key === 'Home' ? top[0] : top[top.length - 1];\n }\n if (!next) return;\n this.active.set(next.key);\n this.frame()?.announce(`${this.names(next.path).join(' / ')}: ${this.valueFormatter()(next.value)}, ${this.percentFormatter()(next.share)}`);\n }\n\n up(): void {\n if (!this.focus().length || !this.drill()) return;\n this.focus.update((path) => path.slice(0, -1));\n this.afterDrill();\n }\n\n private select(arc: TxSunburstArc): void {\n this.segmentClick.emit({ path: this.names(arc.path), value: arc.value, item: arc.item });\n if (!this.drill() || !arc.hasChildren) return;\n this.focus.set(arc.path);\n this.afterDrill();\n }\n\n private afterDrill(): void {\n this.active.set(null);\n this.entrance.play();\n const names = this.names(this.focus());\n this.focusChange.emit(names);\n this.frame()?.announce(names.length ? names.join(' / ') : this.center().label);\n }\n\n private names(path: readonly number[]): string[] {\n const names: string[] = [];\n let items = this.roots();\n for (const index of path) {\n const item = items[index];\n if (!item) break;\n names.push(item.label);\n items = item.children ?? [];\n }\n return names;\n }\n\n private readGeometry(): void {\n const element = this.host.nativeElement;\n const next = {\n hole: readTokenNumber(element, '--tx-chart-sunburst-hole', DEFAULTS.hole),\n corner: this.isUnstyled() ? 0 : readTokenNumber(element, '--tx-chart-sunburst-corner-radius', DEFAULTS.corner),\n fontSize: readTokenNumber(element, '--tx-chart-sunburst-label-font-size', DEFAULTS.fontSize),\n };\n const current = this.geometry();\n if (current.hole !== next.hole || current.corner !== next.corner || current.fontSize !== next.fontSize) this.geometry.set(next);\n }\n}\n","<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [showLegend]=\"false\"\n actionKeys\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n [toolbar]=\"toolbar()\"\n [exportName]=\"ariaLabel()\"\n emptyIcon=\"chart-pie\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g class=\"tx-sunburst-chart__segments\" [style.transform-origin]=\"fit().cx + 'px ' + fit().cy + 'px'\">\n @for (segment of segments(); track segment.key) {\n <svg:path\n class=\"tx-sunburst-chart__segment\"\n [class.tx-sunburst-chart__segment--lit]=\"isLit(segment.key)\"\n [class.tx-sunburst-chart__segment--drill]=\"segment.hasChildren && drill()\"\n [class]=\"passThrough().segment?.class\"\n [style]=\"passThrough().segment?.style\"\n [attr.data-key]=\"segment.key\"\n [attr.data-depth]=\"segment.depth\"\n [attr.d]=\"segment.d\"\n [style.fill]=\"segment.fill\"\n />\n }\n </svg:g>\n @if (showLabels()) {\n <svg:g class=\"tx-sunburst-chart__labels\">\n @for (segment of segments(); track segment.key) {\n @if (segment.text) {\n <svg:text\n class=\"tx-sunburst-chart__label\"\n [class]=\"passThrough().label?.class\"\n [style]=\"passThrough().label?.style\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n [attr.x]=\"segment.labelX\"\n [attr.y]=\"segment.labelY\"\n >\n {{ segment.text }}\n </svg:text>\n }\n }\n </svg:g>\n }\n <svg:g\n class=\"tx-sunburst-chart__center\"\n [class.tx-sunburst-chart__center--up]=\"center().canGoUp\"\n [class.tx-sunburst-chart__center--hover]=\"active() === 'center'\"\n [class]=\"passThrough().center?.class\"\n [style]=\"passThrough().center?.style\"\n >\n <svg:circle class=\"tx-sunburst-chart__hole\" [attr.cx]=\"fit().cx\" [attr.cy]=\"fit().cy\" [attr.r]=\"holeRadius()\" />\n @if (center().canGoUp) {\n <svg:path\n class=\"tx-sunburst-chart__back\"\n [attr.d]=\"'M' + (fit().cx - 4) + ',' + (fit().cy - centerFont().value * 0.95 - 4) + 'l4,-4l4,4'\"\n />\n }\n <svg:text\n class=\"tx-sunburst-chart__center-value\"\n text-anchor=\"middle\"\n [attr.x]=\"fit().cx\"\n [attr.y]=\"fit().cy + centerFont().value * 0.3 - centerFont().label * 0.55\"\n [style.font-size.px]=\"centerFont().value\"\n >\n {{ center().value }}\n </svg:text>\n <svg:text\n class=\"tx-sunburst-chart__center-label\"\n text-anchor=\"middle\"\n dominant-baseline=\"hanging\"\n [attr.x]=\"fit().cx\"\n [attr.y]=\"fit().cy + centerFont().value * 0.3 - centerFont().label * 0.55 + 6\"\n [style.font-size.px]=\"centerFont().label\"\n >\n {{ center().label }}\n </svg:text>\n </svg:g>\n</tx-chart-frame>\n"],"mappings":";;;;;;;;AAIA,SAAgB,cAAc,MAAoB;CAChD,MAAM,MAAM,KAAK,UAAU,QAAQ,KAAK,UAAU,UAAa,OAAO,SAAS,KAAK,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,KAAK,IAAI;CACvH,MAAM,YAAY,KAAK,YAAY,CAAA,EAAA,CAAI,QAAQ,KAAK,UAAU,MAAM,cAAc,KAAK,GAAG,CAAC;CAC3F,OAAO,OAAO;AAChB;AAGA,SAAgB,cAAc,OAAkC,MAAuB;CACrF,IAAI,QAAQ;CACZ,MAAM,QAA0B,CAAA;CAChC,KAAK,MAAM,SAAS,MAAM;EACxB,MAAM,OAAO,MAAM;EACnB,IAAI,CAAC,MAAM;EACX,MAAM,KAAK,IAAI;EACf,QAAQ,KAAK,YAAY,CAAA;CAC3B;CACA,OAAO;EAAE;EAAO;CAAK;AACvB;AAeA,SAAgB,aAAa,OAAkC,SAA0B;CACvF,MAAM,EAAE,OAAO,UAAU,cAAc,OAAO,QAAQ,KAAK;CAC3D,MAAM,SAAS,KAAK,IAAI,GAAG,KAAK,MAAM,QAAQ,MAAM,CAAC;CACrD,MAAM,QAAQ,QAAQ,SAAS,KAAK,IAAI,IAAK,KAAK,IAAI,GAAG,QAAQ,IAAI,CAAC;CACtE,MAAM,QAAQ,QAAQ,SAAS,SAAS;CACxC,MAAM,MAAM,MAAM,QAAQ,KAAK,SAAS,MAAM,cAAc,IAAI,GAAG,CA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AA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,iBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,sBAAsB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAC3B,YAAY,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-charts-sunburst.mjs","names":[],"sources":["../../../../packages/charts/sunburst/src/sunburst-layout.ts","../../../../packages/charts/sunburst/src/sunburst.icons.ts","../../../../packages/charts/sunburst/src/sunburst.theme.ts","../../../../packages/charts/sunburst/src/sunburst-chart.component.ts","../../../../packages/charts/sunburst/src/sunburst-chart.component.html"],"sourcesContent":["import { TX_FULL_CIRCLE, seriesColor } from '@tectra-ng/charts/core';\nimport { TxSunburstArc, TxSunburstItem } from './sunburst-chart.types';\n\n/** Value of an item: its own value, or the sum of its children when it has none. */\nexport function sunburstValue(item: TxSunburstItem): number {\n const own = item.value !== null && item.value !== undefined && Number.isFinite(item.value) ? Math.max(0, item.value) : null;\n const children = (item.children ?? []).reduce((sum, child) => sum + sunburstValue(child), 0);\n return own ?? children;\n}\n\n/** Slices shown after zooming into an index path, and the items along that path. */\nexport function sunburstFocus(roots: readonly TxSunburstItem[], path: readonly number[]): { items: readonly TxSunburstItem[]; trail: TxSunburstItem[] } {\n let items = roots;\n const trail: TxSunburstItem[] = [];\n for (const index of path) {\n const item = items[index];\n if (!item) break;\n trail.push(item);\n items = item.children ?? [];\n }\n return { items, trail };\n}\n\n/** Settings of `sunburstArcs`. */\nexport interface TxSunburstOptions {\n /** Number of rings drawn. */\n levels: number;\n /** Outer radius, in px. */\n radius: number;\n /** Size of the empty centre as a share of the radius, 0 to 0.9. */\n hole: number;\n /** Index path of the slice zoomed into; empty shows the top level. */\n focus: readonly number[];\n}\n\n/** Lays out the visible rings of a sunburst as arcs; slices without a positive value are skipped. */\nexport function sunburstArcs(roots: readonly TxSunburstItem[], options: TxSunburstOptions): TxSunburstArc[] {\n const { items, trail } = sunburstFocus(roots, options.focus);\n const levels = Math.max(1, Math.floor(options.levels));\n const inner = options.radius * Math.min(0.9, Math.max(0, options.hole));\n const ring = (options.radius - inner) / levels;\n const sum = items.reduce((acc, item) => acc + sunburstValue(item), 0);\n const focused = trail[trail.length - 1];\n const total = focused ? Math.max(sunburstValue(focused), sum) : sum;\n const arcs: TxSunburstArc[] = [];\n const topIndex = options.focus[0];\n const inherited = trail.reduce<string | undefined>((color, item) => item.color ?? color, undefined);\n\n const walk = (list: readonly TxSunburstItem[], path: number[], start: number, span: number, depth: number, parentValue: number, color: string | undefined) => {\n let cursor = start;\n list.forEach((item, index) => {\n const value = sunburstValue(item);\n if (value <= 0) return;\n const sweep = parentValue > 0 ? (value / parentValue) * span : 0;\n const itemPath = [...path, index];\n const base = item.color ?? color ?? seriesColor(undefined, topIndex ?? itemPath[0]);\n arcs.push({\n key: itemPath.join('.'),\n path: itemPath,\n item,\n label: item.label,\n value,\n depth,\n start: cursor,\n end: cursor + sweep,\n inner: inner + (depth - 1) * ring,\n outer: inner + depth * ring,\n base,\n share: total ? value / total : 0,\n parentShare: parentValue ? value / parentValue : 0,\n hasChildren: !!item.children?.some((child) => sunburstValue(child) > 0),\n });\n if (depth < levels && item.children?.length) {\n walk(item.children, itemPath, cursor, sweep, depth + 1, Math.max(value, (item.children ?? []).reduce((sum, child) => sum + sunburstValue(child), 0)), item.color ?? color ?? base);\n }\n cursor += sweep;\n });\n };\n walk(items, [...options.focus], 0, TX_FULL_CIRCLE, 1, total, inherited);\n return arcs;\n}\n\n/** The arc under a point, or `null` outside all arcs. */\nexport function sunburstArcAt(arcs: readonly TxSunburstArc[], x: number, y: number, cx: number, cy: number): TxSunburstArc | null {\n const distance = Math.hypot(x - cx, y - cy);\n let angle = Math.atan2(x - cx, -(y - cy));\n if (angle < 0) angle += TX_FULL_CIRCLE;\n return arcs.find((arc) => distance >= arc.inner && distance <= arc.outer && angle >= arc.start && angle < arc.end) ?? null;\n}\n\n/**\n * Tells whether a horizontal label box of `width` × `height` centred at (`x`, `y`) lies inside an arc, keeping `padding`\n * px from its edges; points along the box outline are checked against both radii and both angles.\n */\nexport function sunburstLabelFits(\n arc: Pick<TxSunburstArc, 'start' | 'end' | 'inner' | 'outer'>,\n box: { x: number; y: number; width: number; height: number },\n cx: number,\n cy: number,\n padding = 1,\n): boolean {\n const halfWidth = box.width / 2 + padding;\n const halfHeight = box.height / 2 + padding;\n const fullCircle = arc.end - arc.start >= TX_FULL_CIRCLE - 1e-9;\n const steps = 6;\n for (let step = 0; step <= steps; step++) {\n const along = -1 + (2 * step) / steps;\n const points = [\n [box.x + along * halfWidth, box.y - halfHeight],\n [box.x + along * halfWidth, box.y + halfHeight],\n [box.x - halfWidth, box.y + along * halfHeight],\n [box.x + halfWidth, box.y + along * halfHeight],\n ];\n for (const [px, py] of points) {\n const distance = Math.hypot(px - cx, py - cy);\n if (distance < arc.inner || distance > arc.outer) return false;\n if (fullCircle) continue;\n let angle = Math.atan2(px - cx, -(py - cy));\n if (angle < 0) angle += TX_FULL_CIRCLE;\n if (angle < arc.start || angle > arc.end) return false;\n }\n }\n return true;\n}\n","import { TxIconSet, txIconChartPie } from '@tectra-ng/icons';\n\nexport const SUNBURST_ICON_DEFAULTS: TxIconSet = {\n 'chart-pie': txIconChartPie,\n};\n","import { chartTokens } from '@tectra-ng/themes';\n\nexport const SUNBURST_THEME = {\n chart: chartTokens,\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n TxChartFrame,\n TxChartHeight,\n TxChartPointerEvent,\n TxChartTooltipData,\n TxChartTooltipPlacement,\n TxChartTooltipTemplate,\n TxChartValueFormat,\n arcPath,\n chartNumberFormatter,\n initialChartSize,\n injectChartEntrance,\n polar,\n readTokenNumber,\n textWidth,\n} from '@tectra-ng/charts/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraChartTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { sunburstArcAt, sunburstArcs, sunburstFocus, sunburstLabelFits, sunburstValue } from './sunburst-layout';\nimport { TxSunburstArc, TxSunburstChartPart, TxSunburstEvent, TxSunburstItem } from './sunburst-chart.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { SUNBURST_ICON_DEFAULTS } from './sunburst.icons';\nimport { SUNBURST_THEME } from './sunburst.theme';\n\nconst DEFAULTS = { hole: 0.3, corner: 3, fontSize: 11 };\nconst PADDING = 6;\nconst CENTER = 'center';\n\n@Component({\n selector: 'tx-sunburst-chart',\n imports: [TxChartFrame],\n templateUrl: './sunburst-chart.component.html',\n styleUrl: './sunburst-chart.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-sunburst-chart',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-sunburst-chart--fill]': 'typeof height() === \"string\"',\n '[class.tx-sunburst-chart--entering]': 'entrance.active()',\n '[class.tx-sunburst-chart--active]': 'activeArc() !== null',\n },\n viewProviders: [provideTxIconDefaults(SUNBURST_ICON_DEFAULTS)],\n})\nexport class TxSunburstChart {\n private readonly sunburstTheme = injectTokens(SUNBURST_THEME);\n\n private locale = inject(TxLocaleService);\n private host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly translations = injectTranslations();\n\n readonly data = input<TxSunburstItem | readonly TxSunburstItem[] | null | undefined>([]);\n readonly levels = input(3);\n readonly height = input<TxChartHeight>(380);\n readonly showLabels = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly showTooltip = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly drill = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly totalLabel = input('');\n readonly valueFormat = input<TxChartValueFormat>('number');\n readonly toolbar = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input('');\n readonly dt = input<TectraDeepPartial<TectraChartTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxSunburstChartPart, TxSunburstChart> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly segmentClick = output<TxSunburstEvent>();\n readonly focusChange = output<string[]>();\n\n readonly tooltipTemplate = contentChild(TxChartTooltipTemplate);\n private readonly frame = viewChild(TxChartFrame);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('sunburstChart', this, this.pt, this.ptOptions);\n readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-chart'));\n readonly hostStyle = computed(() => ({ ...this.tokenStyle(), ...this.passThrough().root?.style }));\n readonly entrance = injectChartEntrance();\n readonly geometry = signal(DEFAULTS);\n\n private readonly intl = computed(() => this.locale.locale().intl);\n readonly roots = computed<readonly TxSunburstItem[]>(() => {\n const data = this.data();\n return !data ? [] : Array.isArray(data) ? data : [data as TxSunburstItem];\n });\n readonly focus = linkedSignal<readonly TxSunburstItem[], number[]>({ source: this.roots, computation: () => [] });\n readonly active = signal<string | null>(null);\n readonly size = linkedSignal(() => initialChartSize(this.height(), null, undefined, this.toolbar()));\n readonly isEmpty = computed(() => !this.roots().some((item) => sunburstValue(item) > 0));\n\n readonly fit = computed(() => {\n const { width, height } = this.size();\n return { cx: width / 2, cy: height / 2, radius: Math.max(10, Math.min(width, height) / 2 - PADDING) };\n });\n\n readonly arcs = computed(() => sunburstArcs(this.roots(), { levels: this.levels(), radius: this.fit().radius, hole: this.geometry().hole, focus: this.focus() }));\n readonly inner = computed(() => this.fit().radius * Math.min(0.9, Math.max(0, this.geometry().hole)));\n readonly holeRadius = computed(() => Math.max(0, this.inner() - 2));\n readonly trail = computed(() => sunburstFocus(this.roots(), this.focus()).trail);\n readonly activeArc = computed(() => {\n const key = this.active();\n return key && key !== CENTER ? (this.arcs().find((arc) => arc.key === key) ?? null) : null;\n });\n\n readonly valueFormatter = computed(() => chartNumberFormatter(this.intl(), this.valueFormat()));\n readonly percentFormatter = computed(() => {\n const format = chartNumberFormatter(this.intl(), 'percent');\n return (share: number) => format(Number((share * 100).toFixed(1)));\n });\n\n readonly segments = computed(() => {\n const { cx, cy } = this.fit();\n const corner = this.geometry().corner;\n const fontSize = this.geometry().fontSize;\n return this.arcs().map((arc) => {\n const middle = (arc.start + arc.end) / 2;\n const radius = (arc.inner + arc.outer) / 2;\n const at = polar(cx, cy, radius, middle);\n const fits = this.showLabels() && sunburstLabelFits(arc, { x: at.x, y: at.y, width: textWidth(arc.label, fontSize), height: fontSize }, cx, cy);\n return {\n ...arc,\n d: arcPath(cx, cy, arc.inner, arc.outer, arc.start, arc.end, corner),\n fill: arc.depth > 1 ? `color-mix(in srgb, ${arc.base} calc(100% - ${arc.depth - 1} * var(--tx-chart-sunburst-level-fade, 22%)), var(--tx-chart-sunburst-fade-base, transparent))` : arc.base,\n labelX: at.x,\n labelY: at.y,\n text: fits ? arc.label : null,\n };\n });\n });\n\n readonly center = computed(() => {\n const t = this.translations();\n const trail = this.trail();\n const focused = trail[trail.length - 1];\n const value = focused ? sunburstValue(focused) : this.roots().reduce((sum, item) => sum + sunburstValue(item), 0);\n return { label: focused?.label ?? (this.totalLabel() || t.chartTotal), value: this.valueFormatter()(value), canGoUp: trail.length > 0 && this.drill() };\n });\n\n readonly centerFont = computed(() => {\n const inner = this.inner();\n return { value: Math.max(12, Math.min(24, inner * 0.32)), label: Math.max(10, Math.min(13, inner * 0.17)) };\n });\n\n readonly tooltip = computed<TxChartTooltipData | null>(() => {\n const arc = this.activeArc();\n if (!arc || !this.showTooltip()) return null;\n const t = this.translations();\n const { cx, cy } = this.fit();\n const middle = (arc.start + arc.end) / 2;\n const at = polar(cx, cy, arc.outer + 2, middle);\n const sin = Math.sin(middle);\n const cos = Math.cos(middle);\n const placement: TxChartTooltipPlacement = Math.abs(sin) >= Math.SQRT1_2 ? (sin > 0 ? 'right' : 'left') : cos > 0 ? 'top' : 'bottom';\n const names = this.names(arc.path);\n return {\n title: names.slice(0, -1).join(' / '),\n rows: [\n { label: arc.label, value: this.valueFormatter()(arc.value), color: arc.base, raw: arc.value, seriesIndex: 0, active: true },\n ...(arc.depth > 1 || this.focus().length ? [{ label: t.chartOfParent, value: this.percentFormatter()(arc.parentShare), color: 'transparent', raw: arc.parentShare, seriesIndex: 1 }] : []),\n { label: t.chartOfTotal, value: this.percentFormatter()(arc.share), color: 'transparent', raw: arc.share, seriesIndex: 2 },\n ],\n index: 0,\n x: at.x,\n y: at.y,\n placement,\n };\n });\n\n readonly summary = computed(() => {\n const t = this.translations();\n const top = this.arcs().filter((arc) => arc.depth === 1);\n const parts = top.map((arc) => `${arc.label} ${this.percentFormatter()(arc.share)}`);\n const text = `${t.chartSunburst}, ${this.center().label} ${this.center().value}: ${parts.join(', ')}`;\n return this.ariaLabel() ? `${this.ariaLabel()}. ${text}` : text;\n });\n\n readonly dataTable = computed(() => {\n const t = this.translations();\n return {\n columns: [\n { key: 'value', label: t.chartValue },\n { key: 'share', label: t.chartOfTotal },\n ],\n rows: this.arcs().map((arc) => ({ label: this.names(arc.path).join(' / '), cells: [this.valueFormatter()(arc.value), this.percentFormatter()(arc.share)] })),\n };\n });\n\n constructor() {\n afterRenderEffect(() => {\n this.dt();\n this.readGeometry();\n });\n }\n\n isLit(key: string): boolean {\n const active = this.activeArc();\n return !active || active.key === key || active.key.startsWith(`${key}.`);\n }\n\n onPointer(event: TxChartPointerEvent): void {\n if (event.type === 'leave') {\n this.active.set(null);\n return;\n }\n const { cx, cy } = this.fit();\n const inCenter = Math.hypot(event.x - cx, event.y - cy) < this.inner();\n const arc = inCenter ? null : sunburstArcAt(this.arcs(), event.x, event.y, cx, cy);\n this.active.set(inCenter && this.center().canGoUp ? CENTER : (arc?.key ?? null));\n if (event.type !== 'click') return;\n if (inCenter) this.up();\n else if (arc) this.select(arc);\n }\n\n onNavigate(event: KeyboardEvent): void {\n const arcs = this.arcs();\n if (!arcs.length) return;\n const current = this.activeArc();\n if (event.key === 'Escape' || event.key === 'Backspace') {\n if (current) this.active.set(null);\n else this.up();\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n if (current) this.select(current);\n return;\n }\n let next: TxSunburstArc | undefined;\n if (!current) {\n next = arcs.find((arc) => arc.depth === 1);\n } else if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {\n const siblings = arcs.filter((arc) => arc.depth === current.depth && arc.path.slice(0, -1).join('.') === current.path.slice(0, -1).join('.'));\n const at = siblings.indexOf(current);\n next = siblings[(at + (event.key === 'ArrowRight' ? 1 : -1) + siblings.length) % siblings.length];\n } else if (event.key === 'ArrowDown') {\n next = arcs.find((arc) => arc.depth === current.depth + 1 && arc.key.startsWith(`${current.key}.`)) ?? current;\n } else if (event.key === 'ArrowUp') {\n next = arcs.find((arc) => arc.key === current.path.slice(0, -1).join('.')) ?? current;\n } else if (event.key === 'Home' || event.key === 'End') {\n const top = arcs.filter((arc) => arc.depth === 1);\n next = event.key === 'Home' ? top[0] : top[top.length - 1];\n }\n if (!next) return;\n this.active.set(next.key);\n this.frame()?.announce(`${this.names(next.path).join(' / ')}: ${this.valueFormatter()(next.value)}, ${this.percentFormatter()(next.share)}`);\n }\n\n up(): void {\n if (!this.focus().length || !this.drill()) return;\n this.focus.update((path) => path.slice(0, -1));\n this.afterDrill();\n }\n\n private select(arc: TxSunburstArc): void {\n this.segmentClick.emit({ path: this.names(arc.path), value: arc.value, item: arc.item });\n if (!this.drill() || !arc.hasChildren) return;\n this.focus.set(arc.path);\n this.afterDrill();\n }\n\n private afterDrill(): void {\n this.active.set(null);\n this.entrance.play();\n const names = this.names(this.focus());\n this.focusChange.emit(names);\n this.frame()?.announce(names.length ? names.join(' / ') : this.center().label);\n }\n\n private names(path: readonly number[]): string[] {\n const names: string[] = [];\n let items = this.roots();\n for (const index of path) {\n const item = items[index];\n if (!item) break;\n names.push(item.label);\n items = item.children ?? [];\n }\n return names;\n }\n\n private readGeometry(): void {\n const element = this.host.nativeElement;\n const next = {\n hole: readTokenNumber(element, '--tx-chart-sunburst-hole', DEFAULTS.hole),\n corner: this.isUnstyled() ? 0 : readTokenNumber(element, '--tx-chart-sunburst-corner-radius', DEFAULTS.corner),\n fontSize: readTokenNumber(element, '--tx-chart-sunburst-label-font-size', DEFAULTS.fontSize),\n };\n const current = this.geometry();\n if (current.hole !== next.hole || current.corner !== next.corner || current.fontSize !== next.fontSize) this.geometry.set(next);\n }\n}\n","<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [showLegend]=\"false\"\n actionKeys\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n [toolbar]=\"toolbar()\"\n [exportName]=\"ariaLabel()\"\n emptyIcon=\"chart-pie\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g class=\"tx-sunburst-chart__segments\" [style.transform-origin]=\"fit().cx + 'px ' + fit().cy + 'px'\">\n @for (segment of segments(); track segment.key) {\n <svg:path\n class=\"tx-sunburst-chart__segment\"\n [class.tx-sunburst-chart__segment--lit]=\"isLit(segment.key)\"\n [class.tx-sunburst-chart__segment--drill]=\"segment.hasChildren && drill()\"\n [class]=\"passThrough().segment?.class\"\n [style]=\"passThrough().segment?.style\"\n [attr.data-key]=\"segment.key\"\n [attr.data-depth]=\"segment.depth\"\n [attr.d]=\"segment.d\"\n [style.fill]=\"segment.fill\"\n />\n }\n </svg:g>\n @if (showLabels()) {\n <svg:g class=\"tx-sunburst-chart__labels\">\n @for (segment of segments(); track segment.key) {\n @if (segment.text) {\n <svg:text\n class=\"tx-sunburst-chart__label\"\n [class]=\"passThrough().label?.class\"\n [style]=\"passThrough().label?.style\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n [attr.x]=\"segment.labelX\"\n [attr.y]=\"segment.labelY\"\n >\n {{ segment.text }}\n </svg:text>\n }\n }\n </svg:g>\n }\n <svg:g\n class=\"tx-sunburst-chart__center\"\n [class.tx-sunburst-chart__center--up]=\"center().canGoUp\"\n [class.tx-sunburst-chart__center--hover]=\"active() === 'center'\"\n [class]=\"passThrough().center?.class\"\n [style]=\"passThrough().center?.style\"\n >\n <svg:circle class=\"tx-sunburst-chart__hole\" [attr.cx]=\"fit().cx\" [attr.cy]=\"fit().cy\" [attr.r]=\"holeRadius()\" />\n @if (center().canGoUp) {\n <svg:path\n class=\"tx-sunburst-chart__back\"\n [attr.d]=\"'M' + (fit().cx - 4) + ',' + (fit().cy - centerFont().value * 0.95 - 4) + 'l4,-4l4,4'\"\n />\n }\n <svg:text\n class=\"tx-sunburst-chart__center-value\"\n text-anchor=\"middle\"\n [attr.x]=\"fit().cx\"\n [attr.y]=\"fit().cy + centerFont().value * 0.3 - centerFont().label * 0.55\"\n [style.font-size.px]=\"centerFont().value\"\n >\n {{ center().value }}\n </svg:text>\n <svg:text\n class=\"tx-sunburst-chart__center-label\"\n text-anchor=\"middle\"\n dominant-baseline=\"hanging\"\n [attr.x]=\"fit().cx\"\n [attr.y]=\"fit().cy + centerFont().value * 0.3 - centerFont().label * 0.55 + 6\"\n [style.font-size.px]=\"centerFont().label\"\n >\n {{ center().label }}\n </svg:text>\n </svg:g>\n</tx-chart-frame>\n"],"mappings":";;;;;;;;AAIA,SAAgB,cAAc,MAAoB;CAChD,MAAM,MAAM,KAAK,UAAU,QAAQ,KAAK,UAAU,UAAa,OAAO,SAAS,KAAK,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,KAAK,IAAI;CACvH,MAAM,YAAY,KAAK,YAAY,CAAA,EAAA,CAAI,QAAQ,KAAK,UAAU,MAAM,cAAc,KAAK,GAAG,CAAC;CAC3F,OAAO,OAAO;AAChB;AAGA,SAAgB,cAAc,OAAkC,MAAuB;CACrF,IAAI,QAAQ;CACZ,MAAM,QAA0B,CAAA;CAChC,KAAK,MAAM,SAAS,MAAM;EACxB,MAAM,OAAO,MAAM;EACnB,IAAI,CAAC,MAAM;EACX,MAAM,KAAK,IAAI;EACf,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terRenderEffect, booleanAttribute, computed, contentChild, inject, input, linkedSignal, output, signal, viewChild } from "@angular/core";
|
|
3
|
-
import { TxChartAxes, TxChartFrame, TxChartHoverBand, TxChartTooltipTemplate, cartesianLayout, chartBandRect, chartNumberFormatter, chartSummary, initialChartSize, injectChartEntrance, readTokenNumber, stepIndex } from "@tectra-ng/charts/core";
|
|
3
|
+
import { TxChartAxes, TxChartFrame, TxChartHoverBand, TxChartTooltipTemplate, cartesianLayout, chartBandRect, chartNumberFormatter, chartSummary, compactValueFormatter, initialChartSize, injectChartEntrance, readTokenNumber, stepIndex, textWidth } from "@tectra-ng/charts/core";
|
|
4
4
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
5
|
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
6
6
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
7
7
|
import { chartTokens, toStyleObject } from "@tectra-ng/themes";
|
|
8
8
|
import { provideTxIconDefaults, txIconChartBar } from "@tectra-ng/icons";
|
|
9
|
+
function finite(value) {
|
|
10
|
+
return value !== null && value !== void 0 && Number.isFinite(value);
|
|
11
|
+
}
|
|
9
12
|
function waterfallSteps(items) {
|
|
10
13
|
let running = 0;
|
|
11
14
|
return items.map((item, index) => {
|
|
12
|
-
if (item.total)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
if (item.total) {
|
|
16
|
+
running = finite(item.value) ? item.value : running;
|
|
17
|
+
return {
|
|
18
|
+
index,
|
|
19
|
+
label: item.label,
|
|
20
|
+
kind: "total",
|
|
21
|
+
change: running,
|
|
22
|
+
from: 0,
|
|
23
|
+
to: running,
|
|
24
|
+
color: item.color ?? null
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const change = finite(item.value) ? item.value : 0;
|
|
22
28
|
const from = running;
|
|
23
29
|
running += change;
|
|
24
30
|
return {
|
|
@@ -41,10 +47,27 @@ function waterfallExtent(steps) {
|
|
|
41
47
|
}
|
|
42
48
|
return [min, max];
|
|
43
49
|
}
|
|
50
|
+
function visibleLabels(boxes, gap = 4) {
|
|
51
|
+
const order = boxes.map((_, index) => index).sort((a, b) => Number(boxes[b].total) - Number(boxes[a].total) || a - b);
|
|
52
|
+
const kept = [];
|
|
53
|
+
const visible = boxes.map(() => false);
|
|
54
|
+
for (const index of order) {
|
|
55
|
+
const box = boxes[index];
|
|
56
|
+
if (!kept.some((other) => Math.abs(other.x - box.x) < (other.width + box.width) / 2 + gap && box.top < other.bottom && other.top < box.bottom)) {
|
|
57
|
+
kept.push(box);
|
|
58
|
+
visible[index] = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return visible;
|
|
62
|
+
}
|
|
44
63
|
const WATERFALL_ICON_DEFAULTS = { "chart-bar": txIconChartBar };
|
|
45
64
|
const WATERFALL_THEME = { chart: chartTokens };
|
|
46
65
|
const DEFAULT_WIDTH = .56;
|
|
47
66
|
const LABEL_GAP = 4;
|
|
67
|
+
const LABEL_FONT_SIZE = 11;
|
|
68
|
+
function signedFormat(format) {
|
|
69
|
+
return (value) => value > 0 ? `+${format(value)}` : value < 0 ? `−${format(-value)}` : format(value);
|
|
70
|
+
}
|
|
48
71
|
var TxWaterfallChart = class TxWaterfallChart {
|
|
49
72
|
waterfallTheme = injectTokens(WATERFALL_THEME);
|
|
50
73
|
locale = inject(TxLocaleService);
|
|
@@ -116,10 +139,9 @@ var TxWaterfallChart = class TxWaterfallChart {
|
|
|
116
139
|
legendShown = computed(() => this.showLegend() && this.kinds().size > 1, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
|
|
117
140
|
size = linkedSignal(() => initialChartSize(this.height(), this.legendShown() ? this.legendPosition() : null, void 0, this.toolbar()), ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
118
141
|
valueFormatter = computed(() => chartNumberFormatter(this.intl(), this.valueFormat()), ...ngDevMode ? [{ debugName: "valueFormatter" }] : /* istanbul ignore next */ []);
|
|
119
|
-
signed = computed(() => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}, ...ngDevMode ? [{ debugName: "signed" }] : /* istanbul ignore next */ []);
|
|
142
|
+
signed = computed(() => signedFormat(this.valueFormatter()), ...ngDevMode ? [{ debugName: "signed" }] : /* istanbul ignore next */ []);
|
|
143
|
+
shortFormatter = computed(() => compactValueFormatter(this.intl(), this.valueFormat()), ...ngDevMode ? [{ debugName: "shortFormatter" }] : /* istanbul ignore next */ []);
|
|
144
|
+
shortSigned = computed(() => signedFormat(this.shortFormatter()), ...ngDevMode ? [{ debugName: "shortSigned" }] : /* istanbul ignore next */ []);
|
|
123
145
|
layout = computed(() => {
|
|
124
146
|
const { width, height } = this.size();
|
|
125
147
|
const labels = this.steps().map((step) => step.label);
|
|
@@ -151,7 +173,7 @@ var TxWaterfallChart = class TxWaterfallChart {
|
|
|
151
173
|
const band = layout.category;
|
|
152
174
|
const width = band.bandwidth * Math.min(1, Math.max(.05, this.barWidth()));
|
|
153
175
|
const scale = layout.value;
|
|
154
|
-
|
|
176
|
+
const bars = this.steps().map((step) => {
|
|
155
177
|
const a = scale.map(step.from);
|
|
156
178
|
const b = scale.map(step.to);
|
|
157
179
|
const y = Math.min(a, b);
|
|
@@ -164,11 +186,22 @@ var TxWaterfallChart = class TxWaterfallChart {
|
|
|
164
186
|
y,
|
|
165
187
|
width,
|
|
166
188
|
height,
|
|
167
|
-
text: this.dataLabels() ? step.kind === "total" ?
|
|
189
|
+
text: this.dataLabels() ? this.labelText(step.kind === "total", step.kind === "total" ? step.to : step.change, band.step) : null,
|
|
168
190
|
textY: above ? y - LABEL_GAP : y + height + LABEL_GAP,
|
|
169
191
|
above
|
|
170
192
|
};
|
|
171
193
|
});
|
|
194
|
+
const visible = visibleLabels(bars.map((bar) => ({
|
|
195
|
+
x: bar.x + bar.width / 2,
|
|
196
|
+
width: textWidth(bar.text ?? "", LABEL_FONT_SIZE),
|
|
197
|
+
top: bar.above ? bar.textY - LABEL_FONT_SIZE : bar.textY,
|
|
198
|
+
bottom: bar.above ? bar.textY : bar.textY + LABEL_FONT_SIZE,
|
|
199
|
+
total: bar.kind === "total"
|
|
200
|
+
})));
|
|
201
|
+
return bars.map((bar, index) => visible[index] ? bar : {
|
|
202
|
+
...bar,
|
|
203
|
+
text: null
|
|
204
|
+
});
|
|
172
205
|
}, ...ngDevMode ? [{ debugName: "bars" }] : /* istanbul ignore next */ []);
|
|
173
206
|
hoverBand = computed(() => {
|
|
174
207
|
const index = this.active();
|
|
@@ -306,6 +339,10 @@ var TxWaterfallChart = class TxWaterfallChart {
|
|
|
306
339
|
const t = this.translations();
|
|
307
340
|
this.frame()?.announce(step.kind === "total" ? `${step.label}: ${t.chartTotal} ${this.valueFormatter()(step.to)}` : `${step.label}: ${this.signed()(step.change)}, ${t.chartTotal.toLocaleLowerCase(this.intl())} ${this.valueFormatter()(step.to)}`);
|
|
308
341
|
}
|
|
342
|
+
labelText(total, value, room) {
|
|
343
|
+
const full = total ? this.valueFormatter()(value) : this.signed()(value);
|
|
344
|
+
return textWidth(full, LABEL_FONT_SIZE) <= room - LABEL_GAP ? full : total ? this.shortFormatter()(value) : this.shortSigned()(value);
|
|
345
|
+
}
|
|
309
346
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
310
347
|
minVersion: "12.0.0",
|
|
311
348
|
version: "22.2.5",
|
|
@@ -511,7 +548,7 @@ var TxWaterfallChart = class TxWaterfallChart {
|
|
|
511
548
|
isSignal: true
|
|
512
549
|
}],
|
|
513
550
|
ngImport: i0,
|
|
514
|
-
template: "<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendToggle]=\"false\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n [toolbar]=\"toolbar()\"\n [exportName]=\"ariaLabel()\"\n emptyIcon=\"chart-bar\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g [tx-chart-hover-band]=\"hoverBand()\" [part]=\"passThrough().hoverBand\" />\n <svg:g [tx-chart-axes]=\"layout().axes\" [gridPart]=\"passThrough().grid\" [axisPart]=\"passThrough().axis\" />\n @if (connectors()) {\n <svg:g class=\"tx-waterfall-chart__connectors\">\n @for (line of connectorLines(); track line.key) {\n <svg:line\n class=\"tx-waterfall-chart__connector\"\n [class]=\"passThrough().connector?.class\"\n [style]=\"passThrough().connector?.style\"\n [attr.x1]=\"line.x1\"\n [attr.x2]=\"line.x2\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\"\n />\n }\n </svg:g>\n }\n <svg:g class=\"tx-waterfall-chart__bars\">\n @for (bar of bars(); track bar.key) {\n <svg:rect\n class=\"tx-waterfall-chart__bar\"\n [class.tx-waterfall-chart__bar--active]=\"active() === bar.index\"\n [class]=\"passThrough().bar?.class\"\n [style]=\"passThrough().bar?.style\"\n [attr.data-kind]=\"bar.kind\"\n [attr.data-index]=\"bar.index\"\n [attr.data-dir]=\"bar.above ? 'up' : 'down'\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [style.--tx-waterfall-chart-own]=\"bar.color\"\n [style.--tx-waterfall-chart-order]=\"bar.index\"\n />\n }\n </svg:g>\n @if (dataLabels()) {\n <svg:g class=\"tx-waterfall-chart__labels\">\n @for (bar of bars(); track bar.key) {\n <svg:text\n
|
|
551
|
+
template: "<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendToggle]=\"false\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n [toolbar]=\"toolbar()\"\n [exportName]=\"ariaLabel()\"\n emptyIcon=\"chart-bar\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g [tx-chart-hover-band]=\"hoverBand()\" [part]=\"passThrough().hoverBand\" />\n <svg:g [tx-chart-axes]=\"layout().axes\" [gridPart]=\"passThrough().grid\" [axisPart]=\"passThrough().axis\" />\n @if (connectors()) {\n <svg:g class=\"tx-waterfall-chart__connectors\">\n @for (line of connectorLines(); track line.key) {\n <svg:line\n class=\"tx-waterfall-chart__connector\"\n [class]=\"passThrough().connector?.class\"\n [style]=\"passThrough().connector?.style\"\n [attr.x1]=\"line.x1\"\n [attr.x2]=\"line.x2\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\"\n />\n }\n </svg:g>\n }\n <svg:g class=\"tx-waterfall-chart__bars\">\n @for (bar of bars(); track bar.key) {\n <svg:rect\n class=\"tx-waterfall-chart__bar\"\n [class.tx-waterfall-chart__bar--active]=\"active() === bar.index\"\n [class]=\"passThrough().bar?.class\"\n [style]=\"passThrough().bar?.style\"\n [attr.data-kind]=\"bar.kind\"\n [attr.data-index]=\"bar.index\"\n [attr.data-dir]=\"bar.above ? 'up' : 'down'\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [style.--tx-waterfall-chart-own]=\"bar.color\"\n [style.--tx-waterfall-chart-order]=\"bar.index\"\n />\n }\n </svg:g>\n @if (dataLabels()) {\n <svg:g class=\"tx-waterfall-chart__labels\">\n @for (bar of bars(); track bar.key) {\n @if (bar.text) {\n <svg:text\n class=\"tx-waterfall-chart__label\"\n [class]=\"passThrough().dataLabel?.class\"\n [style]=\"passThrough().dataLabel?.style\"\n [attr.data-kind]=\"bar.kind\"\n text-anchor=\"middle\"\n [attr.dominant-baseline]=\"bar.above ? 'auto' : 'hanging'\"\n [attr.x]=\"bar.x + bar.width / 2\"\n [attr.y]=\"bar.textY\"\n >\n {{ bar.text }}\n </svg:text>\n }\n }\n </svg:g>\n }\n</tx-chart-frame>\n",
|
|
515
552
|
styles: [":host{display:block;min-width:0}:host(.tx-waterfall-chart--fill){height:100%}.tx-waterfall-chart__bar{fill:var(--tx-waterfall-chart-own, currentColor);transform-box:fill-box}.tx-waterfall-chart__bar[data-dir=up]{transform-origin:50% 100%}.tx-waterfall-chart__bar[data-dir=down]{transform-origin:50% 0}.tx-waterfall-chart__connector{stroke:currentColor;stroke-opacity:.4}.tx-waterfall-chart__connectors,.tx-waterfall-chart__labels{pointer-events:none}:host([data-styled]) .tx-waterfall-chart__bar{clip-path:inset(0 round var(--tx-chart-bar-radius));transition:fill var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-waterfall-chart__bar[data-kind=up]{fill:var(--tx-waterfall-chart-own, var(--tx-chart-waterfall-up-color))}:host([data-styled]) .tx-waterfall-chart__bar[data-kind=down]{fill:var(--tx-waterfall-chart-own, var(--tx-chart-waterfall-down-color))}:host([data-styled]) .tx-waterfall-chart__bar[data-kind=total]{fill:var(--tx-waterfall-chart-own, var(--tx-chart-waterfall-total-color))}:host([data-styled]) .tx-waterfall-chart__connector{stroke:var(--tx-chart-waterfall-connector-color);stroke-opacity:1;stroke-width:var(--tx-chart-waterfall-connector-width);stroke-dasharray:var(--tx-chart-waterfall-connector-dash)}:host([data-styled]) .tx-waterfall-chart__label{fill:var(--tx-chart-bar-outside-label-color);font-size:var(--tx-chart-bar-label-font-size);font-weight:var(--tx-chart-bar-label-font-weight);font-variant-numeric:tabular-nums}:host([data-styled].tx-waterfall-chart--active) .tx-waterfall-chart__bar:not(.tx-waterfall-chart__bar--active){opacity:var(--tx-chart-waterfall-dimmed-opacity)}:host([data-styled].tx-waterfall-chart--active) .tx-waterfall-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled].tx-waterfall-chart--morph) .tx-waterfall-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease,x var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),y var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),height var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled].tx-waterfall-chart--entering) .tx-waterfall-chart__bar{animation:tx-waterfall-chart-grow var(--tx-chart-motion-enter-duration) var(--tx-chart-motion-easing) both;animation-delay:calc(var(--tx-waterfall-chart-order, 0) * var(--tx-chart-motion-stagger) * 2)}:host([data-styled].tx-waterfall-chart--entering) .tx-waterfall-chart__connectors,:host([data-styled].tx-waterfall-chart--entering) .tx-waterfall-chart__labels{animation:tx-waterfall-chart-fade var(--tx-chart-motion-enter-duration) ease both}@keyframes tx-waterfall-chart-grow{0%{transform:scaleY(0)}to{transform:scaleY(1)}}@keyframes tx-waterfall-chart-fade{0%,60%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-waterfall-chart__bar,:host([data-styled]) .tx-waterfall-chart__connectors,:host([data-styled]) .tx-waterfall-chart__labels{transition:none;animation:none}}\n"],
|
|
516
553
|
dependencies: [
|
|
517
554
|
{
|
|
@@ -606,7 +643,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
606
643
|
"[class.tx-waterfall-chart--active]": "active() !== null"
|
|
607
644
|
},
|
|
608
645
|
viewProviders: [provideTxIconDefaults(WATERFALL_ICON_DEFAULTS)],
|
|
609
|
-
template: "<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendToggle]=\"false\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n [toolbar]=\"toolbar()\"\n [exportName]=\"ariaLabel()\"\n emptyIcon=\"chart-bar\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g [tx-chart-hover-band]=\"hoverBand()\" [part]=\"passThrough().hoverBand\" />\n <svg:g [tx-chart-axes]=\"layout().axes\" [gridPart]=\"passThrough().grid\" [axisPart]=\"passThrough().axis\" />\n @if (connectors()) {\n <svg:g class=\"tx-waterfall-chart__connectors\">\n @for (line of connectorLines(); track line.key) {\n <svg:line\n class=\"tx-waterfall-chart__connector\"\n [class]=\"passThrough().connector?.class\"\n [style]=\"passThrough().connector?.style\"\n [attr.x1]=\"line.x1\"\n [attr.x2]=\"line.x2\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\"\n />\n }\n </svg:g>\n }\n <svg:g class=\"tx-waterfall-chart__bars\">\n @for (bar of bars(); track bar.key) {\n <svg:rect\n class=\"tx-waterfall-chart__bar\"\n [class.tx-waterfall-chart__bar--active]=\"active() === bar.index\"\n [class]=\"passThrough().bar?.class\"\n [style]=\"passThrough().bar?.style\"\n [attr.data-kind]=\"bar.kind\"\n [attr.data-index]=\"bar.index\"\n [attr.data-dir]=\"bar.above ? 'up' : 'down'\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [style.--tx-waterfall-chart-own]=\"bar.color\"\n [style.--tx-waterfall-chart-order]=\"bar.index\"\n />\n }\n </svg:g>\n @if (dataLabels()) {\n <svg:g class=\"tx-waterfall-chart__labels\">\n @for (bar of bars(); track bar.key) {\n <svg:text\n
|
|
646
|
+
template: "<tx-chart-frame\n [height]=\"height()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendToggle]=\"false\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n [toolbar]=\"toolbar()\"\n [exportName]=\"ariaLabel()\"\n emptyIcon=\"chart-bar\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (tooltipClosed)=\"active.set(null)\"\n>\n <svg:g [tx-chart-hover-band]=\"hoverBand()\" [part]=\"passThrough().hoverBand\" />\n <svg:g [tx-chart-axes]=\"layout().axes\" [gridPart]=\"passThrough().grid\" [axisPart]=\"passThrough().axis\" />\n @if (connectors()) {\n <svg:g class=\"tx-waterfall-chart__connectors\">\n @for (line of connectorLines(); track line.key) {\n <svg:line\n class=\"tx-waterfall-chart__connector\"\n [class]=\"passThrough().connector?.class\"\n [style]=\"passThrough().connector?.style\"\n [attr.x1]=\"line.x1\"\n [attr.x2]=\"line.x2\"\n [attr.y1]=\"line.y\"\n [attr.y2]=\"line.y\"\n />\n }\n </svg:g>\n }\n <svg:g class=\"tx-waterfall-chart__bars\">\n @for (bar of bars(); track bar.key) {\n <svg:rect\n class=\"tx-waterfall-chart__bar\"\n [class.tx-waterfall-chart__bar--active]=\"active() === bar.index\"\n [class]=\"passThrough().bar?.class\"\n [style]=\"passThrough().bar?.style\"\n [attr.data-kind]=\"bar.kind\"\n [attr.data-index]=\"bar.index\"\n [attr.data-dir]=\"bar.above ? 'up' : 'down'\"\n [attr.x]=\"bar.x\"\n [attr.y]=\"bar.y\"\n [attr.width]=\"bar.width\"\n [attr.height]=\"bar.height\"\n [style.--tx-waterfall-chart-own]=\"bar.color\"\n [style.--tx-waterfall-chart-order]=\"bar.index\"\n />\n }\n </svg:g>\n @if (dataLabels()) {\n <svg:g class=\"tx-waterfall-chart__labels\">\n @for (bar of bars(); track bar.key) {\n @if (bar.text) {\n <svg:text\n class=\"tx-waterfall-chart__label\"\n [class]=\"passThrough().dataLabel?.class\"\n [style]=\"passThrough().dataLabel?.style\"\n [attr.data-kind]=\"bar.kind\"\n text-anchor=\"middle\"\n [attr.dominant-baseline]=\"bar.above ? 'auto' : 'hanging'\"\n [attr.x]=\"bar.x + bar.width / 2\"\n [attr.y]=\"bar.textY\"\n >\n {{ bar.text }}\n </svg:text>\n }\n }\n </svg:g>\n }\n</tx-chart-frame>\n",
|
|
610
647
|
styles: [":host{display:block;min-width:0}:host(.tx-waterfall-chart--fill){height:100%}.tx-waterfall-chart__bar{fill:var(--tx-waterfall-chart-own, currentColor);transform-box:fill-box}.tx-waterfall-chart__bar[data-dir=up]{transform-origin:50% 100%}.tx-waterfall-chart__bar[data-dir=down]{transform-origin:50% 0}.tx-waterfall-chart__connector{stroke:currentColor;stroke-opacity:.4}.tx-waterfall-chart__connectors,.tx-waterfall-chart__labels{pointer-events:none}:host([data-styled]) .tx-waterfall-chart__bar{clip-path:inset(0 round var(--tx-chart-bar-radius));transition:fill var(--tx-chart-motion-hover-duration) ease}:host([data-styled]) .tx-waterfall-chart__bar[data-kind=up]{fill:var(--tx-waterfall-chart-own, var(--tx-chart-waterfall-up-color))}:host([data-styled]) .tx-waterfall-chart__bar[data-kind=down]{fill:var(--tx-waterfall-chart-own, var(--tx-chart-waterfall-down-color))}:host([data-styled]) .tx-waterfall-chart__bar[data-kind=total]{fill:var(--tx-waterfall-chart-own, var(--tx-chart-waterfall-total-color))}:host([data-styled]) .tx-waterfall-chart__connector{stroke:var(--tx-chart-waterfall-connector-color);stroke-opacity:1;stroke-width:var(--tx-chart-waterfall-connector-width);stroke-dasharray:var(--tx-chart-waterfall-connector-dash)}:host([data-styled]) .tx-waterfall-chart__label{fill:var(--tx-chart-bar-outside-label-color);font-size:var(--tx-chart-bar-label-font-size);font-weight:var(--tx-chart-bar-label-font-weight);font-variant-numeric:tabular-nums}:host([data-styled].tx-waterfall-chart--active) .tx-waterfall-chart__bar:not(.tx-waterfall-chart__bar--active){opacity:var(--tx-chart-waterfall-dimmed-opacity)}:host([data-styled].tx-waterfall-chart--active) .tx-waterfall-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease}:host([data-styled].tx-waterfall-chart--morph) .tx-waterfall-chart__bar{transition:fill var(--tx-chart-motion-hover-duration) ease,opacity var(--tx-chart-motion-hover-duration) ease,x var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),y var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),width var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing),height var(--tx-chart-motion-update-duration) var(--tx-chart-motion-easing)}:host([data-styled].tx-waterfall-chart--entering) .tx-waterfall-chart__bar{animation:tx-waterfall-chart-grow var(--tx-chart-motion-enter-duration) var(--tx-chart-motion-easing) both;animation-delay:calc(var(--tx-waterfall-chart-order, 0) * var(--tx-chart-motion-stagger) * 2)}:host([data-styled].tx-waterfall-chart--entering) .tx-waterfall-chart__connectors,:host([data-styled].tx-waterfall-chart--entering) .tx-waterfall-chart__labels{animation:tx-waterfall-chart-fade var(--tx-chart-motion-enter-duration) ease both}@keyframes tx-waterfall-chart-grow{0%{transform:scaleY(0)}to{transform:scaleY(1)}}@keyframes tx-waterfall-chart-fade{0%,60%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-waterfall-chart__bar,:host([data-styled]) .tx-waterfall-chart__connectors,:host([data-styled]) .tx-waterfall-chart__labels{transition:none;animation:none}}\n"]
|
|
611
648
|
}]
|
|
612
649
|
}],
|
|
@@ -810,6 +847,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
810
847
|
}]
|
|
811
848
|
}
|
|
812
849
|
});
|
|
813
|
-
export { TxWaterfallChart, waterfallExtent, waterfallSteps };
|
|
850
|
+
export { TxWaterfallChart, visibleLabels, waterfallExtent, waterfallSteps };
|
|
814
851
|
|
|
815
852
|
//# sourceMappingURL=tectra-ng-charts-waterfall.mjs.map
|