@unovis/ts 1.1.2-beta.10 → 1.1.2-beta.11

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.
@@ -23,6 +23,8 @@ export interface NestedDonutConfigInterface<Datum> extends ComponentConfigInterf
23
23
  * Default: `false`
24
24
  */
25
25
  showBackground?: boolean;
26
+ /** Sort function for segments. Default `undefined` */
27
+ sort?: (a: NestedDonutSegment<Datum>, b: NestedDonutSegment<Datum>) => number;
26
28
  /** Array of accessor functions to defined the nested groups */
27
29
  layers: StringAccessor<Datum>[];
28
30
  layerSettings?: GenericAccessor<NestedDonutLayerSettings, number>;
@@ -61,5 +63,6 @@ export declare class NestedDonutConfig<Datum> extends ComponentConfig implements
61
63
  segmentLabelColor: any;
62
64
  showBackground: boolean;
63
65
  showEmptySegments: boolean;
66
+ sort: any;
64
67
  value: any;
65
68
  }
@@ -20,6 +20,7 @@ class NestedDonutConfig extends ComponentConfig {
20
20
  this.segmentLabelColor = undefined;
21
21
  this.showBackground = false;
22
22
  this.showEmptySegments = false;
23
+ this.sort = undefined;
23
24
  this.value = undefined;
24
25
  }
25
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/nested-donut/config.ts"],"sourcesContent":["// Core\nimport { ComponentConfigInterface, ComponentConfig } 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\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 class NestedDonutConfig<Datum> extends ComponentConfig implements NestedDonutConfigInterface<Datum> {\n angleRange = [0, 2 * Math.PI] as [number, number]\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: StringAccessor<Datum>[]\n layerPadding = 0\n layerSettings = undefined\n segmentColor = undefined\n segmentLabel = undefined\n segmentLabelColor = undefined\n showBackground = false\n showEmptySegments = false\n value = undefined\n}\n"],"names":[],"mappings":";;;AAAA;AA2DM,MAAO,iBAAyB,SAAQ,eAAe,CAAA;AAA7D,IAAA,WAAA,GAAA;;QACE,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAqB,CAAA;QACjD,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAe,CAAA,eAAA,GAAG,SAAS,CAAA;QAC3B,IAAmB,CAAA,mBAAA,GAAG,IAAI,CAAA;QAC1B,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;AAChB,QAAA,IAAA,CAAA,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAA;AACxC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAA;QACjC,IAA4B,CAAA,4BAAA,GAAG,IAAI,CAAA;QAEnC,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;QAChB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAc,CAAA,cAAA,GAAG,KAAK,CAAA;QACtB,IAAiB,CAAA,iBAAA,GAAG,KAAK,CAAA;QACzB,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;KAClB;AAAA;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/nested-donut/config.ts"],"sourcesContent":["// Core\nimport { ComponentConfigInterface, ComponentConfig } 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 class NestedDonutConfig<Datum> extends ComponentConfig implements NestedDonutConfigInterface<Datum> {\n angleRange = [0, 2 * Math.PI] as [number, number]\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: StringAccessor<Datum>[]\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;AA6DM,MAAO,iBAAyB,SAAQ,eAAe,CAAA;AAA7D,IAAA,WAAA,GAAA;;QACE,IAAU,CAAA,UAAA,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAqB,CAAA;QACjD,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAe,CAAA,eAAA,GAAG,SAAS,CAAA;QAC3B,IAAmB,CAAA,mBAAA,GAAG,IAAI,CAAA;QAC1B,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;AAChB,QAAA,IAAA,CAAA,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAA;AACxC,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAA;QACjC,IAA4B,CAAA,4BAAA,GAAG,IAAI,CAAA;QAEnC,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;QAChB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAc,CAAA,cAAA,GAAG,KAAK,CAAA;QACtB,IAAiB,CAAA,iBAAA,GAAG,KAAK,CAAA;QACzB,IAAI,CAAA,IAAA,GAAG,SAAS,CAAA;QAChB,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;KAClB;AAAA;;;;"}
@@ -8,8 +8,9 @@ import * as s from './style';
8
8
  export declare class NestedDonut<Datum> extends ComponentCore<Datum[], NestedDonutConfig<Datum>, NestedDonutConfigInterface<Datum>> {
9
9
  static selectors: typeof s;
10
10
  static cssVariables: {
11
- nestedDonutBackgroundColor: "--vis-nested-donut-background-color";
12
11
  nestedDonutFontFamily: "--vis-nested-donut-font-family";
12
+ nestedDonutBackgroundFill: "--vis-nested-donut-background-fill";
13
+ nestedDonutBackgroundStroke: "--vis-nested-donut-background-stroke";
13
14
  nestedDonutCentralLabelFontSize: "--vis-nested-donut-central-label-font-size";
14
15
  nestedDonutCentralLabelFontWeight: "--vis-nested-donut-central-label-font-weight";
15
16
  nestedDonutCentralLabelTextColor: "--vis-nested-donut-central-label-text-color";
@@ -6,10 +6,12 @@ import { ComponentCore } from '../../core/component/index.js';
6
6
  import { SeriesDataModel } from '../../data-models/series.js';
7
7
  import { VerticalAlign } from '../../types/text.js';
8
8
  import { getHexValue, getColor } from '../../utils/color.js';
9
- import { isNumber, getString, getNumber, isNumberWithinRange, merge, getValue } from '../../utils/data.js';
10
9
  import { smartTransition } from '../../utils/d3.js';
10
+ import { isNumber, getString, getNumber, isNumberWithinRange, merge, getValue } from '../../utils/data.js';
11
+ import { getCSSVariableValueInPixels } from '../../utils/misc.js';
12
+ import { cssvar } from '../../utils/style.js';
11
13
  import { wrapSVGText } from '../../utils/text.js';
12
- import { NestedDonutDirection, defaultLayerSettings } from './types.js';
14
+ import { NestedDonutSegmentLabelAlignment, NestedDonutDirection } from './types.js';
13
15
  import { NestedDonutConfig } from './config.js';
14
16
  import { createArc, updateArc, removeArc } from './modules/arc.js';
15
17
  import { createLabel, updateLabel, removeLabel } from './modules/label.js';
@@ -54,13 +56,15 @@ class NestedDonut extends ComponentCore {
54
56
  const backgroundsEnter = backgrounds.enter().append('path')
55
57
  .attr('class', background)
56
58
  .attr('visibility', config.showBackground ? null : 'hidden');
57
- const backgroundsMerged = backgrounds.merge(backgroundsEnter);
59
+ const backgroundsMerged = backgrounds.merge(backgroundsEnter)
60
+ .style('transition', `fill ${duration}ms`)
61
+ .style('fill', d => d.backgroundColor);
58
62
  smartTransition(backgroundsMerged, duration)
59
63
  .attr('d', d => {
60
- var _a, _b, _c, _d, _e, _f, _g, _h;
64
+ var _a, _b, _c, _d;
61
65
  return this.arcGen({
62
- x0: (_d = (_b = (_a = config.angleRange) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : (_c = config.angleRange) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : 0,
63
- x1: (_h = (_f = (_e = config.angleRange) === null || _e === void 0 ? void 0 : _e[1]) !== null && _f !== void 0 ? _f : (_g = config.angleRange) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : 2 * Math.PI,
66
+ x0: (_b = (_a = config.angleRange) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 0,
67
+ x1: (_d = (_c = config.angleRange) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : 2 * Math.PI,
64
68
  y0: d._innerRadius,
65
69
  y1: d._outerRadius,
66
70
  });
@@ -121,42 +125,58 @@ class NestedDonut extends ComponentCore {
121
125
  ? hierarchy(nestedData).sum(index => typeof index === 'number' && getNumber(data[index], config.value, index))
122
126
  : hierarchy(nestedData).count();
123
127
  const partitionData = partition().size([config.angleRange[1], 1])(rootNode);
124
- partitionData.eachBefore(node => {
125
- var _a, _b, _c, _d, _e;
126
- const key = node.data[0];
127
- node.data = { key, root: (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.data.root) !== null && _b !== void 0 ? _b : key };
128
+ partitionData
129
+ .each(node => {
130
+ var _a, _b, _c;
131
+ node.data = {
132
+ key: node.data[0],
133
+ values: ((_a = (node.data[1])) === null || _a === void 0 ? void 0 : _a.length) ? node.data[1].map((index) => data[index]) : [],
134
+ root: (_c = (_b = node.parent) === null || _b === void 0 ? void 0 : _b.data.root) !== null && _c !== void 0 ? _c : node.data[0],
135
+ };
136
+ node._id = `root${partitionData.path(node).map(d => d.data.key).join('->')}`;
128
137
  if (isNumberWithinRange(node.depth - 1, [0, layers.length - 1])) {
129
- node._id = this.uid.replace(/-.*/gm, `-${key}`);
130
138
  node._layer = layers[node.depth - 1];
131
139
  node.y0 = node._layer._innerRadius;
132
140
  node.y1 = node._layer._outerRadius;
133
141
  }
134
- if (node.children) {
135
- const colors = this.colorScale
136
- .domain([-1, node.children.length])
137
- .range(['#fff', getHexValue((_c = node._state) === null || _c === void 0 ? void 0 : _c.fill, this.element)]);
138
- const positions = pie()
139
- .startAngle(node.parent ? node.x0 : (_d = config.angleRange) === null || _d === void 0 ? void 0 : _d[0])
140
- .endAngle(node.parent ? node.x1 : (_e = config.angleRange) === null || _e === void 0 ? void 0 : _e[1])
141
- .value(d => config.showEmptySegments && d.value === 0 ? config.emptySegmentAngle : (d.x1 - d.x0))
142
- .sort(d => d._index)(node.children);
143
- node.children.forEach((child, i) => {
144
- var _a;
145
- child._index = i;
146
- child.x0 = positions[i].startAngle;
147
- child.x1 = positions[i].endAngle;
148
- child._state = {
149
- fill: (_a = getColor(child, config.segmentColor, i, child.depth !== 1)) !== null && _a !== void 0 ? _a : colors(i),
150
- };
151
- });
152
- }
142
+ })
143
+ .eachAfter(node => { var _a; return (_a = node.children) === null || _a === void 0 ? void 0 : _a.forEach(ch => node.data.values.push(...ch.data.values)); })
144
+ .eachBefore(node => {
145
+ var _a, _b, _c;
146
+ if (!node.children || node.depth === rootNode.height - 1)
147
+ return;
148
+ const colors = this.colorScale
149
+ .domain([-1, node.children.length])
150
+ .range([getHexValue((_a = node._state) === null || _a === void 0 ? void 0 : _a.fill, this.element), '#fff']);
151
+ const positions = pie()
152
+ .startAngle(node.parent ? node.x0 : (_b = config.angleRange) === null || _b === void 0 ? void 0 : _b[0])
153
+ .endAngle(node.parent ? node.x1 : (_c = config.angleRange) === null || _c === void 0 ? void 0 : _c[1])
154
+ .value(d => config.showEmptySegments && d.value === 0
155
+ ? config.emptySegmentAngle
156
+ : (d.x1 - d.x0))
157
+ .sort(config.sort)(node.children);
158
+ node.children.forEach((child, i) => {
159
+ var _a;
160
+ child._index = i;
161
+ child.x0 = positions[i].startAngle;
162
+ child.x1 = positions[i].endAngle;
163
+ child._state = {
164
+ fill: (_a = getColor(child, config.segmentColor, positions[i].index, child.depth !== 1)) !== null && _a !== void 0 ? _a : colors(positions[i].index),
165
+ };
166
+ });
153
167
  });
154
168
  const segments = partitionData.descendants().filter(d => { var _a; return ((_a = d.parent) === null || _a === void 0 ? void 0 : _a.value) && d.data.key; });
155
169
  return segments;
156
170
  }
157
171
  _getLayerSettings() {
158
172
  const { direction, layers, layerPadding, layerSettings } = this.config;
159
- const outerRadius = Math.min(this._width, this._height) / 2;
173
+ const strokeWidth = getCSSVariableValueInPixels(cssvar(variables.nestedDonutSegmentStrokeWidth), this.element);
174
+ const outerRadius = (Math.min(this._width, this._height) - strokeWidth) / 2;
175
+ const defaultLayerSettings = {
176
+ backgroundColor: cssvar(variables.nestedDonutBackgroundFill),
177
+ labelAlignment: NestedDonutSegmentLabelAlignment.Perpendicular,
178
+ width: outerRadius * 0.75 / layers.length,
179
+ };
160
180
  const layerItems = layers.reduceRight((arr, _, i) => {
161
181
  const layerId = direction === NestedDonutDirection.Outwards ? i : arr.length;
162
182
  const layerConfig = merge(defaultLayerSettings, getValue(layerId, layerSettings));
@@ -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, 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, getHexValue } from 'utils/color'\nimport { getNumber, getString, getValue, isNumber, isNumberWithinRange, merge } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { wrapSVGText } from 'utils/text'\n\n// Local Types\nimport { NestedDonutDirection, NestedDonutSegment, defaultLayerSettings, NestedDonutLayer } from './types'\n\n// Config\nimport { NestedDonutConfig, 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[],\nNestedDonutConfig<Datum>,\nNestedDonutConfigInterface<Datum>\n> {\n static selectors = s\n static cssVariables = s.variables\n config: NestedDonutConfig<Datum> = new NestedDonutConfig()\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.config.init(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.g.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 smartTransition(backgroundsMerged, duration)\n .attr('d', d => this.arcGen({\n x0: config.angleRange?.[0] ?? config.angleRange?.[0] ?? 0,\n x1: config.angleRange?.[1] ?? 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 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.eachBefore(node => {\n const key = node.data[0] as string\n node.data = { key, root: node.parent?.data.root ?? key }\n\n if (isNumberWithinRange(node.depth - 1, [0, layers.length - 1])) {\n node._id = this.uid.replace(/-.*/gm, `-${key}`)\n node._layer = layers[node.depth - 1]\n node.y0 = node._layer._innerRadius\n node.y1 = node._layer._outerRadius\n }\n\n if (node.children) {\n const colors = this.colorScale\n .domain([-1, node.children.length])\n .range(['#fff', getHexValue(node._state?.fill, this.element)])\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 ? config.emptySegmentAngle : (d.x1 - d.x0))\n .sort(d => d._index)(node.children)\n\n node.children.forEach((child, i) => {\n child._index = i\n child.x0 = positions[i].startAngle\n child.x1 = positions[i].endAngle\n child._state = {\n fill: getColor(child, config.segmentColor, i, child.depth !== 1) ?? colors(i),\n }\n })\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 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 arr.unshift({\n ...layerConfig,\n _id: layerId,\n _outerRadius: radius,\n _innerRadius: radius - layerConfig.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","s.variables"],"mappings":";;;;;;;;;;;;;;;;;;AAgCM,MAAO,WAAmB,SAAQ,aAIvC,CAAA;AAgBC,IAAA,WAAA,CAAa,MAA0C,EAAA;AACrD,QAAA,KAAK,EAAE,CAAA;AAdT,QAAA,IAAA,CAAA,MAAM,GAA6B,IAAI,iBAAiB,EAAE,CAAA;AAC1D,QAAA,IAAA,CAAA,SAAS,GAA2B,IAAI,eAAe,EAAE,CAAA;QAOzD,IAAM,CAAA,MAAA,GAAG,GAAG,EAAsC,CAAA;QAClD,IAAU,CAAA,UAAA,GAAgC,WAAW,EAAE,CAAA;QAEvD,IAAM,CAAA,MAAA,GAAG,EAAG,CAAA;AAIV,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACpC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAC/B,aAAA,IAAI,CAAC,OAAO,EAAEA,aAAe,CAAC,CAAA;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AACtC,aAAA,IAAI,CAAC,OAAO,EAAEC,YAAc,CAAC,CAAA;QAChC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CA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ection'\nimport { arc, pie } from 'd3-shape'\nimport { hierarchy, 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, getHexValue } from 'utils/color'\nimport { smartTransition } from 'utils/d3'\nimport { getNumber, getString, getValue, isNumber, isNumberWithinRange, merge } from 'utils/data'\nimport { getCSSVariableValueInPixels } 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 { NestedDonutConfig, 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[],\nNestedDonutConfig<Datum>,\nNestedDonutConfigInterface<Datum>\n> {\n static selectors = s\n static cssVariables = s.variables\n config: NestedDonutConfig<Datum> = new NestedDonutConfig()\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.config.init(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.g.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 node.data = {\n key: node.data[0] as string,\n values: (node.data[1])?.length ? node.data[1].map((index: number) => data[index]) : [],\n root: node.parent?.data.root ?? node.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 .eachAfter(node => node.children?.forEach(ch => node.data.values.push(...ch.data.values)))\n .eachBefore(node => {\n if (!node.children || node.depth === rootNode.height - 1) return\n\n const colors = this.colorScale\n .domain([-1, node.children.length])\n .range([getHexValue(node._state?.fill, this.element), '#fff'])\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 node.children.forEach((child, i) => {\n child._index = i\n child.x0 = positions[i].startAngle\n child.x1 = positions[i].endAngle\n child._state = {\n fill:\n getColor(child, config.segmentColor, positions[i].index, child.depth !== 1) ??\n colors(positions[i].index),\n }\n })\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 strokeWidth = getCSSVariableValueInPixels(cssvar(s.variables.nestedDonutSegmentStrokeWidth), this.element)\n const outerRadius = (Math.min(this._width, this._height) - strokeWidth) / 2\n\n const defaultLayerSettings = {\n backgroundColor: cssvar(s.variables.nestedDonutBackgroundFill),\n labelAlignment: NestedDonutSegmentLabelAlignment.Perpendicular,\n width: outerRadius * 0.75 / layers.length,\n }\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 arr.unshift({\n ...layerConfig,\n _id: layerId,\n _outerRadius: radius,\n _innerRadius: radius - layerConfig.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,aAIvC,CAAA;AAgBC,I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AA;AAC5E,YAAA,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,EAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAA;YACjF,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,YAAY,GAAG,WAAW,CAAA;YAC5E,GAAG,CAAC,OAAO,CACN,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,WAAW,KACd,GAAG,EAAE,OAAO,EACZ,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GAAG,WAAW,CAAC,KAAK,EAAA,CAAA,CACxC,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;;AAjNM,WAAS,CAAA,SAAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGD,SAAW;;;;"}
@@ -1,8 +1,9 @@
1
1
  export declare const root: string;
2
2
  export declare const segmentsGroup: string;
3
3
  export declare const variables: {
4
- nestedDonutBackgroundColor: "--vis-nested-donut-background-color";
5
4
  nestedDonutFontFamily: "--vis-nested-donut-font-family";
5
+ nestedDonutBackgroundFill: "--vis-nested-donut-background-fill";
6
+ nestedDonutBackgroundStroke: "--vis-nested-donut-background-stroke";
6
7
  nestedDonutCentralLabelFontSize: "--vis-nested-donut-central-label-font-size";
7
8
  nestedDonutCentralLabelFontWeight: "--vis-nested-donut-central-label-font-weight";
8
9
  nestedDonutCentralLabelTextColor: "--vis-nested-donut-central-label-text-color";
@@ -2,9 +2,11 @@ import { css } from '@emotion/css';
2
2
  import { getCssVarNames, injectGlobalCssVariables } from '../../utils/style.js';
3
3
 
4
4
  const cssVarDefaults = {
5
- '--vis-nested-donut-background-color': '#E7E9F3',
6
5
  // Undefined by default to allow proper fallback to var(--vis-font-family)
7
6
  '--vis-nested-donut-font-family': undefined,
7
+ // Background
8
+ '--vis-nested-donut-background-fill': '#E7E9F3',
9
+ '--vis-nested-donut-background-stroke': 'none',
8
10
  // Central label
9
11
  '--vis-nested-donut-central-label-font-size': '16px',
10
12
  '--vis-nested-donut-central-label-font-weight': 600,
@@ -33,7 +35,9 @@ const variables = getCssVarNames(cssVarDefaults);
33
35
  injectGlobalCssVariables(cssVarDefaults, root);
34
36
  const background = css `
35
37
  label: background;
36
- fill: var(--vis-donut-background-color);
38
+ fill: var(--vis-nested-donut-background-fill);
39
+ stroke-width: var(--vis-nested-donut-segment-stroke-width);
40
+ stroke: var(--vis-nested-donut-background-stroke);
37
41
  `;
38
42
  const segment = css `
39
43
  label: segment;
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../src/components/nested-donut/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\nconst cssVarDefaults = {\n '--vis-nested-donut-background-color': '#E7E9F3',\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n '--vis-nested-donut-font-family': undefined,\n\n // Central label\n '--vis-nested-donut-central-label-font-size': '16px',\n '--vis-nested-donut-central-label-font-weight': 600,\n '--vis-nested-donut-central-label-text-color': '#5b5f6d',\n\n // Central sub-label\n '--vis-nested-donut-central-sublabel-font-size': '12px;',\n '--vis-nested-donut-central-sublabel-font-weight': 500,\n '--vis-nested-donut-central-sublabel-text-color': '#5b5f6d',\n\n // Segments\n '--vis-nested-donut-segment-stroke-width': '1px',\n '--vis-nested-donut-segment-stroke-color': undefined,\n '--vis-nested-donut-segment-label-text-color-light': '#5b5f6d',\n '--vis-nested-donut-segment-label-text-color-dark': '#fff',\n\n /* Dark theme */\n '--vis-dark-nested-donut-background-color': '#18160C',\n '--vis-dark-nested-donut-central-label-text-color': '#fff',\n '--vis-dark-nested-donut-central-sublabel-text-color': '#fff',\n}\n\nexport const root = css`\n label: nested-donut-component;\n`\n\nexport const segmentsGroup = css`\n label: nested-donut-segments-group;\n`\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const background = css`\n label: background;\n fill: var(--vis-donut-background-color);\n`\n\nexport const segment = css`\n label: segment;\n `\n\nexport const segmentExit = css`\n label: segment-exit;\n`\n\nexport const segmentArc = css`\n label: segment-arc;\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-segment-stroke-color, var(--vis-donut-background-color));\n`\n\nexport const segmentLabel = css`\n label: segment-label;\n text-anchor: middle;\n dominant-baseline: middle;\n user-select: none;\n`\n\nexport const centralLabel = css`\n label: central-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-label-font-size);\n font-family: var(--vis-nested-donut-central-label-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-label-font-weight);\n fill: var(--vis-nested-donut-central-label-text-color);\n`\n\nexport const centralSubLabel = css`\n label: central-sub-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-sublabel-font-size);\n font-family: var(--vis-nested-donut-central-sublabel-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-sublabel-font-weight);\n fill: var(--vis-nested-donut-central-sublabel-text-color);\n`\n"],"names":[],"mappings":";;;AAKA,MAAM,cAAc,GAAG;AACrB,IAAA,qCAAqC,EAAE,SAAS;;AAEhD,IAAA,gCAAgC,EAAE,SAAS;;AAG3C,IAAA,4CAA4C,EAAE,MAAM;AACpD,IAAA,8CAA8C,EAAE,GAAG;AACnD,IAAA,6CAA6C,EAAE,SAAS;;AAGxD,IAAA,+CAA+C,EAAE,OAAO;AACxD,IAAA,iDAAiD,EAAE,GAAG;AACtD,IAAA,gDAAgD,EAAE,SAAS;;AAG3D,IAAA,yCAAyC,EAAE,KAAK;AAChD,IAAA,yCAAyC,EAAE,SAAS;AACpD,IAAA,mDAAmD,EAAE,SAAS;AAC9D,IAAA,kDAAkD,EAAE,MAAM;;AAG1D,IAAA,0CAA0C,EAAE,SAAS;AACrD,IAAA,kDAAkD,EAAE,MAAM;AAC1D,IAAA,qDAAqD,EAAE,MAAM;CAC9D,CAAA;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,aAAa,GAAG,GAAG,CAAA,CAAA;;EAE/B;MAEY,SAAS,GAAG,cAAc,CAAC,cAAc,EAAC;AACvD,wBAAwB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAEvC,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;EAG5B;AAEM,MAAM,OAAO,GAAG,GAAG,CAAA,CAAA;;GAExB;AAEK,MAAM,WAAW,GAAG,GAAG,CAAA,CAAA;;EAE7B;AAEM,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;;;EAI5B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA,CAAA;;;;;EAK9B;AAEM,MAAM,YAAY,GAAG,GAAG,CAAA,CAAA;;;;;;;;EAQ9B;AAEM,MAAM,eAAe,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"style.js","sources":["../../../src/components/nested-donut/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\nconst cssVarDefaults = {\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n '--vis-nested-donut-font-family': undefined,\n\n // Background\n '--vis-nested-donut-background-fill': '#E7E9F3',\n '--vis-nested-donut-background-stroke': 'none',\n\n // Central label\n '--vis-nested-donut-central-label-font-size': '16px',\n '--vis-nested-donut-central-label-font-weight': 600,\n '--vis-nested-donut-central-label-text-color': '#5b5f6d',\n\n // Central sub-label\n '--vis-nested-donut-central-sublabel-font-size': '12px;',\n '--vis-nested-donut-central-sublabel-font-weight': 500,\n '--vis-nested-donut-central-sublabel-text-color': '#5b5f6d',\n\n // Segments\n '--vis-nested-donut-segment-stroke-width': '1px',\n '--vis-nested-donut-segment-stroke-color': undefined,\n '--vis-nested-donut-segment-label-text-color-light': '#5b5f6d',\n '--vis-nested-donut-segment-label-text-color-dark': '#fff',\n\n /* Dark theme */\n '--vis-dark-nested-donut-background-color': '#18160C',\n '--vis-dark-nested-donut-central-label-text-color': '#fff',\n '--vis-dark-nested-donut-central-sublabel-text-color': '#fff',\n}\n\nexport const root = css`\n label: nested-donut-component;\n`\n\nexport const segmentsGroup = css`\n label: nested-donut-segments-group;\n`\n\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const background = css`\n label: background;\n fill: var(--vis-nested-donut-background-fill);\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-background-stroke);\n`\n\nexport const segment = css`\n label: segment;\n `\n\nexport const segmentExit = css`\n label: segment-exit;\n`\n\nexport const segmentArc = css`\n label: segment-arc;\n stroke-width: var(--vis-nested-donut-segment-stroke-width);\n stroke: var(--vis-nested-donut-segment-stroke-color, var(--vis-donut-background-color));\n`\n\nexport const segmentLabel = css`\n label: segment-label;\n text-anchor: middle;\n dominant-baseline: middle;\n user-select: none;\n`\n\nexport const centralLabel = css`\n label: central-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-label-font-size);\n font-family: var(--vis-nested-donut-central-label-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-label-font-weight);\n fill: var(--vis-nested-donut-central-label-text-color);\n`\n\nexport const centralSubLabel = css`\n label: central-sub-label;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: var(--vis-nested-donut-central-sublabel-font-size);\n font-family: var(--vis-nested-donut-central-sublabel-font-family, var(--vis-font-family));\n font-weight: var(--vis-nested-donut-central-sublabel-font-weight);\n fill: var(--vis-nested-donut-central-sublabel-text-color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declare type NestedDonutSegmentDatum<Datum> = {
3
3
  key: string;
4
4
  root: string;
5
- values?: Datum[];
5
+ values: Datum[];
6
6
  };
7
7
  export declare type NestedDonutSegment<Datum> = HierarchyRectangularNode<NestedDonutSegmentDatum<Datum>> & {
8
8
  _id: string;
@@ -22,6 +22,7 @@ export declare enum NestedDonutSegmentLabelAlignment {
22
22
  Straight = "straight"
23
23
  }
24
24
  export declare type NestedDonutLayerSettings = {
25
+ backgroundColor?: string;
25
26
  labelAlignment?: NestedDonutSegmentLabelAlignment;
26
27
  width?: number;
27
28
  };
@@ -30,4 +31,3 @@ export declare type NestedDonutLayer = NestedDonutLayerSettings & {
30
31
  _innerRadius: number;
31
32
  _outerRadius: number;
32
33
  };
33
- export declare const defaultLayerSettings: NestedDonutLayerSettings;
@@ -8,11 +8,7 @@ var NestedDonutSegmentLabelAlignment;
8
8
  NestedDonutSegmentLabelAlignment["Along"] = "along";
9
9
  NestedDonutSegmentLabelAlignment["Perpendicular"] = "perpendicular";
10
10
  NestedDonutSegmentLabelAlignment["Straight"] = "straight";
11
- })(NestedDonutSegmentLabelAlignment || (NestedDonutSegmentLabelAlignment = {}));
12
- const defaultLayerSettings = {
13
- labelAlignment: NestedDonutSegmentLabelAlignment.Perpendicular,
14
- width: 50,
15
- };
11
+ })(NestedDonutSegmentLabelAlignment || (NestedDonutSegmentLabelAlignment = {}));
16
12
 
17
- export { NestedDonutDirection, NestedDonutSegmentLabelAlignment, defaultLayerSettings };
13
+ export { NestedDonutDirection, NestedDonutSegmentLabelAlignment };
18
14
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/components/nested-donut/types.ts"],"sourcesContent":["import { HierarchyRectangularNode } from 'd3-hierarchy'\n\nexport type NestedDonutSegmentDatum<Datum> = {\n key: string;\n root: string;\n values?: Datum[];\n}\n\nexport type NestedDonutSegment<Datum> = HierarchyRectangularNode<NestedDonutSegmentDatum<Datum>> & {\n _id: string;\n _layer: NestedDonutLayer;\n _index?: number;\n _state?: {\n fill?: string;\n };\n}\n\nexport enum NestedDonutDirection {\n Inwards = 'inwards',\n Outwards = 'outwards',\n}\n\nexport enum NestedDonutSegmentLabelAlignment {\n Along = 'along',\n Perpendicular = 'perpendicular',\n Straight = 'straight',\n}\n\nexport type NestedDonutLayerSettings = {\n labelAlignment?: NestedDonutSegmentLabelAlignment;\n width?: number;\n}\n\nexport type NestedDonutLayer = NestedDonutLayerSettings & {\n _id: number;\n _innerRadius: number;\n _outerRadius: number;\n}\n\nexport const defaultLayerSettings: NestedDonutLayerSettings = {\n labelAlignment: NestedDonutSegmentLabelAlignment.Perpendicular,\n width: 50,\n}\n\n"],"names":[],"mappings":"IAiBY,qBAGX;AAHD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,oBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,GAG/B,EAAA,CAAA,CAAA,CAAA;IAEW,iCAIX;AAJD,CAAA,UAAY,gCAAgC,EAAA;AAC1C,IAAA,gCAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,gCAAA,CAAA,eAAA,CAAA,GAAA,eAA+B,CAAA;AAC/B,IAAA,gCAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,GAI3C,EAAA,CAAA,CAAA,CAAA;AAaY,MAAA,oBAAoB,GAA6B;IAC5D,cAAc,EAAE,gCAAgC,CAAC,aAAa;AAC9D,IAAA,KAAK,EAAE,EAAE;;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/nested-donut/types.ts"],"sourcesContent":["import { HierarchyRectangularNode } from 'd3-hierarchy'\n\nexport type NestedDonutSegmentDatum<Datum> = {\n key: string;\n root: string;\n values: Datum[];\n}\n\nexport type NestedDonutSegment<Datum> = HierarchyRectangularNode<NestedDonutSegmentDatum<Datum>> & {\n _id: string;\n _layer: NestedDonutLayer;\n _index?: number;\n _state?: {\n fill?: string;\n };\n}\n\nexport enum NestedDonutDirection {\n Inwards = 'inwards',\n Outwards = 'outwards',\n}\n\nexport enum NestedDonutSegmentLabelAlignment {\n Along = 'along',\n Perpendicular = 'perpendicular',\n Straight = 'straight',\n}\n\nexport type NestedDonutLayerSettings = {\n backgroundColor?: string;\n labelAlignment?: NestedDonutSegmentLabelAlignment;\n width?: number;\n}\n\nexport type NestedDonutLayer = NestedDonutLayerSettings & {\n _id: number;\n _innerRadius: number;\n _outerRadius: number;\n}\n\n"],"names":[],"mappings":"IAiBY,qBAGX;AAHD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,oBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,GAG/B,EAAA,CAAA,CAAA,CAAA;IAEW,iCAIX;AAJD,CAAA,UAAY,gCAAgC,EAAA;AAC1C,IAAA,gCAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,gCAAA,CAAA,eAAA,CAAA,GAAA,eAA+B,CAAA;AAC/B,IAAA,gCAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,GAI3C,EAAA,CAAA,CAAA;;;;"}
package/index.js CHANGED
@@ -51,5 +51,5 @@ export { SankeyEnterTransitionType, SankeyExitTransitionType, SankeyLayout, Sank
51
51
  export { VisControlsOrientation } from './components/vis-controls/types.js';
52
52
  export { FreeBrushMode } from './components/free-brush/types.js';
53
53
  export { XYLabelPositioning } from './components/xy-labels/types.js';
54
- export { NestedDonutDirection, NestedDonutSegmentLabelAlignment, defaultLayerSettings } from './components/nested-donut/types.js';
54
+ export { NestedDonutDirection, NestedDonutSegmentLabelAlignment } from './components/nested-donut/types.js';
55
55
  //# sourceMappingURL=index.js.map
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.1.2-beta.10",
4
+ "version": "1.1.2-beta.11",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/f5/unovis.git",
package/types.js CHANGED
@@ -24,7 +24,7 @@ export { VisControlsOrientation } from './components/vis-controls/types.js';
24
24
  export { FreeBrushMode } from './components/free-brush/types.js';
25
25
  import './components/bullet-legend/types.js';
26
26
  export { XYLabelPositioning } from './components/xy-labels/types.js';
27
- export { NestedDonutDirection, NestedDonutSegmentLabelAlignment, defaultLayerSettings } from './components/nested-donut/types.js';
27
+ export { NestedDonutDirection, NestedDonutSegmentLabelAlignment } from './components/nested-donut/types.js';
28
28
 
29
29
  /* eslint-disable max-len */
30
30
  //# sourceMappingURL=types.js.map