@limetech/lime-elements 40.19.0 → 40.20.1
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.
- package/CHANGELOG.md +28 -0
- package/dist/cjs/keyboard-navigation-VyqkMDKy.js +152 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/{limel-breadcrumbs_6.cjs.entry.js → limel-badge_7.cjs.entry.js} +33 -0
- package/dist/cjs/limel-chart.cjs.entry.js +51371 -268
- package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +6 -149
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{markdown-exporter-BWS2EBxq.js → markdown-exporter-CGNfjGr9.js} +80 -897
- package/dist/cjs/{markdown-parser-toAp9-Eq.js → markdown-parser-C14XF_G3.js} +994 -38
- package/dist/collection/components/chart/chart.css +75 -924
- package/dist/collection/components/chart/chart.js +332 -287
- package/dist/collection/components/chart/options.js +568 -0
- package/dist/collection/components/chart/scale.js +193 -0
- package/dist/collection/components/chart/theme.js +145 -0
- package/dist/collection/components/scroller/scroller.js +1 -1
- package/dist/esm/keyboard-navigation-BF7IKmnG.js +147 -0
- package/dist/esm/{keycodes-Bu6-QXrA.js → keycodes-DQ5DmW_Y.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/{limel-breadcrumbs_6.entry.js → limel-badge_7.entry.js} +36 -4
- package/dist/esm/limel-chart.entry.js +51372 -269
- package/dist/esm/limel-chip-set.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-markdown.entry.js +2 -2
- package/dist/esm/limel-pagination-jump.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +2 -2
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-resize-handle.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +2 -2
- package/dist/esm/limel-side-panel.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +2 -145
- package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{markdown-exporter-B2vFxSLw.js → markdown-exporter-DcFcD699.js} +80 -897
- package/dist/esm/{markdown-parser-Cw8iW5R9.js → markdown-parser-8aHA9IYo.js} +991 -33
- package/dist/esm/{typeahead-DOlnT3wh.js → typeahead-B4PwrlM3.js} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-d4702653.entry.js → p-07f3565b.entry.js} +1 -1
- package/dist/lime-elements/p-0887e0df.entry.js +56 -0
- package/dist/lime-elements/{p-0910aefc.entry.js → p-22e9e327.entry.js} +1 -1
- package/dist/lime-elements/{p-7bf3bf8a.entry.js → p-23067836.entry.js} +1 -1
- package/dist/lime-elements/{p-7f0743d6.entry.js → p-56e2fa48.entry.js} +1 -1
- package/dist/lime-elements/{p-af7d07fd.entry.js → p-5e408c27.entry.js} +1 -1
- package/dist/lime-elements/{p-843886fe.entry.js → p-7fcd48c6.entry.js} +1 -1
- package/dist/lime-elements/{p-1d9bc526.entry.js → p-9edd79a8.entry.js} +1 -1
- package/dist/lime-elements/p-C9gctvIB.js +1 -0
- package/dist/lime-elements/{p-fYs7n6yY.js → p-DNYOwOWu.js} +1 -1
- package/dist/lime-elements/{p-Bu6-QXrA.js → p-DQ5DmW_Y.js} +1 -1
- package/dist/lime-elements/p-_1yBt1pG.js +1 -0
- package/dist/lime-elements/p-a807a45f.entry.js +159 -0
- package/dist/lime-elements/{p-c2f993cc.entry.js → p-a891f3e8.entry.js} +1 -1
- package/dist/lime-elements/{p-45572e9d.entry.js → p-c8a34cef.entry.js} +1 -1
- package/dist/lime-elements/{p-4834e7c1.entry.js → p-cd479c23.entry.js} +1 -1
- package/dist/lime-elements/p-cf2d43c7.entry.js +1 -0
- package/dist/lime-elements/{p-94ae27e2.entry.js → p-f3b93ce8.entry.js} +2 -2
- package/dist/lime-elements/p-kiQd8Ntf.js +7 -0
- package/dist/types/components/chart/chart.d.ts +51 -52
- package/dist/types/components/chart/chart.types.d.ts +5 -0
- package/dist/types/components/chart/options.d.ts +88 -0
- package/dist/types/components/chart/scale.d.ts +101 -0
- package/dist/types/components/chart/theme.d.ts +52 -0
- package/dist/types/components.d.ts +7 -38
- package/package.json +4 -3
- package/dist/cjs/limel-badge.cjs.entry.js +0 -37
- package/dist/esm/limel-badge.entry.js +0 -35
- package/dist/lime-elements/p-02aac2c0.entry.js +0 -1
- package/dist/lime-elements/p-38ab193f.entry.js +0 -1
- package/dist/lime-elements/p-3ca188f6.entry.js +0 -159
- package/dist/lime-elements/p-Bd37Vplf.js +0 -7
- package/dist/lime-elements/p-CvHpvp0f.js +0 -1
- package/dist/lime-elements/p-f7a90228.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { Languages } from '../date-picker/date.types';
|
|
3
|
-
import { ChartItem } from './chart.types';
|
|
3
|
+
import { ChartItem, ChartType } from './chart.types';
|
|
4
4
|
/**
|
|
5
5
|
* A chart is a graphical representation of data, in which
|
|
6
6
|
* visual symbols such as such bars, dots, lines, or slices, represent
|
|
@@ -29,7 +29,6 @@ import { ChartItem } from './chart.types';
|
|
|
29
29
|
* @exampleComponent limel-example-chart-accessibility
|
|
30
30
|
* @exampleComponent limel-example-chart-axis-labels
|
|
31
31
|
* @exampleComponent limel-example-chart-styling
|
|
32
|
-
* @exampleComponent limel-example-chart-creative-styling
|
|
33
32
|
* @beta
|
|
34
33
|
*/
|
|
35
34
|
export declare class Chart {
|
|
@@ -89,7 +88,7 @@ export declare class Chart {
|
|
|
89
88
|
/**
|
|
90
89
|
* Defines how items are visualized in the chart.
|
|
91
90
|
*/
|
|
92
|
-
type?:
|
|
91
|
+
type?: ChartType;
|
|
93
92
|
/**
|
|
94
93
|
* Defines whether the chart is intended to be displayed wide or tall.
|
|
95
94
|
* Does not have any effect on chart types which generate circular forms.
|
|
@@ -108,6 +107,9 @@ export declare class Chart {
|
|
|
108
107
|
maxValue?: number;
|
|
109
108
|
/**
|
|
110
109
|
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts.
|
|
110
|
+
* When it is not set, or not above zero, the chart works out a step
|
|
111
|
+
* from the values. It also does that when the step would divide the
|
|
112
|
+
* axis into more than 100 parts, so that it does not draw too many lines.
|
|
111
113
|
* Has no effect on other chart types.
|
|
112
114
|
*/
|
|
113
115
|
axisIncrement?: number;
|
|
@@ -115,66 +117,63 @@ export declare class Chart {
|
|
|
115
117
|
* Indicates whether the chart is in a loading state.
|
|
116
118
|
*/
|
|
117
119
|
loading: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Range of the value axis. For most chart types this is the single value
|
|
120
|
-
* axis. For `scatter` it is the range of each point's second value
|
|
121
|
-
* (`value[1]`); the shared axis-line rendering always draws its grid and
|
|
122
|
-
* badges from this range. Whether it runs vertically (landscape) or
|
|
123
|
-
* horizontally (portrait) is decided by `orientation`.
|
|
124
|
-
*/
|
|
125
|
-
private range;
|
|
126
|
-
/**
|
|
127
|
-
* Range of each scatter point's first value (`value[0]`). Only used by the
|
|
128
|
-
* `scatter` type, where both values are plotted on value axes. It is laid
|
|
129
|
-
* out on the opposite screen edge to `range` — horizontally in landscape,
|
|
130
|
-
* vertically in portrait.
|
|
131
|
-
*/
|
|
132
|
-
private secondaryAxisRange;
|
|
133
120
|
/**
|
|
134
121
|
* Fired when a chart item with `clickable` set to `true` is clicked
|
|
135
122
|
*/
|
|
136
123
|
interact: EventEmitter<ChartItem>;
|
|
124
|
+
private readonly host;
|
|
125
|
+
/**
|
|
126
|
+
* The item that last had focus, which is the one that Tab returns to.
|
|
127
|
+
*/
|
|
128
|
+
private focusedIndex;
|
|
129
|
+
private plot?;
|
|
130
|
+
private chart?;
|
|
131
|
+
private drawing?;
|
|
132
|
+
private drawnSettings?;
|
|
133
|
+
private drawnTheme?;
|
|
134
|
+
private themeMayHaveChanged;
|
|
135
|
+
private itemSpace?;
|
|
136
|
+
private axisIncrementWarning?;
|
|
137
|
+
private readonly invalidColors;
|
|
138
|
+
private themeReader?;
|
|
139
|
+
private resizeObserver?;
|
|
140
|
+
private stopWatchingTheme?;
|
|
137
141
|
componentWillLoad(): void;
|
|
142
|
+
connectedCallback(): void;
|
|
143
|
+
componentDidRender(): void;
|
|
144
|
+
disconnectedCallback(): void;
|
|
145
|
+
protected warnAboutAxisIncrement(): void;
|
|
146
|
+
private getAxisIncrementWarning;
|
|
138
147
|
render(): any;
|
|
139
148
|
private renderCaption;
|
|
140
149
|
private renderTableHeader;
|
|
141
|
-
private
|
|
142
|
-
private
|
|
143
|
-
private renderAxisLines;
|
|
150
|
+
private get itemsLabel();
|
|
151
|
+
private get valuesLabel();
|
|
144
152
|
private renderItems;
|
|
145
|
-
private
|
|
146
|
-
private
|
|
147
|
-
private
|
|
148
|
-
private
|
|
149
|
-
private
|
|
150
|
-
private
|
|
151
|
-
private
|
|
152
|
-
private
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
private
|
|
161
|
-
private
|
|
162
|
-
private calculateAxisIncrement;
|
|
163
|
-
private calculateNiceStep;
|
|
164
|
-
private axisSpan;
|
|
165
|
-
private calculateAxisRange;
|
|
166
|
-
private normalize;
|
|
167
|
-
private getXValue;
|
|
168
|
-
private getYValue;
|
|
169
|
-
private getMinimumValue;
|
|
170
|
-
private getMaximumValue;
|
|
171
|
-
private getValueSpan;
|
|
172
|
-
private isRangeItem;
|
|
173
|
-
handleChange(): void;
|
|
174
|
-
private recalculateRangeData;
|
|
175
|
-
private recalculateScatterRanges;
|
|
153
|
+
private getRowDescription;
|
|
154
|
+
private draw;
|
|
155
|
+
private createChart;
|
|
156
|
+
private updateChart;
|
|
157
|
+
private fitItemTextsToSize;
|
|
158
|
+
private getSettings;
|
|
159
|
+
private withItemColors;
|
|
160
|
+
private getItemColor;
|
|
161
|
+
private observeSize;
|
|
162
|
+
private disposeChart;
|
|
163
|
+
private readonly setPlot;
|
|
164
|
+
private readonly handleResize;
|
|
165
|
+
private readonly handleThemeChange;
|
|
166
|
+
private readonly handleChartClick;
|
|
167
|
+
private readonly handleChartOver;
|
|
168
|
+
private readonly handleChartOut;
|
|
169
|
+
private highlightItemAt;
|
|
176
170
|
private getClickableItem;
|
|
171
|
+
private getRowIndex;
|
|
177
172
|
private readonly handleClick;
|
|
178
173
|
private readonly handleKeyDown;
|
|
174
|
+
private readonly handleFocus;
|
|
175
|
+
private readonly handleBlur;
|
|
176
|
+
private focusItem;
|
|
177
|
+
private showItem;
|
|
179
178
|
}
|
|
180
179
|
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Color } from '../../global/shared-types/color.types';
|
|
2
|
+
/**
|
|
3
|
+
* The kinds of chart that `limel-chart` can draw.
|
|
4
|
+
* @beta
|
|
5
|
+
*/
|
|
6
|
+
export type ChartType = 'area' | 'bar' | 'doughnut' | 'line' | 'nps' | 'pie' | 'ring' | 'dot' | 'scatter' | 'stacked-bar';
|
|
2
7
|
/**
|
|
3
8
|
* Chart component props.
|
|
4
9
|
* @beta
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { BarSeriesOption, GaugeSeriesOption, LineSeriesOption, PieSeriesOption, ScatterSeriesOption } from 'echarts/charts';
|
|
2
|
+
import type { GridComponentOption, PolarComponentOption, TooltipComponentOption } from 'echarts/components';
|
|
3
|
+
import { type ComposeOption } from 'echarts/core';
|
|
4
|
+
import { ChartItem, ChartType } from './chart.types';
|
|
5
|
+
import { ChartTheme } from './theme';
|
|
6
|
+
type SeriesOption = BarSeriesOption | GaugeSeriesOption | LineSeriesOption | PieSeriesOption | ScatterSeriesOption;
|
|
7
|
+
export type ChartOption = ComposeOption<SeriesOption | GridComponentOption | PolarComponentOption | TooltipComponentOption>;
|
|
8
|
+
/**
|
|
9
|
+
* What the chart draws, from the props of `limel-chart`.
|
|
10
|
+
*/
|
|
11
|
+
export interface ChartSettings {
|
|
12
|
+
/** The items, each with its color resolved by the theme. */
|
|
13
|
+
items: ChartItem[];
|
|
14
|
+
type: ChartType;
|
|
15
|
+
orientation: 'landscape' | 'portrait';
|
|
16
|
+
maxValue?: number;
|
|
17
|
+
axisIncrement?: number;
|
|
18
|
+
displayAxisLabels: boolean;
|
|
19
|
+
/** The name of the axis that has the items, or the first values of a scatter chart. */
|
|
20
|
+
itemsLabel: string;
|
|
21
|
+
/** The name of the axis that has the values, or the second values of a scatter chart. */
|
|
22
|
+
valuesLabel: string;
|
|
23
|
+
displayItemText: boolean;
|
|
24
|
+
displayItemValue: boolean;
|
|
25
|
+
displayItemPercentage: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The ECharts option for a chart, and where its items are drawn.
|
|
29
|
+
*/
|
|
30
|
+
export interface ChartDrawing {
|
|
31
|
+
option: ChartOption;
|
|
32
|
+
/** The series that draws the items, when they are not series of their own. */
|
|
33
|
+
seriesIndex: number;
|
|
34
|
+
/** Whether every item is a series of its own, as in a stacked bar. */
|
|
35
|
+
itemsAreSeries: boolean;
|
|
36
|
+
/** The axis that shows the texts of the items, when they are shown on one. */
|
|
37
|
+
itemTextAxis?: 'xAxis' | 'yAxis';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The position of an item within the drawn series.
|
|
41
|
+
*/
|
|
42
|
+
export interface ItemLocation {
|
|
43
|
+
seriesIndex: number;
|
|
44
|
+
dataIndex: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Builds the ECharts option for the chart.
|
|
48
|
+
* @param settings - what to draw
|
|
49
|
+
* @param theme - the colors, sizes and font to draw it with
|
|
50
|
+
* @param itemSpace - the distance between two items on the axis, in pixels,
|
|
51
|
+
* when it is known from an earlier drawing
|
|
52
|
+
*/
|
|
53
|
+
export declare function drawChart(settings: ChartSettings, theme: ChartTheme, itemSpace?: number): ChartDrawing;
|
|
54
|
+
/**
|
|
55
|
+
* The index of the item drawn at a position, if an item is drawn there.
|
|
56
|
+
* @param drawing - the drawing of the chart
|
|
57
|
+
* @param location - a position within the drawn series
|
|
58
|
+
*/
|
|
59
|
+
export declare function getItemIndex(drawing: Omit<ChartDrawing, 'option'>, location: Partial<ItemLocation>): number;
|
|
60
|
+
/**
|
|
61
|
+
* Where an item is drawn, for highlighting it and showing its tooltip.
|
|
62
|
+
* @param drawing - the drawing of the chart
|
|
63
|
+
* @param index - the index of the item
|
|
64
|
+
*/
|
|
65
|
+
export declare function locateItem(drawing: Omit<ChartDrawing, 'option'>, index: number): ItemLocation;
|
|
66
|
+
/**
|
|
67
|
+
* Shows the text of every item on the axis, cut short to the space of the
|
|
68
|
+
* item, so that no text runs into the next one. When the items are too close
|
|
69
|
+
* together for that, only some of the texts are shown, as many as fit.
|
|
70
|
+
* @param drawing - the drawing of the chart
|
|
71
|
+
* @param itemSpace - the distance between two items on the axis, in pixels
|
|
72
|
+
*/
|
|
73
|
+
export declare function fitItemTexts(drawing: Pick<ChartDrawing, 'itemTextAxis'>, itemSpace: number): ChartOption;
|
|
74
|
+
/**
|
|
75
|
+
* The text of an item, with its share of the whole for charts of parts when
|
|
76
|
+
* `displayItemPercentage` is set.
|
|
77
|
+
* @param settings - what the chart draws
|
|
78
|
+
* @param index - the index of the item
|
|
79
|
+
*/
|
|
80
|
+
export declare function getItemLabel(settings: Pick<ChartSettings, 'items' | 'type' | 'maxValue' | 'displayItemPercentage'>, index: number): string;
|
|
81
|
+
/**
|
|
82
|
+
* The tooltip of an item, as HTML: its label and its value.
|
|
83
|
+
* @param settings - what the chart draws
|
|
84
|
+
* @param index - the index of the item
|
|
85
|
+
*/
|
|
86
|
+
export declare function getTooltip(settings: ChartSettings, index: number): string;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ChartItem, ChartType } from './chart.types';
|
|
2
|
+
/**
|
|
3
|
+
* The most steps that an `axisIncrement` may divide a value axis into.
|
|
4
|
+
*/
|
|
5
|
+
export declare const MAX_AXIS_STEPS = 100;
|
|
6
|
+
export interface AxisRange {
|
|
7
|
+
minValue: number;
|
|
8
|
+
maxValue: number;
|
|
9
|
+
totalRange: number;
|
|
10
|
+
/** Step between adjacent axis lines, used to render the grid. */
|
|
11
|
+
increment: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether the items of a chart of this type are parts of one whole.
|
|
15
|
+
* @param type - the chart type
|
|
16
|
+
*/
|
|
17
|
+
export declare function isPartOfWhole(type: ChartType): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a chart of this type draws its value axis in steps of
|
|
20
|
+
* `axisIncrement`.
|
|
21
|
+
* @param type - the chart type
|
|
22
|
+
*/
|
|
23
|
+
export declare function usesAxisIncrement(type: ChartType): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the item has a `[start, end]` range, or an `[x, y]` point in a
|
|
26
|
+
* `scatter` chart, as its value.
|
|
27
|
+
* @param item - the item
|
|
28
|
+
*/
|
|
29
|
+
export declare function isRangeItem(item: ChartItem): item is ChartItem<[number, number]>;
|
|
30
|
+
/**
|
|
31
|
+
* The lower end of the item's range, or its value.
|
|
32
|
+
* @param item - the item
|
|
33
|
+
*/
|
|
34
|
+
export declare function getMinimumValue(item: ChartItem): number;
|
|
35
|
+
/**
|
|
36
|
+
* The upper end of the item's range, or its value.
|
|
37
|
+
* @param item - the item
|
|
38
|
+
*/
|
|
39
|
+
export declare function getMaximumValue(item: ChartItem): number;
|
|
40
|
+
/**
|
|
41
|
+
* The extent of the item's range, or its value measured from zero.
|
|
42
|
+
* @param item - the item
|
|
43
|
+
*/
|
|
44
|
+
export declare function getValueSpan(item: ChartItem): number;
|
|
45
|
+
/**
|
|
46
|
+
* The first value of a `scatter` point.
|
|
47
|
+
* @param item - the point
|
|
48
|
+
*/
|
|
49
|
+
export declare function getXValue(item: ChartItem): number;
|
|
50
|
+
/**
|
|
51
|
+
* The second value of a `scatter` point.
|
|
52
|
+
* @param item - the point
|
|
53
|
+
*/
|
|
54
|
+
export declare function getYValue(item: ChartItem): number;
|
|
55
|
+
/**
|
|
56
|
+
* The value axis of a `bar`, `dot`, `area` or `line` chart. It reaches from
|
|
57
|
+
* zero, or from the smallest value when that is below zero, up to `maxValue`
|
|
58
|
+
* or the largest value. Both ends are rounded outwards to a whole step.
|
|
59
|
+
* Without an `axisIncrement` above zero, or with one that would divide the
|
|
60
|
+
* axis into more than `MAX_AXIS_STEPS` steps, the step divides the axis into
|
|
61
|
+
* about ten.
|
|
62
|
+
* @param items - the items in the chart
|
|
63
|
+
* @param maxValue - the requested upper bound, if any
|
|
64
|
+
* @param axisIncrement - the requested step, if any
|
|
65
|
+
*/
|
|
66
|
+
export declare function getAxisRange(items: ChartItem[], maxValue?: number, axisIncrement?: number): AxisRange;
|
|
67
|
+
/**
|
|
68
|
+
* The range of a chart whose items are parts of one whole: `maxValue`
|
|
69
|
+
* when set, otherwise the combined item values or range extents. The value
|
|
70
|
+
* is a scale, not a cap, so the combined size can exceed it. The whole is
|
|
71
|
+
* not rounded to an axis step, since these types draw no axis and an item's
|
|
72
|
+
* size has to be its exact share.
|
|
73
|
+
* @param items - the items in the chart
|
|
74
|
+
* @param maxValue - the whole, if set
|
|
75
|
+
*/
|
|
76
|
+
export declare function getWholeRange(items: ChartItem[], maxValue?: number): AxisRange;
|
|
77
|
+
/**
|
|
78
|
+
* The two value axes of a `scatter` chart: `x` for each point's first value
|
|
79
|
+
* and `y` for its second. Each axis derives its own range and step from its
|
|
80
|
+
* own zero-anchored span, so positive, negative, and zero-crossing data all
|
|
81
|
+
* grid sensibly.
|
|
82
|
+
* @param items - the points in the chart
|
|
83
|
+
*/
|
|
84
|
+
export declare function getScatterRanges(items: ChartItem[]): {
|
|
85
|
+
x: AxisRange;
|
|
86
|
+
y: AxisRange;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* An item's share of the whole, in percent.
|
|
90
|
+
* @param item - the item
|
|
91
|
+
* @param whole - the range from `getWholeRange`
|
|
92
|
+
*/
|
|
93
|
+
export declare function getShare(item: ChartItem, whole: AxisRange): number;
|
|
94
|
+
/**
|
|
95
|
+
* The item's value as text: its `formattedValue` when set, otherwise its
|
|
96
|
+
* value, range, or scatter point.
|
|
97
|
+
* @param item - the item
|
|
98
|
+
* @param type - the chart type
|
|
99
|
+
*/
|
|
100
|
+
export declare function formatValue(item: ChartItem, type: ChartType): string;
|
|
101
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The colors, sizes and font a chart is drawn with. ECharts cannot read CSS
|
|
3
|
+
* custom properties, so they are resolved from the chart's styles into plain
|
|
4
|
+
* values.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChartTheme {
|
|
7
|
+
itemColor: string;
|
|
8
|
+
/** The line, and the area under it, of `line` and `area` charts. */
|
|
9
|
+
lineColor: string;
|
|
10
|
+
axisLineColor: string;
|
|
11
|
+
textColor: string;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
dividerColor: string;
|
|
14
|
+
surfaceColor: string;
|
|
15
|
+
/** In pixels, clockwise from the top left corner. */
|
|
16
|
+
itemBorderRadius: [number, number, number, number];
|
|
17
|
+
/** In pixels. */
|
|
18
|
+
scatterItemSize: number;
|
|
19
|
+
fontFamily: string;
|
|
20
|
+
npsColors: [string, string, string, string];
|
|
21
|
+
animate: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reads colors and lengths as the chart's own styles resolve them.
|
|
25
|
+
*/
|
|
26
|
+
export interface ThemeReader {
|
|
27
|
+
/**
|
|
28
|
+
* The color as `rgb()` or `rgba()`, or `undefined` when the value is not
|
|
29
|
+
* a color.
|
|
30
|
+
* @param value - any CSS color, which may use custom properties
|
|
31
|
+
*/
|
|
32
|
+
color(value: string): string | undefined;
|
|
33
|
+
theme(): ChartTheme;
|
|
34
|
+
dispose(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a reader that resolves values in the given shadow root, where the
|
|
38
|
+
* chart's private custom properties are defined.
|
|
39
|
+
* @param root - the chart's shadow root
|
|
40
|
+
*/
|
|
41
|
+
export declare function createThemeReader(root: ShadowRoot): ThemeReader;
|
|
42
|
+
/**
|
|
43
|
+
* Calls back when the theme of the chart may have changed: when the color
|
|
44
|
+
* scheme or the reduced motion preference of the system changes, the
|
|
45
|
+
* `data-theme` attribute of the page does, or the `style` or `class`
|
|
46
|
+
* attribute of the chart does.
|
|
47
|
+
* @param host - the chart
|
|
48
|
+
* @param onChange - called on every change
|
|
49
|
+
* @returns a function that stops watching
|
|
50
|
+
*/
|
|
51
|
+
export declare function watchTheme(host: HTMLElement, onChange: () => void): () => void;
|
|
52
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { Button } from "./components/button/button.types";
|
|
|
16
16
|
import { CalloutType } from "./components/callout/callout.types";
|
|
17
17
|
import { Image } from "./global/shared-types/image.types";
|
|
18
18
|
import { ListSeparator as ListSeparator1 } from "./global/shared-types/separator.types";
|
|
19
|
-
import { ChartItem } from "./components/chart/chart.types";
|
|
19
|
+
import { ChartItem, ChartType } from "./components/chart/chart.types";
|
|
20
20
|
import { Label, LabelValue } from "./components/dynamic-label/label.types";
|
|
21
21
|
import { Link } from "./global/shared-types/link.types";
|
|
22
22
|
import { Chip, ChipType } from "./components/chip-set/chip.types";
|
|
@@ -68,7 +68,7 @@ export { Button } from "./components/button/button.types";
|
|
|
68
68
|
export { CalloutType } from "./components/callout/callout.types";
|
|
69
69
|
export { Image } from "./global/shared-types/image.types";
|
|
70
70
|
export { ListSeparator as ListSeparator1 } from "./global/shared-types/separator.types";
|
|
71
|
-
export { ChartItem } from "./components/chart/chart.types";
|
|
71
|
+
export { ChartItem, ChartType } from "./components/chart/chart.types";
|
|
72
72
|
export { Label, LabelValue } from "./components/dynamic-label/label.types";
|
|
73
73
|
export { Link } from "./global/shared-types/link.types";
|
|
74
74
|
export { Chip, ChipType } from "./components/chip-set/chip.types";
|
|
@@ -547,7 +547,6 @@ export namespace Components {
|
|
|
547
547
|
* @exampleComponent limel-example-chart-accessibility
|
|
548
548
|
* @exampleComponent limel-example-chart-axis-labels
|
|
549
549
|
* @exampleComponent limel-example-chart-styling
|
|
550
|
-
* @exampleComponent limel-example-chart-creative-styling
|
|
551
550
|
* @beta
|
|
552
551
|
*/
|
|
553
552
|
interface LimelChart {
|
|
@@ -564,7 +563,7 @@ export namespace Components {
|
|
|
564
563
|
*/
|
|
565
564
|
"accessibleValuesLabel"?: string;
|
|
566
565
|
/**
|
|
567
|
-
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. Has no effect on other chart types.
|
|
566
|
+
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. When it is not set, or not above zero, the chart works out a step from the values. It also does that when the step would divide the axis into more than 100 parts, so that it does not draw too many lines. Has no effect on other chart types.
|
|
568
567
|
*/
|
|
569
568
|
"axisIncrement"?: number;
|
|
570
569
|
/**
|
|
@@ -614,16 +613,7 @@ export namespace Components {
|
|
|
614
613
|
* Defines how items are visualized in the chart.
|
|
615
614
|
* @default 'stacked-bar'
|
|
616
615
|
*/
|
|
617
|
-
"type"?:
|
|
618
|
-
| 'bar'
|
|
619
|
-
| 'doughnut'
|
|
620
|
-
| 'line'
|
|
621
|
-
| 'nps'
|
|
622
|
-
| 'pie'
|
|
623
|
-
| 'ring'
|
|
624
|
-
| 'dot'
|
|
625
|
-
| 'scatter'
|
|
626
|
-
| 'stacked-bar';
|
|
616
|
+
"type"?: ChartType;
|
|
627
617
|
}
|
|
628
618
|
/**
|
|
629
619
|
* The Checkbox component is a classic and essential element in UI design that allows
|
|
@@ -5018,7 +5008,6 @@ declare global {
|
|
|
5018
5008
|
* @exampleComponent limel-example-chart-accessibility
|
|
5019
5009
|
* @exampleComponent limel-example-chart-axis-labels
|
|
5020
5010
|
* @exampleComponent limel-example-chart-styling
|
|
5021
|
-
* @exampleComponent limel-example-chart-creative-styling
|
|
5022
5011
|
* @beta
|
|
5023
5012
|
*/
|
|
5024
5013
|
interface HTMLLimelChartElement extends Components.LimelChart, HTMLStencilElement {
|
|
@@ -7792,7 +7781,6 @@ declare namespace LocalJSX {
|
|
|
7792
7781
|
* @exampleComponent limel-example-chart-accessibility
|
|
7793
7782
|
* @exampleComponent limel-example-chart-axis-labels
|
|
7794
7783
|
* @exampleComponent limel-example-chart-styling
|
|
7795
|
-
* @exampleComponent limel-example-chart-creative-styling
|
|
7796
7784
|
* @beta
|
|
7797
7785
|
*/
|
|
7798
7786
|
interface LimelChart {
|
|
@@ -7809,7 +7797,7 @@ declare namespace LocalJSX {
|
|
|
7809
7797
|
*/
|
|
7810
7798
|
"accessibleValuesLabel"?: string;
|
|
7811
7799
|
/**
|
|
7812
|
-
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. Has no effect on other chart types.
|
|
7800
|
+
* Sets the axis increment for `bar`, `dot`, `area`, and `line` charts. When it is not set, or not above zero, the chart works out a step from the values. It also does that when the step would divide the axis into more than 100 parts, so that it does not draw too many lines. Has no effect on other chart types.
|
|
7813
7801
|
*/
|
|
7814
7802
|
"axisIncrement"?: number;
|
|
7815
7803
|
/**
|
|
@@ -7863,16 +7851,7 @@ declare namespace LocalJSX {
|
|
|
7863
7851
|
* Defines how items are visualized in the chart.
|
|
7864
7852
|
* @default 'stacked-bar'
|
|
7865
7853
|
*/
|
|
7866
|
-
"type"?:
|
|
7867
|
-
| 'bar'
|
|
7868
|
-
| 'doughnut'
|
|
7869
|
-
| 'line'
|
|
7870
|
-
| 'nps'
|
|
7871
|
-
| 'pie'
|
|
7872
|
-
| 'ring'
|
|
7873
|
-
| 'dot'
|
|
7874
|
-
| 'scatter'
|
|
7875
|
-
| 'stacked-bar';
|
|
7854
|
+
"type"?: ChartType;
|
|
7876
7855
|
}
|
|
7877
7856
|
/**
|
|
7878
7857
|
* The Checkbox component is a classic and essential element in UI design that allows
|
|
@@ -12104,16 +12083,7 @@ declare namespace LocalJSX {
|
|
|
12104
12083
|
"displayItemText": boolean;
|
|
12105
12084
|
"displayItemValue": boolean;
|
|
12106
12085
|
"displayItemPercentage": boolean;
|
|
12107
|
-
"type":
|
|
12108
|
-
| 'bar'
|
|
12109
|
-
| 'doughnut'
|
|
12110
|
-
| 'line'
|
|
12111
|
-
| 'nps'
|
|
12112
|
-
| 'pie'
|
|
12113
|
-
| 'ring'
|
|
12114
|
-
| 'dot'
|
|
12115
|
-
| 'scatter'
|
|
12116
|
-
| 'stacked-bar';
|
|
12086
|
+
"type": ChartType;
|
|
12117
12087
|
"orientation": 'landscape' | 'portrait';
|
|
12118
12088
|
"maxValue": number;
|
|
12119
12089
|
"axisIncrement": number;
|
|
@@ -13018,7 +12988,6 @@ declare module "@stencil/core" {
|
|
|
13018
12988
|
* @exampleComponent limel-example-chart-accessibility
|
|
13019
12989
|
* @exampleComponent limel-example-chart-axis-labels
|
|
13020
12990
|
* @exampleComponent limel-example-chart-styling
|
|
13021
|
-
* @exampleComponent limel-example-chart-creative-styling
|
|
13022
12991
|
* @beta
|
|
13023
12992
|
*/
|
|
13024
12993
|
"limel-chart": LocalJSX.IntrinsicElements["limel-chart"] & JSXBase.HTMLAttributes<HTMLLimelChartElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.20.1",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@commitlint/cli": "^21.2.4",
|
|
56
56
|
"@commitlint/config-conventional": "^21.2.4",
|
|
57
57
|
"@limetech/eslint-config": "^5.0.3",
|
|
58
|
-
"@microsoft/api-extractor": "^7.
|
|
58
|
+
"@microsoft/api-extractor": "^7.60.0",
|
|
59
59
|
"@playwright/test": "1.64.1",
|
|
60
60
|
"@popperjs/core": "^2.11.8",
|
|
61
61
|
"@rjsf/core": "^6.11.0",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"cross-env": "^10.1.0",
|
|
77
77
|
"dayjs": "^1.11.23",
|
|
78
78
|
"diff": "^9.0.0",
|
|
79
|
+
"echarts": "^6.1.0",
|
|
79
80
|
"eslint": "^10.13.0",
|
|
80
81
|
"flatpickr": "^4.6.13",
|
|
81
82
|
"glob": "^13.0.6",
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
"kompendium": "npm:@limetech/kompendium@^1.4.1",
|
|
89
90
|
"lodash-es": "^4.17.23",
|
|
90
91
|
"material-components-web": "^13.0.0",
|
|
91
|
-
"mdast-util-to-markdown": "^2.2.
|
|
92
|
+
"mdast-util-to-markdown": "^2.2.1",
|
|
92
93
|
"moment": "^2.31.0",
|
|
93
94
|
"morphdom": "^2.7.8",
|
|
94
95
|
"number-abbreviate": "^2.0.0",
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-BlsqxTB1.js');
|
|
4
|
-
var format = require('./format-D4jZb7Ls.js');
|
|
5
|
-
require('./_commonjsHelpers-CFO10eej.js');
|
|
6
|
-
|
|
7
|
-
const badgeCss = () => `@charset "UTF-8";:host([hidden]){display:none}:host(limel-badge){--limel-min-badge-size:1rem;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;min-height:var(--limel-min-badge-size);min-width:var(--limel-min-badge-size);border-radius:var(--limel-min-badge-size)}span{cursor:default;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:0.6875rem;line-height:var(--limel-min-badge-size);color:var(--badge-text-color, rgb(var(--contrast-1200)));border-radius:var(--limel-min-badge-size);max-height:var(--limel-min-badge-size);min-width:0.5rem;min-height:0.5rem;background-color:var(--badge-background-color, rgb(var(--contrast-500)))}span:not(:empty){min-width:var(--limel-min-badge-size);max-width:var(--badge-max-width, 2.75rem);padding:0 0.28125rem}:host(.has-large-label) span{cursor:help}`;
|
|
8
|
-
|
|
9
|
-
const Badge = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
}
|
|
13
|
-
render() {
|
|
14
|
-
return (index.h(index.Host, { key: 'b5fc1ffc51f34992c6a7e748b22a1c333b980724', title: this.labelIsLarge() ? this.label : '', class: {
|
|
15
|
-
'has-large-label': this.labelIsLarge(),
|
|
16
|
-
} }, index.h("span", { key: '37c10595938a038dd7455751b21a949c88245e6a' }, this.renderLabel())));
|
|
17
|
-
}
|
|
18
|
-
renderLabel() {
|
|
19
|
-
if (typeof this.label === 'number') {
|
|
20
|
-
return format.abbreviate(this.label);
|
|
21
|
-
}
|
|
22
|
-
return this.label;
|
|
23
|
-
}
|
|
24
|
-
labelIsLarge() {
|
|
25
|
-
const largeNumericLabel = 999;
|
|
26
|
-
const largeStringLabel = 6;
|
|
27
|
-
if ((typeof this.label === 'number' &&
|
|
28
|
-
this.label > largeNumericLabel) ||
|
|
29
|
-
(typeof this.label === 'string' &&
|
|
30
|
-
this.label.length > largeStringLabel)) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
Badge.style = badgeCss();
|
|
36
|
-
|
|
37
|
-
exports.limel_badge = Badge;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-BU9IJqli.js';
|
|
2
|
-
import { a as abbreviate } from './format-hTrthuPP.js';
|
|
3
|
-
import './_commonjsHelpers-B85MJLTf.js';
|
|
4
|
-
|
|
5
|
-
const badgeCss = () => `@charset "UTF-8";:host([hidden]){display:none}:host(limel-badge){--limel-min-badge-size:1rem;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;min-height:var(--limel-min-badge-size);min-width:var(--limel-min-badge-size);border-radius:var(--limel-min-badge-size)}span{cursor:default;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:0.6875rem;line-height:var(--limel-min-badge-size);color:var(--badge-text-color, rgb(var(--contrast-1200)));border-radius:var(--limel-min-badge-size);max-height:var(--limel-min-badge-size);min-width:0.5rem;min-height:0.5rem;background-color:var(--badge-background-color, rgb(var(--contrast-500)))}span:not(:empty){min-width:var(--limel-min-badge-size);max-width:var(--badge-max-width, 2.75rem);padding:0 0.28125rem}:host(.has-large-label) span{cursor:help}`;
|
|
6
|
-
|
|
7
|
-
const Badge = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return (h(Host, { key: 'b5fc1ffc51f34992c6a7e748b22a1c333b980724', title: this.labelIsLarge() ? this.label : '', class: {
|
|
13
|
-
'has-large-label': this.labelIsLarge(),
|
|
14
|
-
} }, h("span", { key: '37c10595938a038dd7455751b21a949c88245e6a' }, this.renderLabel())));
|
|
15
|
-
}
|
|
16
|
-
renderLabel() {
|
|
17
|
-
if (typeof this.label === 'number') {
|
|
18
|
-
return abbreviate(this.label);
|
|
19
|
-
}
|
|
20
|
-
return this.label;
|
|
21
|
-
}
|
|
22
|
-
labelIsLarge() {
|
|
23
|
-
const largeNumericLabel = 999;
|
|
24
|
-
const largeStringLabel = 6;
|
|
25
|
-
if ((typeof this.label === 'number' &&
|
|
26
|
-
this.label > largeNumericLabel) ||
|
|
27
|
-
(typeof this.label === 'string' &&
|
|
28
|
-
this.label.length > largeStringLabel)) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
Badge.style = badgeCss();
|
|
34
|
-
|
|
35
|
-
export { Badge as limel_badge };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as i,H as r}from"./p-BU9IJqli.js";import{a}from"./p-Bt64o80S.js";import"./p-B85MJLTf.js";const t=class{constructor(i){e(this,i)}render(){return i(r,{key:"b5fc1ffc51f34992c6a7e748b22a1c333b980724",title:this.labelIsLarge()?this.label:"",class:{"has-large-label":this.labelIsLarge()}},i("span",{key:"37c10595938a038dd7455751b21a949c88245e6a"},this.renderLabel()))}renderLabel(){return"number"==typeof this.label?a(this.label):this.label}labelIsLarge(){if("number"==typeof this.label&&this.label>999||"string"==typeof this.label&&this.label.length>6)return!0}};t.style='@charset "UTF-8";:host([hidden]){display:none}:host(limel-badge){--limel-min-badge-size:1rem;display:inline-flex;justify-content:center;align-items:center;flex-shrink:0;min-height:var(--limel-min-badge-size);min-width:var(--limel-min-badge-size);border-radius:var(--limel-min-badge-size)}span{cursor:default;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:0.6875rem;line-height:var(--limel-min-badge-size);color:var(--badge-text-color, rgb(var(--contrast-1200)));border-radius:var(--limel-min-badge-size);max-height:var(--limel-min-badge-size);min-width:0.5rem;min-height:0.5rem;background-color:var(--badge-background-color, rgb(var(--contrast-500)))}span:not(:empty){min-width:var(--limel-min-badge-size);max-width:var(--badge-max-width, 2.75rem);padding:0 0.28125rem}:host(.has-large-label) span{cursor:help}';export{t as limel_badge}
|