@aceshooting/lyra-ui 14.2.0 → 14.3.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.
- package/CHANGELOG.md +24 -0
- package/custom-elements.json +1 -1
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/charts/chart/chart-legend-visibility.d.ts +8 -0
- package/dist/components/charts/chart/chart.class.d.ts +48 -12
- package/dist/components/charts/chart/chart.class.js +10 -10
- package/dist/components/data/table/table.class.d.ts +9 -1
- package/dist/components/data/table/table.class.js +4 -3
- package/dist/components/data/table/table.styles.js +1 -1
- package/dist/components/forms/button/button.class.d.ts +8 -2
- package/dist/components/forms/button/button.class.js +6 -2
- package/dist/components/media/map/map.class.d.ts +34 -6
- package/dist/components/media/map/map.class.js +1 -1
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/custom-elements-jsx.d.ts +1 -1
- package/dist/events.d.ts +17 -1
- package/dist/internal/icons.d.ts +2 -0
- package/dist/internal/icons.js +2 -2
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/vue.d.ts +1 -1
- package/llms/components/lr-accordion-item.md +36 -0
- package/llms/components/lr-accordion.md +36 -0
- package/llms/components/lr-bar-chart.md +4 -1
- package/llms/components/lr-bubble-chart.md +4 -1
- package/llms/components/lr-button.md +5 -0
- package/llms/components/lr-chart.md +40 -2
- package/llms/components/lr-details.md +36 -0
- package/llms/components/lr-doughnut-chart.md +4 -1
- package/llms/components/lr-histogram.md +6 -2
- package/llms/components/lr-line-chart.md +4 -1
- package/llms/components/lr-map.md +45 -7
- package/llms/components/lr-pie-chart.md +4 -1
- package/llms/components/lr-polar-area-chart.md +4 -1
- package/llms/components/lr-radar-chart.md +4 -1
- package/llms/components/lr-scatter-chart.md +4 -1
- package/llms/components/lr-table.md +10 -4
- package/llms-full.txt +171 -16
- package/package.json +1 -1
- package/vscode-html-data.json +1 -1
- package/web-types.json +1 -1
|
@@ -6,6 +6,14 @@ readonly datasetIndex:number;
|
|
|
6
6
|
readonly visible:boolean;
|
|
7
7
|
/** Canonical complete list of hidden zero-based dataset indexes. */
|
|
8
8
|
readonly hiddenDatasets:readonly number[];}
|
|
9
|
+
/** Complete category visibility proposal or committed snapshot for radial charts. */
|
|
10
|
+
export interface LyraChartDatumVisibilityChangeDetail{
|
|
11
|
+
/** Zero-based source category index, shared by every dataset/ring. */
|
|
12
|
+
readonly index:number;
|
|
13
|
+
/** Proposed or committed visibility of this category. */
|
|
14
|
+
readonly visible:boolean;
|
|
15
|
+
/** Complete canonical list of hidden source category indexes. */
|
|
16
|
+
readonly hiddenDatums:readonly number[];}
|
|
9
17
|
/**
|
|
10
18
|
* Returns a stable, bounded visibility snapshot. A defined empty array deliberately means every
|
|
11
19
|
* dataset is visible; `undefined` is left distinct so component configuration can supply its
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import'../../overlays/skeleton/skeleton.class.js';import type{LyraVariant}from'../../../internal/variants.js';import{type LyraChartLegendVisibilityChangeDetail}from'./chart-legend-visibility.js';export type{LyraChartLegendVisibilityChangeDetail}from'./chart-legend-visibility.js';export{seriesPalette}from'./chart-colors.js';export interface LyraChartPoint{readonly x:number;readonly y:number;
|
|
1
|
+
import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import'../../overlays/skeleton/skeleton.class.js';import type{LyraVariant}from'../../../internal/variants.js';import{type LyraChartLegendVisibilityChangeDetail,type LyraChartDatumVisibilityChangeDetail}from'./chart-legend-visibility.js';export type{LyraChartLegendVisibilityChangeDetail,LyraChartDatumVisibilityChangeDetail}from'./chart-legend-visibility.js';export{seriesPalette}from'./chart-colors.js';export interface LyraChartPoint{readonly x:number;readonly y:number;
|
|
2
2
|
/** Bubble radius. Ignored by chart types that do not consume a radius. */
|
|
3
3
|
readonly r?:number;
|
|
4
4
|
/**
|
|
@@ -32,7 +32,11 @@ export type LyraChartScaleType='linear'|'logarithmic';
|
|
|
32
32
|
* numbers, is dropped rather than handed to Chart.js, where it would silently render nothing or
|
|
33
33
|
* throw. `axis` defaults to `'y'`, the value axis for the common threshold case.
|
|
34
34
|
*/
|
|
35
|
-
export interface LyraChartAnnotation{readonly axis?:LyraChartIndexAxis;readonly value?:number;readonly from?:number;readonly to?:number;readonly label?:string;readonly tone?:LyraVariant;}export type LyraChartLayoutPosition='left'|'top'|'right'|'bottom'|'center'|'chartArea'|{[scaleId:string]:number;};export type LyraChartLegendPosition=LyraChartLayoutPosition|'start'|'end'|'auto';
|
|
35
|
+
export interface LyraChartAnnotation{readonly axis?:LyraChartIndexAxis;readonly value?:number;readonly from?:number;readonly to?:number;readonly label?:string;readonly tone?:LyraVariant;}export type LyraChartLayoutPosition='left'|'top'|'right'|'bottom'|'center'|'chartArea'|{[scaleId:string]:number;};export type LyraChartLegendPosition=LyraChartLayoutPosition|'start'|'end'|'auto';
|
|
36
|
+
/** Dataset toggles, or shared category toggles for pie/doughnut/polar-area charts. */
|
|
37
|
+
export type LyraChartLegendMode='dataset'|'datum';
|
|
38
|
+
/** Text shown in the DOM legend, independently of tooltip and axis formatting. */
|
|
39
|
+
export type LyraChartLegendDisplay='auto'|'label'|'value'|'percentage';export type LyraChartValueFormatterContext='tick'|'tooltip'|'legend'|'table';export type LyraChartValueFormatter=(value:number,context:LyraChartValueFormatterContext)=>string;export type LyraChartFormatSurface=LyraChartValueFormatterContext|'visual'|'spoken'|'export';
|
|
36
40
|
/** Identifies which numeric component of a structured datum the formatter receives. */
|
|
37
41
|
export type LyraChartStatistic='x'|'y'|'r'|'min'|'q1'|'median'|'q3'|'max'|'total';export interface LyraChartFormatterContext{readonly value:number;readonly surface:LyraChartFormatSurface;readonly datasetIndex?:number;readonly index?:number;readonly label?:string;readonly seriesLabel?:string;readonly statistic?:LyraChartStatistic;}export type LyraChartFormatter=(context:LyraChartFormatterContext)=>string;export type LyraChartExportFormat='csv'|'png';export interface LyraChartArea{readonly top:number;readonly left:number;readonly right:number;readonly bottom:number;readonly width:number;readonly height:number;}
|
|
38
42
|
/** A Chart.js-compatible plugin shape without making `chart.js` a type dependency for consumers. */
|
|
@@ -47,13 +51,13 @@ export interface LyraChartDataConfiguration{labels?:unknown[];datasets?:LyraChar
|
|
|
47
51
|
* controller-specific checking is useful; that type remains structurally
|
|
48
52
|
* assignable to this passthrough surface.
|
|
49
53
|
*/
|
|
50
|
-
export interface LyraChartConfiguration{type?:string;data?:LyraChartDataConfiguration;options?:object;plugins?:LyraChartPlugin[];}interface ChartHit{datasetIndex:number;index:number;}interface RuntimeChart{data:{labels?:unknown[];datasets:LyraChartDatasetConfiguration[];};options:Record<string,unknown>;config:{type?:unknown;};legend?:unknown;chartArea?:LyraChartArea;destroy():void;update(mode?:string):void;toBase64Image?():string;getElementsAtEventForMode(event:Event,mode:string,options:Record<string,unknown>,useFinalPosition:boolean):ChartHit[];getDatasetMeta?(index:number):{hidden:boolean|null;};isDatasetVisible(index:number):boolean;setDatasetVisibility(index:number,visible:boolean):void;}
|
|
54
|
+
export interface LyraChartConfiguration{type?:string;data?:LyraChartDataConfiguration;options?:object;plugins?:LyraChartPlugin[];}interface ChartHit{datasetIndex:number;index:number;}interface RuntimeChart{data:{labels?:unknown[];datasets:LyraChartDatasetConfiguration[];};options:Record<string,unknown>;config:{type?:unknown;};legend?:unknown;chartArea?:LyraChartArea;destroy():void;update(mode?:string):void;toBase64Image?():string;getElementsAtEventForMode(event:Event,mode:string,options:Record<string,unknown>,useFinalPosition:boolean):ChartHit[];getDatasetMeta?(index:number):{hidden:boolean|null;};isDatasetVisible(index:number):boolean;setDatasetVisibility(index:number,visible:boolean):void;getDataVisibility?(index:number):boolean;toggleDataVisibility?(index:number):void;}
|
|
51
55
|
/** Public structural view of the current Chart.js instance, without imposing `chart.js` as a
|
|
52
56
|
* type dependency on consumers. The value is `undefined` before the peer loads and after the
|
|
53
57
|
* component disconnects. */
|
|
54
58
|
export interface LyraChartInstance extends RuntimeChart{}export type LyraChartDatumKind='bar'|'point'|'segment'|'slice'|'box';type LyraCoreChartDatumKind=Exclude<LyraChartDatumKind,'box'>;
|
|
55
59
|
/** Input-neutral detail shared by every chart-family `lr-datum-activate` event. */
|
|
56
|
-
export interface LyraChartDatumActivateDetail<TKind extends LyraChartDatumKind=LyraChartDatumKind,TValue=unknown>{readonly kind:TKind;readonly datasetIndex:number;readonly index:number;readonly label:string|undefined;readonly value:TValue;}export interface LyraChartEventMap{'lr-point-click':CustomEvent<{datasetIndex:number;index:number;label:string|undefined;value:unknown;}>;'lr-zoom':CustomEvent<{zoomed:boolean;}>;'lr-before-legend-visibility-change':CustomEvent<LyraChartLegendVisibilityChangeDetail>;'lr-legend-visibility-change':CustomEvent<LyraChartLegendVisibilityChangeDetail>;'lr-datum-activate':CustomEvent<LyraChartDatumActivateDetail<LyraCoreChartDatumKind>>;}
|
|
60
|
+
export interface LyraChartDatumActivateDetail<TKind extends LyraChartDatumKind=LyraChartDatumKind,TValue=unknown>{readonly kind:TKind;readonly datasetIndex:number;readonly index:number;readonly label:string|undefined;readonly value:TValue;}export interface LyraChartEventMap{'lr-point-click':CustomEvent<{datasetIndex:number;index:number;label:string|undefined;value:unknown;}>;'lr-zoom':CustomEvent<{zoomed:boolean;}>;'lr-before-legend-visibility-change':CustomEvent<LyraChartLegendVisibilityChangeDetail>;'lr-legend-visibility-change':CustomEvent<LyraChartLegendVisibilityChangeDetail>;'lr-before-datum-visibility-change':CustomEvent<LyraChartDatumVisibilityChangeDetail>;'lr-datum-visibility-change':CustomEvent<LyraChartDatumVisibilityChangeDetail>;'lr-datum-activate':CustomEvent<LyraChartDatumActivateDetail<LyraCoreChartDatumKind>>;}
|
|
57
61
|
/**
|
|
58
62
|
* `<lr-chart>` — the core Chart.js wrapper used directly and by the typed
|
|
59
63
|
* Chart.js tags plus `<lr-histogram>`. `<lr-lite-chart>` and `<lr-box-plot>`
|
|
@@ -62,6 +66,9 @@ export interface LyraChartDatumActivateDetail<TKind extends LyraChartDatumKind=L
|
|
|
62
66
|
* are further optional peers loaded only on demand.
|
|
63
67
|
* With IntersectionObserver available, canvas construction waits for the first delivered
|
|
64
68
|
* visibility decision; without it, drawing starts as soon as the peer and canvas are ready.
|
|
69
|
+
* Simplified pie/doughnut datasets with magnitudes above Number.MAX_SAFE_INTEGER are uniformly
|
|
70
|
+
* scaled for finite peer arc geometry. Legends, tooltips, data labels and semantic exports retain
|
|
71
|
+
* original values; direct peer callbacks see scaled values. Explicit config.data is passed through.
|
|
65
72
|
*
|
|
66
73
|
* **API mirror note:** the real `wa-chart` docs page
|
|
67
74
|
* (https://webawesome.com/docs/components/chart/) documents a `config:
|
|
@@ -92,13 +99,18 @@ export interface LyraChartDatumActivateDetail<TKind extends LyraChartDatumKind=L
|
|
|
92
99
|
* value, and the complete canonical proposed `hiddenDatasets` snapshot.
|
|
93
100
|
* @event lr-legend-visibility-change - Emitted after an accepted DOM legend toggle commits the
|
|
94
101
|
* same detail. Programmatic `hiddenDatasets` changes reconcile without either event.
|
|
102
|
+
* @event lr-before-datum-visibility-change - Cancelable category visibility proposal in datum
|
|
103
|
+
* legend mode. `detail: { index: number, visible: boolean, hiddenDatums: readonly number[] }`.
|
|
104
|
+
* Source category indexes apply to every dataset/ring. The complete detail is frozen.
|
|
105
|
+
* @event lr-datum-visibility-change - Emitted after an accepted category toggle commits the same
|
|
106
|
+
* frozen detail. Programmatic `hiddenDatums` assignments are silent.
|
|
95
107
|
* @csspart base - The chart wrapper.
|
|
96
108
|
* @csspart plot - The fixed-height canvas/overlay region.
|
|
97
109
|
* @csspart canvas - The Chart.js canvas.
|
|
98
110
|
* @csspart legend - The wrapping DOM legend, rendered unless `withoutLegend` is set.
|
|
99
|
-
* @csspart legend-item - A keyboard-operable
|
|
100
|
-
* @csspart legend-item-hidden - Added
|
|
101
|
-
* @csspart legend-swatch - The resolved
|
|
111
|
+
* @csspart legend-item - A keyboard-operable dataset or category visibility toggle.
|
|
112
|
+
* @csspart legend-item-hidden - Added while the legend item's dataset or category is hidden.
|
|
113
|
+
* @csspart legend-swatch - The resolved dataset/category color swatch in a legend item.
|
|
102
114
|
* @csspart reset-zoom-button - The reset-zoom control when zoom is active.
|
|
103
115
|
* @csspart description - The accessible chart summary.
|
|
104
116
|
* @csspart data-table - The optional generated or slotted data table.
|
|
@@ -192,7 +204,27 @@ get datasets():readonly LyraChartSeries[];set datasets(value:readonly LyraChartS
|
|
|
192
204
|
* an empty array deliberately makes every dataset visible. Invalid, duplicate, and out-of-range
|
|
193
205
|
* indexes are ignored when state is applied or emitted.
|
|
194
206
|
*/
|
|
195
|
-
hiddenDatasets?:readonly number[];
|
|
207
|
+
hiddenDatasets?:readonly number[];private _hiddenDatums;
|
|
208
|
+
/**
|
|
209
|
+
* Controlled hidden source category indexes for pie/doughnut/polar-area charts, shared by all
|
|
210
|
+
* datasets/rings. Clone-owned; invalid, duplicate and out-of-range indexes are ignored when
|
|
211
|
+
* applied or emitted. Empty restores all categories. Does not alter dataset visibility or exports.
|
|
212
|
+
* @default []
|
|
213
|
+
*/
|
|
214
|
+
get hiddenDatums():readonly number[];set hiddenDatums(value:readonly number[]);
|
|
215
|
+
/**
|
|
216
|
+
* `datum` renders category toggles for pie/doughnut/polar-area charts. Categories use the first
|
|
217
|
+
* dataset's colors and values; a toggle affects that category in every ring. Other chart types
|
|
218
|
+
* retain dataset legends. Both modes use the generated accessible-data sampling budget.
|
|
219
|
+
*/
|
|
220
|
+
legendMode:LyraChartLegendMode;
|
|
221
|
+
/**
|
|
222
|
+
* `auto` retains optional legend formatting; `label` omits values even with a formatter; `value`
|
|
223
|
+
* appends a formatted value. `percentage` uses locale percentages of the absolute represented
|
|
224
|
+
* legend values, including hidden items (zero totals yield 0%). Dataset values are sampled sums;
|
|
225
|
+
* category values come from the first dataset. Tooltip and axis formatting are unchanged.
|
|
226
|
+
*/
|
|
227
|
+
legendDisplay:LyraChartLegendDisplay;
|
|
196
228
|
/**
|
|
197
229
|
* Accessible chart description, which REPLACES the generated summary rather than adding to it.
|
|
198
230
|
*
|
|
@@ -354,7 +386,9 @@ private callbackIndexes;
|
|
|
354
386
|
/** The public controlled snapshot when supplied, otherwise the effective configuration default. */
|
|
355
387
|
private effectiveHiddenDatasetIndexes;
|
|
356
388
|
/** Applies the public controlled state to the live Chart.js metadata after any data replacement. */
|
|
357
|
-
private applyDatasetVisibility;private
|
|
389
|
+
private applyDatasetVisibility;private isSliceChart;
|
|
390
|
+
/** Reconcile through Chart.js's public category visibility API after data/index remapping. */
|
|
391
|
+
private applyDatumVisibility;private hasExplicitConfigData;private datasetLabel;private datasetValues;private isPointDataset;
|
|
358
392
|
/**
|
|
359
393
|
* Appends one streamed category to numeric `data` series and optionally keeps only the newest
|
|
360
394
|
* `maxPoints` categories. An explicitly supplied `config.data` member is updated at that same
|
|
@@ -376,7 +410,7 @@ private loading;
|
|
|
376
410
|
*/
|
|
377
411
|
private loadFailed;private loadLibrary;private loadZoomFeature;private loadDataLabelsFeature;private loadAnnotationFeature;private loadGeneration;private zoomLoadGeneration;private dataLabelsLoadGeneration;private annotationLoadGeneration;private zoomFeatureState;private dataLabelsFeatureState;private annotationFeatureState;private dataLabelsPlugin?;private annotationPlugin?;private stopAnnotationRegistrationWatch?;private zoomed;private visible;private intersectionObserver?;private intersectionGeneration;private reducedMotionQuery?;private reducedMotionWindow?;private canvasEl?;
|
|
378
412
|
/** The current Chart.js instance. Read it only while the element is connected and loaded. */
|
|
379
|
-
chart?:LyraChartInstance;private chartJsModule?;private resizeObserver?;private resizeDrawFrame?;private resizeDrawFrameOwner?;private lastObservedInlineSize?;private autoLegendPosition;private resolvedChartArea?;private chartAreaUpdateQueued;private builtType?;private builtPlugins;private visualDatasetSourceIndexes?;private visualRowSourceIndexes?;private suppressZoomComplete;private descriptionId;private keyboardDatumIndex;private keyboardDatumAnnouncement;
|
|
413
|
+
chart?:LyraChartInstance;private scaledSliceDatasets;private chartJsModule?;private resizeObserver?;private resizeDrawFrame?;private resizeDrawFrameOwner?;private lastObservedInlineSize?;private autoLegendPosition;private resolvedChartArea?;private chartAreaUpdateQueued;private builtType?;private builtPlugins;private visualDatasetSourceIndexes?;private visualRowSourceIndexes?;private suppressZoomComplete;private descriptionId;private keyboardDatumIndex;private keyboardDatumAnnouncement;
|
|
380
414
|
/** Shared document-level regions that carry announcements. The visually hidden datum copy is an
|
|
381
415
|
* inspection mirror only because shadow-root live regions are not consistently spoken. */
|
|
382
416
|
private politeAnnouncementSink?;private assertiveAnnouncementSink?;private lastDataTruncationAnnouncement;
|
|
@@ -566,7 +600,9 @@ private localizedChartType;private formatValue;private legendValue;private legen
|
|
|
566
600
|
*/
|
|
567
601
|
private legendGridPlacement;private updateChartArea;
|
|
568
602
|
/** The current Chart.js chart-area geometry in canvas-local coordinates. */
|
|
569
|
-
get chartArea():LyraChartArea|undefined;private buildConfig;
|
|
603
|
+
get chartArea():LyraChartArea|undefined;private buildConfig;
|
|
604
|
+
/** Keep proportional slice geometry finite while every Lyra readout retains source values. */
|
|
605
|
+
private scaleExtremeSlices;private draw;private drawIfVisible;
|
|
570
606
|
/** Destroys the peer instance and reconciles the Lyra-owned zoom state in one place. */
|
|
571
607
|
private discardChart;
|
|
572
608
|
/**
|
|
@@ -602,4 +638,4 @@ private summarizeSeries;private formatSummaryValue;private formatTableValue;
|
|
|
602
638
|
private formatExportValue;
|
|
603
639
|
/** The `'spoken'` surface, for the live announcement a keyboard user hears. Falls back to the
|
|
604
640
|
* locale number format, which is what it always used. */
|
|
605
|
-
private formatSpokenValue;private tableStackAxes;private tableStackTotalLabel;private accessibleName;private chartDescription;private dataTableSample;private generatedDataIsSampled;private dataTruncationMessage;private renderDataTable;private hasCustomDataTable;private legendTextFor;private legendColor;private toggleDataset;private renderLegend;render():TemplateResult;private get showsLegend();}declare global{interface HTMLElementTagNameMap{'lr-chart':LyraChart;}}
|
|
641
|
+
private formatSpokenValue;private tableStackAxes;private tableStackTotalLabel;private accessibleName;private chartDescription;private dataTableSample;private generatedDataIsSampled;private dataTruncationMessage;private renderDataTable;private hasCustomDataTable;private legendTextFor;private legendColor;private toggleDataset;private toggleDatum;private renderLegend;render():TemplateResult;private get showsLegend();}declare global{interface HTMLElementTagNameMap{'lr-chart':LyraChart;}}
|