From e2517891977e018cedf80f70652853f34348ceb6 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Tue, 14 Jul 2020 08:00:37 +0000 Subject: [PATCH] fix(sunburst-chart): Fixes an issue with missing types dependency. --- .../sunburst-chart/src/sunburst-chart.util.ts | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/libs/barista-components/sunburst-chart/src/sunburst-chart.util.ts b/libs/barista-components/sunburst-chart/src/sunburst-chart.util.ts index a137a5a95e..99ef18d120 100644 --- a/libs/barista-components/sunburst-chart/src/sunburst-chart.util.ts +++ b/libs/barista-components/sunburst-chart/src/sunburst-chart.util.ts @@ -18,7 +18,7 @@ import { DtColors, DT_CHART_COLOR_PALETTE_ORDERED, } from '@dynatrace/barista-components/theming'; -import { pie, PieArcDatum, arc } from 'd3-shape'; +import { pie, arc } from 'd3-shape'; /** * DtSunburstChartNode represents a single node within the sunburst datastructure. @@ -68,8 +68,41 @@ export interface DtSunburstChartTooltipData { ariaLabel: string; } -export interface DtSunburstChartNodeSlice - extends PieArcDatum { +// TODO: Remove this when we either ship the types for d3-shape as a peer-dependency +export interface DtSunburstChartNodeSlice { + /** + * The input datum; the corresponding element in the input + * data array of the Pie generator. + */ + data: DtSunburstChartTooltipData; + /** + * The numeric value of the arc. + */ + value: number; + /** + * The zero-based sorted index of the arc. + */ + index: number; + /** + * The start angle of the arc. + * If the pie generator was configured to be used for the arc generator, + * then the units are in radians with 0 at -y (12 o’clock) and positive angles + * proceeding clockwise. + */ + startAngle: number; + /** + * The end angle of the arc. + * If the pie generator was configured to be used for the arc generator, + * then the units are in radians with 0 at -y (12 o’clock) and positive angles + * proceeding clockwise. + */ + endAngle: number; + /** + * The pad angle of the arc. If the pie generator was configured to be used + * for the arc generator, than the units are in radians. + */ + padAngle: number; + path: string | null; labelPosition: [number, number]; tooltipPosition: [number, number];