@limetech/lime-elements 40.20.1 → 40.21.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.
@@ -6,7 +6,7 @@ import { ChartItem, ChartType } from './chart.types';
6
6
  * visual symbols such as such bars, dots, lines, or slices, represent
7
7
  * each data point, in comparison to others.
8
8
  *
9
- * @exampleComponent limel-example-chart-stacked-bar
9
+ * @exampleComponent limel-example-chart-type-proportion-bar
10
10
  * @exampleComponent limel-example-chart-orientation
11
11
  * @exampleComponent limel-example-chart-max-value
12
12
  * @exampleComponent limel-example-chart-display-item-percentage
@@ -77,7 +77,7 @@ export declare class Chart {
77
77
  * Set to `false` to hide the percentage in item tooltips.
78
78
  * The percentage is an item's value or range extent as a share of the
79
79
  * whole. The whole is `maxValue` when set and the combined items otherwise.
80
- * Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
80
+ * Applies to `proportion-bar`, `pie`, `doughnut`, and `ring` charts.
81
81
  */
82
82
  displayItemPercentage: boolean;
83
83
  /**
@@ -87,6 +87,8 @@ export declare class Chart {
87
87
  items: ChartItem[];
88
88
  /**
89
89
  * Defines how items are visualized in the chart.
90
+ * `stacked-bar` is the old name of `proportion-bar`. It still works, but
91
+ * logs a warning.
90
92
  */
91
93
  type?: ChartType;
92
94
  /**
@@ -96,7 +98,7 @@ export declare class Chart {
96
98
  orientation?: 'landscape' | 'portrait';
97
99
  /**
98
100
  * Sets the value used to scale item values.
99
- * For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator
101
+ * For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator
100
102
  * used as the whole. It defaults to the combined item values or range
101
103
  * extents. The combined size can exceed `maxValue` and produce a total
102
104
  * above 100%.
@@ -143,6 +145,8 @@ export declare class Chart {
143
145
  componentDidRender(): void;
144
146
  disconnectedCallback(): void;
145
147
  protected warnAboutAxisIncrement(): void;
148
+ protected warnAboutOldTypeName(): void;
149
+ private get chartType();
146
150
  private getAxisIncrementWarning;
147
151
  render(): any;
148
152
  private renderCaption;
@@ -1,9 +1,12 @@
1
1
  import { Color } from '../../global/shared-types/color.types';
2
2
  /**
3
3
  * The kinds of chart that `limel-chart` can draw.
4
+ *
5
+ * `stacked-bar` is the old name of `proportion-bar`. It still works, but
6
+ * logs a warning.
4
7
  * @beta
5
8
  */
6
- export type ChartType = 'area' | 'bar' | 'doughnut' | 'line' | 'nps' | 'pie' | 'ring' | 'dot' | 'scatter' | 'stacked-bar';
9
+ export type ChartType = 'area' | 'bar' | 'doughnut' | 'line' | 'nps' | 'pie' | 'ring' | 'dot' | 'scatter' | 'proportion-bar' | 'stacked-bar';
7
10
  /**
8
11
  * Chart component props.
9
12
  * @beta
@@ -1,7 +1,8 @@
1
1
  import type { BarSeriesOption, GaugeSeriesOption, LineSeriesOption, PieSeriesOption, ScatterSeriesOption } from 'echarts/charts';
2
2
  import type { GridComponentOption, PolarComponentOption, TooltipComponentOption } from 'echarts/components';
3
3
  import { type ComposeOption } from 'echarts/core';
4
- import { ChartItem, ChartType } from './chart.types';
4
+ import { ChartItem } from './chart.types';
5
+ import { DrawnChartType } from './scale';
5
6
  import { ChartTheme } from './theme';
6
7
  type SeriesOption = BarSeriesOption | GaugeSeriesOption | LineSeriesOption | PieSeriesOption | ScatterSeriesOption;
7
8
  export type ChartOption = ComposeOption<SeriesOption | GridComponentOption | PolarComponentOption | TooltipComponentOption>;
@@ -11,7 +12,7 @@ export type ChartOption = ComposeOption<SeriesOption | GridComponentOption | Pol
11
12
  export interface ChartSettings {
12
13
  /** The items, each with its color resolved by the theme. */
13
14
  items: ChartItem[];
14
- type: ChartType;
15
+ type: DrawnChartType;
15
16
  orientation: 'landscape' | 'portrait';
16
17
  maxValue?: number;
17
18
  axisIncrement?: number;
@@ -31,7 +32,7 @@ export interface ChartDrawing {
31
32
  option: ChartOption;
32
33
  /** The series that draws the items, when they are not series of their own. */
33
34
  seriesIndex: number;
34
- /** Whether every item is a series of its own, as in a stacked bar. */
35
+ /** Whether every item is a series of its own, as in a proportion bar. */
35
36
  itemsAreSeries: boolean;
36
37
  /** The axis that shows the texts of the items, when they are shown on one. */
37
38
  itemTextAxis?: 'xAxis' | 'yAxis';
@@ -3,6 +3,11 @@ import { ChartItem, ChartType } from './chart.types';
3
3
  * The most steps that an `axisIncrement` may divide a value axis into.
4
4
  */
5
5
  export declare const MAX_AXIS_STEPS = 100;
6
+ /**
7
+ * The chart types that are drawn. `stacked-bar` is only an old name, which
8
+ * `limel-chart` turns into `proportion-bar` before drawing.
9
+ */
10
+ export type DrawnChartType = Exclude<ChartType, 'stacked-bar'>;
6
11
  export interface AxisRange {
7
12
  minValue: number;
8
13
  maxValue: number;
@@ -14,13 +19,13 @@ export interface AxisRange {
14
19
  * Whether the items of a chart of this type are parts of one whole.
15
20
  * @param type - the chart type
16
21
  */
17
- export declare function isPartOfWhole(type: ChartType): boolean;
22
+ export declare function isPartOfWhole(type: DrawnChartType): boolean;
18
23
  /**
19
24
  * Whether a chart of this type draws its value axis in steps of
20
25
  * `axisIncrement`.
21
26
  * @param type - the chart type
22
27
  */
23
- export declare function usesAxisIncrement(type: ChartType): boolean;
28
+ export declare function usesAxisIncrement(type: DrawnChartType): boolean;
24
29
  /**
25
30
  * Whether the item has a `[start, end]` range, or an `[x, y]` point in a
26
31
  * `scatter` chart, as its value.
@@ -97,5 +102,5 @@ export declare function getShare(item: ChartItem, whole: AxisRange): number;
97
102
  * @param item - the item
98
103
  * @param type - the chart type
99
104
  */
100
- export declare function formatValue(item: ChartItem, type: ChartType): string;
105
+ export declare function formatValue(item: ChartItem, type: DrawnChartType): string;
101
106
  //# sourceMappingURL=scale.d.ts.map
@@ -524,7 +524,7 @@ export namespace Components {
524
524
  * A chart is a graphical representation of data, in which
525
525
  * visual symbols such as such bars, dots, lines, or slices, represent
526
526
  * each data point, in comparison to others.
527
- * @exampleComponent limel-example-chart-stacked-bar
527
+ * @exampleComponent limel-example-chart-type-proportion-bar
528
528
  * @exampleComponent limel-example-chart-orientation
529
529
  * @exampleComponent limel-example-chart-max-value
530
530
  * @exampleComponent limel-example-chart-display-item-percentage
@@ -572,7 +572,7 @@ export namespace Components {
572
572
  */
573
573
  "displayAxisLabels": boolean;
574
574
  /**
575
- * Set to `false` to hide the percentage in item tooltips. The percentage is an item's value or range extent as a share of the whole. The whole is `maxValue` when set and the combined items otherwise. Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
575
+ * Set to `false` to hide the percentage in item tooltips. The percentage is an item's value or range extent as a share of the whole. The whole is `maxValue` when set and the combined items otherwise. Applies to `proportion-bar`, `pie`, `doughnut`, and `ring` charts.
576
576
  * @default true
577
577
  */
578
578
  "displayItemPercentage": boolean;
@@ -601,7 +601,7 @@ export namespace Components {
601
601
  */
602
602
  "loading": boolean;
603
603
  /**
604
- * Sets the value used to scale item values. For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
604
+ * Sets the value used to scale item values. For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
605
605
  */
606
606
  "maxValue"?: number;
607
607
  /**
@@ -610,8 +610,8 @@ export namespace Components {
610
610
  */
611
611
  "orientation"?: 'landscape' | 'portrait';
612
612
  /**
613
- * Defines how items are visualized in the chart.
614
- * @default 'stacked-bar'
613
+ * Defines how items are visualized in the chart. `stacked-bar` is the old name of `proportion-bar`. It still works, but logs a warning.
614
+ * @default 'proportion-bar'
615
615
  */
616
616
  "type"?: ChartType;
617
617
  }
@@ -4985,7 +4985,7 @@ declare global {
4985
4985
  * A chart is a graphical representation of data, in which
4986
4986
  * visual symbols such as such bars, dots, lines, or slices, represent
4987
4987
  * each data point, in comparison to others.
4988
- * @exampleComponent limel-example-chart-stacked-bar
4988
+ * @exampleComponent limel-example-chart-type-proportion-bar
4989
4989
  * @exampleComponent limel-example-chart-orientation
4990
4990
  * @exampleComponent limel-example-chart-max-value
4991
4991
  * @exampleComponent limel-example-chart-display-item-percentage
@@ -7758,7 +7758,7 @@ declare namespace LocalJSX {
7758
7758
  * A chart is a graphical representation of data, in which
7759
7759
  * visual symbols such as such bars, dots, lines, or slices, represent
7760
7760
  * each data point, in comparison to others.
7761
- * @exampleComponent limel-example-chart-stacked-bar
7761
+ * @exampleComponent limel-example-chart-type-proportion-bar
7762
7762
  * @exampleComponent limel-example-chart-orientation
7763
7763
  * @exampleComponent limel-example-chart-max-value
7764
7764
  * @exampleComponent limel-example-chart-display-item-percentage
@@ -7806,7 +7806,7 @@ declare namespace LocalJSX {
7806
7806
  */
7807
7807
  "displayAxisLabels"?: boolean;
7808
7808
  /**
7809
- * Set to `false` to hide the percentage in item tooltips. The percentage is an item's value or range extent as a share of the whole. The whole is `maxValue` when set and the combined items otherwise. Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
7809
+ * Set to `false` to hide the percentage in item tooltips. The percentage is an item's value or range extent as a share of the whole. The whole is `maxValue` when set and the combined items otherwise. Applies to `proportion-bar`, `pie`, `doughnut`, and `ring` charts.
7810
7810
  * @default true
7811
7811
  */
7812
7812
  "displayItemPercentage"?: boolean;
@@ -7835,7 +7835,7 @@ declare namespace LocalJSX {
7835
7835
  */
7836
7836
  "loading"?: boolean;
7837
7837
  /**
7838
- * Sets the value used to scale item values. For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
7838
+ * Sets the value used to scale item values. For `proportion-bar`, `pie`, `doughnut`, and `ring`, it is the denominator used as the whole. It defaults to the combined item values or range extents. The combined size can exceed `maxValue` and produce a total above 100%. For `bar`, `dot`, `area`, and `line`, it is the requested upper bound. The chart can round that bound up to the next `axisIncrement`. Has no effect on `nps` or `scatter`.
7839
7839
  */
7840
7840
  "maxValue"?: number;
7841
7841
  /**
@@ -7848,8 +7848,8 @@ declare namespace LocalJSX {
7848
7848
  */
7849
7849
  "orientation"?: 'landscape' | 'portrait';
7850
7850
  /**
7851
- * Defines how items are visualized in the chart.
7852
- * @default 'stacked-bar'
7851
+ * Defines how items are visualized in the chart. `stacked-bar` is the old name of `proportion-bar`. It still works, but logs a warning.
7852
+ * @default 'proportion-bar'
7853
7853
  */
7854
7854
  "type"?: ChartType;
7855
7855
  }
@@ -12965,7 +12965,7 @@ declare module "@stencil/core" {
12965
12965
  * A chart is a graphical representation of data, in which
12966
12966
  * visual symbols such as such bars, dots, lines, or slices, represent
12967
12967
  * each data point, in comparison to others.
12968
- * @exampleComponent limel-example-chart-stacked-bar
12968
+ * @exampleComponent limel-example-chart-type-proportion-bar
12969
12969
  * @exampleComponent limel-example-chart-orientation
12970
12970
  * @exampleComponent limel-example-chart-max-value
12971
12971
  * @exampleComponent limel-example-chart-display-item-percentage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "40.20.1",
3
+ "version": "40.21.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",