@ixfx/components 0.7.5 → 0.8.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/bundle/index.d.ts +256 -17
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +1462 -166
- package/bundle/index.js.map +1 -1
- package/dist/ac-token.js +1 -1
- package/dist/{data-grid-CtJ35v8L.d.ts → data-grid-D-z7bx5-.d.ts} +2 -2
- package/dist/{data-grid-CtJ35v8L.d.ts.map → data-grid-D-z7bx5-.d.ts.map} +1 -1
- package/dist/data-grid.d.ts +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{detail-list-BS5dRDda.d.ts → detail-list-_ZJHYEBr.d.ts} +3 -3
- package/dist/{detail-list-BS5dRDda.d.ts.map → detail-list-_ZJHYEBr.d.ts.map} +1 -1
- package/dist/detail-list.d.ts +2 -2
- package/dist/detail-list.js +1 -1
- package/dist/grid-list-nRUQOcEL.js +1537 -0
- package/dist/grid-list-nRUQOcEL.js.map +1 -0
- package/dist/{grid-list-D-GbghSH.d.ts → grid-list-u33vmKzb.d.ts} +116 -15
- package/dist/grid-list-u33vmKzb.d.ts.map +1 -0
- package/dist/grid-list.d.ts +1 -1
- package/dist/grid-list.js +1 -993
- package/dist/{incr-search-DpbSJtgj.js → incr-search-C05WjbZh.js} +40 -3
- package/dist/incr-search-C05WjbZh.js.map +1 -0
- package/dist/incr-search.d.ts +2 -2
- package/dist/incr-search.js +2 -2
- package/dist/{index-CBS4z1v-.d.ts → index-h6gxtfHH.d.ts} +34 -2
- package/dist/index-h6gxtfHH.d.ts.map +1 -0
- package/dist/index.d.ts +60 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +343 -16
- package/dist/index.js.map +1 -1
- package/dist/led.d.ts +33 -1
- package/dist/led.d.ts.map +1 -1
- package/dist/led.js +157 -13
- package/dist/led.js.map +1 -1
- package/dist/miller.d.ts +1 -1
- package/dist/miller.js +1 -1
- package/dist/narrowed-text.js +1 -1
- package/dist/panel.d.ts +3 -1
- package/dist/panel.d.ts.map +1 -1
- package/dist/panel.js +31 -1
- package/dist/panel.js.map +1 -1
- package/dist/plots.d.ts +2 -2
- package/dist/plots.js +1 -1
- package/dist/{titlebar-Bj5pfdw_.d.ts → titlebar-YQ-jVQoS.d.ts} +2 -2
- package/dist/{titlebar-Bj5pfdw_.d.ts.map → titlebar-YQ-jVQoS.d.ts.map} +1 -1
- package/dist/titlebar.d.ts +1 -1
- package/dist/titlebar.js +83 -1
- package/dist/titlebar.js.map +1 -1
- package/dist/{tree-DAii2A1g.js → tree-Chptss7I.js} +2 -2
- package/dist/{tree-DAii2A1g.js.map → tree-Chptss7I.js.map} +1 -1
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-DwtCPy1b.d.ts → vertical-list-CFuFDygi.d.ts} +2 -2
- package/dist/{vertical-list-DwtCPy1b.d.ts.map → vertical-list-CFuFDygi.d.ts.map} +1 -1
- package/dist/vertical-list.d.ts +1 -1
- package/dist/vertical-list.js +1 -1
- package/dist/{xy-axis-5KhVTNoX.d.ts → xy-axis-BfP9hKLj.d.ts} +25 -2
- package/dist/{xy-axis-5KhVTNoX.d.ts.map → xy-axis-BfP9hKLj.d.ts.map} +1 -1
- package/dist/{xy-axis-VrX8dmvS.js → xy-axis-DzM1brBZ.js} +141 -8
- package/dist/xy-axis-DzM1brBZ.js.map +1 -0
- package/docs-user/dock.md +1 -0
- package/docs-user/grid-list.md +99 -14
- package/docs-user/index.json +3 -3
- package/docs-user/led.md +37 -7
- package/docs-user/llms.txt +1 -1
- package/docs-user/panel.md +68 -13
- package/docs-user/titlebar.md +3 -4
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/dist/grid-list-D-GbghSH.d.ts.map +0 -1
- package/dist/grid-list.js.map +0 -1
- package/dist/incr-search-DpbSJtgj.js.map +0 -1
- package/dist/index-CBS4z1v-.d.ts.map +0 -1
- package/dist/xy-axis-VrX8dmvS.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as ListSearchController } from "./index-h6gxtfHH.js";
|
|
2
2
|
import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-B5ioL-dG.js";
|
|
3
3
|
import { LitElement, PropertyValues } from "lit";
|
|
4
4
|
import { CommandId, CommandRegistry } from "@clinth/ui-commands";
|
|
@@ -140,4 +140,4 @@ declare global {
|
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
export { CustomCheckboxOptions as n, VerticalListElement as r, AddItemOptions as t };
|
|
143
|
-
//# sourceMappingURL=vertical-list-
|
|
143
|
+
//# sourceMappingURL=vertical-list-CFuFDygi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-list-
|
|
1
|
+
{"version":3,"file":"vertical-list-CFuFDygi.d.ts","names":[],"sources":["../src/vertical-list/vertical-list.ts"],"mappings":";;;;;UA2CiB;EACf,WAAW;EACX;EACA;;UAGe;;;;;;EAMf;;cAMW,4BAA4B;;EAEvC,eAAe;EAGf,iBAAiB;EAGjB,mBAAmB,IAAI;;;;;;EAQvB;;;;;;;;;;;;;;;;;;;EAqBA,oBAAoB,gCAAgC;;;;;;EAQpD;mBAUiB;UAeT;;WAeC,QAAM,qBAAA;;MAYX,YAAY;EAoBP;EAmBA;EA4CA,QAAQ,SAAS;;MAmCtB,gBAAgB;;MAKhB,iBAAiB,YAAY;EAIjC,QAAQ,MAAM,kBAAkB,UAAU;;;;;;EAqB1C,WAAW,MAAM,UAAU;;EAW3B,YAAY,OAAO,SAAS,WAAW;EAIvC;;;;;;EAYA,SAAS,gBAAgB;;;;;;EAczB,SAAS,WAAW,WAAW,OAAO;EAItC,OAAO,MAAM;EAIb,WAAW,OAAO,SAAS;EAI3B,SAAS,MAAM;EAIf;EAIA;;MAQI,gBAAgB;;MAKhB;;EAMJ,WAAW,MAAM;;EAKjB,gBAAgB,MAAM;;EAKtB,mBAAmB,MAAM;;EAKzB,SAAS;EAkBP,eAAe,0CAA0C,UAAU;UAqB7D;UAgBA;UAOA;UAiBA;;;;;;;UA6FA;;;;;UAuBA;UAcA;UAYA;UAUA;UAMA;UAIA;UAwDA;UAQA;UAMA;SAUQ,sBAAM;EA+Hb,wBAAM;;QAYT;YACI;IACR,sBAAsB;;YAGd,4BAA4B"}
|
package/dist/vertical-list.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as ListItemClickDetail, c as ListSelectEvent, d as ListTickleEvent, i as ListInteractionMode, l as ListSelectionMode, n as ListActivateEvent, o as ListItemClickEvent, r as ListElementEventMap, s as ListSelectDetail, t as ListActivateDetail, u as ListTickleDetail } from "./list-selection-types-B5ioL-dG.js";
|
|
2
|
-
import { n as CustomCheckboxOptions, r as VerticalListElement, t as AddItemOptions } from "./vertical-list-
|
|
2
|
+
import { n as CustomCheckboxOptions, r as VerticalListElement, t as AddItemOptions } from "./vertical-list-CFuFDygi.js";
|
|
3
3
|
export { AddItemOptions, CustomCheckboxOptions, type ListActivateDetail, type ListActivateEvent, type ListElementEventMap, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListSelectDetail, type ListSelectEvent, type ListSelectionMode, type ListTickleDetail, type ListTickleEvent, VerticalListElement };
|
package/dist/vertical-list.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as TickledController } from "./tickled-controller-C66DgJHl.js";
|
|
2
2
|
import { t as themeFallbacks } from "./fallbacks-DNI9xt0F.js";
|
|
3
3
|
import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
|
|
4
|
-
import { c as createElementListSearchAdapter, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-
|
|
4
|
+
import { c as createElementListSearchAdapter, i as ListSearchController, n as listSearchStyles, o as registerListSearchCommands, r as LIST_SEARCH_MODES, u as keyForElement } from "./incr-search-C05WjbZh.js";
|
|
5
5
|
import { n as animateListItemIn, r as animateListItemOut } from "./list-item-animation-DuiwgN3l.js";
|
|
6
6
|
import { t as ListSelectionController } from "./list-selection-controller-DTFI40li.js";
|
|
7
7
|
import { LitElement, css, html, render } from "lit";
|
|
@@ -291,6 +291,7 @@ type PlotHistogramOrientation = `horizontal` | `vertical`;
|
|
|
291
291
|
* - `none`: no hover feedback.
|
|
292
292
|
*/
|
|
293
293
|
type PlotHistogramValueTooltips = `hover` | `inline` | `none`;
|
|
294
|
+
type PlotHistogramInteractionMode = `inspect` | `select`;
|
|
294
295
|
type PlotHistogramBucketClickDetail = {
|
|
295
296
|
readonly bucketIndex: number;
|
|
296
297
|
readonly valueMin: number;
|
|
@@ -320,15 +321,37 @@ declare class PlotHistogram extends LitElement {
|
|
|
320
321
|
tooltipDelay: number;
|
|
321
322
|
/** Max rate (ms) at which an already-shown value display refreshes to match live-changing bucket data. */
|
|
322
323
|
valueUpdateInterval: number;
|
|
324
|
+
/** Interaction mode: 'inspect' for hover tooltips, 'select' for click-drag selection. */
|
|
325
|
+
interactionMode: PlotHistogramInteractionMode;
|
|
323
326
|
/** Override to customize the value/frequency label used by the tooltip and overlay text. */
|
|
324
327
|
valueFormat: (valueMin: number, valueMax: number, frequency: number) => string;
|
|
325
328
|
private _width;
|
|
326
329
|
private _height;
|
|
327
330
|
private _hoveredIndex;
|
|
328
331
|
private _inlineOverlayText;
|
|
332
|
+
private _coloredRangeMin;
|
|
333
|
+
private _coloredRangeMax;
|
|
334
|
+
private _selectionStart;
|
|
335
|
+
private _selectionEnd;
|
|
336
|
+
private _isDragging;
|
|
337
|
+
private _selectionOverlayText;
|
|
329
338
|
add(v: number): void;
|
|
330
339
|
set(values: number[]): void;
|
|
331
340
|
clear(): void;
|
|
341
|
+
setColoredRange(min: number, max: number): void;
|
|
342
|
+
clearColoredRange(): void;
|
|
343
|
+
setSelection(startBarIndex: number, endBarIndex: number): void;
|
|
344
|
+
clearSelection(): void;
|
|
345
|
+
getSelectedRange(): {
|
|
346
|
+
barIndices: {
|
|
347
|
+
start: number;
|
|
348
|
+
end: number;
|
|
349
|
+
} | null;
|
|
350
|
+
dataValues: {
|
|
351
|
+
min: number;
|
|
352
|
+
max: number;
|
|
353
|
+
} | null;
|
|
354
|
+
};
|
|
332
355
|
protected firstUpdated(_changed: PropertyValues): void;
|
|
333
356
|
protected updated(changed: PropertyValues): void;
|
|
334
357
|
disconnectedCallback(): void;
|
|
@@ -384,5 +407,5 @@ declare global {
|
|
|
384
407
|
}
|
|
385
408
|
}
|
|
386
409
|
//#endregion
|
|
387
|
-
export {
|
|
388
|
-
//# sourceMappingURL=xy-axis-
|
|
410
|
+
export { readBaseColour as A, PlotDataSeriesOptions as C, applyAgeModification as D, ColourResult as E, computeColour as O, PlotDataSeries as S, ColourMode as T, PlotSingleAxisElementEventMap as _, PlotHistogramBucketClickDetail as a, SingleAxisAgeStyle as b, PlotHistogramInteractionMode as c, PlotMultiAxis as d, PlotMultiAxisDataPointClickDetail as f, PlotSingleAxis as g, PlotMultiAxisLayout as h, PlotHistogram as i, parseColourScaleAttr as k, PlotHistogramOrientation as l, PlotMultiAxisElementEventMap as m, XyAgeStyle as n, PlotHistogramBucketClickEvent as o, PlotMultiAxisDataPointClickEvent as p, XyDrawStyle as r, PlotHistogramElementEventMap as s, PlotXyAxis as t, PlotHistogramValueTooltips as u, PlotSingleAxisPointerMoveDetail as v, ColourMapConfig as w, SingleAxisDrawStyle as x, PlotSingleAxisPointerMoveEvent as y };
|
|
411
|
+
//# sourceMappingURL=xy-axis-BfP9hKLj.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xy-axis-
|
|
1
|
+
{"version":3,"file":"xy-axis-BfP9hKLj.d.ts","names":[],"sources":["../src/plots/colour-map.ts","../src/plots/data.ts","../src/plots/single-axis.ts","../src/plots/multi-axis.ts","../src/plots/plot-histogram.ts","../src/plots/xy-axis.ts"],"mappings":";;KAeY;KAEA;EACV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I,WAAW;EASf,MAAM,cAAc;EASpB;YAMmB,aAAa,UAAU;YAWvB,QAAQ,SAAS;EA8G3B,wBAAM;SAkEC,sBAAM;;QAuBhB;YACI;IACR,qBAAqB"}
|
|
@@ -717,11 +717,18 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
717
717
|
this.valueTooltips = `hover`;
|
|
718
718
|
this.tooltipDelay = 400;
|
|
719
719
|
this.valueUpdateInterval = 500;
|
|
720
|
+
this.interactionMode = `inspect`;
|
|
720
721
|
this.valueFormat = (valueMin, valueMax, frequency) => `${valueMin.toFixed(2)} - ${valueMax.toFixed(2)}: ${frequency}`;
|
|
721
722
|
this._width = 100;
|
|
722
723
|
this._height = 40;
|
|
723
724
|
this._hoveredIndex = null;
|
|
724
725
|
this._inlineOverlayText = null;
|
|
726
|
+
this._coloredRangeMin = null;
|
|
727
|
+
this._coloredRangeMax = null;
|
|
728
|
+
this._selectionStart = null;
|
|
729
|
+
this._selectionEnd = null;
|
|
730
|
+
this._isDragging = false;
|
|
731
|
+
this._selectionOverlayText = null;
|
|
725
732
|
this.#series = new PlotDataSeries({
|
|
726
733
|
capacityLimit: 100,
|
|
727
734
|
persistentScaling: true
|
|
@@ -734,6 +741,22 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
734
741
|
this.#tooltipPosition = null;
|
|
735
742
|
this.#valueRefreshTimer = null;
|
|
736
743
|
this.#onPointerMove = (e) => {
|
|
744
|
+
if (this.interactionMode === `select` && this._isDragging) {
|
|
745
|
+
const index = this.#bucketIndexFromPosition(e.clientX, e.clientY);
|
|
746
|
+
this._selectionEnd = index;
|
|
747
|
+
const start = Math.min(this._selectionStart, this._selectionEnd);
|
|
748
|
+
const end = Math.max(this._selectionStart, this._selectionEnd);
|
|
749
|
+
const bars = this.#computeBars();
|
|
750
|
+
if (start <= end) {
|
|
751
|
+
const startBar = bars[start];
|
|
752
|
+
const endBar = bars[end];
|
|
753
|
+
this.setColoredRange(startBar.valueMin, endBar.valueMax);
|
|
754
|
+
this._selectionOverlayText = `Select: ${startBar.valueMin.toFixed(2)} – ${endBar.valueMax.toFixed(2)}`;
|
|
755
|
+
}
|
|
756
|
+
this.requestUpdate();
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
if (this.interactionMode === `select`) return;
|
|
737
760
|
if (this.valueTooltips === `none`) return;
|
|
738
761
|
const index = this.#bucketIndexFromPointer(e.clientX, e.clientY);
|
|
739
762
|
const bucketIndex = index >= 0 ? index : null;
|
|
@@ -741,10 +764,34 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
741
764
|
else this.#updateBubbleTooltip(bucketIndex, e.clientX, e.clientY);
|
|
742
765
|
};
|
|
743
766
|
this.#onPointerLeave = () => {
|
|
767
|
+
if (this.interactionMode === `select`) {
|
|
768
|
+
if (this._isDragging) {
|
|
769
|
+
this._isDragging = false;
|
|
770
|
+
this._selectionOverlayText = null;
|
|
771
|
+
this.requestUpdate();
|
|
772
|
+
}
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
744
775
|
if (this.valueTooltips === `none`) return;
|
|
745
776
|
if (this.valueTooltips === `inline`) this.#setInlineIndex(null);
|
|
746
777
|
else this.#updateBubbleTooltip(null, 0, 0);
|
|
747
778
|
};
|
|
779
|
+
this.#onPointerDown = (e) => {
|
|
780
|
+
if (this.interactionMode !== `select`) return;
|
|
781
|
+
const index = this.#bucketIndexFromPosition(e.clientX, e.clientY);
|
|
782
|
+
this._isDragging = true;
|
|
783
|
+
this._selectionStart = index;
|
|
784
|
+
this._selectionEnd = index;
|
|
785
|
+
const bars = this.#computeBars();
|
|
786
|
+
const startBar = bars[index];
|
|
787
|
+
const endBar = bars[index];
|
|
788
|
+
this.setColoredRange(startBar.valueMin, endBar.valueMax);
|
|
789
|
+
this._selectionOverlayText = `Select: ${startBar.valueMin.toFixed(2)} – ${endBar.valueMax.toFixed(2)}`;
|
|
790
|
+
this.requestUpdate();
|
|
791
|
+
};
|
|
792
|
+
this.#onPointerUp = () => {
|
|
793
|
+
if (this.interactionMode === `select`) this._isDragging = false;
|
|
794
|
+
};
|
|
748
795
|
}
|
|
749
796
|
#series;
|
|
750
797
|
#hasProgrammaticData;
|
|
@@ -768,6 +815,59 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
768
815
|
this.#series.clear();
|
|
769
816
|
this.requestUpdate();
|
|
770
817
|
}
|
|
818
|
+
setColoredRange(min, max) {
|
|
819
|
+
this._coloredRangeMin = min;
|
|
820
|
+
this._coloredRangeMax = max;
|
|
821
|
+
this.requestUpdate();
|
|
822
|
+
}
|
|
823
|
+
clearColoredRange() {
|
|
824
|
+
this._coloredRangeMin = null;
|
|
825
|
+
this._coloredRangeMax = null;
|
|
826
|
+
this.requestUpdate();
|
|
827
|
+
}
|
|
828
|
+
setSelection(startBarIndex, endBarIndex) {
|
|
829
|
+
const bars = this.#computeBars();
|
|
830
|
+
const start = Math.min(startBarIndex, endBarIndex);
|
|
831
|
+
const end = Math.max(startBarIndex, endBarIndex);
|
|
832
|
+
const clampedStart = Math.max(0, Math.min(start, bars.length - 1));
|
|
833
|
+
const clampedEnd = Math.max(0, Math.min(end, bars.length - 1));
|
|
834
|
+
this._selectionStart = clampedStart;
|
|
835
|
+
this._selectionEnd = clampedEnd;
|
|
836
|
+
if (clampedStart <= clampedEnd) {
|
|
837
|
+
const startBar = bars[clampedStart];
|
|
838
|
+
const endBar = bars[clampedEnd];
|
|
839
|
+
this.setColoredRange(startBar.valueMin, endBar.valueMax);
|
|
840
|
+
}
|
|
841
|
+
this.requestUpdate();
|
|
842
|
+
}
|
|
843
|
+
clearSelection() {
|
|
844
|
+
this._selectionStart = null;
|
|
845
|
+
this._selectionEnd = null;
|
|
846
|
+
this.requestUpdate();
|
|
847
|
+
}
|
|
848
|
+
getSelectedRange() {
|
|
849
|
+
if (this._selectionStart === null || this._selectionEnd === null) return {
|
|
850
|
+
barIndices: null,
|
|
851
|
+
dataValues: null
|
|
852
|
+
};
|
|
853
|
+
const bars = this.#computeBars();
|
|
854
|
+
const start = Math.min(this._selectionStart, this._selectionEnd);
|
|
855
|
+
const end = Math.max(this._selectionStart, this._selectionEnd);
|
|
856
|
+
const clampedStart = Math.max(0, Math.min(start, bars.length - 1));
|
|
857
|
+
const clampedEnd = Math.max(0, Math.min(end, bars.length - 1));
|
|
858
|
+
const startBar = bars[clampedStart];
|
|
859
|
+
const endBar = bars[clampedEnd];
|
|
860
|
+
return {
|
|
861
|
+
barIndices: {
|
|
862
|
+
start: clampedStart,
|
|
863
|
+
end: clampedEnd
|
|
864
|
+
},
|
|
865
|
+
dataValues: {
|
|
866
|
+
min: startBar.valueMin,
|
|
867
|
+
max: endBar.valueMax
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
}
|
|
771
871
|
firstUpdated(_changed) {
|
|
772
872
|
this._width = this.clientWidth || 100;
|
|
773
873
|
this._height = this.clientHeight || 40;
|
|
@@ -902,6 +1002,10 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
902
1002
|
}
|
|
903
1003
|
});
|
|
904
1004
|
}
|
|
1005
|
+
#isBarInColoredRange(bar) {
|
|
1006
|
+
if (this._coloredRangeMin === null || this._coloredRangeMax === null) return true;
|
|
1007
|
+
return bar.valueMin < this._coloredRangeMax && bar.valueMax > this._coloredRangeMin;
|
|
1008
|
+
}
|
|
905
1009
|
/** Index of the bar rect under the pointer, or -1 if none (matches click hit-testing). */
|
|
906
1010
|
#bucketIndexFromPointer(clientX, clientY) {
|
|
907
1011
|
const rect = this.getBoundingClientRect();
|
|
@@ -909,6 +1013,18 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
909
1013
|
const y = clientY - rect.top;
|
|
910
1014
|
return this.#computeBars().findIndex((b) => x >= b.x && x <= b.x + b.width && y >= b.y && y <= b.y + b.height);
|
|
911
1015
|
}
|
|
1016
|
+
/** Gets bucket index from position, clamping to valid range (0 to bucketCount-1). */
|
|
1017
|
+
#bucketIndexFromPosition(clientX, clientY) {
|
|
1018
|
+
const { w, h, isHorizontal, padding, dataMin, dataSpan, bucketCount, availableMain } = this.#computeGeometry();
|
|
1019
|
+
const rect = this.getBoundingClientRect();
|
|
1020
|
+
const x = clientX - rect.left;
|
|
1021
|
+
const y = clientY - rect.top;
|
|
1022
|
+
let relativePos;
|
|
1023
|
+
if (isHorizontal) relativePos = (x - padding) / availableMain;
|
|
1024
|
+
else relativePos = (y - padding) / availableMain;
|
|
1025
|
+
relativePos = Math.max(0, Math.min(1, relativePos));
|
|
1026
|
+
return Math.floor(relativePos * bucketCount);
|
|
1027
|
+
}
|
|
912
1028
|
#tooltipIndex;
|
|
913
1029
|
#tooltipVisible;
|
|
914
1030
|
#tooltipShowTimer;
|
|
@@ -1043,15 +1159,23 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
1043
1159
|
}
|
|
1044
1160
|
#onPointerMove;
|
|
1045
1161
|
#onPointerLeave;
|
|
1162
|
+
#onPointerDown;
|
|
1163
|
+
#onPointerUp;
|
|
1046
1164
|
render() {
|
|
1047
1165
|
const { w, h, padding } = this.#computeGeometry();
|
|
1048
|
-
const barsContent = this.#computeBars().map((b, i) =>
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1166
|
+
const barsContent = this.#computeBars().map((b, i) => {
|
|
1167
|
+
const greyStyle = this.#isBarInColoredRange(b) ? `` : `filter: grayscale(1)`;
|
|
1168
|
+
return svg`
|
|
1169
|
+
<rect class="bar" x=${b.x} y=${b.y} width=${b.width} height=${b.height}
|
|
1170
|
+
style="--value: ${b.relativeValue}; ${greyStyle}"
|
|
1171
|
+
@click=${() => this.#emitClick(i, b.valueMin, b.valueMax, b.relativeValue)} />
|
|
1172
|
+
`;
|
|
1173
|
+
});
|
|
1053
1174
|
const textColor = `var(--plot-text, var(--surface-2-text, #fff))`;
|
|
1054
|
-
|
|
1175
|
+
let overlayText;
|
|
1176
|
+
if (this.interactionMode === `select` && this._selectionOverlayText !== null) overlayText = this._selectionOverlayText;
|
|
1177
|
+
else if (this.valueTooltips === `inline` && this._inlineOverlayText !== null) overlayText = this._inlineOverlayText;
|
|
1178
|
+
else overlayText = this.title;
|
|
1055
1179
|
const titleContent = overlayText ? svg`<text x=${padding + 2} y=${padding + Math.min(10, h * .6)}
|
|
1056
1180
|
class="overlay-text" fill=${textColor}
|
|
1057
1181
|
style="opacity: 0.6">${overlayText}</text>` : svg``;
|
|
@@ -1059,7 +1183,9 @@ let PlotHistogram = class PlotHistogram extends LitElement {
|
|
|
1059
1183
|
<svg width=${w} height=${h} viewBox="0 0 ${w} ${h}"
|
|
1060
1184
|
xmlns="http://www.w3.org/2000/svg"
|
|
1061
1185
|
@pointermove=${this.#onPointerMove}
|
|
1062
|
-
@pointerleave=${this.#onPointerLeave}
|
|
1186
|
+
@pointerleave=${this.#onPointerLeave}
|
|
1187
|
+
@pointerdown=${this.#onPointerDown}
|
|
1188
|
+
@pointerup=${this.#onPointerUp}>
|
|
1063
1189
|
<rect width=${w} height=${h} fill="transparent" />
|
|
1064
1190
|
${barsContent}
|
|
1065
1191
|
${titleContent}
|
|
@@ -1121,10 +1247,17 @@ __decorate([property({
|
|
|
1121
1247
|
type: Number,
|
|
1122
1248
|
attribute: `value-update-interval`
|
|
1123
1249
|
})], PlotHistogram.prototype, "valueUpdateInterval", void 0);
|
|
1250
|
+
__decorate([property({ attribute: `interaction-mode` })], PlotHistogram.prototype, "interactionMode", void 0);
|
|
1124
1251
|
__decorate([state()], PlotHistogram.prototype, "_width", void 0);
|
|
1125
1252
|
__decorate([state()], PlotHistogram.prototype, "_height", void 0);
|
|
1126
1253
|
__decorate([state()], PlotHistogram.prototype, "_hoveredIndex", void 0);
|
|
1127
1254
|
__decorate([state()], PlotHistogram.prototype, "_inlineOverlayText", void 0);
|
|
1255
|
+
__decorate([state()], PlotHistogram.prototype, "_coloredRangeMin", void 0);
|
|
1256
|
+
__decorate([state()], PlotHistogram.prototype, "_coloredRangeMax", void 0);
|
|
1257
|
+
__decorate([state()], PlotHistogram.prototype, "_selectionStart", void 0);
|
|
1258
|
+
__decorate([state()], PlotHistogram.prototype, "_selectionEnd", void 0);
|
|
1259
|
+
__decorate([state()], PlotHistogram.prototype, "_isDragging", void 0);
|
|
1260
|
+
__decorate([state()], PlotHistogram.prototype, "_selectionOverlayText", void 0);
|
|
1128
1261
|
PlotHistogram = __decorate([safeCustomElement(`ixfx-plot-histogram`)], PlotHistogram);
|
|
1129
1262
|
//#endregion
|
|
1130
1263
|
//#region src/plots/single-axis.ts
|
|
@@ -1846,4 +1979,4 @@ PlotXyAxis = __decorate([safeCustomElement(`ixfx-plot-xy-axis`)], PlotXyAxis);
|
|
|
1846
1979
|
//#endregion
|
|
1847
1980
|
export { TooltipElement as a, computeColour as c, PlotMultiAxis as i, parseColourScaleAttr as l, PlotSingleAxis as n, PlotDataSeries as o, PlotHistogram as r, applyAgeModification as s, PlotXyAxis as t, readBaseColour as u };
|
|
1848
1981
|
|
|
1849
|
-
//# sourceMappingURL=xy-axis-
|
|
1982
|
+
//# sourceMappingURL=xy-axis-DzM1brBZ.js.map
|