@unovis/ts 1.5.2 → 1.6.0-bigip.0

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.
Files changed (88) hide show
  1. package/components/axis/index.d.ts +0 -1
  2. package/components/axis/index.js +2 -10
  3. package/components/axis/index.js.map +1 -1
  4. package/components/brush/config.d.ts +1 -1
  5. package/components/brush/config.js.map +1 -1
  6. package/components/crosshair/config.d.ts +5 -0
  7. package/components/crosshair/config.js +1 -1
  8. package/components/crosshair/config.js.map +1 -1
  9. package/components/crosshair/index.d.ts +6 -1
  10. package/components/crosshair/index.js +182 -34
  11. package/components/crosshair/index.js.map +1 -1
  12. package/components/crosshair/sync-bus.d.ts +9 -0
  13. package/components/crosshair/sync-bus.js +27 -0
  14. package/components/crosshair/sync-bus.js.map +1 -0
  15. package/components/graph/config.d.ts +8 -0
  16. package/components/graph/config.js +1 -1
  17. package/components/graph/config.js.map +1 -1
  18. package/components/graph/index.d.ts +1 -0
  19. package/components/graph/index.js +14 -9
  20. package/components/graph/index.js.map +1 -1
  21. package/components/graph/modules/layout.js +31 -29
  22. package/components/graph/modules/layout.js.map +1 -1
  23. package/components/graph/modules/link/index.js +1 -1
  24. package/components/graph/modules/link/index.js.map +1 -1
  25. package/components/graph/types.d.ts +2 -1
  26. package/components/graph/types.js.map +1 -1
  27. package/components/plotband/config.d.ts +59 -0
  28. package/components/plotband/config.js +9 -0
  29. package/components/plotband/config.js.map +1 -0
  30. package/components/plotband/constants.d.ts +5 -0
  31. package/components/plotband/constants.js +413 -0
  32. package/components/plotband/constants.js.map +1 -0
  33. package/components/plotband/index.d.ts +15 -0
  34. package/components/plotband/index.js +92 -0
  35. package/components/plotband/index.js.map +1 -0
  36. package/components/plotband/style.d.ts +4 -0
  37. package/components/plotband/style.js +38 -0
  38. package/components/plotband/style.js.map +1 -0
  39. package/components/plotband/types.d.ts +51 -0
  40. package/components/plotband/types.js +27 -0
  41. package/components/plotband/types.js.map +1 -0
  42. package/components/timeline/config.d.ts +65 -14
  43. package/components/timeline/config.js +15 -1
  44. package/components/timeline/config.js.map +1 -1
  45. package/components/timeline/constants.d.ts +3 -0
  46. package/components/timeline/constants.js +6 -0
  47. package/components/timeline/constants.js.map +1 -0
  48. package/components/timeline/index.d.ts +21 -10
  49. package/components/timeline/index.js +379 -93
  50. package/components/timeline/index.js.map +1 -1
  51. package/components/timeline/style.d.ts +7 -0
  52. package/components/timeline/style.js +40 -1
  53. package/components/timeline/style.js.map +1 -1
  54. package/components/timeline/types.d.ts +62 -0
  55. package/components/timeline/types.js +2 -0
  56. package/components/timeline/types.js.map +1 -0
  57. package/components/timeline/utils.d.ts +2 -0
  58. package/components/timeline/utils.js +16 -0
  59. package/components/timeline/utils.js.map +1 -0
  60. package/components.d.ts +4 -2
  61. package/components.js +1 -0
  62. package/components.js.map +1 -1
  63. package/containers/xy-container/config.d.ts +2 -0
  64. package/containers/xy-container/config.js +1 -1
  65. package/containers/xy-container/config.js.map +1 -1
  66. package/containers/xy-container/index.js +2 -2
  67. package/containers/xy-container/index.js.map +1 -1
  68. package/data-models/graph.js +7 -1
  69. package/data-models/graph.js.map +1 -1
  70. package/index.js +4 -2
  71. package/index.js.map +1 -1
  72. package/package.json +1 -1
  73. package/types/position.d.ts +2 -1
  74. package/types/position.js +1 -0
  75. package/types/position.js.map +1 -1
  76. package/types.d.ts +2 -0
  77. package/types.js +2 -0
  78. package/types.js.map +1 -1
  79. package/utils/data.d.ts +1 -1
  80. package/utils/data.js +1 -1
  81. package/utils/data.js.map +1 -1
  82. package/utils/index.js +2 -2
  83. package/utils/path.d.ts +8 -0
  84. package/utils/path.js +109 -1
  85. package/utils/path.js.map +1 -1
  86. package/utils/text.d.ts +2 -1
  87. package/utils/text.js +10 -2
  88. package/utils/text.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/plotband/index.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\nimport { AxisType } from 'components/axis/types'\n\n// Config\nimport { VERTICAL_X, HORIZONTAL_X, VERTICAL_Y, HORIZONTAL_Y } from './constants'\nimport { PlotbandDefaultConfig, PlotbandConfigInterface } from './config'\nimport { PlotbandLabelOrientation, PlotbandLabelPosition, PlotbandLabelLayout } from './types'\n\n// Styles\nimport * as s from './style'\n\nexport class Plotband<Datum> extends XYComponentCore<Datum, PlotbandConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = PlotbandDefaultConfig as PlotbandConfigInterface<Datum>\n from: number | null | undefined\n to: number | null | undefined\n plotband: Selection<SVGRectElement, unknown, null, undefined>\n label: Selection<SVGTextElement, unknown, null, undefined>\n\n constructor (config: PlotbandConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n this.plotband = this.g.append('rect')\n .attr('class', s.plotband)\n\n this.label = this.g\n .append('text')\n .attr('class', s.label)\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config } = this\n this.from = config.from\n this.to = config.to\n\n this.plotband\n .style('fill', config.color)\n\n if (this.from == null || this.to == null) return\n\n let x = 0\n let y = 0\n let width = 0\n let height = 0\n\n if (config.axis === 'y') {\n const y1 = this.yScale(this.from)\n const y2 = this.yScale(this.to)\n y = Math.min(y1, y2)\n height = Math.abs(y1 - y2)\n x = 0\n width = this._width\n } else {\n const x1 = this.xScale(this.from)\n const x2 = this.xScale(this.to)\n x = Math.min(x1, x2)\n width = Math.abs(x1 - x2)\n y = 0\n height = this._height\n }\n\n smartTransition(this.plotband, config.duration)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n\n if (config.labelText) {\n const labelProps = this.computeLabel(\n config.axis,\n x,\n y,\n width,\n height,\n config.labelPosition,\n config.labelOffsetX,\n config.labelOffsetY,\n config.labelOrientation\n )\n\n this.label\n .attr('dominant-baseline', labelProps.dominantBaseline)\n .attr('transform', labelProps.transform)\n .style('text-anchor', labelProps.textAnchor)\n .style('fill', config.labelColor)\n .style('font-size', config.labelSize ? `${config.labelSize}px` : undefined)\n\n smartTransition(this.label, config.duration)\n .text(config.labelText)\n .attr('x', labelProps.x)\n .attr('y', labelProps.y)\n }\n\n smartTransition(this.plotband.exit())\n .style('opacity', 0)\n .remove()\n }\n\n private computeLabel (\n axis: AxisType,\n startX: number,\n startY: number,\n width: number,\n height: number,\n position: PlotbandLabelPosition,\n offsetX: number,\n offsetY: number,\n orientation: PlotbandLabelOrientation\n ): PlotbandLabelLayout {\n const isVertical = orientation === 'vertical'\n const rotation = isVertical ? -90 : 0\n const args = { startX, startY, width, height, offsetX, offsetY }\n\n let layoutPartial: Omit<PlotbandLabelLayout, 'rotation' | 'transform'>\n\n if (axis === AxisType.X) {\n layoutPartial = (isVertical ? VERTICAL_X : HORIZONTAL_X)[position](args)\n } else {\n layoutPartial = (isVertical ? VERTICAL_Y : HORIZONTAL_Y)[position](args)\n }\n\n const { x, y, textAnchor, dominantBaseline } = layoutPartial\n const transform = rotation !== 0 ? `rotate(${rotation}, ${x}, ${y})` : ''\n\n return { x, y, rotation, textAnchor, transform, dominantBaseline }\n }\n}\n"],"names":["s.plotband","s.label","s"],"mappings":";;;;;;;;AAEA;AAeM,MAAO,QAAgB,SAAQ,eAAsD,CAAA;AAQzF,IAAA,WAAA,CAAa,MAAsC,EAAA;AACjD,QAAA,KAAK,EAAE,CAAA;QAPC,IAAc,CAAA,cAAA,GAAG,qBAAuD,CAAA;AAQhF,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QAElC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AAClC,aAAA,IAAI,CAAC,OAAO,EAAEA,QAAU,CAAC,CAAA;AAE5B,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;aAChB,MAAM,CAAC,MAAM,CAAC;AACd,a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A,OAAA,EAAU,QAAQ,CAAK,EAAA,EAAA,CAAC,KAAK,CAAC,CAAA,CAAA,CAAG,GAAG,EAAE,CAAA;AAEzE,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;KACnE;;AAnHM,QAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
@@ -0,0 +1,4 @@
1
+ export declare const globalStyles: void;
2
+ export declare const root: string;
3
+ export declare const plotband: string;
4
+ export declare const label: string;
@@ -0,0 +1,38 @@
1
+ import { injectGlobal, css } from '@emotion/css';
2
+
3
+ const globalStyles = injectGlobal `
4
+ :root {
5
+ --vis-plotband-color: rgba(255, 255, 90, 0.2);
6
+ --vis-plotband-label-font-size: 12px;
7
+ --vis-plotband-label-color: #000;
8
+
9
+ --vis-dark-plotband-color: rgba(220, 220, 90, 0.2);
10
+ --vis-dark-plotband-label-color: #e5e9f7;
11
+ }
12
+
13
+ body.theme-dark {
14
+ --vis-plotband-color: var(--vis-dark-plotband-color);
15
+ --vis-plotband-label-color: var(--vis-dark-tooltip-text-color);
16
+ }
17
+ `;
18
+ const root = css `
19
+ label: plotband-component;
20
+ `;
21
+ const plotband = css `
22
+ label: plotband-area;
23
+ transition: opacity 200ms;
24
+ cursor: var(--vis-line-cursor);
25
+ fill: var(--vis-plotband-color);
26
+ `;
27
+ const label = css `
28
+ label: plotline-label;
29
+
30
+ user-select: none;
31
+ text-anchor: middle;
32
+ pointer-events: none;
33
+ font-size: var(--vis-plotband-label-font-size);
34
+ fill: var(--vis-plotband-label-color);
35
+ `;
36
+
37
+ export { globalStyles, label, plotband, root };
38
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../../src/components/plotband/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\n\nexport const globalStyles = injectGlobal`\n :root {\n --vis-plotband-color: rgba(255, 255, 90, 0.2);\n --vis-plotband-label-font-size: 12px;\n --vis-plotband-label-color: #000;\n\n --vis-dark-plotband-color: rgba(220, 220, 90, 0.2);\n --vis-dark-plotband-label-color: #e5e9f7;\n }\n\n body.theme-dark {\n --vis-plotband-color: var(--vis-dark-plotband-color);\n --vis-plotband-label-color: var(--vis-dark-tooltip-text-color);\n }\n`\n\nexport const root = css`\n label: plotband-component;\n`\n\nexport const plotband = css`\n label: plotband-area;\n transition: opacity 200ms;\n cursor: var(--vis-line-cursor);\n fill: var(--vis-plotband-color);\n`\n\nexport const label = css`\n label: plotline-label;\n\n user-select: none;\n text-anchor: middle;\n pointer-events: none;\n font-size: var(--vis-plotband-label-font-size);\n fill: var(--vis-plotband-label-color);\n`\n"],"names":[],"mappings":";;AAGO,MAAM,YAAY,GAAG,YAAY,CAAA,CAAA;;;;;;;;;;;;;;EAcvC;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;AAEM,MAAM,QAAQ,GAAG,GAAG,CAAA,CAAA;;;;;EAK1B;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;"}
@@ -0,0 +1,51 @@
1
+ export declare enum PlotbandLabelPosition {
2
+ TopLeftInside = "top-left-inside",
3
+ TopLeftOutside = "top-left-outside",
4
+ TopInside = "top-inside",
5
+ TopOutside = "top-outside",
6
+ TopRightInside = "top-right-inside",
7
+ TopRightOutside = "top-right-outside",
8
+ RightInside = "right-inside",
9
+ RightOutside = "right-outside",
10
+ BottomRightInside = "bottom-right-inside",
11
+ BottomRightOutside = "bottom-right-outside",
12
+ BottomInside = "bottom-inside",
13
+ BottomOutside = "bottom-outside",
14
+ BottomLeftInside = "bottom-left-inside",
15
+ BottomLeftOutside = "bottom-left-outside",
16
+ LeftInside = "left-inside",
17
+ LeftOutside = "left-outside"
18
+ }
19
+ export declare enum PlotbandLabelOrientation {
20
+ Horizontal = "horizontal",
21
+ Vertical = "vertical"
22
+ }
23
+ export interface PlotlineLabelOptions {
24
+ labelText?: string;
25
+ labelPosition: PlotbandLabelPosition;
26
+ labelOffsetX: number;
27
+ labelOffsetY: number;
28
+ labelOrientation: PlotbandLabelOrientation;
29
+ labelColor?: string;
30
+ labelSize?: number;
31
+ }
32
+ export declare type LayoutValue = {
33
+ x: number;
34
+ y: number;
35
+ textAnchor: string;
36
+ dominantBaseline: string;
37
+ };
38
+ export declare type PlotbandLabelLayout = {
39
+ rotation: number;
40
+ transform: string;
41
+ } & LayoutValue;
42
+ declare type LabelLayoutFn = (params: {
43
+ startX: number;
44
+ startY: number;
45
+ width: number;
46
+ height: number;
47
+ offsetX: number;
48
+ offsetY: number;
49
+ }) => LayoutValue;
50
+ export declare type LayoutMap = Record<PlotbandLabelPosition, LabelLayoutFn>;
51
+ export {};
@@ -0,0 +1,27 @@
1
+ var PlotbandLabelPosition;
2
+ (function (PlotbandLabelPosition) {
3
+ PlotbandLabelPosition["TopLeftInside"] = "top-left-inside";
4
+ PlotbandLabelPosition["TopLeftOutside"] = "top-left-outside";
5
+ PlotbandLabelPosition["TopInside"] = "top-inside";
6
+ PlotbandLabelPosition["TopOutside"] = "top-outside";
7
+ PlotbandLabelPosition["TopRightInside"] = "top-right-inside";
8
+ PlotbandLabelPosition["TopRightOutside"] = "top-right-outside";
9
+ PlotbandLabelPosition["RightInside"] = "right-inside";
10
+ PlotbandLabelPosition["RightOutside"] = "right-outside";
11
+ PlotbandLabelPosition["BottomRightInside"] = "bottom-right-inside";
12
+ PlotbandLabelPosition["BottomRightOutside"] = "bottom-right-outside";
13
+ PlotbandLabelPosition["BottomInside"] = "bottom-inside";
14
+ PlotbandLabelPosition["BottomOutside"] = "bottom-outside";
15
+ PlotbandLabelPosition["BottomLeftInside"] = "bottom-left-inside";
16
+ PlotbandLabelPosition["BottomLeftOutside"] = "bottom-left-outside";
17
+ PlotbandLabelPosition["LeftInside"] = "left-inside";
18
+ PlotbandLabelPosition["LeftOutside"] = "left-outside";
19
+ })(PlotbandLabelPosition || (PlotbandLabelPosition = {}));
20
+ var PlotbandLabelOrientation;
21
+ (function (PlotbandLabelOrientation) {
22
+ PlotbandLabelOrientation["Horizontal"] = "horizontal";
23
+ PlotbandLabelOrientation["Vertical"] = "vertical";
24
+ })(PlotbandLabelOrientation || (PlotbandLabelOrientation = {}));
25
+
26
+ export { PlotbandLabelOrientation, PlotbandLabelPosition };
27
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/plotband/types.ts"],"sourcesContent":["export enum PlotbandLabelPosition {\n TopLeftInside = 'top-left-inside',\n TopLeftOutside = 'top-left-outside',\n TopInside = 'top-inside',\n TopOutside = 'top-outside',\n TopRightInside = 'top-right-inside',\n TopRightOutside = 'top-right-outside',\n RightInside = 'right-inside',\n RightOutside = 'right-outside',\n BottomRightInside = 'bottom-right-inside',\n BottomRightOutside = 'bottom-right-outside',\n BottomInside = 'bottom-inside',\n BottomOutside = 'bottom-outside',\n BottomLeftInside = 'bottom-left-inside',\n BottomLeftOutside = 'bottom-left-outside',\n LeftInside = 'left-inside',\n LeftOutside = 'left-outside',\n}\n\nexport enum PlotbandLabelOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\nexport interface PlotlineLabelOptions {\n labelText?: string;\n labelPosition: PlotbandLabelPosition;\n labelOffsetX: number;\n labelOffsetY: number;\n labelOrientation: PlotbandLabelOrientation;\n labelColor?: string;\n labelSize?: number;\n}\n\nexport type LayoutValue = {\n x: number;\n y: number;\n textAnchor: string;\n dominantBaseline: string;\n}\n\nexport type PlotbandLabelLayout = {\n rotation: number;\n transform: string;\n} & LayoutValue\n\n\ntype LabelLayoutFn = (params: {\n startX: number;\n startY: number;\n width: number;\n height: number;\n offsetX: number;\n offsetY: number;\n}) => LayoutValue\n\nexport type LayoutMap = Record<PlotbandLabelPosition, LabelLayoutFn>\n"],"names":[],"mappings":"IAAY,sBAiBX;AAjBD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,C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,83 @@
1
1
  import { XYComponentConfigInterface } from "../../core/xy-component/config";
2
2
  import { WithOptional } from "../../types/misc";
3
- import { ColorAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
3
+ import { ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from "../../types/accessor";
4
+ import { TextAlign } from "../../types/text";
5
+ import { Arrangement } from "../../types/position";
6
+ import type { TimelineArrow, TimelineLineRenderState, TimelineRowIcon, TimelineRowLabel } from './types';
4
7
  export interface TimelineConfigInterface<Datum> extends WithOptional<XYComponentConfigInterface<Datum>, 'y'> {
8
+ /** @deprecated This property has been renamed to `key` */
9
+ type?: StringAccessor<Datum>;
10
+ /** @deprecated This property has been renamed to `lineDuration` */
11
+ length?: NumericAccessor<Datum>;
12
+ /** @deprecated This property has been renamed to `lineCursor` */
13
+ cursor?: StringAccessor<Datum>;
14
+ /** Timeline item row accessor function. Records with the `lineRow` will be plotted in one row. Default: `undefined` */
15
+ lineRow?: StringAccessor<Datum>;
16
+ /** Timeline item duration accessor function. Default: `undefined`. Falls back to the deprecated `length` property */
17
+ lineDuration?: NumericAccessor<Datum>;
5
18
  /** Timeline item color accessor function. Default: `d => d.color` */
6
19
  color?: ColorAccessor<Datum>;
7
20
  /** Width of the timeline items. Default: `8` */
8
21
  lineWidth?: NumericAccessor<Datum>;
9
22
  /** Display rounded ends for timeline items. Default: `true` */
10
23
  lineCap?: boolean;
24
+ /** Provide a href to an SVG defined in container's `svgDefs` to display an icon at the start of the line. Default: undefined */
25
+ lineStartIcon?: StringAccessor<Datum>;
26
+ /** Line start icon color accessor function. Default: `undefined` */
27
+ lineStartIconColor?: StringAccessor<Datum>;
28
+ /** Line start icon size accessor function. Default: `undefined` */
29
+ lineStartIconSize?: NumericAccessor<Datum>;
30
+ /** Line start icon arrangement configuration. Controls how the icon is positioned relative to the line.
31
+ * Accepts values from the Arrangement enum: `Arrangement.Start`, `Arrangement.Middle`, `Arrangement.End` or a string equivalent.
32
+ * Default: `Arrangement.Inside` */
33
+ lineStartIconArrangement?: GenericAccessor<Arrangement | `${Arrangement}`, Datum>;
34
+ /** Provide a href to an SVG defined in container's `svgDefs` to display an icon at the end of the line. Default: undefined */
35
+ lineEndIcon?: StringAccessor<Datum>;
36
+ /** Line end icon color accessor function. Default: `undefined` */
37
+ lineEndIconColor?: StringAccessor<Datum>;
38
+ /** Line end icon size accessor function. Default: `undefined` */
39
+ lineEndIconSize?: NumericAccessor<Datum>;
40
+ /** Line end icon arrangement configuration. Controls how the icon is positioned relative to the line.
41
+ * Accepts values from the Arrangement enum: `Arrangement.Start`, `Arrangement.Middle`, `Arrangement.End` or a string equivalent.
42
+ * Default: `Arrangement.Inside` */
43
+ lineEndIconArrangement?: GenericAccessor<Arrangement | `${Arrangement}`, Datum>;
44
+ /** Configurable Timeline item cursor when hovering over. Default: `undefined` */
45
+ lineCursor?: StringAccessor<Datum>;
46
+ /** Sets the minimum line length to 1 pixel for better visibility of small values. Default: `false` */
47
+ showEmptySegments?: boolean;
11
48
  /** Timeline row height. Default: `22` */
12
49
  rowHeight?: number;
13
- /** Timeline item length accessor function. Default: `d => d.length` */
14
- length?: NumericAccessor<Datum>;
15
- /** Timeline item type accessor function. Records of one type will be plotted in one row. Default: `d => d.type` */
16
- type?: StringAccessor<Datum>;
17
- /** Configurable Timeline item cursor when hovering over. Default: `null` */
18
- cursor?: StringAccessor<Datum>;
19
- /** Show item type labels when set to `true`. Default: `false` */
50
+ /** Alternating row colors. Default: `true` */
51
+ alternatingRowColors?: boolean;
52
+ /** @deprecated This property has been renamed to `showRowLabels */
20
53
  showLabels?: boolean;
21
- /** Fixed label width in pixels. Labels longer than the specified value will be trimmed. Default: `undefined` */
54
+ /** @deprecated This property has been renamed to `rowLabelWidth */
22
55
  labelWidth?: number;
23
- /** Maximum label width in pixels. Labels longer than the specified value will be trimmed. Default: `120` */
56
+ /** @deprecated This property has been renamed to `rowMaxLabelWidth */
24
57
  maxLabelWidth?: number;
25
- /** Alternating row colors. Default: `true` */
26
- alternatingRowColors?: boolean;
58
+ /** Show row labels when set to `true`. Default: `false`. Falls back to deprecated `showLabels` */
59
+ showRowLabels?: boolean;
60
+ /** Row label style as an object with the `{ [property-name]: value }` format. Default: `undefined` */
61
+ rowLabelStyle?: GenericAccessor<Record<string, string>, TimelineRowLabel<Datum>>;
62
+ /** Row label formatter function. Default: `undefined` */
63
+ rowLabelFormatter?: (key: string, items: Datum[], i: number) => string;
64
+ /** Provide an icon href to be displayed before the row label. Default: `undefined` */
65
+ rowIcon?: (key: string, items: Datum[], i: number) => TimelineRowIcon | undefined;
66
+ /** Fixed label width in pixels. Labels longer than the specified value will be trimmed. Default: `undefined`. Falls back to deprecated `labelWidth`. */
67
+ rowLabelWidth?: number;
68
+ /** Maximum label width in pixels. Labels longer than the specified value will be trimmed. Default: `undefined`. Falls back to deprecated `maxLabelWidth`. */
69
+ rowMaxLabelWidth?: number;
70
+ /** Text alignment for labels: `TextAlign.Left`, `TextAlign.Center` or `TextAlign.Right`. Default: `TextAlign.Right` */
71
+ rowLabelTextAlign?: TextAlign | `${TextAlign}`;
72
+ arrows?: TimelineArrow[];
73
+ /** Control the animation by specify the initial position for new lines as [x, y]. Default: `undefined` */
74
+ animationLineEnterPosition?: [
75
+ number | undefined | null,
76
+ number | undefined | null
77
+ ] | ((d: Datum & TimelineLineRenderState, i: number, data: (Datum & TimelineLineRenderState)[]) => [number | undefined, number | undefined]) | undefined;
78
+ /** Control the animation by specify the destination position for exiting lines as [x, y]. Default: `undefined` */
79
+ animationLineExitPosition?: [number | undefined | null, number | undefined | null] | ((d: Datum & TimelineLineRenderState, i: number, data: (Datum & TimelineLineRenderState)[]) => [number | undefined, number | undefined]) | undefined;
27
80
  /** Scrolling callback function: `(scrollTop: number) => void`. Default: `undefined` */
28
81
  onScroll?: (scrollTop: number) => void;
29
- /** Sets the minimum line length to 1 pixel for better visibility of small values. Default: `false` */
30
- showEmptySegments?: boolean;
31
82
  }
32
83
  export declare const TimelineDefaultConfig: TimelineConfigInterface<unknown>;
@@ -1,6 +1,20 @@
1
1
  import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
2
+ import { TextAlign } from '../../types/text.js';
3
+ import { Arrangement } from '../../types/position.js';
2
4
 
3
- const TimelineDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { id: undefined, color: (d) => d.color, lineWidth: 8, lineCap: false, rowHeight: 22, length: (d) => d.length, type: (d) => d.type, cursor: null, labelWidth: undefined, showLabels: false, maxLabelWidth: 120, alternatingRowColors: true, onScroll: undefined, showEmptySegments: false });
5
+ const TimelineDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { id: undefined,
6
+ // Items (Lines)
7
+ cursor: undefined, type: (d) => d.type, length: (d) => d.length, color: (d) => d.color, lineRow: undefined, lineDuration: undefined, lineWidth: 8, lineCap: false, lineCursor: undefined, showEmptySegments: false, lineStartIcon: undefined, lineStartIconColor: undefined, lineStartIconSize: undefined, lineStartIconArrangement: Arrangement.Inside, lineEndIcon: undefined, lineEndIconColor: undefined, lineEndIconSize: undefined, lineEndIconArrangement: Arrangement.Inside,
8
+ // Rows
9
+ rowHeight: 22, alternatingRowColors: true,
10
+ // Row Labels
11
+ showLabels: false, labelWidth: undefined, maxLabelWidth: 120, showRowLabels: undefined, rowLabelFormatter: undefined, rowIcon: undefined, rowLabelStyle: undefined, rowLabelWidth: undefined, rowMaxLabelWidth: undefined, rowLabelTextAlign: TextAlign.Right,
12
+ // Arrows
13
+ arrows: undefined,
14
+ // Animation
15
+ animationLineEnterPosition: undefined,
16
+ // Callbacks
17
+ onScroll: undefined });
4
18
 
5
19
  export { TimelineDefaultConfig };
6
20
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/components/timeline/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { WithOptional } from 'types/misc'\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\nexport interface TimelineConfigInterface<Datum> extends WithOptional<XYComponentConfigInterface<Datum>, 'y'> {\n /** Timeline item color accessor function. Default: `d => d.color` */\n color?: ColorAccessor<Datum>;\n /** Width of the timeline items. Default: `8` */\n lineWidth?: NumericAccessor<Datum>;\n /** Display rounded ends for timeline items. Default: `true` */\n lineCap?: boolean;\n /** Timeline row height. Default: `22` */\n rowHeight?: number;\n /** Timeline item length accessor function. Default: `d => d.length` */\n length?: NumericAccessor<Datum>;\n /** Timeline item type accessor function. Records of one type will be plotted in one row. Default: `d => d.type` */\n type?: StringAccessor<Datum>;\n /** Configurable Timeline item cursor when hovering over. Default: `null` */\n cursor?: StringAccessor<Datum>;\n /** Show item type labels when set to `true`. Default: `false` */\n showLabels?: boolean;\n /** Fixed label width in pixels. Labels longer than the specified value will be trimmed. Default: `undefined` */\n labelWidth?: number;\n /** Maximum label width in pixels. Labels longer than the specified value will be trimmed. Default: `120` */\n maxLabelWidth?: number;\n /** Alternating row colors. Default: `true` */\n alternatingRowColors?: boolean;\n /** Scrolling callback function: `(scrollTop: number) => void`. Default: `undefined` */\n onScroll?: (scrollTop: number) => void;\n /** Sets the minimum line length to 1 pixel for better visibility of small values. Default: `false` */\n showEmptySegments?: boolean;\n}\n\nexport const TimelineDefaultConfig: TimelineConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n id: undefined,\n color: (d: unknown): string => (d as { color: string }).color,\n lineWidth: 8,\n lineCap: false,\n rowHeight: 22,\n length: (d: unknown): number => (d as { length: number }).length,\n type: (d: unknown): string => (d as { type: string }).type,\n cursor: null,\n labelWidth: undefined,\n showLabels: false,\n maxLabelWidth: 120,\n alternatingRowColors: true,\n onScroll: undefined,\n showEmptySegments: false,\n}\n"],"names":[],"mappings":";;AAmCa,MAAA,qBAAqB,GAC7B,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,wBAAwB,KAC3B,EAAE,EAAE,SAAS,EACb,KAAK,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAC7D,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,KAAK,EACd,SAAS,EAAE,EAAE,EACb,MAAM,EAAE,CAAC,CAAU,KAAc,CAAwB,CAAC,MAAM,EAChE,IAAI,EAAE,CAAC,CAAU,KAAc,CAAsB,CAAC,IAAI,EAC1D,MAAM,EAAE,IAAI,EACZ,UAAU,EAAE,SAAS,EACrB,UAAU,EAAE,KAAK,EACjB,aAAa,EAAE,GAAG,EAClB,oBAAoB,EAAE,IAAI,EAC1B,QAAQ,EAAE,SAAS,EACnB,iBAAiB,EAAE,KAAK;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../../src/components/timeline/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { WithOptional } from 'types/misc'\nimport { ColorAccessor, NumericAccessor, StringAccessor, GenericAccessor } from 'types/accessor'\nimport { TextAlign } from 'types/text'\nimport { Arrangement } from 'types/position'\n\n// Local Types\nimport type { TimelineArrow, TimelineLineRenderState, TimelineRowIcon, TimelineRowLabel } from './types'\n\nexport interface TimelineConfigInterface<Datum> extends WithOptional<XYComponentConfigInterface<Datum>, 'y'> {\n // Items (Lines)\n /** @deprecated This property has been renamed to `key` */\n type?: StringAccessor<Datum>;\n /** @deprecated This property has been renamed to `lineDuration` */\n length?: NumericAccessor<Datum>;\n /** @deprecated This property has been renamed to `lineCursor` */\n cursor?: StringAccessor<Datum>;\n /** Timeline item row accessor function. Records with the `lineRow` will be plotted in one row. Default: `undefined` */\n lineRow?: StringAccessor<Datum>;\n /** Timeline item duration accessor function. Default: `undefined`. Falls back to the deprecated `length` property */\n lineDuration?: NumericAccessor<Datum>;\n /** Timeline item color accessor function. Default: `d => d.color` */\n color?: ColorAccessor<Datum>;\n /** Width of the timeline items. Default: `8` */\n lineWidth?: NumericAccessor<Datum>;\n /** Display rounded ends for timeline items. Default: `true` */\n lineCap?: boolean;\n /** Provide a href to an SVG defined in container's `svgDefs` to display an icon at the start of the line. Default: undefined */\n lineStartIcon?: StringAccessor<Datum>;\n /** Line start icon color accessor function. Default: `undefined` */\n lineStartIconColor?: StringAccessor<Datum>;\n /** Line start icon size accessor function. Default: `undefined` */\n lineStartIconSize?: NumericAccessor<Datum>;\n /** Line start icon arrangement configuration. Controls how the icon is positioned relative to the line.\n * Accepts values from the Arrangement enum: `Arrangement.Start`, `Arrangement.Middle`, `Arrangement.End` or a string equivalent.\n * Default: `Arrangement.Inside` */\n lineStartIconArrangement?: GenericAccessor<Arrangement | `${Arrangement}`, Datum>;\n /** Provide a href to an SVG defined in container's `svgDefs` to display an icon at the end of the line. Default: undefined */\n lineEndIcon?: StringAccessor<Datum>;\n /** Line end icon color accessor function. Default: `undefined` */\n lineEndIconColor?: StringAccessor<Datum>;\n /** Line end icon size accessor function. Default: `undefined` */\n lineEndIconSize?: NumericAccessor<Datum>;\n /** Line end icon arrangement configuration. Controls how the icon is positioned relative to the line.\n * Accepts values from the Arrangement enum: `Arrangement.Start`, `Arrangement.Middle`, `Arrangement.End` or a string equivalent.\n * Default: `Arrangement.Inside` */\n lineEndIconArrangement?: GenericAccessor<Arrangement | `${Arrangement}`, Datum>;\n /** Configurable Timeline item cursor when hovering over. Default: `undefined` */\n lineCursor?: StringAccessor<Datum>;\n /** Sets the minimum line length to 1 pixel for better visibility of small values. Default: `false` */\n showEmptySegments?: boolean;\n\n /** Timeline row height. Default: `22` */\n rowHeight?: number;\n /** Alternating row colors. Default: `true` */\n alternatingRowColors?: boolean;\n\n // Row Labels\n /** @deprecated This property has been renamed to `showRowLabels */\n showLabels?: boolean;\n /** @deprecated This property has been renamed to `rowLabelWidth */\n labelWidth?: number;\n /** @deprecated This property has been renamed to `rowMaxLabelWidth */\n maxLabelWidth?: number;\n\n /** Show row labels when set to `true`. Default: `false`. Falls back to deprecated `showLabels` */\n showRowLabels?: boolean;\n /** Row label style as an object with the `{ [property-name]: value }` format. Default: `undefined` */\n rowLabelStyle?: GenericAccessor<Record<string, string>, TimelineRowLabel<Datum>>;\n /** Row label formatter function. Default: `undefined` */\n rowLabelFormatter?: (key: string, items: Datum[], i: number) => string;\n /** Provide an icon href to be displayed before the row label. Default: `undefined` */\n rowIcon?: (key: string, items: Datum[], i: number) => TimelineRowIcon | undefined;\n /** Fixed label width in pixels. Labels longer than the specified value will be trimmed. Default: `undefined`. Falls back to deprecated `labelWidth`. */\n rowLabelWidth?: number;\n /** Maximum label width in pixels. Labels longer than the specified value will be trimmed. Default: `undefined`. Falls back to deprecated `maxLabelWidth`. */\n rowMaxLabelWidth?: number;\n /** Text alignment for labels: `TextAlign.Left`, `TextAlign.Center` or `TextAlign.Right`. Default: `TextAlign.Right` */\n rowLabelTextAlign?: TextAlign | `${TextAlign}`;\n\n // Arrows\n arrows?: TimelineArrow[];\n\n // Animation\n /** Control the animation by specify the initial position for new lines as [x, y]. Default: `undefined` */\n animationLineEnterPosition?:\n [number | undefined | null, number | undefined | null] |\n ((d: Datum & TimelineLineRenderState, i: number, data: (Datum & TimelineLineRenderState)[]) => [number | undefined, number | undefined]) |\n undefined;\n /** Control the animation by specify the destination position for exiting lines as [x, y]. Default: `undefined` */\n animationLineExitPosition?: [number | undefined | null, number | undefined | null] |\n ((d: Datum & TimelineLineRenderState, i: number, data: (Datum & TimelineLineRenderState)[]) => [number | undefined, number | undefined]) |\n undefined;\n\n // Callbacks\n /** Scrolling callback function: `(scrollTop: number) => void`. Default: `undefined` */\n onScroll?: (scrollTop: number) => void;\n}\n\nexport const TimelineDefaultConfig: TimelineConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n id: undefined,\n\n // Items (Lines)\n cursor: undefined, // Deprecated (see above)\n type: (d: unknown): string => (d as { type: string }).type, // Deprecated (see above)\n length: (d: unknown): number => (d as { length: number }).length, // Deprecated (see above)\n color: (d: unknown): string => (d as { color: string }).color,\n lineRow: undefined,\n lineDuration: undefined,\n lineWidth: 8,\n lineCap: false,\n lineCursor: undefined,\n showEmptySegments: false,\n lineStartIcon: undefined,\n lineStartIconColor: undefined,\n lineStartIconSize: undefined,\n lineStartIconArrangement: Arrangement.Inside,\n lineEndIcon: undefined,\n lineEndIconColor: undefined,\n lineEndIconSize: undefined,\n lineEndIconArrangement: Arrangement.Inside,\n\n // Rows\n rowHeight: 22,\n alternatingRowColors: true,\n\n // Row Labels\n showLabels: false, // Deprecated (see above)\n labelWidth: undefined, // Deprecated (see above)\n maxLabelWidth: 120, // Deprecated (see above)\n\n showRowLabels: undefined,\n rowLabelFormatter: undefined,\n rowIcon: undefined,\n rowLabelStyle: undefined,\n rowLabelWidth: undefined,\n rowMaxLabelWidth: undefined,\n rowLabelTextAlign: TextAlign.Right,\n\n // Arrows\n arrows: undefined,\n\n // Animation\n animationLineEnterPosition: undefined,\n\n // Callbacks\n onScroll: undefined,\n}\n"],"names":[],"mappings":";;;;MAqGa,qBAAqB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC7B,wBAAwB,CAC3B,EAAA,EAAA,EAAE,EAAE,SAAS;;IAGb,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,CAAC,CAAU,KAAc,CAAsB,CAAC,IAAI,EAC1D,MAAM,EAAE,CAAC,CAAU,KAAc,CAAwB,CAAC,MAAM,EAChE,KAAK,EAAE,CAAC,CAAU,KAAc,CAAuB,CAAC,KAAK,EAC7D,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,SAAS,EACvB,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,KAAK,EACd,UAAU,EAAE,SAAS,EACrB,iBAAiB,EAAE,KAAK,EACxB,aAAa,EAAE,SAAS,EACxB,kBAAkB,EAAE,SAAS,EAC7B,iBAAiB,EAAE,SAAS,EAC5B,wBAAwB,EAAE,WAAW,CAAC,MAAM,EAC5C,WAAW,EAAE,SAAS,EACtB,gBAAgB,EAAE,SAAS,EAC3B,eAAe,EAAE,SAAS,EAC1B,sBAAsB,EAAE,WAAW,CAAC,MAAM;;AAG1C,IAAA,SAAS,EAAE,EAAE,EACb,oBAAoB,EAAE,IAAI;;AAG1B,IAAA,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,SAAS,EACrB,aAAa,EAAE,GAAG,EAElB,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,SAAS,EAC5B,OAAO,EAAE,SAAS,EAClB,aAAa,EAAE,SAAS,EACxB,aAAa,EAAE,SAAS,EACxB,gBAAgB,EAAE,SAAS,EAC3B,iBAAiB,EAAE,SAAS,CAAC,KAAK;;AAGlC,IAAA,MAAM,EAAE,SAAS;;AAGjB,IAAA,0BAA0B,EAAE,SAAS;;IAGrC,QAAQ,EAAE,SAAS,EAAA;;;;"}
@@ -0,0 +1,3 @@
1
+ export declare const TIMELINE_DEFAULT_ARROW_HEAD_LENGTH = 8;
2
+ export declare const TIMELINE_DEFAULT_ARROW_HEAD_WIDTH = 6;
3
+ export declare const TIMELINE_DEFAULT_ARROW_MARGIN = 3;
@@ -0,0 +1,6 @@
1
+ const TIMELINE_DEFAULT_ARROW_HEAD_LENGTH = 8;
2
+ const TIMELINE_DEFAULT_ARROW_HEAD_WIDTH = 6;
3
+ const TIMELINE_DEFAULT_ARROW_MARGIN = 3;
4
+
5
+ export { TIMELINE_DEFAULT_ARROW_HEAD_LENGTH, TIMELINE_DEFAULT_ARROW_HEAD_WIDTH, TIMELINE_DEFAULT_ARROW_MARGIN };
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/components/timeline/constants.ts"],"sourcesContent":["export const TIMELINE_DEFAULT_ARROW_HEAD_LENGTH = 8\nexport const TIMELINE_DEFAULT_ARROW_HEAD_WIDTH = 6\nexport const TIMELINE_DEFAULT_ARROW_MARGIN = 3\n"],"names":[],"mappings":"AAAO,MAAM,kCAAkC,GAAG,EAAC;AAC5C,MAAM,iCAAiC,GAAG,EAAC;AAC3C,MAAM,6BAA6B,GAAG;;;;"}
@@ -1,4 +1,5 @@
1
1
  import { XYComponentCore } from "../../core/xy-component";
2
+ import { Spacing } from "../../types";
2
3
  import { TimelineConfigInterface } from './config';
3
4
  import * as s from './style';
4
5
  export declare class Timeline<Datum> extends XYComponentCore<Datum, TimelineConfigInterface<Datum>> {
@@ -12,8 +13,10 @@ export declare class Timeline<Datum> extends XYComponentCore<Datum, TimelineConf
12
13
  };
13
14
  private _background;
14
15
  private _rowsGroup;
16
+ private _arrowsGroup;
15
17
  private _linesGroup;
16
18
  private _labelsGroup;
19
+ private _rowIconsGroup;
17
20
  private _scrollBarGroup;
18
21
  private _scrollBarBackground;
19
22
  private _scrollBarHandle;
@@ -23,20 +26,28 @@ export declare class Timeline<Datum> extends XYComponentCore<Datum, TimelineConf
23
26
  private _maxScroll;
24
27
  private _scrollbarHeight;
25
28
  private _labelMargin;
29
+ private _labelWidth;
30
+ private _rowIconBleed;
31
+ private _lineBleed;
32
+ /** We define a dedicated clipping path for this component because it needs to behave
33
+ * differently than the regular XYContainer's clipPath */
34
+ private _clipPathId;
35
+ private _clipPath;
26
36
  constructor(config?: TimelineConfigInterface<Datum>);
27
- get bleed(): {
28
- top: number;
29
- bottom: number;
30
- left: number;
31
- right: number;
32
- };
37
+ setConfig(config: TimelineConfigInterface<Datum>): void;
38
+ setData(data: Datum[]): void;
39
+ get bleed(): Spacing;
33
40
  _render(customDuration?: number): void;
34
- private _positionLines;
41
+ private _getLineLength;
42
+ private _getLineWidth;
43
+ private _getLineDuration;
44
+ private _prepareLinesData;
45
+ private _prepareArrowsData;
46
+ private _renderLines;
35
47
  private _onScrollbarDrag;
36
48
  private _onMouseWheel;
37
49
  private _updateScrollPosition;
38
- private _getMaxLineWidth;
39
- private _getRecordType;
40
- private _getRecordLabels;
50
+ private _getRecordKey;
51
+ private _getRowLabels;
41
52
  getXDataExtent(): number[];
42
53
  }