@limetech/lime-elements 40.0.3 → 40.1.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.
@@ -9,6 +9,7 @@ import { ChartItem } from './chart.types';
9
9
  * @exampleComponent limel-example-chart-stacked-bar
10
10
  * @exampleComponent limel-example-chart-orientation
11
11
  * @exampleComponent limel-example-chart-max-value
12
+ * @exampleComponent limel-example-chart-display-item-percentage
12
13
  * @exampleComponent limel-example-chart-type-bar
13
14
  * @exampleComponent limel-example-chart-type-dot
14
15
  * @exampleComponent limel-example-chart-type-area
@@ -73,6 +74,13 @@ export declare class Chart {
73
74
  * Only affects chart types with X and Y axes, such as area, bar, and line charts.
74
75
  */
75
76
  displayItemValue: boolean;
77
+ /**
78
+ * Set to `false` to hide the percentage in item tooltips.
79
+ * The percentage is an item's value or range extent as a share of the
80
+ * whole. The whole is `maxValue` when set and the combined items otherwise.
81
+ * Applies to `stacked-bar`, `pie`, `doughnut`, and `ring` charts.
82
+ */
83
+ displayItemPercentage: boolean;
76
84
  /**
77
85
  * List of items in the chart,
78
86
  * each representing a data point.
@@ -88,13 +96,19 @@ export declare class Chart {
88
96
  */
89
97
  orientation?: 'landscape' | 'portrait';
90
98
  /**
91
- * Specifies the range that items' values could be in.
92
- * This is used in calculation of the size of the items in the chart.
93
- * When not provided, the sum of all values in the items will be considered as the range.
99
+ * Sets the value used to scale item values.
100
+ * For `stacked-bar`, `pie`, `doughnut`, and `ring`, it is the denominator
101
+ * used as the whole. It defaults to the combined item values or range
102
+ * extents. The combined size can exceed `maxValue` and produce a total
103
+ * above 100%.
104
+ * For `bar`, `dot`, `area`, and `line`, it is the requested upper bound.
105
+ * The chart can round that bound up to the next `axisIncrement`.
106
+ * Has no effect on `nps` or `scatter`.
94
107
  */
95
108
  maxValue?: number;
96
109
  /**
97
- * Specifies the increment for the axis lines.
110
+ * Sets the axis increment for `bar`, `dot`, `area`, and `line` charts.
111
+ * Has no effect on other chart types.
98
112
  */
99
113
  axisIncrement?: number;
100
114
  /**
@@ -136,6 +150,15 @@ export declare class Chart {
136
150
  private getItemText;
137
151
  private renderTooltip;
138
152
  private calculateRange;
153
+ /**
154
+ * The range of a chart whose items are parts of one whole: `maxValue`
155
+ * when set, otherwise the combined item values or range extents. The value
156
+ * is a scale, not a cap, so the combined size can exceed it. The whole is
157
+ * not rounded to an axis step, since these types draw no axis and an item's
158
+ * size has to be its exact share.
159
+ */
160
+ private calculateWholeRange;
161
+ private isPartOfWhole;
139
162
  private calculateAxisIncrement;
140
163
  private calculateNiceStep;
141
164
  private axisSpan;
@@ -145,6 +168,7 @@ export declare class Chart {
145
168
  private getYValue;
146
169
  private getMinimumValue;
147
170
  private getMaximumValue;
171
+ private getValueSpan;
148
172
  private isRangeItem;
149
173
  handleChange(): void;
150
174
  private recalculateRangeData;
@@ -518,6 +518,7 @@ export namespace Components {
518
518
  * @exampleComponent limel-example-chart-stacked-bar
519
519
  * @exampleComponent limel-example-chart-orientation
520
520
  * @exampleComponent limel-example-chart-max-value
521
+ * @exampleComponent limel-example-chart-display-item-percentage
521
522
  * @exampleComponent limel-example-chart-type-bar
522
523
  * @exampleComponent limel-example-chart-type-dot
523
524
  * @exampleComponent limel-example-chart-type-area
@@ -554,7 +555,7 @@ export namespace Components {
554
555
  */
555
556
  "accessibleValuesLabel"?: string;
556
557
  /**
557
- * Specifies the increment for the axis lines.
558
+ * Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. Has no effect on other chart types.
558
559
  */
559
560
  "axisIncrement"?: number;
560
561
  /**
@@ -562,6 +563,11 @@ export namespace Components {
562
563
  * @default false
563
564
  */
564
565
  "displayAxisLabels": boolean;
566
+ /**
567
+ * 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.
568
+ * @default true
569
+ */
570
+ "displayItemPercentage": boolean;
565
571
  /**
566
572
  * Makes the `text` of chart items constantly visible, By default, item texts are displayed in a tooltip, when the item is hovered or focused. Only affects chart types with X and Y axes, such as area, bar, and line charts.
567
573
  * @default false
@@ -587,7 +593,7 @@ export namespace Components {
587
593
  */
588
594
  "loading": boolean;
589
595
  /**
590
- * Specifies the range that items' values could be in. This is used in calculation of the size of the items in the chart. When not provided, the sum of all values in the items will be considered as the range.
596
+ * 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`.
591
597
  */
592
598
  "maxValue"?: number;
593
599
  /**
@@ -4563,6 +4569,7 @@ declare global {
4563
4569
  * @exampleComponent limel-example-chart-stacked-bar
4564
4570
  * @exampleComponent limel-example-chart-orientation
4565
4571
  * @exampleComponent limel-example-chart-max-value
4572
+ * @exampleComponent limel-example-chart-display-item-percentage
4566
4573
  * @exampleComponent limel-example-chart-type-bar
4567
4574
  * @exampleComponent limel-example-chart-type-dot
4568
4575
  * @exampleComponent limel-example-chart-type-area
@@ -7097,6 +7104,7 @@ declare namespace LocalJSX {
7097
7104
  * @exampleComponent limel-example-chart-stacked-bar
7098
7105
  * @exampleComponent limel-example-chart-orientation
7099
7106
  * @exampleComponent limel-example-chart-max-value
7107
+ * @exampleComponent limel-example-chart-display-item-percentage
7100
7108
  * @exampleComponent limel-example-chart-type-bar
7101
7109
  * @exampleComponent limel-example-chart-type-dot
7102
7110
  * @exampleComponent limel-example-chart-type-area
@@ -7133,7 +7141,7 @@ declare namespace LocalJSX {
7133
7141
  */
7134
7142
  "accessibleValuesLabel"?: string;
7135
7143
  /**
7136
- * Specifies the increment for the axis lines.
7144
+ * Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. Has no effect on other chart types.
7137
7145
  */
7138
7146
  "axisIncrement"?: number;
7139
7147
  /**
@@ -7141,6 +7149,11 @@ declare namespace LocalJSX {
7141
7149
  * @default false
7142
7150
  */
7143
7151
  "displayAxisLabels"?: boolean;
7152
+ /**
7153
+ * 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.
7154
+ * @default true
7155
+ */
7156
+ "displayItemPercentage"?: boolean;
7144
7157
  /**
7145
7158
  * Makes the `text` of chart items constantly visible, By default, item texts are displayed in a tooltip, when the item is hovered or focused. Only affects chart types with X and Y axes, such as area, bar, and line charts.
7146
7159
  * @default false
@@ -7166,7 +7179,7 @@ declare namespace LocalJSX {
7166
7179
  */
7167
7180
  "loading"?: boolean;
7168
7181
  /**
7169
- * Specifies the range that items' values could be in. This is used in calculation of the size of the items in the chart. When not provided, the sum of all values in the items will be considered as the range.
7182
+ * 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`.
7170
7183
  */
7171
7184
  "maxValue"?: number;
7172
7185
  /**
@@ -10991,6 +11004,7 @@ declare namespace LocalJSX {
10991
11004
  "displayAxisLabels": boolean;
10992
11005
  "displayItemText": boolean;
10993
11006
  "displayItemValue": boolean;
11007
+ "displayItemPercentage": boolean;
10994
11008
  "type": | 'area'
10995
11009
  | 'bar'
10996
11010
  | 'doughnut'
@@ -11813,6 +11827,7 @@ declare module "@stencil/core" {
11813
11827
  * @exampleComponent limel-example-chart-stacked-bar
11814
11828
  * @exampleComponent limel-example-chart-orientation
11815
11829
  * @exampleComponent limel-example-chart-max-value
11830
+ * @exampleComponent limel-example-chart-display-item-percentage
11816
11831
  * @exampleComponent limel-example-chart-type-bar
11817
11832
  * @exampleComponent limel-example-chart-type-dot
11818
11833
  * @exampleComponent limel-example-chart-type-area
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "40.0.3",
3
+ "version": "40.1.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -93,7 +93,7 @@
93
93
  "postal-mime": "^3.0.0",
94
94
  "prettier": "^3.8.3",
95
95
  "prosemirror-example-setup": "^1.2.3",
96
- "prosemirror-markdown": "^1.13.6",
96
+ "prosemirror-markdown": "^1.13.7",
97
97
  "prosemirror-model": ">=1.25.11",
98
98
  "prosemirror-schema-basic": "^1.2.4",
99
99
  "prosemirror-tables": "^1.8.5",