@nova-ui/charts 20.0.0 → 20.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/bundles/css/styles.css +1 -1
  2. package/fesm2022/nova-ui-charts.mjs +51 -82
  3. package/fesm2022/nova-ui-charts.mjs.map +1 -1
  4. package/index.d.ts +4104 -3
  5. package/package.json +10 -2
  6. package/chart/chart.component.d.ts +0 -22
  7. package/chart-collection/chart-collection-id.directive.d.ts +0 -19
  8. package/chart-collection/chart-collection.service.d.ts +0 -11
  9. package/chart-collection/public-api.d.ts +0 -2
  10. package/chart-donut-content/chart-donut-content.component.d.ts +0 -15
  11. package/chart-marker/chart-marker.component.d.ts +0 -22
  12. package/chart-popover/chart-popover.component.d.ts +0 -22
  13. package/chart-tooltips/chart-tooltip.component.d.ts +0 -7
  14. package/chart-tooltips/chart-tooltip.directive.d.ts +0 -28
  15. package/chart-tooltips/chart-tooltips.component.d.ts +0 -41
  16. package/charts.module.d.ts +0 -21
  17. package/constants.d.ts +0 -30
  18. package/core/chart-assists/chart-assist.d.ts +0 -120
  19. package/core/chart-assists/public-api.d.ts +0 -3
  20. package/core/chart-assists/spark-chart-assist.d.ts +0 -49
  21. package/core/chart-assists/types.d.ts +0 -59
  22. package/core/chart-collection.d.ts +0 -51
  23. package/core/chart.d.ts +0 -46
  24. package/core/common/chart-plugin.d.ts +0 -9
  25. package/core/common/data-manager.d.ts +0 -25
  26. package/core/common/data-series.d.ts +0 -11
  27. package/core/common/event-bus.d.ts +0 -6
  28. package/core/common/lasagna.d.ts +0 -15
  29. package/core/common/mouse-interactive-area.d.ts +0 -23
  30. package/core/common/palette/chart-palette.d.ts +0 -12
  31. package/core/common/palette/color.helper.d.ts +0 -1
  32. package/core/common/palette/default-providers.d.ts +0 -4
  33. package/core/common/palette/mapped-value-provider.d.ts +0 -14
  34. package/core/common/palette/markers/path-marker.d.ts +0 -19
  35. package/core/common/palette/markers/svg-marker.d.ts +0 -11
  36. package/core/common/palette/palettes.d.ts +0 -20
  37. package/core/common/palette/processed-color-provider.d.ts +0 -13
  38. package/core/common/palette/public-api.d.ts +0 -12
  39. package/core/common/palette/sequential-chart-marker-provider.d.ts +0 -10
  40. package/core/common/palette/sequential-color-provider.d.ts +0 -9
  41. package/core/common/palette/sequential-value-provider.d.ts +0 -13
  42. package/core/common/palette/text-color-provider.d.ts +0 -27
  43. package/core/common/public-api.d.ts +0 -12
  44. package/core/common/render-engine.d.ts +0 -59
  45. package/core/common/renderer.d.ts +0 -110
  46. package/core/common/scales/band-scale.d.ts +0 -91
  47. package/core/common/scales/constants.d.ts +0 -2
  48. package/core/common/scales/domain-calculation/automatic-domain.d.ts +0 -19
  49. package/core/common/scales/domain-calculation/domain-with-auxiliary-series.d.ts +0 -9
  50. package/core/common/scales/domain-calculation/domain-with-ticks.d.ts +0 -3
  51. package/core/common/scales/domain-calculation/merge-domains.d.ts +0 -8
  52. package/core/common/scales/formatters/datetime-formatter.d.ts +0 -5
  53. package/core/common/scales/formatters/public-api.d.ts +0 -1
  54. package/core/common/scales/helpers/convert.d.ts +0 -10
  55. package/core/common/scales/helpers/domain.d.ts +0 -2
  56. package/core/common/scales/helpers/invert.d.ts +0 -2
  57. package/core/common/scales/helpers/is-in-range.d.ts +0 -8
  58. package/core/common/scales/linear-scale.d.ts +0 -12
  59. package/core/common/scales/noop-scale.d.ts +0 -21
  60. package/core/common/scales/point-scale.d.ts +0 -55
  61. package/core/common/scales/public-api.d.ts +0 -15
  62. package/core/common/scales/scale.d.ts +0 -44
  63. package/core/common/scales/time-interval-scale.d.ts +0 -30
  64. package/core/common/scales/time-scale.d.ts +0 -13
  65. package/core/common/scales/types.d.ts +0 -144
  66. package/core/common/types.d.ts +0 -327
  67. package/core/common/utility.service.d.ts +0 -53
  68. package/core/grid/config/area-grid-config.d.ts +0 -7
  69. package/core/grid/config/axis-config.d.ts +0 -20
  70. package/core/grid/config/bar-grid-config.d.ts +0 -7
  71. package/core/grid/config/bar-horizontal-grid-config.d.ts +0 -7
  72. package/core/grid/config/bar-status-grid-config.d.ts +0 -6
  73. package/core/grid/config/border-config.d.ts +0 -9
  74. package/core/grid/config/dimension-config.d.ts +0 -31
  75. package/core/grid/config/grid-config.d.ts +0 -16
  76. package/core/grid/config/linear-gauge-grid-config-fn.d.ts +0 -11
  77. package/core/grid/config/public-api.d.ts +0 -11
  78. package/core/grid/config/spark-chart-grid-config.d.ts +0 -9
  79. package/core/grid/config/xy-grid-config.d.ts +0 -10
  80. package/core/grid/default-text-overflow-handler.d.ts +0 -10
  81. package/core/grid/grid.d.ts +0 -125
  82. package/core/grid/public-api.d.ts +0 -5
  83. package/core/grid/radial-grid.d.ts +0 -9
  84. package/core/grid/types.d.ts +0 -285
  85. package/core/grid/xy-grid.d.ts +0 -107
  86. package/core/plugins/chart-donut-content-plugin.d.ts +0 -15
  87. package/core/plugins/chart-popover-plugin.d.ts +0 -39
  88. package/core/plugins/gauge/constants.d.ts +0 -12
  89. package/core/plugins/gauge/donut-gauge-labels-plugin.d.ts +0 -21
  90. package/core/plugins/gauge/linear-gauge-labels-plugin.d.ts +0 -26
  91. package/core/plugins/gauge/public-api.d.ts +0 -4
  92. package/core/plugins/gauge/types.d.ts +0 -16
  93. package/core/plugins/interaction/interaction-label-plugin.d.ts +0 -24
  94. package/core/plugins/interaction/interaction-line-plugin.d.ts +0 -18
  95. package/core/plugins/interaction/public-api.d.ts +0 -2
  96. package/core/plugins/mouse-interactive-area-plugin.d.ts +0 -14
  97. package/core/plugins/public-api.d.ts +0 -12
  98. package/core/plugins/radial-popover-plugin.d.ts +0 -8
  99. package/core/plugins/render-engine-plugin.d.ts +0 -12
  100. package/core/plugins/timeseries-zoom-plugin-sync.service.d.ts +0 -13
  101. package/core/plugins/timeseries-zoom-plugin.d.ts +0 -55
  102. package/core/plugins/tooltips/bar-tooltips-plugin.d.ts +0 -5
  103. package/core/plugins/tooltips/chart-tooltips-plugin.d.ts +0 -63
  104. package/core/plugins/tooltips/index.d.ts +0 -3
  105. package/core/plugins/tooltips/radial-tooltips-plugin.d.ts +0 -23
  106. package/core/plugins/types.d.ts +0 -30
  107. package/core/plugins/zoom-plugin.d.ts +0 -23
  108. package/core/public-api.d.ts +0 -7
  109. package/core/types.d.ts +0 -8
  110. package/gauge/constants.d.ts +0 -54
  111. package/gauge/gauge-util.d.ts +0 -161
  112. package/gauge/public-api.d.ts +0 -3
  113. package/gauge/types.d.ts +0 -89
  114. package/legend/legend-series/legend-series.component.d.ts +0 -79
  115. package/legend/legend-tile/basic-legend-tile/basic-legend-tile.component.d.ts +0 -5
  116. package/legend/legend-tile/public-api.d.ts +0 -2
  117. package/legend/legend-tile/rich-legend-tile/rich-legend-tile.component.d.ts +0 -33
  118. package/legend/legend.component.d.ts +0 -37
  119. package/legend/public-api.d.ts +0 -3
  120. package/legend/types.d.ts +0 -4
  121. package/public-api.d.ts +0 -15
  122. package/renderers/accessors/noop-accessors.d.ts +0 -11
  123. package/renderers/accessors/public-api.d.ts +0 -3
  124. package/renderers/accessors/rectangle-accessors.d.ts +0 -30
  125. package/renderers/accessors/xy-accessors.d.ts +0 -13
  126. package/renderers/area/area-accessors.d.ts +0 -28
  127. package/renderers/area/area-grid.d.ts +0 -7
  128. package/renderers/area/area-renderer.d.ts +0 -41
  129. package/renderers/area/public-api.d.ts +0 -6
  130. package/renderers/area/stacked-area-accessors.d.ts +0 -3
  131. package/renderers/area/stacked-area-preprocessor.d.ts +0 -5
  132. package/renderers/area/stacked-percentage-area-preprocessor.d.ts +0 -7
  133. package/renderers/bar/accessors/bar-accessors-fn.d.ts +0 -13
  134. package/renderers/bar/accessors/bar-accessors.d.ts +0 -24
  135. package/renderers/bar/accessors/horizontal-bar-accessors.d.ts +0 -8
  136. package/renderers/bar/accessors/public-api.d.ts +0 -6
  137. package/renderers/bar/accessors/status-accessors-fn.d.ts +0 -3
  138. package/renderers/bar/accessors/status-accessors.d.ts +0 -17
  139. package/renderers/bar/accessors/vertical-bar-accessors.d.ts +0 -8
  140. package/renderers/bar/bar-grid.d.ts +0 -10
  141. package/renderers/bar/bar-renderer.d.ts +0 -47
  142. package/renderers/bar/bar-scales.d.ts +0 -10
  143. package/renderers/bar/highlight-strategies/bar-highlight-strategy-outline.d.ts +0 -15
  144. package/renderers/bar/highlight-strategies/bar-highlight-strategy.d.ts +0 -23
  145. package/renderers/bar/highlight-strategies/bar-series-highlight-strategy.d.ts +0 -21
  146. package/renderers/bar/highlight-strategies/public-api.d.ts +0 -3
  147. package/renderers/bar/linear-gauge-renderer-config.d.ts +0 -7
  148. package/renderers/bar/linear-gauge-thresholds-renderer.d.ts +0 -25
  149. package/renderers/bar/preprocessor-utils.d.ts +0 -4
  150. package/renderers/bar/public-api.d.ts +0 -8
  151. package/renderers/bar/stacked-preprocessor.d.ts +0 -5
  152. package/renderers/bar/types.d.ts +0 -13
  153. package/renderers/constants.d.ts +0 -12
  154. package/renderers/line/calculate-missing-data.d.ts +0 -10
  155. package/renderers/line/interaction-strategies/line-select-series-interaction-strategy.d.ts +0 -15
  156. package/renderers/line/interaction-strategies/public-api.d.ts +0 -1
  157. package/renderers/line/line-accessors.d.ts +0 -37
  158. package/renderers/line/line-renderer.d.ts +0 -46
  159. package/renderers/line/missing-data-line-renderer-config.d.ts +0 -8
  160. package/renderers/line/public-api.d.ts +0 -5
  161. package/renderers/marker-utils.d.ts +0 -21
  162. package/renderers/noop-renderer.d.ts +0 -19
  163. package/renderers/public-api.d.ts +0 -10
  164. package/renderers/radial/accessors/radial-accessors.d.ts +0 -22
  165. package/renderers/radial/gauge/donut-gauge-renderer-config.d.ts +0 -7
  166. package/renderers/radial/gauge/donut-gauge-rendering-util.d.ts +0 -6
  167. package/renderers/radial/gauge/donut-gauge-thresholds-renderer.d.ts +0 -24
  168. package/renderers/radial/pie-renderer.d.ts +0 -8
  169. package/renderers/radial/public-api.d.ts +0 -9
  170. package/renderers/radial/radial-grid-fn.d.ts +0 -2
  171. package/renderers/radial/radial-preprocessor.d.ts +0 -12
  172. package/renderers/radial/radial-renderer.d.ts +0 -33
  173. package/renderers/radial/radial-scales.d.ts +0 -5
  174. package/renderers/side-indicator-renderer.d.ts +0 -55
  175. package/renderers/types.d.ts +0 -99
  176. package/renderers/xy-renderer.d.ts +0 -15
  177. package/thresholds/public-api.d.ts +0 -4
  178. package/thresholds/thresholds-service.d.ts +0 -114
  179. package/thresholds/thresholds-summary-grid-config.d.ts +0 -7
  180. package/thresholds/thresholds-top-grid-config.d.ts +0 -7
  181. package/thresholds/types.d.ts +0 -21
@@ -1,21 +0,0 @@
1
- import { AxisScale } from "d3-axis";
2
- import { IFormatters, IScale } from "./types";
3
- export declare class NoopScale<T = string> implements IScale<T> {
4
- readonly id: string;
5
- formatters: IFormatters<T>;
6
- isDomainFixed: boolean;
7
- constructor(id?: string);
8
- convert(): number;
9
- invert(): T;
10
- get d3Scale(): AxisScale<T>;
11
- range(): [number, number];
12
- range(range: [number, number]): this;
13
- domain(): T[];
14
- domain(domain: T[]): this;
15
- fixDomain(domain: any[]): null;
16
- isContinuous(): boolean;
17
- isDomainValid(): boolean;
18
- reverse(): this;
19
- reversed(): boolean;
20
- reversed(reversed: boolean): this;
21
- }
@@ -1,55 +0,0 @@
1
- import { Scale } from "./scale";
2
- import { IScale } from "./types";
3
- /** @ignore */
4
- export declare class PointScale extends Scale<string> {
5
- constructor(id?: string);
6
- protected createD3Scale(): any;
7
- convert(value: string): number;
8
- invert(coordinate: number): string;
9
- /**
10
- * Gets the rounded setting for the scale
11
- *
12
- * @returns {boolean} The value indicating whether the scale is rounded
13
- */
14
- round(): boolean;
15
- /**
16
- * Sets whether the scale should be rounded
17
- * Rounding helps to have crisp edges https://github.com/d3/d3-scale#band_round
18
- *
19
- * @param {boolean} round The specified round setting
20
- */
21
- round(round: boolean): IScale<string>;
22
- /**
23
- * A convenience method for setting the inner and outer padding.
24
- * This differs from D3 implementation. We're setting the outer padding to half of the inner padding.
25
- *
26
- * @param padding Value in [0, 1] interval.
27
- */
28
- padding(padding: number): IScale<string>;
29
- /**
30
- * Returns the current alignment which defaults to 0.5.
31
- *
32
- * @returns {number} The current alignment
33
- */
34
- align(): number;
35
- /**
36
- * Sets the alignment to the specified value which must be in the range [0, 1].
37
- *
38
- * The default is 0.5.
39
- *
40
- * The alignment determines how any leftover unused space in the range is distributed.
41
- * A value of 0.5 indicates that the leftover space should be equally distributed before the first band and
42
- * after the last band, i.e. the bands should be centered within the range. A value of 0 or 1 may be used to
43
- * shift the bands to one side, say to position them adjacent to an axis.
44
- *
45
- * @param {number} align Value for alignment setting in [0, 1] interval.
46
- */
47
- align(align: number): this;
48
- /**
49
- * Returns the width of each band
50
- *
51
- * @returns {number} The width of each band
52
- */
53
- bandwidth(): number;
54
- isContinuous(): boolean;
55
- }
@@ -1,15 +0,0 @@
1
- export * from "./domain-calculation/automatic-domain";
2
- export * from "./domain-calculation/domain-with-ticks";
3
- export * from "./domain-calculation/domain-with-auxiliary-series";
4
- export * from "./domain-calculation/merge-domains";
5
- export * from "./band-scale";
6
- export * from "./point-scale";
7
- export * from "./linear-scale";
8
- export * from "./scale";
9
- export * from "./time-scale";
10
- export * from "./time-interval-scale";
11
- export * from "./formatters/public-api";
12
- export * from "./types";
13
- export * from "./noop-scale";
14
- export * from "./helpers/convert";
15
- export * from "./helpers/invert";
@@ -1,44 +0,0 @@
1
- import { AxisScale } from "d3-axis";
2
- import { UnitOption } from "@nova-ui/bits";
3
- import { DomainCalculator, IFormatters, IScale } from "./types";
4
- export declare abstract class Scale<T> implements IScale<T> {
5
- readonly id: string;
6
- domainCalculator: DomainCalculator;
7
- formatters: IFormatters<T>;
8
- isDomainFixed: boolean;
9
- scaleUnits?: UnitOption;
10
- isTimeseriesScale: boolean;
11
- __domainCalculatedWithTicks?: boolean;
12
- private isReversed;
13
- protected _fixDomainValues: T[];
14
- protected readonly _d3Scale: any;
15
- protected constructor(id?: string);
16
- /**
17
- * Creates a d3 scale based on the scale's type
18
- *
19
- * @returns {any} A new d3 scale appropriate to the scale type
20
- */
21
- protected abstract createD3Scale(): any;
22
- abstract convert(value: T): number;
23
- abstract invert(coordinate: number): T | undefined;
24
- abstract isContinuous(): boolean;
25
- /** See {@link IScale#d3Scale} */
26
- get d3Scale(): AxisScale<T>;
27
- get fixDomainValues(): T[];
28
- /** See {@link IScale#setFixDomainValues} */
29
- setFixDomainValues(values: T[]): void;
30
- /** See {@link IScale#range} */
31
- range(): [number, number];
32
- range(range: [number, number]): this;
33
- /** See {@link IScale#domain} */
34
- domain(): T[];
35
- domain(domain: T[]): this;
36
- /** See {@link IScale#fixDomain} */
37
- fixDomain(domain: T[]): this;
38
- /** See {@link IScale#reverse} */
39
- isDomainValid(): boolean;
40
- reverse(): this;
41
- /** See {@link IScale#reversed} */
42
- reversed(): boolean;
43
- reversed(reversed: boolean): this;
44
- }
@@ -1,30 +0,0 @@
1
- import { Duration } from "moment/moment";
2
- import { TimeScale } from "./time-scale";
3
- import { IBandScale } from "./types";
4
- export declare function isDaylightSavingTime(d: Date): boolean;
5
- /**
6
- * Scale designed to support regular interval based data.
7
- */
8
- export declare class TimeIntervalScale extends TimeScale implements IBandScale<Date> {
9
- private _bandScale;
10
- private _interval;
11
- constructor(interval: Duration, id?: string);
12
- interval(): Duration;
13
- interval(value: Duration): TimeIntervalScale;
14
- domain(domain?: Date[]): any;
15
- range(range?: [number, number]): any;
16
- getBands(): Date[];
17
- convert(value: Date, position?: number): number;
18
- /**
19
- * Converts the specified coordinate into the value of the closest band data point
20
- *
21
- * @param {number} coordinate The coordinate to convert
22
- * @returns {string} The value of the closest band data point
23
- */
24
- invert(coordinate: number): Date | undefined;
25
- bandwidth(): number;
26
- truncToInterval(datetime: Date | undefined, interval: Duration, isDomainChange?: boolean): Date | undefined;
27
- isContinuous(): boolean;
28
- defaultTitleFormatter: (inputDate: Date) => string;
29
- private getBandsForInterval;
30
- }
@@ -1,13 +0,0 @@
1
- import { AxisScale } from "d3-axis";
2
- import { Scale } from "./scale";
3
- /**
4
- * Nova wrapper around [D3's scaleTime](https://d3indepth.com/scales/#scaletime)
5
- */
6
- export declare class TimeScale extends Scale<Date> {
7
- constructor(id?: string);
8
- protected createD3Scale(): AxisScale<Date>;
9
- convert(value: Date): number;
10
- invert(coordinate: number): Date | undefined;
11
- isContinuous(): boolean;
12
- isDomainValid(): boolean;
13
- }
@@ -1,144 +0,0 @@
1
- import { AxisScale } from "d3-axis";
2
- import { UnitOption } from "@nova-ui/bits";
3
- import { IAccessors, IChartSeries } from "../types";
4
- /** Domain for series with empty or null data */
5
- export declare const EMPTY_CONTINUOUS_DOMAIN: number[];
6
- /** A reasonable non-data-driven domain for charts */
7
- export declare const NORMALIZED_DOMAIN: number[];
8
- /** Signature for domain calculator */
9
- export type DomainCalculator = (chartSeriesSet: IChartSeries<IAccessors>[], scaleId: string, scale: IScale<any>) => any[];
10
- /** Signature for a specific domain calculator that rounds domain to the closes tick */
11
- export interface IDomainWithTicksCalculator extends DomainCalculator {
12
- domainWithTicks?: true;
13
- }
14
- /** Type guard for the domain calculator with ticks */
15
- export declare function isDomainWithTicksCalculator(obj: any): obj is IDomainWithTicksCalculator;
16
- /** Interface for scale formatters */
17
- export interface IFormatters<T> {
18
- /** Formatter for tick labels */
19
- tick?: Formatter<T>;
20
- /** Additional formatters */
21
- [p: string]: Formatter<T> | undefined;
22
- }
23
- /** Signature for label formatters */
24
- export type Formatter<T> = (value: T) => string;
25
- /** Dictionary of scale collections in index and array form */
26
- export interface ScalesIndex {
27
- [key: string]: {
28
- /** Scale collection as an index */
29
- index: {
30
- [scaleId: string]: IScale<any>;
31
- };
32
- /** Scale collection as an array */
33
- list: IScale<any>[];
34
- };
35
- }
36
- /** Dictionary of scales */
37
- export type Scales = Record<string, IScale<any>>;
38
- export interface IXYScales extends Scales {
39
- x: IScale<any>;
40
- y: IScale<any>;
41
- }
42
- export interface IRadialScales extends Scales {
43
- r: IScale<number>;
44
- }
45
- /** Interface for a scale */
46
- export interface IScale<T> {
47
- /** The scale identifier */
48
- readonly id: string;
49
- readonly d3Scale: AxisScale<T>;
50
- fixDomainValues?: T[];
51
- /** If this flag is enabled, the domain of this scale is not recalculated */
52
- isDomainFixed?: boolean;
53
- /** Method used to calculate the scale's domain */
54
- domainCalculator?: DomainCalculator;
55
- /** The scales formatters */
56
- formatters: IFormatters<T>;
57
- /** If this flag is enabled, the domain has been recalculated with ticks in mind */
58
- __domainCalculatedWithTicks?: boolean;
59
- scaleUnits?: UnitOption;
60
- /** If this flag is enabled, the label generated by InteractionLabelPlugin will be shown only on a chart that is beeing hovered */
61
- isTimeseriesScale?: boolean;
62
- /**
63
- * Sets fix domain to the first and last value and assigns values to fixDomainValues property
64
- */
65
- setFixDomainValues?(values: T[]): void;
66
- /**
67
- * Determines if the scale's domain is continuous
68
- *
69
- * @returns {boolean} true if the scale's domain is continuous (numeric), false otherwise
70
- */
71
- isContinuous(): boolean;
72
- /**
73
- * Determines if the scale's domain is valid
74
- *
75
- * @returns {boolean} true if the scale's domain is valid, false otherwise
76
- */
77
- isDomainValid(): boolean;
78
- /**
79
- * Converts a value to its corresponding coordinate
80
- *
81
- * @param {T} value The value to be converted
82
- * @returns {number} The coordinate corresponding to the specified value
83
- */
84
- convert(value: T): number;
85
- /**
86
- * Converts a coordinate to its corresponding value
87
- *
88
- * @param {number} coordinate The coordinate to be converted
89
- * @returns {T} The value corresponding to the specified coordinate
90
- */
91
- invert(coordinate: number): T | undefined;
92
- /**
93
- * Gets the scale's range
94
- *
95
- * @returns {[number, number]} The scale's range
96
- */
97
- range(): [number, number];
98
- /**
99
- * Sets the scale's range
100
- *
101
- * @param {[number, number]} range The scale's new range
102
- */
103
- range(range: [number, number]): this;
104
- /**
105
- * Gets the scale's domain
106
- *
107
- * @returns {T[]} The scale's domain
108
- */
109
- domain(): T[];
110
- /**
111
- * Sets the scale's domain
112
- *
113
- * @param {T[]} domain The scale's new domain
114
- */
115
- domain(domain: T[]): this;
116
- /**
117
- * Shorthand method for setting the domain and isDomainFixed at once
118
- *
119
- * @param {T[]} domain The scale's fixed domain
120
- */
121
- fixDomain(domain: T[]): void;
122
- /**
123
- * Reverse the scale orientation by toggling the reversed flag
124
- */
125
- reverse(): this;
126
- /**
127
- * Getter for the reversed flag (see #reverse)
128
- */
129
- reversed(): boolean;
130
- /**
131
- * Setter for the reversed flag (see #reverse)
132
- *
133
- * @param reversed
134
- */
135
- reversed(reversed: boolean): this;
136
- }
137
- export interface IBandScale<T> extends IScale<T> {
138
- bandwidth(): number;
139
- }
140
- export declare function isBandScale(scale: any): scale is IBandScale<any>;
141
- export interface IHasInnerScale<T> extends IScale<T> {
142
- innerScale: IScale<any>;
143
- }
144
- export declare function hasInnerScale(scale: any): scale is IHasInnerScale<any>;
@@ -1,327 +0,0 @@
1
- import { ScaleLinear } from "d3-scale";
2
- import { Selection } from "d3-selection";
3
- import { ValueMap } from "d3-selection-multi";
4
- import { ChartPlugin } from "./chart-plugin";
5
- import { DataManager } from "./data-manager";
6
- import { EventBus } from "./event-bus";
7
- import { RenderEngine } from "./render-engine";
8
- import { Renderer } from "./renderer";
9
- import { Scales } from "./scales/types";
10
- import { StandardGaugeThresholdMarkerRadius } from "../../gauge/constants";
11
- import { RenderState } from "../../renderers/types";
12
- import { IGrid } from "../grid/types";
13
- /**
14
- * Short-form alias for the most commonly used generic D3 Selection type
15
- */
16
- export type D3Selection<T extends SVGElement = SVGElement> = Selection<T, any, SVGElement, any>;
17
- /**
18
- * Signature for data accessors
19
- *
20
- * @param d data point
21
- * @param i index
22
- * @param series the whole data series
23
- */
24
- export type DataAccessor<D = any, T = any> = (d: D, i: number, series: D[], dataSeries: IDataSeries<IAccessors>) => T;
25
- /**
26
- * Signature for series accessors
27
- */
28
- export type SeriesAccessor = (seriesId: string, series: IDataSeries<IAccessors>) => any;
29
- /** @ignore */
30
- export interface ILasagnaLayer {
31
- name: string;
32
- order: number;
33
- clipped: boolean;
34
- }
35
- /** Mouse interaction types */
36
- export declare enum InteractionType {
37
- /** Indicates that an element has been clicked */
38
- Click = "click",
39
- /** Indicates that an element is hovered */
40
- Hover = "hover",
41
- /** Indicates a 'mousedown' event */
42
- MouseDown = "mousedown",
43
- /** Indicates that the mouse has entered the bounds of an element */
44
- MouseEnter = "mouseenter",
45
- /** Indicates that the mouse has left the bounds of an element */
46
- MouseLeave = "mouseleave",
47
- /** Indicates a movement of the mouse across the chart */
48
- MouseMove = "mousemove",
49
- /** Indicates a 'mouseup' event */
50
- MouseUp = "mouseup"
51
- }
52
- /** @ignore */
53
- export interface ICoordinates {
54
- x: number;
55
- y: number;
56
- }
57
- /** @ignore */
58
- export interface IInteractionEvent {
59
- type: InteractionType;
60
- coordinates: ICoordinates;
61
- }
62
- /**
63
- * Information about the render state of a series
64
- */
65
- export interface IRenderStateData {
66
- /** Series identifier */
67
- seriesId: string;
68
- /** Series render state */
69
- state: RenderState;
70
- /** Series */
71
- series?: IChartSeries<IAccessors>;
72
- }
73
- /** @ignore */
74
- export interface IDomainLimits<T> {
75
- min: T;
76
- max: T;
77
- }
78
- export interface IRendererConfig {
79
- stateStyles?: Record<RenderState, ValueMap<any, any>>;
80
- transitionDuration?: number;
81
- interactive?: boolean;
82
- /** Excludes series from scale domain calculations */
83
- ignoreForDomainCalculation?: boolean;
84
- }
85
- export interface IRadialRendererConfig extends IRendererConfig {
86
- annularWidth?: number;
87
- annularPadding?: number;
88
- /** annularGrowth is a percentage value to define annular width automatically.
89
- * It will grow until it reaches maxThickness.
90
- * Set one to 0 to use annularWidth constant value instead */
91
- maxThickness?: number;
92
- annularGrowth?: number;
93
- cursor?: string;
94
- strokeWidth?: number;
95
- enableSeriesHighlighting?: boolean;
96
- enableDataPointHighlighting?: boolean;
97
- }
98
- /**
99
- * Standard configuration for gauge threshold renderers
100
- */
101
- export interface IGaugeThresholdsRendererConfig {
102
- /** The radius of each threshold marker */
103
- markerRadius?: StandardGaugeThresholdMarkerRadius | number;
104
- /** Boolean indicating whether the renderer is enabled */
105
- enabled?: boolean;
106
- }
107
- /**
108
- * Configuration for the DonutGaugeThresholdsRenderer
109
- */
110
- export interface IDonutGaugeThresholdsRendererConfig extends IRadialRendererConfig, IGaugeThresholdsRendererConfig {
111
- }
112
- /**
113
- * Configuration for the LinearGaugeThresholdsRenderer
114
- */
115
- export interface ILinearGaugeThresholdsRendererConfig extends IRendererConfig, IGaugeThresholdsRendererConfig {
116
- }
117
- export interface ILinearScales {
118
- x: ScaleLinear<number, number>;
119
- y: ScaleLinear<number, number>;
120
- }
121
- export interface IDataAccessors<D = any> {
122
- [key: string]: DataAccessor<D> | undefined;
123
- }
124
- export interface ISeriesAccessors {
125
- [key: string]: SeriesAccessor | undefined;
126
- }
127
- /**
128
- * Accessors describe the data for the consumers.
129
- */
130
- export interface IAccessors<D = any> {
131
- /** Data point level accessors for defining what part of a datum is used for visualizations */
132
- data?: IDataAccessors<D>;
133
- /** Series level accessors - e.g. for colors, markers, etc. */
134
- series?: ISeriesAccessors;
135
- }
136
- /**
137
- * A set of data to visualize on the chart
138
- */
139
- export interface IDataSeries<A extends IAccessors<D>, D = any> {
140
- /** The series identifier */
141
- id: string;
142
- /**
143
- * The series data. It is an array of arbitrary objects, the structure of which is prescribed by the consumer of this data series. Specific
144
- * renderers require specific accessor keys that are used to access values on data points. The renderers and other consumers rarely access
145
- * data point properties directly, but usually through accessors.
146
- */
147
- data: D[];
148
- /** Accessors describing the data */
149
- accessors: A;
150
- /** Allow any properties to be stored on this object to facilitate the transfer of data from APIs */
151
- [key: string]: any;
152
- }
153
- /**
154
- * The set of elements required for a chart to visualize some data
155
- */
156
- export interface IChartSeries<A extends IAccessors> extends IDataSeries<A> {
157
- /** The renderer to be used for visualizing the data */
158
- renderer: Renderer<A>;
159
- /**
160
- * Information about how chart data should conform to the drawable area.
161
- * Grids expect certain scale keys to be used depending on the type of grid, for example an x-y grid
162
- * uses 'x' and 'y' as the keys for its scales.
163
- */
164
- scales: Scales;
165
- /**
166
- * Represents an emphasis/visibility state of this series
167
- */
168
- renderState?: RenderState;
169
- }
170
- export interface IChartAssistSeries<A extends IAccessors> extends IChartSeries<A> {
171
- /**
172
- * Whether this series should be shown in the legend
173
- */
174
- showInLegend?: boolean;
175
- /**
176
- * Whether this series should be preprocessed in the chart assist
177
- */
178
- preprocess?: boolean;
179
- }
180
- export interface IChartMarker {
181
- getSvg(): string;
182
- setColor(color: string): void;
183
- }
184
- export interface IChart {
185
- target?: D3Selection<SVGSVGElement>;
186
- configuration?: IChartConfiguration;
187
- getEventBus(): EventBus<IChartEvent>;
188
- getDataManager(): DataManager;
189
- getRenderEngine(): RenderEngine;
190
- getGrid(): IGrid;
191
- addPlugin(plugin: IChartPlugin): void;
192
- removePlugin?(classRef: typeof ChartPlugin): void;
193
- build(element: HTMLElement): void;
194
- update(seriesSet: IChartSeries<IAccessors>[]): void;
195
- updateDimensions(): void;
196
- setSeriesStates(renderStateData: IRenderStateData[]): void;
197
- destroy(): void;
198
- }
199
- export interface IChartConfiguration {
200
- updateDomainForEmptySeries?: boolean;
201
- }
202
- /** @ignore */
203
- export interface IChartComponent {
204
- chart: IChart;
205
- }
206
- /** Interface defining a chart plugin */
207
- export interface IChartPlugin {
208
- /**
209
- * Associated chart - set automatically on chart initialization
210
- */
211
- chart: IChart;
212
- /** Initialize the plugin - Invoked automatically on chart initialization */
213
- initialize(): void;
214
- /** Update the plugin - Invoked automatically on chart update */
215
- update(): void;
216
- /** Update the plugin's dimensions - Invoked automatically on update of the chart's dimensions */
217
- updateDimensions(): void;
218
- /** Perform plugin cleanup - Invoked automatically on chart destruction */
219
- destroy(): void;
220
- }
221
- export interface IChartEvent<T = any> {
222
- broadcast?: boolean;
223
- data: T;
224
- }
225
- /** @ignore */
226
- export interface IChartCollectionEvent {
227
- chartIndex: string;
228
- event: IChartEvent;
229
- }
230
- /**
231
- * Dictionary of render container name to render container
232
- */
233
- export interface IRenderContainers {
234
- /** Container name as key to render container */
235
- [name: string]: D3Selection<SVGGElement>;
236
- }
237
- /**
238
- * Position on the chart
239
- */
240
- export interface IPosition {
241
- x: number;
242
- y: number;
243
- width?: number;
244
- height?: number;
245
- }
246
- /**
247
- * A point at which a data series enters or exits a threshold zone
248
- */
249
- export interface IZoneCrossPoint extends IPosition {
250
- /** Indicates whether the cross point is on the edge of a threshold zone */
251
- isZoneEdge?: boolean;
252
- }
253
- /**
254
- * Information about a data point
255
- */
256
- export interface IDataPoint {
257
- /** Series identifier */
258
- seriesId: string;
259
- /** Series */
260
- dataSeries: IDataSeries<IAccessors>;
261
- /** Data index */
262
- index: number;
263
- /** Data */
264
- data: any;
265
- /** Position */
266
- position?: IPosition;
267
- }
268
- /**
269
- * Payload for the chart's visibility status in relation to the nearest scrollable parent
270
- */
271
- export interface IChartViewStatusEventPayload {
272
- /**
273
- * Indicates whether at least one pixel of the chart's parent element has
274
- * intersected with the visible area of its nearest scrollable parent
275
- */
276
- isChartInView: boolean;
277
- }
278
- /**
279
- * Payload for events regarding a data point
280
- */
281
- export interface IRendererEventPayload<T = any> {
282
- /** Name of the event */
283
- eventName: string;
284
- /** Information about the data point */
285
- data: T;
286
- }
287
- /**
288
- * Collection of one or more data points as a dictionary of seriesId to IDataPoint
289
- */
290
- export interface IDataPointsPayload {
291
- /** Series id as key to highlighted data point */
292
- [seriesId: string]: IDataPoint;
293
- }
294
- /**
295
- * Payload for interaction events
296
- */
297
- export interface IInteractionPayload {
298
- interactionType: InteractionType;
299
- }
300
- /**
301
- * Payload for interaction events regarding a single data point
302
- */
303
- export interface IInteractionDataPointEvent extends IInteractionPayload {
304
- dataPoint: IDataPoint;
305
- }
306
- /**
307
- * Payload for axes style change when emphasizing series on grid
308
- */
309
- export type IAxesStyleChangeEventPayload = Record<string, Record<string, any>>;
310
- /**
311
- * Payload for interaction events regarding one or more data points
312
- */
313
- export interface IInteractionDataPointsEvent extends IInteractionPayload {
314
- dataPoints: IDataPointsPayload;
315
- }
316
- export interface ISetDomainEventPayload {
317
- [scaleId: string]: any[];
318
- }
319
- export interface IValueProvider<T> {
320
- get(entityId: string): T | undefined;
321
- reset(): void;
322
- }
323
- export interface IChartPalette {
324
- readonly standardColors: IValueProvider<string>;
325
- readonly backgroundColors: IValueProvider<string>;
326
- readonly textColors: IValueProvider<string>;
327
- }