@arcgis/common-components 5.2.0-next.11 → 5.2.0-next.111
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/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/cdn/{L2JNUMXB.js → 3UH3ZOZB.js} +1 -1
- package/dist/cdn/475SP47T.js +2 -0
- package/dist/cdn/{4W7JZPB6.js → 4JMH3KRC.js} +1 -1
- package/dist/cdn/{VQLI4IE7.js → 4LO2YSUJ.js} +1 -1
- package/dist/cdn/4TZVXSQZ.js +2 -0
- package/dist/cdn/56HK5TL6.js +2 -0
- package/dist/cdn/5IM4X2GT.js +2 -0
- package/dist/cdn/6HBX6QDQ.js +2 -0
- package/dist/cdn/{OBIWQRXY.js → 73ETIJP2.js} +1 -1
- package/dist/cdn/7EP7KDAN.js +2 -0
- package/dist/cdn/7YNFXAZI.js +2 -0
- package/dist/cdn/{GVOQ2CB7.js → AWK4HGJV.js} +1 -1
- package/dist/cdn/DG5IVKVO.js +2 -0
- package/dist/cdn/{5KS7T5BY.js → DRV7OKQT.js} +1 -1
- package/dist/cdn/EA5M73N4.js +2 -0
- package/dist/cdn/EPTZSQ77.js +2 -0
- package/dist/cdn/{3P53QRGS.js → G2LLGGQQ.js} +1 -1
- package/dist/cdn/{XRARFMJ7.js → GQ2PO4L4.js} +1 -1
- package/dist/cdn/GSQIARZL.js +2 -0
- package/dist/cdn/HJZA4ZUL.js +2 -0
- package/dist/cdn/I7CTLPWD.js +2 -0
- package/dist/cdn/{LKUOAV7B.js → ICJXMKTL.js} +1 -1
- package/dist/cdn/{L5RMOAO3.js → J6ZKTXN7.js} +1 -1
- package/dist/cdn/KMYFQIQ7.js +2 -0
- package/dist/cdn/L7XGWJZF.js +2 -0
- package/dist/cdn/LAQNGXPG.js +2 -0
- package/dist/cdn/ND7AQ3X6.js +2 -0
- package/dist/cdn/NNNE4T7L.js +2 -0
- package/dist/cdn/O4H2JR53.js +2 -0
- package/dist/cdn/{3V5M7OHL.js → OSOV6LK3.js} +3 -3
- package/dist/cdn/PMV2N3L3.js +2 -0
- package/dist/cdn/{MCZBUYS5.js → PQG3COJ4.js} +1 -1
- package/dist/cdn/PSVNG2MS.js +2 -0
- package/dist/cdn/PUNWW4GY.js +2 -0
- package/dist/cdn/PWYFUIF6.js +4 -0
- package/dist/cdn/Q3AMPMQV.js +2 -0
- package/dist/cdn/{WEKRF34E.js → QWRE6ILV.js} +1 -1
- package/dist/cdn/RC2HNFFD.js +2 -0
- package/dist/cdn/{JLPZ3OR2.js → SKLYKTDC.js} +1 -1
- package/dist/cdn/TKCEZXLC.js +2 -0
- package/dist/cdn/TWW63D32.js +2 -0
- package/dist/cdn/XMGOCO2S.js +2 -0
- package/dist/cdn/Z5QBBHLD.js +2 -0
- package/dist/cdn/{N7C4DINF.js → Z5SIZJN5.js} +1 -1
- package/dist/cdn/ZMZH3Z5A.js +2 -0
- package/dist/cdn/assets/field-pick-list/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/slider-field/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/slider-histogram-range/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/element-reference-controller.js +19 -0
- package/dist/chunks/layer-utils.js +52 -40
- package/dist/chunks/locale.js +14 -6
- package/dist/chunks/strategies.js +287 -0
- package/dist/chunks/toolbar.js +9 -0
- package/dist/chunks/types.js +16 -0
- package/dist/chunks/utils.js +59 -0
- package/dist/chunks/utils2.js +20 -0
- package/dist/chunks/utils3.js +7 -0
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +23 -0
- package/dist/components/arcgis-ckeditor5/customElement.js +2 -2
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
- package/dist/components/arcgis-color-input/customElement.d.ts +2 -1
- package/dist/components/arcgis-color-input/customElement.js +1 -1
- package/dist/components/arcgis-coordinate-system-picker/customElement.d.ts +23 -0
- package/dist/components/arcgis-coordinate-system-picker/customElement.js +1 -1
- package/dist/components/arcgis-field-info/customElement.d.ts +1 -1
- package/dist/components/arcgis-field-info/customElement.js +248 -225
- package/dist/components/arcgis-field-info/index.js +1 -0
- package/dist/components/arcgis-field-info/utils/basic.d.ts +3 -1
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +15 -12
- package/dist/components/arcgis-field-pick-list/customElement.js +205 -122
- package/dist/components/arcgis-field-pick-list/index.js +4 -3
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +3 -1
- package/dist/components/arcgis-histogram/customElement.d.ts +39 -2
- package/dist/components/arcgis-histogram/customElement.js +105 -90
- package/dist/components/arcgis-label-input/customElement.js +18 -14
- package/dist/components/arcgis-slider/customElement.d.ts +11 -3
- package/dist/components/arcgis-slider/customElement.js +371 -348
- package/dist/components/arcgis-slider-field/customElement.d.ts +298 -0
- package/dist/components/arcgis-slider-field/customElement.js +96 -0
- package/dist/components/arcgis-slider-field/index.d.ts +1 -0
- package/dist/components/arcgis-slider-field/index.js +2 -0
- package/dist/components/arcgis-slider-histogram-range/customElement.d.ts +390 -0
- package/dist/components/arcgis-slider-histogram-range/customElement.js +120 -0
- package/dist/components/arcgis-slider-histogram-range/index.d.ts +1 -0
- package/dist/components/arcgis-slider-histogram-range/index.js +3 -0
- package/dist/components/arcgis-slider-histogram-range/types.d.ts +6 -0
- package/dist/components/arcgis-ticks/customElement.d.ts +11 -3
- package/dist/components/arcgis-ticks/customElement.js +100 -79
- package/dist/components/arcgis-toolbar/customElement.d.ts +67 -0
- package/dist/components/arcgis-toolbar/customElement.js +108 -0
- package/dist/components/arcgis-toolbar/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar/index.js +2 -0
- package/dist/components/arcgis-toolbar/types.d.ts +41 -0
- package/dist/components/arcgis-toolbar-action/customElement.d.ts +97 -0
- package/dist/components/arcgis-toolbar-action/customElement.js +52 -0
- package/dist/components/arcgis-toolbar-action/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-action/index.js +3 -0
- package/dist/components/arcgis-toolbar-group/customElement.d.ts +38 -0
- package/dist/components/arcgis-toolbar-group/customElement.js +48 -0
- package/dist/components/arcgis-toolbar-group/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-group/index.js +2 -0
- package/dist/components/arcgis-toolbar-item/customElement.d.ts +83 -0
- package/dist/components/arcgis-toolbar-item/customElement.js +42 -0
- package/dist/components/arcgis-toolbar-item/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-item/index.js +4 -0
- package/dist/components/arcgis-toolbar-more-button/customElement.d.ts +52 -0
- package/dist/components/arcgis-toolbar-more-button/customElement.js +68 -0
- package/dist/components/arcgis-toolbar-more-button/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-more-button/index.js +6 -0
- package/dist/components/arcgis-toolbar-split-button/customElement.d.ts +51 -0
- package/dist/components/arcgis-toolbar-split-button/customElement.js +67 -0
- package/dist/components/arcgis-toolbar-split-button/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-split-button/index.js +6 -0
- package/dist/components/arcgis-toolbar-stack/customElement.d.ts +48 -0
- package/dist/components/arcgis-toolbar-stack/customElement.js +174 -0
- package/dist/components/arcgis-toolbar-stack/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-stack/index.js +1 -0
- package/dist/components/arcgis-unique-values-list/customElement.js +115 -95
- package/dist/components/arcgis-value-picker/customElement.js +5 -5
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +62 -0
- package/dist/index.js +2 -0
- package/dist/loader.js +13 -4
- package/dist/types/lumina.d.ts +58 -2
- package/dist/types/preact.d.ts +67 -2
- package/dist/types/react.d.ts +76 -2
- package/dist/types/stencil.d.ts +60 -4
- package/dist/utils/types.d.ts +14 -1
- package/package.json +6 -6
- package/dist/cdn/2XA6O2MP.js +0 -2
- package/dist/cdn/4BJYJUMR.js +0 -2
- package/dist/cdn/5U5NQ3F5.js +0 -2
- package/dist/cdn/77HZGUSC.js +0 -2
- package/dist/cdn/A3CISHRB.js +0 -2
- package/dist/cdn/AFBKMYU6.js +0 -4
- package/dist/cdn/IUJ4ILLQ.js +0 -2
- package/dist/cdn/JPD7Z3MB.js +0 -2
- package/dist/cdn/LB7I345F.js +0 -2
- package/dist/cdn/LBD3GPSD.js +0 -2
- package/dist/cdn/MCH3WQ4X.js +0 -2
- package/dist/cdn/NKMDS2IH.js +0 -2
- package/dist/cdn/PSITQBDP.js +0 -2
- package/dist/cdn/TXYPZ6MB.js +0 -2
- package/dist/cdn/WLYFLEI6.js +0 -2
- package/dist/cdn/assets/coordinate-system-picker/t9n/messages.en-US.json +0 -1
- /package/dist/cdn/{ECNI2A4K.js → XEK22IDA.js} +0 -0
- /package/dist/chunks/{commonFunctions.js → general.js} +0 -0
|
@@ -17,10 +17,12 @@ import type SubtypeGroupLayer from "@arcgis/core/layers/SubtypeGroupLayer.js";
|
|
|
17
17
|
import type VoxelLayer from "@arcgis/core/layers/VoxelLayer.js";
|
|
18
18
|
import type WCSLayer from "@arcgis/core/layers/WCSLayer.js";
|
|
19
19
|
import type WFSLayer from "@arcgis/core/layers/WFSLayer.js";
|
|
20
|
+
import type DimensionFeatureLayer from "@arcgis/core/layers/DimensionFeatureLayer.js";
|
|
21
|
+
import type AnnotationFeatureLayer from "@arcgis/core/layers/AnnotationFeatureLayer.js";
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* All supported layer types
|
|
23
25
|
*
|
|
24
26
|
* @internal
|
|
25
27
|
*/
|
|
26
|
-
export type FieldPickListLayer = CatalogFootprintLayer | CatalogLayer | CSVLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | ImageryTileLayer | KnowledgeGraphSublayer | OGCFeatureLayer | OrientedImageryLayer | ParquetLayer | SceneLayer | StreamLayer | Sublayer | SubtypeGroupLayer | SubtypeSublayer | VoxelLayer | WCSLayer | WFSLayer;
|
|
28
|
+
export type FieldPickListLayer = AnnotationFeatureLayer | CatalogFootprintLayer | CatalogLayer | CSVLayer | DimensionFeatureLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | ImageryTileLayer | KnowledgeGraphSublayer | OGCFeatureLayer | OrientedImageryLayer | ParquetLayer | SceneLayer | StreamLayer | Sublayer | SubtypeGroupLayer | SubtypeSublayer | VoxelLayer | WCSLayer | WFSLayer;
|
|
@@ -4,6 +4,15 @@ import type { HistogramBin } from "@arcgis/core/smartMapping/statistics/types.js
|
|
|
4
4
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
5
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
6
|
|
|
7
|
+
declare module "@arcgis/lumina" {
|
|
8
|
+
export interface DeclareCssProperties {
|
|
9
|
+
/** Specifies the color of the histogram bars when the bin doesn't have a corresponding color stop. */
|
|
10
|
+
"--arcgis-histogram-bar-color": "*";
|
|
11
|
+
/** Specifies the default color for color stops. */
|
|
12
|
+
"--arcgis-histogram-stop-color": "*";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
/**
|
|
8
17
|
* Renders a histogram to visualize the spread of a dataset based on [bins](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-histogram/#bins) representing buckets, or sub-ranges, of
|
|
9
18
|
* data. Each [bin](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/types/#HistogramBin) is defined by a minimum and maximum value and a total count.
|
|
@@ -41,8 +50,6 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
41
50
|
*
|
|
42
51
|
* 
|
|
43
52
|
*
|
|
44
|
-
* @cssproperty [--arcgis-histogram-bar-color] - Specifies the color of the histogram bars when the bin doesn't have a corresponding color stop.
|
|
45
|
-
* @cssproperty [--arcgis-histogram-stop-color] - Specifies the default color for color stops.
|
|
46
53
|
* @see [histogram module](https://developers.arcgis.com/javascript/latest/references/core/smartMapping/statistics/histogram/)
|
|
47
54
|
* @see [Sample - Histogram component](https://developers.arcgis.com/javascript/latest/sample-code/histogram/)
|
|
48
55
|
* @since 5.0
|
|
@@ -188,6 +195,25 @@ export abstract class ArcgisHistogram extends LitElement {
|
|
|
188
195
|
accessor icon: string | undefined;
|
|
189
196
|
/** The component's default label. */
|
|
190
197
|
accessor label: string | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Allows customizing how the average and standard deviation line labels render on the histogram. Note that this property is only responsible
|
|
200
|
+
* for formatting the numeric value of the data line it represents, so the average and standard-deviation symbols are preserved regardless of
|
|
201
|
+
* whether it is set. Return `null` or `undefined` to use the default formatting.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```js
|
|
205
|
+
* histogram.labelFormatter = (value, type, defaultFormatter) => {
|
|
206
|
+
* if (type === "average") {
|
|
207
|
+
* return value + "%";
|
|
208
|
+
* }
|
|
209
|
+
*
|
|
210
|
+
* if (type === "standard-deviation") {
|
|
211
|
+
* return value.toFixed(2);
|
|
212
|
+
* }
|
|
213
|
+
* };
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
accessor labelFormatter: (value: number, type: "average" | "standard-deviation", defaultFormatter: (value: number) => string) => string | null | undefined;
|
|
191
217
|
/**
|
|
192
218
|
* Determines the orientation of the histogram.
|
|
193
219
|
*
|
|
@@ -255,4 +281,15 @@ export abstract class ArcgisHistogram extends LitElement {
|
|
|
255
281
|
* ```
|
|
256
282
|
*/
|
|
257
283
|
accessor standardDeviation: number | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* Indicates the number of standard deviation lines to render on the histogram from the [average](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-histogram/#average).
|
|
286
|
+
*
|
|
287
|
+
* @default 1
|
|
288
|
+
* @example
|
|
289
|
+
* ```js
|
|
290
|
+
* // Will render lines for +σ, +2σ, +3σ, and -σ, -2σ, -3σ
|
|
291
|
+
* histogram.standardDeviationCount = 3;
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
accessor standardDeviationCount: number;
|
|
258
295
|
}
|
|
@@ -2,59 +2,63 @@
|
|
|
2
2
|
import { c as M } from "../../chunks/runtime.js";
|
|
3
3
|
import { u as k } from "../../chunks/useT9n.js";
|
|
4
4
|
import { substitute as E } from "@arcgis/core/intl.js";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { css as
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
9
|
-
function S(t,
|
|
10
|
-
const [s, a] =
|
|
11
|
-
if (!t || a === 0 || s === 0 || n == null ||
|
|
5
|
+
import { LitElement as F, nothing as h, safeStyleMap as x, safeClassMap as I } from "@arcgis/lumina";
|
|
6
|
+
import { css as O, html as y, svg as d } from "lit";
|
|
7
|
+
import { a as R } from "../../chunks/locale.js";
|
|
8
|
+
const z = O`:host{display:block;--arcgis-histogram-bar-color: var(--calcite-color-border-1);--arcgis-histogram-stop-color: color-mix(in srgb, var(--calcite-color-brand) 80%, transparent)}.content{display:block;direction:ltr;width:100%;height:100%}.svg{display:block;width:100%;height:100%;overflow:visible}.data-line{stroke:#888;stroke-width:1px;shape-rendering:crispEdges}.average-data-line{stroke-width:1px;shape-rendering:crispEdges;stroke:#444}.label,.data-line-symbol{font-size:12px;stroke:#fff;stroke-width:2px;paint-order:stroke;unicode-bidi:plaintext}.data-line-symbol{font-family:"Georgia, serif",sans-serif;font-style:italic}`;
|
|
9
|
+
function S(t, i, n, e, r) {
|
|
10
|
+
const [s, a] = r;
|
|
11
|
+
if (!t || a === 0 || s === 0 || n == null || i == null)
|
|
12
12
|
return null;
|
|
13
|
-
const o = n -
|
|
13
|
+
const o = n - i, l = (t.length > 1 ? t[t.length - 1].maxValue - t[0].minValue : 0) / o, [u, g] = e === "vertical" ? [a * l, s] : [a, s * l], p = t ? t.map((m) => m.count) : [], f = Math.max(...p);
|
|
14
14
|
return t.map((m) => {
|
|
15
|
-
const [
|
|
16
|
-
return [_,
|
|
15
|
+
const [b, v] = e === "vertical" ? [u / t.length, f !== 0 ? m.count / f * g : 0] : [f !== 0 ? m.count / f * u : 0, g / t.length], { maxValue: C } = m, $ = n - C, [L, _] = e === "vertical" ? [0, $ * (a / o)] : [s - v - $ * (s / o), a - b];
|
|
16
|
+
return [L, _, v, b];
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function B(t,
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
function B(t, i, n, e, r, s) {
|
|
20
|
+
if (e === void 0 || r === void 0)
|
|
21
|
+
return [];
|
|
22
|
+
const a = [];
|
|
23
|
+
return t != null && a.push({
|
|
22
24
|
value: t,
|
|
23
25
|
symbol: "x̄",
|
|
24
26
|
lineClass: "average-data-line"
|
|
25
|
-
}),
|
|
27
|
+
}), i != null && e != null && r != null && a.push(
|
|
28
|
+
...G(e, r, i, n, t)
|
|
29
|
+
), s && a.push(...s), a.filter(({ value: o }) => o >= e && o <= r);
|
|
26
30
|
}
|
|
27
|
-
function N(t,
|
|
31
|
+
function N(t, i, n, e, r) {
|
|
28
32
|
if (n == null)
|
|
29
33
|
return [0, 0, 0, 0];
|
|
30
|
-
const s = Math.round((
|
|
31
|
-
if (
|
|
32
|
-
let
|
|
33
|
-
return
|
|
34
|
+
const s = Math.round((r - n) / e * 100) / 100, [a, o] = t;
|
|
35
|
+
if (i === "vertical") {
|
|
36
|
+
let l = o - s * o || 1;
|
|
37
|
+
return l = Math.round(l) + 0.5, [0, "100%", l, l];
|
|
34
38
|
}
|
|
35
|
-
let
|
|
36
|
-
return
|
|
39
|
+
let c = s * a || 1;
|
|
40
|
+
return c = Math.round(c) + 0.5, [c, c, "100%", 0];
|
|
37
41
|
}
|
|
38
|
-
function P(t,
|
|
42
|
+
function P(t, i, n, e, r) {
|
|
39
43
|
if (n == null)
|
|
40
44
|
return [0, 0];
|
|
41
|
-
const s = Math.round((
|
|
42
|
-
return
|
|
45
|
+
const s = Math.round((r - n) / e * 100) / 100, [a, o] = t;
|
|
46
|
+
return i === "vertical" ? [a, o - s * o] : [0, s * a];
|
|
43
47
|
}
|
|
44
|
-
function T(t,
|
|
48
|
+
function T(t, i, n) {
|
|
45
49
|
if (!t || t.length === 0)
|
|
46
50
|
return null;
|
|
47
|
-
if (
|
|
48
|
-
const e = t.map((
|
|
49
|
-
...
|
|
50
|
-
color: w(
|
|
51
|
+
if (V(t)) {
|
|
52
|
+
const e = t.map((r) => ({
|
|
53
|
+
...r,
|
|
54
|
+
color: w(r.color ?? n)
|
|
51
55
|
}));
|
|
52
56
|
return e.unshift({
|
|
53
|
-
color:
|
|
57
|
+
color: i,
|
|
54
58
|
minValue: Number.NEGATIVE_INFINITY,
|
|
55
59
|
maxValue: e[0].minValue
|
|
56
60
|
}), e.push({
|
|
57
|
-
color:
|
|
61
|
+
color: i,
|
|
58
62
|
minValue: e[e.length - 1].maxValue,
|
|
59
63
|
maxValue: Number.POSITIVE_INFINITY
|
|
60
64
|
}), e;
|
|
@@ -64,45 +68,45 @@ function T(t, r, n) {
|
|
|
64
68
|
color: w(e.color ?? n)
|
|
65
69
|
}));
|
|
66
70
|
}
|
|
67
|
-
function A(t,
|
|
71
|
+
function A(t, i, n, e) {
|
|
68
72
|
if (!t || t.length === 0)
|
|
69
73
|
return n;
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
74
|
+
if (V(t)) {
|
|
75
|
+
const r = H(t, i);
|
|
76
|
+
if (r.length === 0)
|
|
73
77
|
return n;
|
|
74
78
|
if (e) {
|
|
75
|
-
const { color: s = n, weight: a } =
|
|
76
|
-
return `color-mix(in srgb, ${s} ${a /
|
|
79
|
+
const { color: s = n, weight: a } = r[0], { color: o = n, weight: c } = r[1] ?? r[0], l = a + c;
|
|
80
|
+
return `color-mix(in srgb, ${s} ${a / l * 100}%, ${o} ${c / l * 100}%)`;
|
|
77
81
|
}
|
|
78
|
-
return
|
|
82
|
+
return r[0].color ?? n;
|
|
79
83
|
}
|
|
80
|
-
return W(t,
|
|
84
|
+
return W(t, i);
|
|
81
85
|
}
|
|
82
|
-
function H(t,
|
|
86
|
+
function H(t, i) {
|
|
83
87
|
const n = [];
|
|
84
88
|
for (const e of t) {
|
|
85
|
-
const
|
|
86
|
-
|
|
89
|
+
const r = Math.max(0, Math.min(i.maxValue, e.maxValue) - Math.max(i.minValue, e.minValue));
|
|
90
|
+
r > 0 && n.push({ color: e.color, weight: r });
|
|
87
91
|
}
|
|
88
|
-
return n.sort((e,
|
|
92
|
+
return n.sort((e, r) => r.weight - e.weight);
|
|
89
93
|
}
|
|
90
|
-
function W(t,
|
|
91
|
-
const n = (
|
|
94
|
+
function W(t, i) {
|
|
95
|
+
const n = (i.maxValue - i.minValue) / 2 + i.minValue;
|
|
92
96
|
if (n > t[t.length - 1].value)
|
|
93
97
|
return t[t.length - 1].color;
|
|
94
98
|
for (let e = 0; e < t.length - 1; e++) {
|
|
95
|
-
const
|
|
96
|
-
if (n <=
|
|
97
|
-
return
|
|
99
|
+
const r = t[e], s = t[e + 1];
|
|
100
|
+
if (n <= r.value)
|
|
101
|
+
return r.color;
|
|
98
102
|
if (n < s.value) {
|
|
99
|
-
const a = (n -
|
|
100
|
-
return `color-mix(in srgb, ${
|
|
103
|
+
const a = (n - r.value) / (s.value - r.value) * 100;
|
|
104
|
+
return `color-mix(in srgb, ${r.color}, ${s.color} ${a}%)`;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
return t[t.length - 1].color;
|
|
104
108
|
}
|
|
105
|
-
function
|
|
109
|
+
function V(t) {
|
|
106
110
|
return t[0] != null && "minValue" in t[0];
|
|
107
111
|
}
|
|
108
112
|
function w(t) {
|
|
@@ -110,76 +114,87 @@ function w(t) {
|
|
|
110
114
|
return t;
|
|
111
115
|
if (Array.isArray(t))
|
|
112
116
|
return `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3] ?? 1})`;
|
|
113
|
-
const { r, g: n, b: e, a:
|
|
114
|
-
return `rgba(${
|
|
117
|
+
const { r: i, g: n, b: e, a: r = 1 } = t;
|
|
118
|
+
return `rgba(${i}, ${n}, ${e}, ${r})`;
|
|
115
119
|
}
|
|
116
|
-
function G(t,
|
|
117
|
-
const
|
|
118
|
-
return Y(n, e
|
|
119
|
-
const l =
|
|
120
|
+
function G(t, i, n, e, r) {
|
|
121
|
+
const s = 0.06 * (i - t);
|
|
122
|
+
return Y(n, e, r).map((a, o, c) => {
|
|
123
|
+
const l = c.length / 2, u = a > r ? "+" : "-", g = o >= l ? o - l + 1 : l - o;
|
|
120
124
|
return {
|
|
121
|
-
symbol: `${
|
|
122
|
-
value:
|
|
125
|
+
symbol: `${u}${g === 1 ? "" : g}σ`,
|
|
126
|
+
value: a
|
|
123
127
|
};
|
|
124
|
-
});
|
|
128
|
+
}).filter(({ value: a }) => Math.abs(r - a) > s);
|
|
125
129
|
}
|
|
126
|
-
function Y(t,
|
|
127
|
-
if (
|
|
130
|
+
function Y(t, i, n) {
|
|
131
|
+
if (n == null || t == null)
|
|
128
132
|
return [];
|
|
129
|
-
const
|
|
130
|
-
for (let
|
|
131
|
-
|
|
132
|
-
return
|
|
133
|
+
const e = i, r = [];
|
|
134
|
+
for (let s = e * -1; s <= e; s++)
|
|
135
|
+
s !== 0 && r.push(n + s * t);
|
|
136
|
+
return r;
|
|
133
137
|
}
|
|
134
|
-
const
|
|
135
|
-
class j extends
|
|
138
|
+
const D = "var(--arcgis-histogram-bar-color)", U = "var(--arcgis-histogram-stop-color)";
|
|
139
|
+
class j extends F {
|
|
136
140
|
constructor() {
|
|
137
|
-
super(...arguments), this._messages = k(), this._normalizedStops = null, this
|
|
141
|
+
super(...arguments), this._messages = k(), this._normalizedStops = null, this.#t = (i, n) => {
|
|
142
|
+
const e = (r) => R(this._messages._lang, this._numberFormatterOptions).format(r);
|
|
143
|
+
return this.labelFormatter?.(i, n, e) ?? e(i);
|
|
144
|
+
}, this._numberFormatterOptions = {
|
|
138
145
|
maximumFractionDigits: 2
|
|
139
|
-
}, this.containerDimensions = [0, 0], this.icon = "graph-histogram", this.layout = "horizontal", this.colorBlendingEnabled = !1;
|
|
146
|
+
}, this.containerDimensions = [0, 0], this.icon = "graph-histogram", this.layout = "horizontal", this.colorBlendingEnabled = !1, this.standardDeviationCount = 1;
|
|
140
147
|
}
|
|
141
148
|
static {
|
|
142
|
-
this.properties = { containerDimensions: 16, colorStops: 0, icon: 3, average: 11, messageOverrides: 0, standardDeviation: 11, bins: 0, dataLines: 0, label: 1, layout: 3, max: 11, min: 11, colorBlendingEnabled: 5 };
|
|
149
|
+
this.properties = { containerDimensions: 16, colorStops: 0, icon: 3, labelFormatter: 0, average: 11, messageOverrides: 0, standardDeviation: 11, bins: 0, dataLines: 0, label: 1, layout: 3, max: 11, min: 11, colorBlendingEnabled: 5, standardDeviationCount: 9 };
|
|
143
150
|
}
|
|
144
151
|
static {
|
|
145
|
-
this.styles =
|
|
152
|
+
this.styles = z;
|
|
146
153
|
}
|
|
154
|
+
#t;
|
|
147
155
|
loaded() {
|
|
148
|
-
const
|
|
149
|
-
for (const s of
|
|
156
|
+
const i = new ResizeObserver((r) => {
|
|
157
|
+
for (const s of r) {
|
|
150
158
|
const { width: a, height: o } = s.contentRect;
|
|
151
159
|
this.containerDimensions = [a, o];
|
|
152
160
|
}
|
|
153
161
|
}), { width: n, height: e } = this.el.getBoundingClientRect();
|
|
154
|
-
this.containerDimensions = [n, e],
|
|
162
|
+
this.containerDimensions = [n, e], i.observe(this.el);
|
|
155
163
|
}
|
|
156
|
-
willUpdate(
|
|
157
|
-
|
|
164
|
+
willUpdate(i) {
|
|
165
|
+
i.has("colorStops") && (this._normalizedStops = T(this.colorStops, D, U));
|
|
158
166
|
}
|
|
159
167
|
render() {
|
|
160
|
-
const { label:
|
|
161
|
-
return y`<div role=img .ariaLabel=${
|
|
168
|
+
const { label: i } = this;
|
|
169
|
+
return y`<div role=img .ariaLabel=${i ?? void 0} class="content">${this._renderContent()}</div>`;
|
|
162
170
|
}
|
|
163
171
|
_renderContent() {
|
|
164
|
-
const { containerDimensions: [
|
|
165
|
-
|
|
172
|
+
const { containerDimensions: [i, n] } = this, e = "bg-fill", r = i ? [
|
|
173
|
+
d`<defs><clipPath id=${e}><rect height=${n ?? h} width=${i ?? h} x=0 y=0 /></clipPath></defs>`,
|
|
174
|
+
d`<g style=${x({ clipPath: `url(#${e})` })}><g>${this._renderBars()}</g></g>`,
|
|
175
|
+
d`<g>${this._renderLines()}</g>`
|
|
176
|
+
] : [];
|
|
177
|
+
return y`<svg class="svg" xmlns=http://www.w3.org/2000/svg>${r}</svg>`;
|
|
166
178
|
}
|
|
167
179
|
_renderBars() {
|
|
168
|
-
const { bins:
|
|
169
|
-
return !e || !
|
|
170
|
-
const [a, o,
|
|
171
|
-
return
|
|
172
|
-
fill: A(this._normalizedStops, u,
|
|
173
|
-
})} .ariaLabel=${g} data-index=${s ?? h} height=${
|
|
180
|
+
const { bins: i, _messages: n } = this, e = S(this.bins, this.min, this.max, this.layout, this.containerDimensions);
|
|
181
|
+
return !e || !i ? null : e.map((r, s) => {
|
|
182
|
+
const [a, o, c, l] = r, u = i[s], g = n?.barLabel ? E(n.barLabel, u) : "";
|
|
183
|
+
return d`<rect style=${x({
|
|
184
|
+
fill: A(this._normalizedStops, u, D, this.colorBlendingEnabled)
|
|
185
|
+
})} .ariaLabel=${g} data-index=${s ?? h} height=${l ?? h} role=img shape-rendering=crispEdges stroke-width=0 width=${c ?? h} x=${a ?? h} y=${o ?? h} />`;
|
|
174
186
|
});
|
|
175
187
|
}
|
|
176
188
|
_renderLines() {
|
|
177
|
-
return B(this.average, this.standardDeviation, this.min, this.max, this.dataLines)?.map((n) => q({ dataLine: n, containerDimensions: this.containerDimensions, layout: this.layout, min: this.min, max: this.max, labelFormatter: this
|
|
189
|
+
return B(this.average, this.standardDeviation, this.standardDeviationCount, this.min, this.max, this.dataLines)?.map((n) => q({ dataLine: n, containerDimensions: this.containerDimensions, layout: this.layout, min: this.min, max: this.max, labelFormatter: this.#t }));
|
|
178
190
|
}
|
|
179
191
|
}
|
|
180
192
|
const q = (t) => {
|
|
181
|
-
const { containerDimensions:
|
|
182
|
-
|
|
193
|
+
const { containerDimensions: i, layout: n, min: e, max: r, dataLine: s, labelFormatter: a } = t, o = r != null && e != null ? r - e : 0, [c, l, u, g] = N(i, n, e, o, s.value), [p, f] = P(i, n, e, o, s.value), m = "symbol" in s ? [
|
|
194
|
+
d`<tspan class="data-line-symbol">${s.symbol}</tspan>`,
|
|
195
|
+
d`<tspan>${a(s.value, s.lineClass === "average-data-line" ? "average" : "standard-deviation")}</tspan>`
|
|
196
|
+
] : s.label, b = "lineClass" in s && s.lineClass ? s.lineClass : "data-line";
|
|
197
|
+
return d`<g><title>${s.value}</title><line class=${I(b)} shape-rendering=crispEdges x1=${c ?? h} x2=${l ?? h} y1=${u ?? h} y2=${g ?? h} /><text class="label" text-anchor=end transform=${(n === "horizontal" ? "rotate(270)" : void 0) ?? h} x=${p ?? h} y=${f - 2}>${m}</text></g>`;
|
|
183
198
|
};
|
|
184
199
|
M("arcgis-histogram", j);
|
|
185
200
|
export {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { formatNumber as
|
|
4
|
-
import { LitElement as
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { formatNumber as o } from "@arcgis/core/intl.js";
|
|
4
|
+
import { LitElement as u, createEvent as c, safeClassMap as h } from "@arcgis/lumina";
|
|
5
|
+
import { useWatchAttributes as d } from "@arcgis/lumina/controllers";
|
|
5
6
|
import { createRef as s, ref as l } from "lit/directives/ref.js";
|
|
6
|
-
import { css as p, html as
|
|
7
|
+
import { css as p, html as a } from "lit";
|
|
7
8
|
const m = p`:host{display:block}:host([hidden]){display:none}.content{display:flex;flex-direction:column}.readOnlyLabel{display:block;font-size:var(--calcite-font-size-sm);font-variant-numeric:tabular-nums;line-height:var(--calcite-font-line-height-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:.5rem;padding-block:3px;border-color:var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px);color:var(--calcite-color-text-1)}:host(:not([read-only])) .readOnlyLabel{position:absolute;opacity:0}:host([alignment="start"]){.content{align-items:start}.readOnlyLabel{text-align:start}}:host([alignment="end"]){.content{align-items:end}.readOnlyLabel{text-align:end}}:host([alignment="center"]){.content{align-items:center}.readOnlyLabel{text-align:center}}calcite-button{inline-size:100%;--calcite-offset-invert-focus: 1;--calcite-internal-animation-timing-fast: 0}calcite-input-number{inline-size:100%;--calcite-internal-animation-timing-fast: 0}`;
|
|
8
|
-
class f extends
|
|
9
|
+
class f extends u {
|
|
9
10
|
constructor() {
|
|
10
|
-
super(
|
|
11
|
+
super(), this._buttonRef = s(), this._inputRef = s(), this._labelRef = s(), this._formatOptions = {
|
|
11
12
|
style: "decimal",
|
|
12
13
|
useGrouping: !0,
|
|
13
14
|
minimumFractionDigits: 0,
|
|
14
15
|
maximumFractionDigits: 2
|
|
15
|
-
}, this._formatValue = (t) =>
|
|
16
|
+
}, this._formatValue = (t) => o(t, this._formatOptions), this._pointerDownPosition = null, this._displayedValue = "", this._editing = !1, this.alignment = "center", this.readOnly = !1, this.value = 0, this.arcgisChange = c({ cancelable: !1 }), d(["hidden"], () => this.requestUpdate());
|
|
16
17
|
}
|
|
17
18
|
static {
|
|
18
19
|
this.properties = { _displayedValue: 16, _editing: 16, alignment: 3, editing: 39, labelFormatter: 0, readOnly: 7, value: 11 };
|
|
@@ -39,10 +40,13 @@ class f extends c {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
updated(t) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
this.#t();
|
|
44
|
+
}
|
|
45
|
+
#t() {
|
|
46
|
+
const t = this._inputRef.value, e = this._buttonRef.value, i = this.renderRoot.querySelector(".readOnlyLabel");
|
|
47
|
+
if (t && e && i) {
|
|
48
|
+
const n = i.offsetWidth;
|
|
49
|
+
n > 0 && (e.style.width = `${n}px`, t.style.width = `${n}px`);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
_enterEdit() {
|
|
@@ -103,14 +107,14 @@ class f extends c {
|
|
|
103
107
|
}
|
|
104
108
|
render() {
|
|
105
109
|
const { alignment: t, _displayedValue: e } = this, i = [
|
|
106
|
-
|
|
110
|
+
a`<span class="readOnlyLabel"><span ${l(this._labelRef)}>${e}</span></span>`
|
|
107
111
|
];
|
|
108
|
-
return this.readOnly || i.push(
|
|
112
|
+
return this.readOnly || i.push(a`<calcite-button .alignment=${t} appearance=transparent .hidden=${this._editing} kind=neutral @pointerdown=${this._onPointerDown} @click=${this._onClick} scale=s width=full ${l(this._buttonRef)}>${e}</calcite-button>`, a`<calcite-input-number .alignment=${t} group-separator .hidden=${!this._editing} number-button-type=none @calciteInputNumberChange=${this._onValueChange} @keydown=${this._onKeyDown} @blur=${this._onBlur} @input=${this._onInput} scale=s status=idle .value=${`${this.value}`} ${l(this._inputRef)}></calcite-input-number>`), a`<div class=${h({
|
|
109
113
|
content: !0
|
|
110
114
|
})}>${i}</div>`;
|
|
111
115
|
}
|
|
112
116
|
}
|
|
113
|
-
|
|
117
|
+
r("arcgis-label-input", f);
|
|
114
118
|
export {
|
|
115
119
|
f as ArcgisLabelInput
|
|
116
120
|
};
|
|
@@ -74,12 +74,13 @@ export abstract class ArcgisSlider extends LitElement {
|
|
|
74
74
|
*/
|
|
75
75
|
accessor disabled: boolean;
|
|
76
76
|
/**
|
|
77
|
-
* Controls where the filled segment is displayed on the track
|
|
78
|
-
*
|
|
77
|
+
* Controls where the filled segment is displayed on the track. Single-thumb sliders may only display the fill on the `start` or `end` segments, which
|
|
78
|
+
* represent the range of values up to, and range of values past the slider thumb. Range sliders with two or more thumbs may only display
|
|
79
|
+
* the fill on the `between` or `not-between` segments, which represent the range between the min and max thumbs, and the range outside the min and max thumbs.
|
|
79
80
|
*
|
|
80
81
|
* @default "start"
|
|
81
82
|
*/
|
|
82
|
-
accessor fillPlacement: "end" | "none" | "start";
|
|
83
|
+
accessor fillPlacement: "between" | "end" | "none" | "not-between" | "start";
|
|
83
84
|
/**
|
|
84
85
|
* Sets the maximum value of the slider's displayed range.
|
|
85
86
|
* When specified, the slider track is scaled from [fullRangeMin](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#fullRangeMin) to `fullRangeMax`, while
|
|
@@ -214,6 +215,13 @@ export abstract class ArcgisSlider extends LitElement {
|
|
|
214
215
|
* @see [layout](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#layout)
|
|
215
216
|
*/
|
|
216
217
|
accessor mirrored: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Determines whether the popover should always render over the most recently active thumb or range segment,
|
|
220
|
+
* or only while that thumb or range segment is active.
|
|
221
|
+
*
|
|
222
|
+
* @default "auto"
|
|
223
|
+
*/
|
|
224
|
+
accessor popoverDisplay: "always" | "auto";
|
|
217
225
|
/**
|
|
218
226
|
* The accessible label for the popover. This label is used by assistive technologies and does not affect the visible UI.
|
|
219
227
|
*
|