@unovis/ts 1.4.0-beta.0 → 1.4.0-beta.1

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.
@@ -41,21 +41,22 @@ class Annotations extends ComponentCore {
41
41
  // Todo: smooth transition
42
42
  annotationsEnter.merge(annotations)
43
43
  .each((annotation, i, elements) => {
44
- var _a;
45
44
  // Content rendering
46
- // const contentGroupElement = elements[i].querySelector<SVGGElement>(`.${s.annotationContent}`)
47
- const contentGroupElement = select(elements[i])
48
- .select(`.${annotationContent}`)
49
- .style('cursor', ((_a = config.events) === null || _a === void 0 ? void 0 : _a[annotationSubject]) ? 'pointer' : null);
50
- const content = typeof annotation.content === 'string' ? { text: annotation.content, fontSize: 12 } : annotation.content;
51
- const x = parseUnit(annotation.x, this._width);
52
- const y = parseUnit(annotation.y, this._height);
53
- const width = parseUnit(annotation.width, this._width);
54
- const height = parseUnit(annotation.height, this._height);
55
- const options = Object.assign(Object.assign({}, annotation), { x, y, width, height });
56
- renderTextIntoFrame(contentGroupElement.node(), content, options);
45
+ if (annotation === null || annotation === void 0 ? void 0 : annotation.content) {
46
+ const contentGroupElement = select(elements[i])
47
+ .select(`.${annotationContent}`);
48
+ const content = typeof annotation.content === 'string' ? { text: annotation.content, fontSize: 12 } : annotation.content;
49
+ const x = parseUnit(annotation.x, this._width);
50
+ const y = parseUnit(annotation.y, this._height);
51
+ const width = parseUnit(annotation.width, this._width);
52
+ const height = parseUnit(annotation.height, this._height);
53
+ const options = Object.assign(Object.assign({}, annotation), { x, y, width, height });
54
+ renderTextIntoFrame(contentGroupElement.node(), content, options);
55
+ }
57
56
  // Subject rendering
58
- requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject, duration));
57
+ if (annotation === null || annotation === void 0 ? void 0 : annotation.subject) {
58
+ requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject, duration));
59
+ }
59
60
  });
60
61
  smartTransition(annotations.exit(), duration)
61
62
  .style('opacity', 0)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Utils\nimport { isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { renderTextIntoFrame } from 'utils/text'\nimport { parseUnit } from 'utils/misc'\n\n// Types\nimport { Spacing } from 'types/spacing'\n\n// Local Types\nimport { AnnotationItem, AnnotationSubject } from './types'\n\n// Config\nimport { AnnotationsDefaultConfig, AnnotationsConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Annotations extends ComponentCore<unknown[], AnnotationsConfigInterface> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = AnnotationsDefaultConfig as AnnotationsConfigInterface\n public config: AnnotationsConfigInterface = this._defaultConfig\n\n g: Selection<SVGGElement, unknown, null, undefined>\n\n events = {}\n\n constructor (config?: AnnotationsConfigInterface) {\n super()\n if (config) this.setConfig(config)\n }\n\n // Todo: implement\n get bleed (): Spacing {\n return { top: 0, bottom: 0, left: 0, right: 0 }\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const annotations = this.g\n .selectAll<SVGGElement, AnnotationItem>(`.${s.annotation}`)\n .data(config.items ?? [])\n\n const annotationsEnter = annotations.enter().append('g')\n .attr('class', s.annotation)\n\n annotationsEnter.append('g')\n .attr('class', s.annotationContent)\n .classed(s.clickable, config.events?.[s.annotationContent] !== undefined)\n\n const annotationsSubject = annotationsEnter.append('g')\n .attr('class', s.annotationSubject)\n\n annotationsSubject.append('circle')\n annotationsSubject.append('line')\n\n // Todo: smooth transition\n annotationsEnter.merge(annotations)\n .each((annotation, i, elements) => {\n // Content rendering\n // const contentGroupElement = elements[i].querySelector<SVGGElement>(`.${s.annotationContent}`)\n const contentGroupElement = select(elements[i])\n .select<SVGGElement>(`.${s.annotationContent}`)\n .style('cursor', config.events?.[s.annotationSubject] ? 'pointer' : null)\n const content = typeof annotation.content === 'string' ? { text: annotation.content, fontSize: 12 } : annotation.content\n const x = parseUnit(annotation.x, this._width)\n const y = parseUnit(annotation.y, this._height)\n const width = parseUnit(annotation.width, this._width)\n const height = parseUnit(annotation.height, this._height)\n const options = { ...annotation, x, y, width, height }\n\n renderTextIntoFrame(contentGroupElement.node(), content, options)\n\n // Subject rendering\n requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject, duration))\n })\n\n smartTransition(annotations.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n private _renderSubject (\n annotationGroupElement: SVGGElement,\n subject: AnnotationSubject | undefined,\n duration?: number\n ): void {\n const contentGroupElement = annotationGroupElement.querySelector<SVGGElement>(`.${s.annotationContent}`)\n const subjectGroupElement = annotationGroupElement.querySelector<SVGGElement>(`.${s.annotationSubject}`)\n const subjectGroup = select(subjectGroupElement)\n\n const subjectX: number | null = parseUnit(typeof subject?.x === 'function' ? subject.x() : subject?.x, this._width) ?? null\n const subjectY: number | null = parseUnit(typeof subject?.y === 'function' ? subject.y() : subject?.y, this._height) ?? null\n const subjectStrokeColor: string | null = subject?.strokeColor ?? null\n const subjectFillColor: string | null = subject?.fillColor ?? null\n const subjectStrokeDasharray: string | null = subject?.strokeDasharray ?? null\n const connectorLineColor: string | null = subject?.connectorLineColor ?? null\n const connectorLineStrokeDasharray: string | null = subject?.connectorLineStrokeDasharray ?? null\n const subjectRadius: number | null = subject?.radius ?? 0\n const padding = subject?.padding ?? 5\n\n const contentBbox = contentGroupElement.getBBox()\n const dy = Math.abs(subjectY - (contentBbox.y + contentBbox.height / 2))\n const dx = Math.abs(subjectX - (contentBbox.x + contentBbox.width / 2))\n const annotationPadding = 5\n const x2 = (dx < dy) && ((subjectY < contentBbox.y) || (subjectY > (contentBbox.y + contentBbox.height)))\n ? contentBbox.x + contentBbox.width / 2\n : (subjectX < contentBbox.x) ? contentBbox.x - annotationPadding : contentBbox.x + contentBbox.width + annotationPadding\n\n const y2 = (dx >= dy) || ((subjectY >= contentBbox.y) && (subjectY <= (contentBbox.y + contentBbox.height)))\n ? contentBbox.y + contentBbox.height / 2\n : (subjectY < contentBbox.y) ? contentBbox.y - annotationPadding : contentBbox.y + contentBbox.height + annotationPadding\n\n const angle = Math.atan2(y2 - subjectY, x2 - subjectX) * 180 / Math.PI\n const x1 = subjectX + Math.cos(angle * Math.PI / 180) * (subjectRadius + padding)\n const y1 = subjectY + Math.sin(angle * Math.PI / 180) * (subjectRadius + padding)\n\n const circleSelection = subjectGroup.select('circle')\n const lineSelection = subjectGroup.select('line')\n circleSelection\n .attr('visibility', subject ? null : 'hidden')\n .attr('cx', subjectX)\n .attr('cy', subjectY)\n .attr('r', subjectRadius)\n .style('stroke', subjectStrokeColor)\n .style('fill', subjectFillColor)\n .style('stroke-dasharray', subjectStrokeDasharray)\n\n lineSelection\n .attr('visibility', subject ? null : 'hidden')\n .attr('x1', x1)\n .attr('y1', y1)\n .attr('x2', x2)\n .attr('y2', y2)\n .style('stroke', connectorLineColor)\n .style('stroke-dasharray', connectorLineStrokeDasharray)\n .style('fill', 'none')\n }\n}\n"],"names":["s.annotation","s.annotationContent","s.clickable","s.annotationSubject","s","s.variables"],"mappings":";;;;;;;;;;AAuBM,MAAO,WAAY,SAAQ,aAAoD,CAAA;AAUnF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QARC,IAAc,CAAA,cAAA,GAAG,wBAAsD,CAAA;AAC1E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QAI/D,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAIT,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;;AAGD,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,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aAAA,KAAK,CAAC,QAAQ,EAAE,kBAAkB,CAAC;AACnC,aAAA,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC;AAC/B,aAAA,KAAK,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAA;QAEpD,aAAa;AACV,aAAA,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,IAAI,GAAG,QAAQ,CAAC;AAC7C,aAAA,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AACd,aAAA,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AACd,aAAA,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AACd,aAAA,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;AACd,aAAA,KAAK,CAAC,QAAQ,EAAE,kBAAkB,CAAC;AACnC,aAAA,KAAK,CAAC,kBAAkB,EAAE,4BAA4B,CAAC;AACvD,aAAA,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACzB;;AA1HM,WAAS,CAAA,SAAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGC,SAAW;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Utils\nimport { isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { renderTextIntoFrame } from 'utils/text'\nimport { parseUnit } from 'utils/misc'\n\n// Types\nimport { Spacing } from 'types/spacing'\n\n// Local Types\nimport { AnnotationItem, AnnotationSubject } from './types'\n\n// Config\nimport { AnnotationsDefaultConfig, AnnotationsConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Annotations extends ComponentCore<unknown[], AnnotationsConfigInterface> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = AnnotationsDefaultConfig as AnnotationsConfigInterface\n public config: AnnotationsConfigInterface = this._defaultConfig\n\n g: Selection<SVGGElement, unknown, null, undefined>\n\n events = {}\n\n constructor (config?: AnnotationsConfigInterface) {\n super()\n if (config) this.setConfig(config)\n }\n\n // Todo: implement\n get bleed (): Spacing {\n return { top: 0, bottom: 0, left: 0, right: 0 }\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const annotations = this.g\n .selectAll<SVGGElement, AnnotationItem>(`.${s.annotation}`)\n .data(config.items ?? [])\n\n const annotationsEnter = annotations.enter().append('g')\n .attr('class', s.annotation)\n\n annotationsEnter.append('g')\n .attr('class', s.annotationContent)\n .classed(s.clickable, config.events?.[s.annotationContent] !== undefined)\n\n const annotationsSubject = annotationsEnter.append('g')\n .attr('class', s.annotationSubject)\n\n annotationsSubject.append('circle')\n annotationsSubject.append('line')\n\n // Todo: smooth transition\n annotationsEnter.merge(annotations)\n .each((annotation, i, elements) => {\n // Content rendering\n if (annotation?.content) {\n const contentGroupElement = select(elements[i])\n .select<SVGGElement>(`.${s.annotationContent}`)\n const content = typeof annotation.content === 'string' ? { text: annotation.content, fontSize: 12 } : annotation.content\n const x = parseUnit(annotation.x, this._width)\n const y = parseUnit(annotation.y, this._height)\n const width = parseUnit(annotation.width, this._width)\n const height = parseUnit(annotation.height, this._height)\n const options = { ...annotation, x, y, width, height }\n\n\n renderTextIntoFrame(contentGroupElement.node(), content, options)\n }\n // Subject rendering\n if (annotation?.subject) {\n requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject, duration))\n }\n })\n smartTransition(annotations.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n private _renderSubject (\n annotationGroupElement: SVGGElement,\n subject: AnnotationSubject | undefined,\n duration?: number\n ): void {\n const contentGroupElement = annotationGroupElement.querySelector<SVGGElement>(`.${s.annotationContent}`)\n const subjectGroupElement = annotationGroupElement.querySelector<SVGGElement>(`.${s.annotationSubject}`)\n const subjectGroup = select(subjectGroupElement)\n\n const subjectX: number | null = parseUnit(typeof subject?.x === 'function' ? subject.x() : subject?.x, this._width) ?? null\n const subjectY: number | null = parseUnit(typeof subject?.y === 'function' ? subject.y() : subject?.y, this._height) ?? null\n const subjectStrokeColor: string | null = subject?.strokeColor ?? null\n const subjectFillColor: string | null = subject?.fillColor ?? null\n const subjectStrokeDasharray: string | null = subject?.strokeDasharray ?? null\n const connectorLineColor: string | null = subject?.connectorLineColor ?? null\n const connectorLineStrokeDasharray: string | null = subject?.connectorLineStrokeDasharray ?? null\n const subjectRadius: number | null = subject?.radius ?? 0\n const padding = subject?.padding ?? 5\n\n const contentBbox = contentGroupElement.getBBox()\n const dy = Math.abs(subjectY - (contentBbox.y + contentBbox.height / 2))\n const dx = Math.abs(subjectX - (contentBbox.x + contentBbox.width / 2))\n const annotationPadding = 5\n const x2 = (dx < dy) && ((subjectY < contentBbox.y) || (subjectY > (contentBbox.y + contentBbox.height)))\n ? contentBbox.x + contentBbox.width / 2\n : (subjectX < contentBbox.x) ? contentBbox.x - annotationPadding : contentBbox.x + contentBbox.width + annotationPadding\n\n const y2 = (dx >= dy) || ((subjectY >= contentBbox.y) && (subjectY <= (contentBbox.y + contentBbox.height)))\n ? contentBbox.y + contentBbox.height / 2\n : (subjectY < contentBbox.y) ? contentBbox.y - annotationPadding : contentBbox.y + contentBbox.height + annotationPadding\n\n const angle = Math.atan2(y2 - subjectY, x2 - subjectX) * 180 / Math.PI\n const x1 = subjectX + Math.cos(angle * Math.PI / 180) * (subjectRadius + padding)\n const y1 = subjectY + Math.sin(angle * Math.PI / 180) * (subjectRadius + padding)\n\n const circleSelection = subjectGroup.select('circle')\n const lineSelection = subjectGroup.select('line')\n circleSelection\n .attr('visibility', subject ? null : 'hidden')\n .attr('cx', subjectX)\n .attr('cy', subjectY)\n .attr('r', subjectRadius)\n .style('stroke', subjectStrokeColor)\n .style('fill', subjectFillColor)\n .style('stroke-dasharray', subjectStrokeDasharray)\n\n lineSelection\n .attr('visibility', subject ? null : 'hidden')\n .attr('x1', x1)\n .attr('y1', y1)\n .attr('x2', x2)\n .attr('y2', y2)\n .style('stroke', connectorLineColor)\n .style('stroke-dasharray', connectorLineStrokeDasharray)\n .style('fill', 'none')\n }\n}\n"],"names":["s.annotation","s.annotationContent","s.clickable","s.annotationSubject","s","s.variables"],"mappings":";;;;;;;;;;AAuBM,MAAO,WAAY,SAAQ,aAAoD,CAAA;AAUnF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QARC,IAAc,CAAA,cAAA,GAAG,wBAAsD,CAAA;AAC1E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QAI/D,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAIT,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;;AAGD,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;KAChD;AAED,IAAA,OAAO,CAAE,cAAuB,EAAA;;AAC9B,QAAA,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;AAC7B,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AACvB,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAA;AAE5E,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC;AACvB,aAAA,SAAS,CAA8B,CAAI,CAAA,EAAAA,UAAY,EAAE,CAAC;aAC1D,IAAI,CAAC,MAAA,MAAM,CAAC,KAAK,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,EAAE,CAAC,CAAA;QAE3B,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC;AACr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AAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGC,SAAW;;;;"}
@@ -45,5 +45,6 @@ export interface NestedDonutConfigInterface<Datum> extends ComponentConfigInterf
45
45
  * Default: `false`
46
46
  */
47
47
  showEmptySegments?: boolean;
48
+ showSegmentLabels?: boolean;
48
49
  }
49
50
  export declare const NestedDonutDefaultConfig: NestedDonutConfigInterface<unknown>;
@@ -2,7 +2,7 @@ import { ComponentDefaultConfig } from '../../core/component/config.js';
2
2
  import { NestedDonutDirection } from './types.js';
3
3
 
4
4
  // Core
5
- const NestedDonutDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { angleRange: [0, 2 * Math.PI], centralLabel: undefined, centralSubLabel: undefined, centralSubLabelWrap: true, cornerRadius: 0, direction: NestedDonutDirection.Inwards, emptySegmentAngle: Math.PI / 180, hideOverflowingSegmentLabels: true, layers: [], layerPadding: 0, layerSettings: undefined, segmentColor: undefined, segmentLabel: undefined, segmentLabelColor: undefined, showBackground: false, showEmptySegments: false, sort: undefined, value: undefined });
5
+ const NestedDonutDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { angleRange: [0, 2 * Math.PI], centralLabel: undefined, centralSubLabel: undefined, centralSubLabelWrap: true, cornerRadius: 0, direction: NestedDonutDirection.Inwards, emptySegmentAngle: Math.PI / 180, hideOverflowingSegmentLabels: true, layers: [], layerPadding: 0, layerSettings: undefined, segmentColor: undefined, segmentLabel: undefined, segmentLabelColor: undefined, showBackground: false, showEmptySegments: false, showSegmentLabels: true, sort: undefined, value: undefined });
6
6
 
7
7
  export { NestedDonutDefaultConfig };
8
8
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/nested-donut/config.ts"],"sourcesContent":["// Core\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { NestedDonutDirection, NestedDonutLayerSettings, NestedDonutSegment } from './types'\n\nexport interface NestedDonutConfigInterface<Datum> extends ComponentConfigInterface {\n /** Diagram angle range. Default: `[0, 2 * Math.PI]` */\n angleRange?: [number, number];\n /** Direction of hierarchy flow from root to leaf.\n * `NestedDonutDirection.Inwards` starts from the outer most radius and works towards center\n * `NestedDonutDirection.Outwards` starts from the inner most radius the consecutive layers outward.\n * Default: `NestedDonutDirection.Inwards`\n */\n direction?: NestedDonutDirection | string;\n /* Numeric accessor for segment size value. Default: `undefined`. */\n value?: NumericAccessor<Datum>;\n\n /** Central label text. Default: `undefined` */\n centralLabel?: string;\n /** Central sub-label accessor function or text. Default: `undefined` */\n centralSubLabel?: string;\n /** Enables wrapping for the sub-label. Default: `true` */\n centralSubLabelWrap?: boolean;\n /**\n * Show donut background. The color is configurable via\n * the `--vis-nested-donut-background-color` and `--vis-dark-nested-donut-background-color` CSS variables.\n * Default: `false`\n */\n showBackground?: boolean;\n /** Sort function for segments. Default `undefined` */\n sort?: (a: NestedDonutSegment<Datum>, b: NestedDonutSegment<Datum>) => number;\n\n // Layers\n /** Array of accessor functions to defined the nested groups */\n layers: StringAccessor<Datum>[];\n /* Layer settings */\n layerSettings?: GenericAccessor<NestedDonutLayerSettings, number>;\n /* Space between layers */\n layerPadding?: number;\n\n // Segments\n /** Corner Radius. Default: `0` */\n cornerRadius?: number;\n /** Angular size for empty segments in radians. Default: `Math.PI / 180` */\n emptySegmentAngle?: number;\n /** Hide segment labels when they don't fit. Default: `true` */\n hideOverflowingSegmentLabels?: boolean;\n /** Color accessor function for segments. Default: `undefined` */\n segmentColor?: ColorAccessor<NestedDonutSegment<Datum>>;\n /** Segment label accessor function. Default `undefined` */\n segmentLabel?: StringAccessor<NestedDonutSegment<Datum>>;\n /** Color accessor function for segment labels */\n segmentLabelColor?: ColorAccessor<NestedDonutSegment<Datum>>;\n /** When true, the component will display empty segments (the ones that have `0` values) as tiny slices.\n * Default: `false`\n */\n showEmptySegments?: boolean;\n}\n\nexport const NestedDonutDefaultConfig: NestedDonutConfigInterface<unknown> = {\n ...ComponentDefaultConfig,\n angleRange: [0, 2 * Math.PI],\n centralLabel: undefined,\n centralSubLabel: undefined,\n centralSubLabelWrap: true,\n cornerRadius: 0,\n direction: NestedDonutDirection.Inwards,\n emptySegmentAngle: Math.PI / 180,\n hideOverflowingSegmentLabels: true,\n layers: [],\n layerPadding: 0,\n layerSettings: undefined,\n segmentColor: undefined,\n segmentLabel: undefined,\n segmentLabelColor: undefined,\n showBackground: false,\n showEmptySegments: false,\n sort: undefined,\n value: undefined,\n}\n"],"names":[],"mappings":";;;AAAA;MA6Da,wBAAwB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAChC,sBAAsB,CACzB,EAAA,EAAA,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,EAC5B,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,EAC1B,mBAAmB,EAAE,IAAI,EACzB,YAAY,EAAE,CAAC,EACf,SAAS,EAAE,oBAAoB,CAAC,OAAO,EACvC,iBAAiB,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,EAChC,4BAA4B,EAAE,IAAI,EAClC,MAAM,EAAE,EAAE,EACV,YAAY,EAAE,CAAC,EACf,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,SAAS,EACvB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,SAAS,EAC5B,cAAc,EAAE,KAAK,EACrB,iBAAiB,EAAE,KAAK,EACxB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/nested-donut/config.ts"],"sourcesContent":["// Core\nimport { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { NestedDonutDirection, NestedDonutLayerSettings, NestedDonutSegment } from './types'\n\nexport interface NestedDonutConfigInterface<Datum> extends ComponentConfigInterface {\n /** Diagram angle range. Default: `[0, 2 * Math.PI]` */\n angleRange?: [number, number];\n /** Direction of hierarchy flow from root to leaf.\n * `NestedDonutDirection.Inwards` starts from the outer most radius and works towards center\n * `NestedDonutDirection.Outwards` starts from the inner most radius the consecutive layers outward.\n * Default: `NestedDonutDirection.Inwards`\n */\n direction?: NestedDonutDirection | string;\n /* Numeric accessor for segment size value. Default: `undefined`. */\n value?: NumericAccessor<Datum>;\n\n /** Central label text. Default: `undefined` */\n centralLabel?: string;\n /** Central sub-label accessor function or text. Default: `undefined` */\n centralSubLabel?: string;\n /** Enables wrapping for the sub-label. Default: `true` */\n centralSubLabelWrap?: boolean;\n /**\n * Show donut background. The color is configurable via\n * the `--vis-nested-donut-background-color` and `--vis-dark-nested-donut-background-color` CSS variables.\n * Default: `false`\n */\n showBackground?: boolean;\n /** Sort function for segments. Default `undefined` */\n sort?: (a: NestedDonutSegment<Datum>, b: NestedDonutSegment<Datum>) => number;\n\n // Layers\n /** Array of accessor functions to defined the nested groups */\n layers: StringAccessor<Datum>[];\n /* Layer settings */\n layerSettings?: GenericAccessor<NestedDonutLayerSettings, number>;\n /* Space between layers */\n layerPadding?: number;\n\n // Segments\n /** Corner Radius. Default: `0` */\n cornerRadius?: number;\n /** Angular size for empty segments in radians. Default: `Math.PI / 180` */\n emptySegmentAngle?: number;\n /** Hide segment labels when they don't fit. Default: `true` */\n hideOverflowingSegmentLabels?: boolean;\n /** Color accessor function for segments. Default: `undefined` */\n segmentColor?: ColorAccessor<NestedDonutSegment<Datum>>;\n /** Segment label accessor function. Default `undefined` */\n segmentLabel?: StringAccessor<NestedDonutSegment<Datum>>;\n /** Color accessor function for segment labels */\n segmentLabelColor?: ColorAccessor<NestedDonutSegment<Datum>>;\n /** When true, the component will display empty segments (the ones that have `0` values) as tiny slices.\n * Default: `false`\n */\n showEmptySegments?: boolean;\n showSegmentLabels?: boolean;\n}\n\nexport const NestedDonutDefaultConfig: NestedDonutConfigInterface<unknown> = {\n ...ComponentDefaultConfig,\n angleRange: [0, 2 * Math.PI],\n centralLabel: undefined,\n centralSubLabel: undefined,\n centralSubLabelWrap: true,\n cornerRadius: 0,\n direction: NestedDonutDirection.Inwards,\n emptySegmentAngle: Math.PI / 180,\n hideOverflowingSegmentLabels: true,\n layers: [],\n layerPadding: 0,\n layerSettings: undefined,\n segmentColor: undefined,\n segmentLabel: undefined,\n segmentLabelColor: undefined,\n showBackground: false,\n showEmptySegments: false,\n showSegmentLabels: true,\n sort: undefined,\n value: undefined,\n}\n"],"names":[],"mappings":";;;AAAA;MA8Da,wBAAwB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAChC,sBAAsB,CACzB,EAAA,EAAA,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,EAC5B,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,EAC1B,mBAAmB,EAAE,IAAI,EACzB,YAAY,EAAE,CAAC,EACf,SAAS,EAAE,oBAAoB,CAAC,OAAO,EACvC,iBAAiB,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,EAChC,4BAA4B,EAAE,IAAI,EAClC,MAAM,EAAE,EAAE,EACV,YAAY,EAAE,CAAC,EACf,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,SAAS,EACvB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,SAAS,EAC5B,cAAc,EAAE,KAAK,EACrB,iBAAiB,EAAE,KAAK,EACxB,iBAAiB,EAAE,IAAI,EACvB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAAA;;;;"}
@@ -41,6 +41,10 @@ class NestedDonut extends ComponentCore {
41
41
  var _a, _b;
42
42
  const { config } = this;
43
43
  const duration = isNumber(customDuration) ? customDuration : config.duration;
44
+ if (config.layers === undefined || config.layers.length === 0) {
45
+ console.warn('Unovis | Nested Donut: No layers defined.');
46
+ return;
47
+ }
44
48
  const layers = this._getLayerSettings();
45
49
  const data = this._getHierarchyData(layers);
46
50
  this.arcGen
@@ -100,16 +104,18 @@ class NestedDonut extends ComponentCore {
100
104
  .attr('class', segmentExit)
101
105
  .call(removeArc, duration);
102
106
  // Segment labels
103
- const labels = this.arcGroup
104
- .selectAll(`.${segmentLabel}`)
105
- .data(data, d => d._id);
106
- const labelsEnter = segmentsEnter.append('text')
107
- .attr('class', segmentLabel)
108
- .call(createLabel, this.arcGen);
109
- labels.merge(labelsEnter)
110
- .call(updateLabel, config, this.arcGen, duration);
111
- labels.exit()
112
- .call(removeLabel, duration);
107
+ if (config.showSegmentLabels) {
108
+ const labels = this.arcGroup
109
+ .selectAll(`.${segmentLabel}`)
110
+ .data(data, d => d._id);
111
+ const labelsEnter = segmentsEnter.append('text')
112
+ .attr('class', segmentLabel)
113
+ .call(createLabel, this.arcGen);
114
+ labels.merge(labelsEnter)
115
+ .call(updateLabel, config, this.arcGen, duration);
116
+ labels.exit()
117
+ .call(removeLabel, duration);
118
+ }
113
119
  // Chart labels
114
120
  this.centralLabel
115
121
  .attr('dy', config.centralSubLabel ? '-0.55em' : null)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { arc, pie } from 'd3-shape'\nimport { hierarchy, HierarchyNode, partition } from 'd3-hierarchy'\nimport { scaleLinear, ScaleLinear } from 'd3-scale'\nimport { group } from 'd3-array'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { SeriesDataModel } from 'data-models/series'\n\n// Types\nimport { VerticalAlign } from 'types/text'\n\n// Utils\nimport { getColor } from 'utils/color'\nimport { smartTransition } from 'utils/d3'\nimport { getNumber, getString, getValue, isNumber, isNumberWithinRange, merge } from 'utils/data'\nimport { getPixelValue } from 'utils/misc'\nimport { cssvar } from 'utils/style'\nimport { wrapSVGText } from 'utils/text'\n\n// Local Types\nimport { NestedDonutDirection, NestedDonutSegment, NestedDonutLayer, NestedDonutSegmentLabelAlignment } from './types'\n\n// Config\nimport { NestedDonutDefaultConfig, NestedDonutConfigInterface } from './config'\n\n// Modules\nimport { createArc, updateArc, removeArc } from './modules/arc'\nimport { createLabel, updateLabel, removeLabel } from './modules/label'\n\n// Styles\nimport * as s from './style'\n\nexport class NestedDonut<Datum> extends ComponentCore<\nDatum[],\nNestedDonutConfigInterface<Datum>\n> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = NestedDonutDefaultConfig as NestedDonutConfigInterface<Datum>\n public config: NestedDonutConfigInterface<Datum> = this._defaultConfig\n datamodel: SeriesDataModel<Datum> = new SeriesDataModel()\n\n arcBackground: Selection<SVGGElement, unknown, SVGGElement, unknown>\n arcGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n centralLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>\n centralSubLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>\n\n arcGen = arc<Partial<NestedDonutSegment<Datum>>>()\n colorScale: ScaleLinear<string, string> = scaleLinear()\n\n events = { }\n\n constructor (config?: NestedDonutConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n this.arcBackground = this.g.append('g')\n this.arcGroup = this.g.append('g')\n .attr('class', s.segmentsGroup)\n this.centralLabel = this.g.append('text')\n .attr('class', s.centralLabel)\n this.centralSubLabel = this.g.append('text')\n .attr('class', s.centralSubLabel)\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const layers = this._getLayerSettings()\n const data = this._getHierarchyData(layers)\n\n this.arcGen\n .startAngle(d => d.x0)\n .endAngle(d => d.x1)\n .innerRadius(d => d.y0)\n .outerRadius(d => d.y1)\n .cornerRadius(config.cornerRadius)\n\n this.arcGroup.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n this.arcBackground.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n this.centralLabel.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n this.centralSubLabel.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n\n // Layer backgrounds\n const backgrounds = this.arcBackground\n .selectAll<SVGPathElement, NestedDonutLayer>(`.${s.background}`)\n .data(layers, d => d._id)\n\n const backgroundsEnter = backgrounds.enter().append('path')\n .attr('class', s.background)\n .attr('visibility', config.showBackground ? null : 'hidden')\n\n const backgroundsMerged = backgrounds.merge(backgroundsEnter)\n .style('transition', `fill ${duration}ms`)\n .style('fill', d => d.backgroundColor)\n\n smartTransition(backgroundsMerged, duration)\n .attr('d', d => this.arcGen({\n x0: config.angleRange?.[0] ?? 0,\n x1: config.angleRange?.[1] ?? 2 * Math.PI,\n y0: d._innerRadius,\n y1: d._outerRadius,\n }))\n\n smartTransition(backgrounds.exit(), duration)\n .style('opacity', 0)\n .remove()\n\n // Segments\n const segments = this.arcGroup.selectAll<SVGGElement, NestedDonutSegment<Datum>>(`${s.segment}`)\n .data(data, d => d._id)\n\n const segmentsEnter = segments.enter()\n .append('g')\n .attr('class', s.segment)\n\n segments.merge(segmentsEnter)\n smartTransition(segments.exit(), duration)\n .attr('class', s.segmentExit)\n .style('opacity', 0)\n .remove()\n\n // Segment arcs\n const arcs = this.arcGroup\n .selectAll<SVGPathElement, NestedDonutSegment<Datum>>(`.${s.segmentArc}`)\n .data(data, d => d._id)\n\n const arcsEnter = segmentsEnter.append('path')\n .attr('class', s.segmentArc)\n .call(createArc, config)\n\n arcs.merge(arcsEnter)\n .call(updateArc, config, this.arcGen, duration)\n\n arcs.exit<NestedDonutSegment<Datum>>()\n .attr('class', s.segmentExit)\n .call(removeArc, duration)\n\n // Segment labels\n const labels = this.arcGroup\n .selectAll<SVGTextElement, NestedDonutSegment<Datum>>(`.${s.segmentLabel}`)\n .data(data, d => d._id)\n\n const labelsEnter = segmentsEnter.append('text')\n .attr('class', s.segmentLabel)\n .call(createLabel, this.arcGen)\n\n labels.merge(labelsEnter)\n .call(updateLabel, config, this.arcGen, duration)\n\n labels.exit<NestedDonutSegment<Datum>>()\n .call(removeLabel, duration)\n\n // Chart labels\n this.centralLabel\n .attr('dy', config.centralSubLabel ? '-0.55em' : null)\n .text(config.centralLabel ?? null)\n\n this.centralSubLabel\n .attr('dy', config.centralLabel ? '0.55em' : null)\n .text(config.centralSubLabel ?? null)\n\n if (config.centralSubLabelWrap) wrapSVGText(this.centralSubLabel, layers[0]._innerRadius * 1.9, VerticalAlign.Top)\n }\n\n private _getHierarchyData (layers: NestedDonutLayer[]): NestedDonutSegment<Datum>[] {\n const { config, datamodel: { data } } = this\n\n const layerAccessors = config.layers?.map(layerAccessor => (i: number) => getString(data[i], layerAccessor, i))\n const nestedData = group(data.keys(), ...layerAccessors as [(i: number) => string])\n\n const rootNode = config.value !== undefined\n ? hierarchy(nestedData).sum(index => typeof index === 'number' && getNumber(data[index], config.value, index))\n : hierarchy(nestedData).count()\n\n const partitionData = partition().size([config.angleRange[1], 1])(rootNode) as NestedDonutSegment<Datum>\n\n partitionData\n .each(node => {\n // Starting with the root, we transform the original data returned from d3.hierarchy\n const n = node as unknown as HierarchyNode<[string, number[]]>\n node.data = {\n key: n.data[0],\n values: Array.isArray(n.data[1]) ? (n.data[1] as number[]).map(i => data[i]) : [],\n root: node.parent?.data?.root ?? n.data[0],\n }\n node._id = `root${partitionData.path(node).map(d => d.data.key).join('->')}`\n if (isNumberWithinRange(node.depth - 1, [0, layers.length - 1])) {\n node._layer = layers[node.depth - 1]\n node.y0 = node._layer._innerRadius\n node.y1 = node._layer._outerRadius\n }\n })\n .eachBefore((node) => {\n // Once ancestors have been visited, children properties that are\n // dependent on the parent's data are populated here\n if (!node.children || node.depth === rootNode.height - 1) return\n\n const positions = pie<NestedDonutSegment<Datum>>()\n .startAngle(node.parent ? node.x0 : config.angleRange?.[0])\n .endAngle(node.parent ? node.x1 : config.angleRange?.[1])\n .value(d => config.showEmptySegments && d.value === 0\n ? config.emptySegmentAngle\n : (d.x1 - d.x0))\n .sort(config.sort)(node.children)\n\n const opacity = scaleLinear()\n .domain([-1, node.children.length])\n .range([node._state?.fillOpacity ?? 1, 0])\n\n node.children.forEach((child, i) => {\n child._index = i\n child.x0 = positions[i].startAngle\n child.x1 = positions[i].endAngle\n\n // Default to parent's fill if segmentColor accessor is not provided\n const color = getColor(child, config.segmentColor, positions[i].index, child.depth !== 1)\n child._state = {\n fill: color ?? node._state.fill,\n fillOpacity: color === null ? opacity(positions[i].index) : null,\n }\n })\n })\n .eachAfter(node => {\n // Once hierarchy has been traversed, we append children data the parent\n // parent.data serves as a reference to all the original data it represents\n node.children?.forEach(ch => node.data.values.push(...ch.data.values))\n })\n\n const segments = partitionData.descendants().filter(d => d.parent?.value && d.data.key)\n return segments\n }\n\n private _getLayerSettings (): NestedDonutLayer[] {\n const { direction, layers, layerPadding, layerSettings } = this.config\n\n const outerRadius = Math.min(this._width, this._height) / 2\n\n const defaultLayerSettings = {\n backgroundColor: cssvar(s.variables.nestedDonutBackgroundColor),\n labelAlignment: NestedDonutSegmentLabelAlignment.Perpendicular,\n width: outerRadius * 0.75 / layers.length,\n }\n const layerItems = layers.reduceRight((arr, _, i) => {\n const layerId = direction === NestedDonutDirection.Outwards ? i : arr.length\n const layerConfig = merge(defaultLayerSettings, getValue(layerId, layerSettings))\n const radius = arr.length ? arr[0]._innerRadius - layerPadding : outerRadius\n const layerWidth = getPixelValue(layerConfig.width)\n if (layerWidth === null) {\n console.warn(`Unovis | Nested Donut: Could not parse width ${layerConfig.width}. Setting to default.`)\n }\n arr.unshift({\n ...layerConfig,\n _id: layerId,\n _outerRadius: radius,\n _innerRadius: radius - (layerWidth ?? defaultLayerSettings.width),\n })\n return arr\n }, new Array<NestedDonutLayer>())\n\n return direction === NestedDonutDirection.Inwards ? layerItems.reverse() : layerItems\n }\n}\n"],"names":["s.segmentsGroup","s.centralLabel","s.centralSubLabel","s.background","s.segment","s.segmentExit","s.segmentArc","s.segmentLabel","s.variables","s"],"mappings":";;;;;;;;;;;;;;;;;;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,MAAM,IAAI,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,KAAA,CAAA,GAAV,UAAU,GAAI,oBAAoB,CAAC,KAAK,CAAC,IACjE,CAAA;AACF,YAAA,OAAO,GAAG,CAAA;AACZ,SAAC,EAAE,IAAI,KAAK,EAAoB,CAAC,CAAA;AAEjC,QAAA,OAAO,SAAS,KAAK,oBAAoB,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,UAAU,CAAA;KACtF;;AAjOM,WAAS,CAAA,SAAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGD,SAAW;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { arc, pie } from 'd3-shape'\nimport { hierarchy, HierarchyNode, partition } from 'd3-hierarchy'\nimport { scaleLinear, ScaleLinear } from 'd3-scale'\nimport { group } from 'd3-array'\n\n// Core\nimport { ComponentCore } from 'core/component'\nimport { SeriesDataModel } from 'data-models/series'\n\n// Types\nimport { VerticalAlign } from 'types/text'\n\n// Utils\nimport { getColor } from 'utils/color'\nimport { smartTransition } from 'utils/d3'\nimport { getNumber, getString, getValue, isNumber, isNumberWithinRange, merge } from 'utils/data'\nimport { getPixelValue } from 'utils/misc'\nimport { cssvar } from 'utils/style'\nimport { wrapSVGText } from 'utils/text'\n\n// Local Types\nimport { NestedDonutDirection, NestedDonutSegment, NestedDonutLayer, NestedDonutSegmentLabelAlignment } from './types'\n\n// Config\nimport { NestedDonutDefaultConfig, NestedDonutConfigInterface } from './config'\n\n// Modules\nimport { createArc, updateArc, removeArc } from './modules/arc'\nimport { createLabel, updateLabel, removeLabel } from './modules/label'\n\n// Styles\nimport * as s from './style'\n\nexport class NestedDonut<Datum> extends ComponentCore<\nDatum[],\nNestedDonutConfigInterface<Datum>\n> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = NestedDonutDefaultConfig as NestedDonutConfigInterface<Datum>\n public config: NestedDonutConfigInterface<Datum> = this._defaultConfig\n datamodel: SeriesDataModel<Datum> = new SeriesDataModel()\n\n arcBackground: Selection<SVGGElement, unknown, SVGGElement, unknown>\n arcGroup: Selection<SVGGElement, unknown, SVGGElement, unknown>\n centralLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>\n centralSubLabel: Selection<SVGTextElement, unknown, SVGGElement, unknown>\n\n arcGen = arc<Partial<NestedDonutSegment<Datum>>>()\n colorScale: ScaleLinear<string, string> = scaleLinear()\n\n events = { }\n\n constructor (config?: NestedDonutConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n this.arcBackground = this.g.append('g')\n this.arcGroup = this.g.append('g')\n .attr('class', s.segmentsGroup)\n this.centralLabel = this.g.append('text')\n .attr('class', s.centralLabel)\n this.centralSubLabel = this.g.append('text')\n .attr('class', s.centralSubLabel)\n }\n\n _render (customDuration?: number): void {\n const { config } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n if (config.layers === undefined || config.layers.length === 0) {\n console.warn('Unovis | Nested Donut: No layers defined.')\n return\n }\n const layers = this._getLayerSettings()\n const data = this._getHierarchyData(layers)\n\n this.arcGen\n .startAngle(d => d.x0)\n .endAngle(d => d.x1)\n .innerRadius(d => d.y0)\n .outerRadius(d => d.y1)\n .cornerRadius(config.cornerRadius)\n\n this.arcGroup.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n this.arcBackground.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n this.centralLabel.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n this.centralSubLabel.attr('transform', `translate(${this._width / 2},${this._height / 2})`)\n\n // Layer backgrounds\n const backgrounds = this.arcBackground\n .selectAll<SVGPathElement, NestedDonutLayer>(`.${s.background}`)\n .data(layers, d => d._id)\n\n const backgroundsEnter = backgrounds.enter().append('path')\n .attr('class', s.background)\n .attr('visibility', config.showBackground ? null : 'hidden')\n\n const backgroundsMerged = backgrounds.merge(backgroundsEnter)\n .style('transition', `fill ${duration}ms`)\n .style('fill', d => d.backgroundColor)\n\n smartTransition(backgroundsMerged, duration)\n .attr('d', d => this.arcGen({\n x0: config.angleRange?.[0] ?? 0,\n x1: config.angleRange?.[1] ?? 2 * Math.PI,\n y0: d._innerRadius,\n y1: d._outerRadius,\n }))\n\n smartTransition(backgrounds.exit(), duration)\n .style('opacity', 0)\n .remove()\n\n // Segments\n const segments = this.arcGroup.selectAll<SVGGElement, NestedDonutSegment<Datum>>(`${s.segment}`)\n .data(data, d => d._id)\n\n const segmentsEnter = segments.enter()\n .append('g')\n .attr('class', s.segment)\n\n segments.merge(segmentsEnter)\n smartTransition(segments.exit(), duration)\n .attr('class', s.segmentExit)\n .style('opacity', 0)\n .remove()\n\n // Segment arcs\n const arcs = this.arcGroup\n .selectAll<SVGPathElement, NestedDonutSegment<Datum>>(`.${s.segmentArc}`)\n .data(data, d => d._id)\n\n const arcsEnter = segmentsEnter.append('path')\n .attr('class', s.segmentArc)\n .call(createArc, config)\n\n arcs.merge(arcsEnter)\n .call(updateArc, config, this.arcGen, duration)\n\n arcs.exit<NestedDonutSegment<Datum>>()\n .attr('class', s.segmentExit)\n .call(removeArc, duration)\n\n // Segment labels\n if (config.showSegmentLabels) {\n const labels = this.arcGroup\n .selectAll<SVGTextElement, NestedDonutSegment<Datum>>(`.${s.segmentLabel}`)\n .data(data, d => d._id)\n\n const labelsEnter = segmentsEnter.append('text')\n .attr('class', s.segmentLabel)\n .call(createLabel, this.arcGen)\n\n labels.merge(labelsEnter)\n .call(updateLabel, config, this.arcGen, duration)\n\n labels.exit<NestedDonutSegment<Datum>>()\n .call(removeLabel, duration)\n }\n\n // Chart labels\n this.centralLabel\n .attr('dy', config.centralSubLabel ? '-0.55em' : null)\n .text(config.centralLabel ?? null)\n\n this.centralSubLabel\n .attr('dy', config.centralLabel ? '0.55em' : null)\n .text(config.centralSubLabel ?? null)\n\n if (config.centralSubLabelWrap) wrapSVGText(this.centralSubLabel, layers[0]._innerRadius * 1.9, VerticalAlign.Top)\n }\n\n private _getHierarchyData (layers: NestedDonutLayer[]): NestedDonutSegment<Datum>[] {\n const { config, datamodel: { data } } = this\n\n const layerAccessors = config.layers?.map(layerAccessor => (i: number) => getString(data[i], layerAccessor, i))\n const nestedData = group(data.keys(), ...layerAccessors as [(i: number) => string])\n\n const rootNode = config.value !== undefined\n ? hierarchy(nestedData).sum(index => typeof index === 'number' && getNumber(data[index], config.value, index))\n : hierarchy(nestedData).count()\n\n const partitionData = partition().size([config.angleRange[1], 1])(rootNode) as NestedDonutSegment<Datum>\n\n partitionData\n .each(node => {\n // Starting with the root, we transform the original data returned from d3.hierarchy\n const n = node as unknown as HierarchyNode<[string, number[]]>\n node.data = {\n key: n.data[0],\n values: Array.isArray(n.data[1]) ? (n.data[1] as number[]).map(i => data[i]) : [],\n root: node.parent?.data?.root ?? n.data[0],\n }\n node._id = `root${partitionData.path(node).map(d => d.data.key).join('->')}`\n if (isNumberWithinRange(node.depth - 1, [0, layers.length - 1])) {\n node._layer = layers[node.depth - 1]\n node.y0 = node._layer._innerRadius\n node.y1 = node._layer._outerRadius\n }\n })\n .eachBefore((node) => {\n // Once ancestors have been visited, children properties that are\n // dependent on the parent's data are populated here\n if (!node.children || node.depth === rootNode.height - 1) return\n\n const positions = pie<NestedDonutSegment<Datum>>()\n .startAngle(node.parent ? node.x0 : config.angleRange?.[0])\n .endAngle(node.parent ? node.x1 : config.angleRange?.[1])\n .value(d => config.showEmptySegments && d.value === 0\n ? config.emptySegmentAngle\n : (d.x1 - d.x0))\n .sort(config.sort)(node.children)\n\n const opacity = scaleLinear()\n .domain([-1, node.children.length])\n .range([node._state?.fillOpacity ?? 1, 0])\n\n node.children.forEach((child, i) => {\n child._index = i\n child.x0 = positions[i].startAngle\n child.x1 = positions[i].endAngle\n\n // Default to parent's fill if segmentColor accessor is not provided\n const color = getColor(child, config.segmentColor, positions[i].index, child.depth !== 1)\n child._state = {\n fill: color ?? node._state.fill,\n fillOpacity: color === null ? opacity(positions[i].index) : null,\n }\n })\n })\n .eachAfter(node => {\n // Once hierarchy has been traversed, we append children data the parent\n // parent.data serves as a reference to all the original data it represents\n node.children?.forEach(ch => node.data.values.push(...ch.data.values))\n })\n\n const segments = partitionData.descendants().filter(d => d.parent?.value && d.data.key)\n return segments\n }\n\n private _getLayerSettings (): NestedDonutLayer[] {\n const { direction, layers, layerPadding, layerSettings } = this.config\n\n const outerRadius = Math.min(this._width, this._height) / 2\n\n const defaultLayerSettings = {\n backgroundColor: cssvar(s.variables.nestedDonutBackgroundColor),\n labelAlignment: NestedDonutSegmentLabelAlignment.Perpendicular,\n width: outerRadius * 0.75 / layers.length,\n }\n const layerItems = layers.reduceRight((arr, _, i) => {\n const layerId = direction === NestedDonutDirection.Outwards ? i : arr.length\n const layerConfig = merge(defaultLayerSettings, getValue(layerId, layerSettings))\n const radius = arr.length ? arr[0]._innerRadius - layerPadding : outerRadius\n const layerWidth = getPixelValue(layerConfig.width)\n if (layerWidth === null) {\n console.warn(`Unovis | Nested Donut: Could not parse width ${layerConfig.width}. Setting to default.`)\n }\n arr.unshift({\n ...layerConfig,\n _id: layerId,\n _outerRadius: radius,\n _innerRadius: radius - (layerWidth ?? defaultLayerSettings.width),\n })\n return arr\n }, new Array<NestedDonutLayer>())\n\n return direction === NestedDonutDirection.Inwards ? layerItems.reverse() : layerItems\n }\n}\n"],"names":["s.segmentsGroup","s.centralLabel","s.centralSubLabel","s.background","s.segment","s.segmentExit","s.segmentArc","s.segmentLabel","s.variables","s"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCM,MAAO,WAAmB,SAAQ,aAGvC,CAAA;AAiBC,IAAA,WAAA,CAAa,MAA0C,EAAA;AACrD,QAAA,KAAK,EAAE,CAAA;QAfC,IAAc,CAAA,cAAA,GAAG,wBAA6D,CAAA;AACjF,QAAA,IAAA,CAAA,MAAM,GAAsC,IAAI,CAAC,cAAc,CAAA;AACtE,QAAA,IAAA,CAAA,SAAS,GAA2B,IAAI,eAAe,EAAE,CAA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,UAAU,KAAA,KAAA,CAAA,GAAV,UAAU,GAAI,oBAAoB,CAAC,KAAK,CAAC,IACjE,CAAA;AACF,YAAA,OAAO,GAAG,CAAA;AACZ,SAAC,EAAE,IAAI,KAAK,EAAoB,CAAC,CAAA;AAEjC,QAAA,OAAO,SAAS,KAAK,oBAAoB,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,UAAU,CAAA;KACtF;;AAvOM,WAAS,CAAA,SAAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGD,SAAW;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unovis/ts",
3
3
  "description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
4
- "version": "1.4.0-beta.0",
4
+ "version": "1.4.0-beta.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/f5/unovis.git",