@vitessce/layer-controller 4.0.7 → 4.0.9
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/dist/{deflate-Boj6T2f8.js → deflate-DeIPeSHQ.js} +1 -1
- package/dist/{index-imWYvgCt.js → index-Byo5sRvW.js} +1341 -93
- package/dist/index.js +1 -1
- package/dist/{jpeg-qEHhnFxg.js → jpeg-wF_G-80a.js} +1 -1
- package/dist/{lerc-CxsPWOpO.js → lerc-CkBQzVHv.js} +1 -1
- package/dist/{lzw-BUiQlht2.js → lzw-Yu0h4Mbz.js} +1 -1
- package/dist/{packbits-Csx0O27a.js → packbits-DWEcy2Ta.js} +1 -1
- package/dist/{raw-CFxI_WvJ.js → raw-C8diIxIM.js} +1 -1
- package/dist/{webimage-BldO2DMp.js → webimage-DrxIJlKv.js} +1 -1
- package/package.json +7 -7
|
@@ -8312,7 +8312,7 @@ var values = Object.values || function(obj) {
|
|
|
8312
8312
|
return obj[k];
|
|
8313
8313
|
});
|
|
8314
8314
|
};
|
|
8315
|
-
var defaultProps$
|
|
8315
|
+
var defaultProps$Q = {
|
|
8316
8316
|
component: "div",
|
|
8317
8317
|
childFactory: function childFactory(child) {
|
|
8318
8318
|
return child;
|
|
@@ -8439,7 +8439,7 @@ TransitionGroup.propTypes = {
|
|
|
8439
8439
|
*/
|
|
8440
8440
|
childFactory: PropTypes.func
|
|
8441
8441
|
};
|
|
8442
|
-
TransitionGroup.defaultProps = defaultProps$
|
|
8442
|
+
TransitionGroup.defaultProps = defaultProps$Q;
|
|
8443
8443
|
const UNINITIALIZED = {};
|
|
8444
8444
|
function useLazyRef(init2, initArg) {
|
|
8445
8445
|
const ref = React.useRef(UNINITIALIZED);
|
|
@@ -21408,7 +21408,9 @@ const ViewType = {
|
|
|
21408
21408
|
DUAL_SCATTERPLOT: "dualScatterplot",
|
|
21409
21409
|
TREEMAP: "treemap",
|
|
21410
21410
|
SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
|
|
21411
|
-
FEATURE_STATS_TABLE: "featureStatsTable"
|
|
21411
|
+
FEATURE_STATS_TABLE: "featureStatsTable",
|
|
21412
|
+
SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector",
|
|
21413
|
+
ANNOTATION_CONTROLLER: "annotationController"
|
|
21412
21414
|
};
|
|
21413
21415
|
const CoordinationType = {
|
|
21414
21416
|
META_COORDINATION_SCOPES: "metaCoordinationScopes",
|
|
@@ -21555,7 +21557,15 @@ const CoordinationType = {
|
|
|
21555
21557
|
FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
|
|
21556
21558
|
FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
|
|
21557
21559
|
// Treemap
|
|
21558
|
-
HIERARCHY_LEVELS: "hierarchyLevels"
|
|
21560
|
+
HIERARCHY_LEVELS: "hierarchyLevels",
|
|
21561
|
+
// Annotation frames
|
|
21562
|
+
ANNOTATION_STORY: "annotationStory",
|
|
21563
|
+
ANNOTATION_FRAME_INDEX: "annotationFrameIndex",
|
|
21564
|
+
ANNOTATION_SHAPES: "annotationShapes",
|
|
21565
|
+
ANNOTATION_OVERLAY_VISIBLE: "annotationOverlayVisible",
|
|
21566
|
+
ANNOTATION_TRANSITION_DURATION: "annotationTransitionDuration",
|
|
21567
|
+
ANNOTATION_SEMANTIC_ZOOM: "annotationSemanticZoom",
|
|
21568
|
+
ANNOTATION_EDITABLE: "annotationEditable"
|
|
21559
21569
|
};
|
|
21560
21570
|
const ViewHelpMapping = {
|
|
21561
21571
|
LAYER_CONTROLLER: "The spatial layer controller provides an interface for manipulating the visualization layers displayed in the spatial view."
|
|
@@ -21650,7 +21660,14 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
21650
21660
|
CoordinationType.EMBEDDING_CONTOURS_FILLED,
|
|
21651
21661
|
CoordinationType.EMBEDDING_CONTOUR_PERCENTILES,
|
|
21652
21662
|
CoordinationType.CONTOUR_COLOR_ENCODING,
|
|
21653
|
-
CoordinationType.CONTOUR_COLOR
|
|
21663
|
+
CoordinationType.CONTOUR_COLOR,
|
|
21664
|
+
CoordinationType.ANNOTATION_STORY,
|
|
21665
|
+
CoordinationType.ANNOTATION_SHAPES,
|
|
21666
|
+
CoordinationType.ANNOTATION_FRAME_INDEX,
|
|
21667
|
+
CoordinationType.ANNOTATION_OVERLAY_VISIBLE,
|
|
21668
|
+
CoordinationType.ANNOTATION_TRANSITION_DURATION,
|
|
21669
|
+
CoordinationType.ANNOTATION_EDITABLE,
|
|
21670
|
+
CoordinationType.ANNOTATION_SEMANTIC_ZOOM
|
|
21654
21671
|
],
|
|
21655
21672
|
[ViewType.DUAL_SCATTERPLOT]: [
|
|
21656
21673
|
CoordinationType.DATASET,
|
|
@@ -21766,7 +21783,14 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
21766
21783
|
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
21767
21784
|
CoordinationType.MOLECULE_HIGHLIGHT,
|
|
21768
21785
|
CoordinationType.TOOLTIPS_VISIBLE,
|
|
21769
|
-
CoordinationType.PHOTOMETRIC_INTERPRETATION
|
|
21786
|
+
CoordinationType.PHOTOMETRIC_INTERPRETATION,
|
|
21787
|
+
CoordinationType.ANNOTATION_STORY,
|
|
21788
|
+
CoordinationType.ANNOTATION_SHAPES,
|
|
21789
|
+
CoordinationType.ANNOTATION_FRAME_INDEX,
|
|
21790
|
+
CoordinationType.ANNOTATION_OVERLAY_VISIBLE,
|
|
21791
|
+
CoordinationType.ANNOTATION_TRANSITION_DURATION,
|
|
21792
|
+
CoordinationType.ANNOTATION_EDITABLE,
|
|
21793
|
+
CoordinationType.ANNOTATION_SEMANTIC_ZOOM
|
|
21770
21794
|
],
|
|
21771
21795
|
[ViewType.SPATIAL_BETA]: [
|
|
21772
21796
|
CoordinationType.META_COORDINATION_SCOPES,
|
|
@@ -21844,7 +21868,27 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
21844
21868
|
CoordinationType.SPATIAL_CHANNEL_LABELS_ORIENTATION,
|
|
21845
21869
|
CoordinationType.SPATIAL_CHANNEL_LABEL_SIZE,
|
|
21846
21870
|
CoordinationType.SPATIAL_CHANNELS_SORT_ORDER,
|
|
21847
|
-
CoordinationType.PHOTOMETRIC_INTERPRETATION
|
|
21871
|
+
CoordinationType.PHOTOMETRIC_INTERPRETATION,
|
|
21872
|
+
CoordinationType.ANNOTATION_STORY,
|
|
21873
|
+
CoordinationType.ANNOTATION_SHAPES,
|
|
21874
|
+
CoordinationType.ANNOTATION_FRAME_INDEX,
|
|
21875
|
+
CoordinationType.ANNOTATION_OVERLAY_VISIBLE,
|
|
21876
|
+
CoordinationType.ANNOTATION_TRANSITION_DURATION,
|
|
21877
|
+
CoordinationType.ANNOTATION_EDITABLE,
|
|
21878
|
+
CoordinationType.ANNOTATION_SEMANTIC_ZOOM
|
|
21879
|
+
],
|
|
21880
|
+
[ViewType.ANNOTATION_CONTROLLER]: [
|
|
21881
|
+
CoordinationType.DATASET,
|
|
21882
|
+
CoordinationType.ANNOTATION_STORY,
|
|
21883
|
+
CoordinationType.ANNOTATION_FRAME_INDEX,
|
|
21884
|
+
CoordinationType.ANNOTATION_OVERLAY_VISIBLE,
|
|
21885
|
+
CoordinationType.ANNOTATION_TRANSITION_DURATION,
|
|
21886
|
+
CoordinationType.ANNOTATION_EDITABLE,
|
|
21887
|
+
CoordinationType.ANNOTATION_SEMANTIC_ZOOM
|
|
21888
|
+
// Note: the annotation controller also needs to read the coordination state
|
|
21889
|
+
// of all other views/coordination types via the full config.
|
|
21890
|
+
// Note: we get/set the CoordinationType.ANNOTATION_SHAPES from the full config,
|
|
21891
|
+
// as this info is view-specific rather than global to the story.
|
|
21848
21892
|
],
|
|
21849
21893
|
[ViewType.HEATMAP]: [
|
|
21850
21894
|
CoordinationType.DATASET,
|
|
@@ -22154,6 +22198,11 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
22154
22198
|
CoordinationType.FEATURE_POINT_FOLD_CHANGE_THRESHOLD,
|
|
22155
22199
|
CoordinationType.FEATURE_LABEL_FOLD_CHANGE_THRESHOLD
|
|
22156
22200
|
],
|
|
22201
|
+
[ViewType.SINGLE_OBS_SET_SELECTOR]: [
|
|
22202
|
+
CoordinationType.OBS_TYPE,
|
|
22203
|
+
CoordinationType.OBS_SET_COLOR,
|
|
22204
|
+
CoordinationType.OBS_SET_SELECTION
|
|
22205
|
+
],
|
|
22157
22206
|
[ViewType.OBS_SET_COMPOSITION_BAR_PLOT]: [
|
|
22158
22207
|
CoordinationType.DATASET,
|
|
22159
22208
|
CoordinationType.OBS_TYPE,
|
|
@@ -24234,8 +24283,8 @@ class Vector extends MathArray {
|
|
|
24234
24283
|
distanceSquared(mathArray) {
|
|
24235
24284
|
let length2 = 0;
|
|
24236
24285
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
24237
|
-
const
|
|
24238
|
-
length2 +=
|
|
24286
|
+
const dist2 = this[i2] - mathArray[i2];
|
|
24287
|
+
length2 += dist2 * dist2;
|
|
24239
24288
|
}
|
|
24240
24289
|
return checkNumber(length2);
|
|
24241
24290
|
}
|
|
@@ -24556,6 +24605,12 @@ function multiply$3(out, a2, b) {
|
|
|
24556
24605
|
out[2] = a2[2] * b[2];
|
|
24557
24606
|
return out;
|
|
24558
24607
|
}
|
|
24608
|
+
function distance$3(a2, b) {
|
|
24609
|
+
var x = b[0] - a2[0];
|
|
24610
|
+
var y = b[1] - a2[1];
|
|
24611
|
+
var z = b[2] - a2[2];
|
|
24612
|
+
return Math.hypot(x, y, z);
|
|
24613
|
+
}
|
|
24559
24614
|
function squaredLength$2(a2) {
|
|
24560
24615
|
var x = a2[0];
|
|
24561
24616
|
var y = a2[1];
|
|
@@ -24679,6 +24734,7 @@ function angle$2(a2, b) {
|
|
|
24679
24734
|
}
|
|
24680
24735
|
var sub = subtract;
|
|
24681
24736
|
var mul = multiply$3;
|
|
24737
|
+
var dist = distance$3;
|
|
24682
24738
|
var len = length$4;
|
|
24683
24739
|
var sqrLen = squaredLength$2;
|
|
24684
24740
|
(function() {
|
|
@@ -49810,7 +49866,7 @@ function noop$2() {
|
|
|
49810
49866
|
const getCursor = ({
|
|
49811
49867
|
isDragging
|
|
49812
49868
|
}) => isDragging ? "grabbing" : "grab";
|
|
49813
|
-
const defaultProps$
|
|
49869
|
+
const defaultProps$P = {
|
|
49814
49870
|
id: "",
|
|
49815
49871
|
width: "100%",
|
|
49816
49872
|
height: "100%",
|
|
@@ -49941,7 +49997,7 @@ class Deck {
|
|
|
49941
49997
|
this._lastPointerDownInfo = pickedInfo.result[0] || pickedInfo.emptyInfo;
|
|
49942
49998
|
});
|
|
49943
49999
|
this.props = {
|
|
49944
|
-
...defaultProps$
|
|
50000
|
+
...defaultProps$P,
|
|
49945
50001
|
...props
|
|
49946
50002
|
};
|
|
49947
50003
|
props = this.props;
|
|
@@ -50443,7 +50499,7 @@ class Deck {
|
|
|
50443
50499
|
metrics.gpuMemory = memoryStats.get("GPU Memory").count;
|
|
50444
50500
|
}
|
|
50445
50501
|
}
|
|
50446
|
-
_defineProperty(Deck, "defaultProps", defaultProps$
|
|
50502
|
+
_defineProperty(Deck, "defaultProps", defaultProps$P);
|
|
50447
50503
|
_defineProperty(Deck, "VERSION", deckGlobal.VERSION);
|
|
50448
50504
|
class ShaderAttribute {
|
|
50449
50505
|
constructor(dataColumn, opts) {
|
|
@@ -53198,7 +53254,7 @@ const areViewportsEqual = memoize$1(({
|
|
|
53198
53254
|
return oldViewport.equals(viewport);
|
|
53199
53255
|
});
|
|
53200
53256
|
let pickingColorCache = new Uint8ClampedArray(0);
|
|
53201
|
-
const defaultProps$
|
|
53257
|
+
const defaultProps$O = {
|
|
53202
53258
|
data: {
|
|
53203
53259
|
type: "data",
|
|
53204
53260
|
value: EMPTY_ARRAY$1,
|
|
@@ -54073,7 +54129,7 @@ class Layer extends Component {
|
|
|
54073
54129
|
this.setNeedsUpdate();
|
|
54074
54130
|
}
|
|
54075
54131
|
}
|
|
54076
|
-
_defineProperty(Layer, "defaultProps", defaultProps$
|
|
54132
|
+
_defineProperty(Layer, "defaultProps", defaultProps$O);
|
|
54077
54133
|
_defineProperty(Layer, "layerName", "Layer");
|
|
54078
54134
|
const TRACE_RENDER_LAYERS = "compositeLayer.renderLayers";
|
|
54079
54135
|
class CompositeLayer extends Layer {
|
|
@@ -55109,6 +55165,124 @@ const esm$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
55109
55165
|
project32,
|
|
55110
55166
|
shadow
|
|
55111
55167
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
55168
|
+
const dashShaders = {
|
|
55169
|
+
inject: {
|
|
55170
|
+
"vs:#decl": "\nattribute vec2 instanceDashArrays;\nattribute float instanceDashOffsets;\nvarying vec2 vDashArray;\nvarying float vDashOffset;\n",
|
|
55171
|
+
"vs:#main-end": "\nvDashArray = instanceDashArrays;\nvDashOffset = instanceDashOffsets / width.x;\n",
|
|
55172
|
+
"fs:#decl": "\nuniform float dashAlignMode;\nuniform float capType;\nuniform bool dashGapPickable;\nvarying vec2 vDashArray;\nvarying float vDashOffset;\n\nfloat round(float x) {\n return floor(x + 0.5);\n}\n",
|
|
55173
|
+
"fs:#main-start": "\n float solidLength = vDashArray.x;\n float gapLength = vDashArray.y;\n float unitLength = solidLength + gapLength;\n\n float offset;\n\n if (unitLength > 0.0) {\n if (dashAlignMode == 0.0) {\n offset = vDashOffset;\n } else {\n unitLength = vPathLength / round(vPathLength / unitLength);\n offset = solidLength / 2.0;\n }\n\n float unitOffset = mod(clamp(vPathPosition.y, 0.0, vPathLength) + offset, unitLength);\n\n if (gapLength > 0.0 && unitOffset > solidLength) {\n if (capType <= 0.5) {\n if (!(dashGapPickable && picking_uActive)) {\n discard;\n }\n } else {\n // caps are rounded, test the distance to solid ends\n float distToEnd = length(vec2(\n min(unitOffset - solidLength, unitLength - unitOffset),\n vPathPosition.x\n ));\n if (distToEnd > 1.0) {\n if (!(dashGapPickable && picking_uActive)) {\n discard;\n }\n }\n }\n }\n }\n"
|
|
55174
|
+
}
|
|
55175
|
+
};
|
|
55176
|
+
const offsetShaders = {
|
|
55177
|
+
inject: {
|
|
55178
|
+
"vs:#decl": "\nattribute float instanceOffsets;\n",
|
|
55179
|
+
"vs:DECKGL_FILTER_SIZE": "\n float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;\n size *= offsetWidth;\n",
|
|
55180
|
+
"vCornerOffset = offsetVec;": "\n float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;\n vec2 offsetCenter = -instanceOffsets * (isCap ? perp : miterVec * miterSize) * 2.0;\n vCornerOffset = vCornerOffset * offsetWidth - offsetCenter;\n",
|
|
55181
|
+
"fs:#main-start": "\n float isInside;\n isInside = step(-1.0, vPathPosition.x) * step(vPathPosition.x, 1.0);\n if (isInside == 0.0) {\n discard;\n }\n"
|
|
55182
|
+
}
|
|
55183
|
+
};
|
|
55184
|
+
const defaultProps$N = {
|
|
55185
|
+
getDashArray: {
|
|
55186
|
+
type: "accessor",
|
|
55187
|
+
value: [0, 0]
|
|
55188
|
+
},
|
|
55189
|
+
getOffset: {
|
|
55190
|
+
type: "accessor",
|
|
55191
|
+
value: 0
|
|
55192
|
+
},
|
|
55193
|
+
dashJustified: false,
|
|
55194
|
+
dashGapPickable: false
|
|
55195
|
+
};
|
|
55196
|
+
class PathStyleExtension extends LayerExtension {
|
|
55197
|
+
constructor({
|
|
55198
|
+
dash = false,
|
|
55199
|
+
offset: offset2 = false,
|
|
55200
|
+
highPrecisionDash = false
|
|
55201
|
+
} = {}) {
|
|
55202
|
+
super({
|
|
55203
|
+
dash: dash || highPrecisionDash,
|
|
55204
|
+
offset: offset2,
|
|
55205
|
+
highPrecisionDash
|
|
55206
|
+
});
|
|
55207
|
+
}
|
|
55208
|
+
isEnabled(layer) {
|
|
55209
|
+
return "pathTesselator" in layer.state;
|
|
55210
|
+
}
|
|
55211
|
+
getShaders(extension) {
|
|
55212
|
+
if (!extension.isEnabled(this)) {
|
|
55213
|
+
return null;
|
|
55214
|
+
}
|
|
55215
|
+
let result = {};
|
|
55216
|
+
if (extension.opts.dash) {
|
|
55217
|
+
result = mergeShaders(result, dashShaders);
|
|
55218
|
+
}
|
|
55219
|
+
if (extension.opts.offset) {
|
|
55220
|
+
result = mergeShaders(result, offsetShaders);
|
|
55221
|
+
}
|
|
55222
|
+
return result;
|
|
55223
|
+
}
|
|
55224
|
+
initializeState(context, extension) {
|
|
55225
|
+
const attributeManager = this.getAttributeManager();
|
|
55226
|
+
if (!attributeManager || !extension.isEnabled(this)) {
|
|
55227
|
+
return;
|
|
55228
|
+
}
|
|
55229
|
+
if (extension.opts.dash) {
|
|
55230
|
+
attributeManager.addInstanced({
|
|
55231
|
+
instanceDashArrays: {
|
|
55232
|
+
size: 2,
|
|
55233
|
+
accessor: "getDashArray"
|
|
55234
|
+
}
|
|
55235
|
+
});
|
|
55236
|
+
}
|
|
55237
|
+
if (extension.opts.highPrecisionDash) {
|
|
55238
|
+
attributeManager.addInstanced({
|
|
55239
|
+
instanceDashOffsets: {
|
|
55240
|
+
size: 1,
|
|
55241
|
+
accessor: "getPath",
|
|
55242
|
+
transform: extension.getDashOffsets.bind(this)
|
|
55243
|
+
}
|
|
55244
|
+
});
|
|
55245
|
+
}
|
|
55246
|
+
if (extension.opts.offset) {
|
|
55247
|
+
attributeManager.addInstanced({
|
|
55248
|
+
instanceOffsets: {
|
|
55249
|
+
size: 1,
|
|
55250
|
+
accessor: "getOffset"
|
|
55251
|
+
}
|
|
55252
|
+
});
|
|
55253
|
+
}
|
|
55254
|
+
}
|
|
55255
|
+
updateState(params, extension) {
|
|
55256
|
+
if (!extension.isEnabled(this)) {
|
|
55257
|
+
return;
|
|
55258
|
+
}
|
|
55259
|
+
const uniforms = {};
|
|
55260
|
+
if (extension.opts.dash) {
|
|
55261
|
+
uniforms.dashAlignMode = this.props.dashJustified ? 1 : 0;
|
|
55262
|
+
uniforms.dashGapPickable = Boolean(this.props.dashGapPickable);
|
|
55263
|
+
}
|
|
55264
|
+
this.state.model.setUniforms(uniforms);
|
|
55265
|
+
}
|
|
55266
|
+
getDashOffsets(path) {
|
|
55267
|
+
const result = [0];
|
|
55268
|
+
const positionSize = this.props.positionFormat === "XY" ? 2 : 3;
|
|
55269
|
+
const isNested2 = Array.isArray(path[0]);
|
|
55270
|
+
const geometrySize = isNested2 ? path.length : path.length / positionSize;
|
|
55271
|
+
let p;
|
|
55272
|
+
let prevP;
|
|
55273
|
+
for (let i2 = 0; i2 < geometrySize - 1; i2++) {
|
|
55274
|
+
p = isNested2 ? path[i2] : path.slice(i2 * positionSize, i2 * positionSize + positionSize);
|
|
55275
|
+
p = this.projectPosition(p);
|
|
55276
|
+
if (i2 > 0) {
|
|
55277
|
+
result[i2] = result[i2 - 1] + dist(prevP, p);
|
|
55278
|
+
}
|
|
55279
|
+
prevP = p;
|
|
55280
|
+
}
|
|
55281
|
+
return result;
|
|
55282
|
+
}
|
|
55283
|
+
}
|
|
55284
|
+
_defineProperty(PathStyleExtension, "defaultProps", defaultProps$N);
|
|
55285
|
+
_defineProperty(PathStyleExtension, "extensionName", "PathStyleExtension");
|
|
55112
55286
|
const defaultProps$M = {
|
|
55113
55287
|
clipBounds: [0, 0, 1, 1]
|
|
55114
55288
|
};
|
|
@@ -111220,8 +111394,8 @@ function requireJs$b() {
|
|
|
111220
111394
|
var DeltaPsi = Math.log(Math.tan(phi2 / 2 + Math.PI / 4) / Math.tan(phi12 / 2 + Math.PI / 4));
|
|
111221
111395
|
var q = Math.abs(DeltaPsi) > 1e-11 ? DeltaPhi / DeltaPsi : Math.cos(phi12);
|
|
111222
111396
|
var delta = Math.sqrt(DeltaPhi * DeltaPhi + q * q * DeltaLambda * DeltaLambda);
|
|
111223
|
-
var
|
|
111224
|
-
return
|
|
111397
|
+
var dist2 = delta * R;
|
|
111398
|
+
return dist2;
|
|
111225
111399
|
}
|
|
111226
111400
|
js$a.default = rhumbDistance;
|
|
111227
111401
|
return js$a;
|
|
@@ -111534,7 +111708,7 @@ function requireUtils$2() {
|
|
|
111534
111708
|
var x;
|
|
111535
111709
|
var y;
|
|
111536
111710
|
var segmentIdx;
|
|
111537
|
-
var
|
|
111711
|
+
var dist2;
|
|
111538
111712
|
if (coords.length > 1 && pointCoords.length) {
|
|
111539
111713
|
var lineCoordinates;
|
|
111540
111714
|
var pointCoordinate;
|
|
@@ -111551,17 +111725,17 @@ function requireUtils$2() {
|
|
|
111551
111725
|
if (lineCoordinates[n2][0] !== lineCoordinates[n2 - 1][0]) {
|
|
111552
111726
|
var slope = (lineCoordinates[n2][1] - lineCoordinates[n2 - 1][1]) / (lineCoordinates[n2][0] - lineCoordinates[n2 - 1][0]);
|
|
111553
111727
|
var inverseSlope = lineCoordinates[n2][1] - slope * lineCoordinates[n2][0];
|
|
111554
|
-
|
|
111555
|
-
} else
|
|
111728
|
+
dist2 = Math.abs(slope * pointCoordinate[0] + inverseSlope - pointCoordinate[1]) / Math.sqrt(slope * slope + 1);
|
|
111729
|
+
} else dist2 = Math.abs(pointCoordinate[0] - lineCoordinates[n2][0]);
|
|
111556
111730
|
var rl2 = Math.pow(lineCoordinates[n2][1] - lineCoordinates[n2 - 1][1], 2) + Math.pow(lineCoordinates[n2][0] - lineCoordinates[n2 - 1][0], 2);
|
|
111557
111731
|
var ln2 = Math.pow(lineCoordinates[n2][1] - pointCoordinate[1], 2) + Math.pow(lineCoordinates[n2][0] - pointCoordinate[0], 2);
|
|
111558
111732
|
var lnm12 = Math.pow(lineCoordinates[n2 - 1][1] - pointCoordinate[1], 2) + Math.pow(lineCoordinates[n2 - 1][0] - pointCoordinate[0], 2);
|
|
111559
|
-
var
|
|
111560
|
-
var calcrl2 = ln2 -
|
|
111733
|
+
var dist22 = Math.pow(dist2, 2);
|
|
111734
|
+
var calcrl2 = ln2 - dist22 + lnm12 - dist22;
|
|
111561
111735
|
if (calcrl2 > rl2) {
|
|
111562
|
-
|
|
111736
|
+
dist2 = Math.sqrt(Math.min(ln2, lnm12));
|
|
111563
111737
|
}
|
|
111564
|
-
if (minDist === null || minDist === void 0 || minDist >
|
|
111738
|
+
if (minDist === null || minDist === void 0 || minDist > dist2) {
|
|
111565
111739
|
if (calcrl2 > rl2) {
|
|
111566
111740
|
if (lnm12 < ln2) {
|
|
111567
111741
|
to = 0;
|
|
@@ -111571,10 +111745,10 @@ function requireUtils$2() {
|
|
|
111571
111745
|
to = 1;
|
|
111572
111746
|
}
|
|
111573
111747
|
} else {
|
|
111574
|
-
to = Math.sqrt(lnm12 -
|
|
111575
|
-
from2 = Math.sqrt(ln2 -
|
|
111748
|
+
to = Math.sqrt(lnm12 - dist22) / Math.sqrt(rl2);
|
|
111749
|
+
from2 = Math.sqrt(ln2 - dist22) / Math.sqrt(rl2);
|
|
111576
111750
|
}
|
|
111577
|
-
minDist =
|
|
111751
|
+
minDist = dist2;
|
|
111578
111752
|
segmentIdx = n2;
|
|
111579
111753
|
}
|
|
111580
111754
|
}
|
|
@@ -127832,22 +128006,22 @@ function addDecoder(cases, importFn) {
|
|
|
127832
128006
|
}
|
|
127833
128007
|
cases.forEach((c) => registry$1.set(c, importFn));
|
|
127834
128008
|
}
|
|
127835
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
127836
|
-
addDecoder(5, () => import("./lzw-
|
|
128009
|
+
addDecoder([void 0, 1], () => import("./raw-C8diIxIM.js").then((m) => m.default));
|
|
128010
|
+
addDecoder(5, () => import("./lzw-Yu0h4Mbz.js").then((m) => m.default));
|
|
127837
128011
|
addDecoder(6, () => {
|
|
127838
128012
|
throw new Error("old style JPEG compression is not supported.");
|
|
127839
128013
|
});
|
|
127840
|
-
addDecoder(7, () => import("./jpeg-
|
|
127841
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
127842
|
-
addDecoder(32773, () => import("./packbits-
|
|
128014
|
+
addDecoder(7, () => import("./jpeg-wF_G-80a.js").then((m) => m.default));
|
|
128015
|
+
addDecoder([8, 32946], () => import("./deflate-DeIPeSHQ.js").then((m) => m.default));
|
|
128016
|
+
addDecoder(32773, () => import("./packbits-DWEcy2Ta.js").then((m) => m.default));
|
|
127843
128017
|
addDecoder(
|
|
127844
128018
|
34887,
|
|
127845
|
-
() => import("./lerc-
|
|
128019
|
+
() => import("./lerc-CkBQzVHv.js").then(async (m) => {
|
|
127846
128020
|
await m.zstd.init();
|
|
127847
128021
|
return m;
|
|
127848
128022
|
}).then((m) => m.default)
|
|
127849
128023
|
);
|
|
127850
|
-
addDecoder(50001, () => import("./webimage-
|
|
128024
|
+
addDecoder(50001, () => import("./webimage-DrxIJlKv.js").then((m) => m.default));
|
|
127851
128025
|
function decodeRowAcc(row, stride) {
|
|
127852
128026
|
let length2 = row.length - stride;
|
|
127853
128027
|
let offset2 = 0;
|
|
@@ -131848,8 +132022,8 @@ function TreeDesc(dyn_tree, stat_desc) {
|
|
|
131848
132022
|
this.max_code = 0;
|
|
131849
132023
|
this.stat_desc = stat_desc;
|
|
131850
132024
|
}
|
|
131851
|
-
const d_code = (
|
|
131852
|
-
return
|
|
132025
|
+
const d_code = (dist2) => {
|
|
132026
|
+
return dist2 < 256 ? _dist_code[dist2] : _dist_code[256 + (dist2 >>> 7)];
|
|
131853
132027
|
};
|
|
131854
132028
|
const put_short = (s2, w2) => {
|
|
131855
132029
|
s2.pending_buf[s2.pending++] = w2 & 255;
|
|
@@ -131983,7 +132157,7 @@ const tr_static_init = () => {
|
|
|
131983
132157
|
let bits;
|
|
131984
132158
|
let length2;
|
|
131985
132159
|
let code;
|
|
131986
|
-
let
|
|
132160
|
+
let dist2;
|
|
131987
132161
|
const bl_count = new Array(MAX_BITS + 1);
|
|
131988
132162
|
length2 = 0;
|
|
131989
132163
|
for (code = 0; code < LENGTH_CODES - 1; code++) {
|
|
@@ -131993,18 +132167,18 @@ const tr_static_init = () => {
|
|
|
131993
132167
|
}
|
|
131994
132168
|
}
|
|
131995
132169
|
_length_code[length2 - 1] = code;
|
|
131996
|
-
|
|
132170
|
+
dist2 = 0;
|
|
131997
132171
|
for (code = 0; code < 16; code++) {
|
|
131998
|
-
base_dist[code] =
|
|
132172
|
+
base_dist[code] = dist2;
|
|
131999
132173
|
for (n2 = 0; n2 < 1 << extra_dbits[code]; n2++) {
|
|
132000
|
-
_dist_code[
|
|
132174
|
+
_dist_code[dist2++] = code;
|
|
132001
132175
|
}
|
|
132002
132176
|
}
|
|
132003
|
-
|
|
132177
|
+
dist2 >>= 7;
|
|
132004
132178
|
for (; code < D_CODES; code++) {
|
|
132005
|
-
base_dist[code] =
|
|
132179
|
+
base_dist[code] = dist2 << 7;
|
|
132006
132180
|
for (n2 = 0; n2 < 1 << extra_dbits[code] - 7; n2++) {
|
|
132007
|
-
_dist_code[256 +
|
|
132181
|
+
_dist_code[256 + dist2++] = code;
|
|
132008
132182
|
}
|
|
132009
132183
|
}
|
|
132010
132184
|
for (bits = 0; bits <= MAX_BITS; bits++) {
|
|
@@ -132095,17 +132269,17 @@ const pqdownheap = (s2, tree, k) => {
|
|
|
132095
132269
|
s2.heap[k] = v;
|
|
132096
132270
|
};
|
|
132097
132271
|
const compress_block = (s2, ltree, dtree) => {
|
|
132098
|
-
let
|
|
132272
|
+
let dist2;
|
|
132099
132273
|
let lc;
|
|
132100
132274
|
let lx = 0;
|
|
132101
132275
|
let code;
|
|
132102
132276
|
let extra;
|
|
132103
132277
|
if (s2.last_lit !== 0) {
|
|
132104
132278
|
do {
|
|
132105
|
-
|
|
132279
|
+
dist2 = s2.pending_buf[s2.d_buf + lx * 2] << 8 | s2.pending_buf[s2.d_buf + lx * 2 + 1];
|
|
132106
132280
|
lc = s2.pending_buf[s2.l_buf + lx];
|
|
132107
132281
|
lx++;
|
|
132108
|
-
if (
|
|
132282
|
+
if (dist2 === 0) {
|
|
132109
132283
|
send_code(s2, lc, ltree);
|
|
132110
132284
|
} else {
|
|
132111
132285
|
code = _length_code[lc];
|
|
@@ -132115,13 +132289,13 @@ const compress_block = (s2, ltree, dtree) => {
|
|
|
132115
132289
|
lc -= base_length[code];
|
|
132116
132290
|
send_bits(s2, lc, extra);
|
|
132117
132291
|
}
|
|
132118
|
-
|
|
132119
|
-
code = d_code(
|
|
132292
|
+
dist2--;
|
|
132293
|
+
code = d_code(dist2);
|
|
132120
132294
|
send_code(s2, code, dtree);
|
|
132121
132295
|
extra = extra_dbits[code];
|
|
132122
132296
|
if (extra !== 0) {
|
|
132123
|
-
|
|
132124
|
-
send_bits(s2,
|
|
132297
|
+
dist2 -= base_dist[code];
|
|
132298
|
+
send_bits(s2, dist2, extra);
|
|
132125
132299
|
}
|
|
132126
132300
|
}
|
|
132127
132301
|
} while (lx < s2.last_lit);
|
|
@@ -132392,18 +132566,18 @@ const _tr_flush_block = (s2, buf, stored_len, last) => {
|
|
|
132392
132566
|
bi_windup(s2);
|
|
132393
132567
|
}
|
|
132394
132568
|
};
|
|
132395
|
-
const _tr_tally = (s2,
|
|
132396
|
-
s2.pending_buf[s2.d_buf + s2.last_lit * 2] =
|
|
132397
|
-
s2.pending_buf[s2.d_buf + s2.last_lit * 2 + 1] =
|
|
132569
|
+
const _tr_tally = (s2, dist2, lc) => {
|
|
132570
|
+
s2.pending_buf[s2.d_buf + s2.last_lit * 2] = dist2 >>> 8 & 255;
|
|
132571
|
+
s2.pending_buf[s2.d_buf + s2.last_lit * 2 + 1] = dist2 & 255;
|
|
132398
132572
|
s2.pending_buf[s2.l_buf + s2.last_lit] = lc & 255;
|
|
132399
132573
|
s2.last_lit++;
|
|
132400
|
-
if (
|
|
132574
|
+
if (dist2 === 0) {
|
|
132401
132575
|
s2.dyn_ltree[lc * 2]++;
|
|
132402
132576
|
} else {
|
|
132403
132577
|
s2.matches++;
|
|
132404
|
-
|
|
132578
|
+
dist2--;
|
|
132405
132579
|
s2.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++;
|
|
132406
|
-
s2.dyn_dtree[d_code(
|
|
132580
|
+
s2.dyn_dtree[d_code(dist2) * 2]++;
|
|
132407
132581
|
}
|
|
132408
132582
|
return s2.last_lit === s2.lit_bufsize - 1;
|
|
132409
132583
|
};
|
|
@@ -133908,7 +134082,7 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
133908
134082
|
let here;
|
|
133909
134083
|
let op;
|
|
133910
134084
|
let len2;
|
|
133911
|
-
let
|
|
134085
|
+
let dist2;
|
|
133912
134086
|
let from2;
|
|
133913
134087
|
let from_source;
|
|
133914
134088
|
let input, output;
|
|
@@ -133974,7 +134148,7 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
133974
134148
|
bits -= op;
|
|
133975
134149
|
op = here >>> 16 & 255;
|
|
133976
134150
|
if (op & 16) {
|
|
133977
|
-
|
|
134151
|
+
dist2 = here & 65535;
|
|
133978
134152
|
op &= 15;
|
|
133979
134153
|
if (bits < op) {
|
|
133980
134154
|
hold += input[_in++] << bits;
|
|
@@ -133984,8 +134158,8 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
133984
134158
|
bits += 8;
|
|
133985
134159
|
}
|
|
133986
134160
|
}
|
|
133987
|
-
|
|
133988
|
-
if (
|
|
134161
|
+
dist2 += hold & (1 << op) - 1;
|
|
134162
|
+
if (dist2 > dmax) {
|
|
133989
134163
|
strm.msg = "invalid distance too far back";
|
|
133990
134164
|
state.mode = BAD;
|
|
133991
134165
|
break top;
|
|
@@ -133993,8 +134167,8 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
133993
134167
|
hold >>>= op;
|
|
133994
134168
|
bits -= op;
|
|
133995
134169
|
op = _out - beg;
|
|
133996
|
-
if (
|
|
133997
|
-
op =
|
|
134170
|
+
if (dist2 > op) {
|
|
134171
|
+
op = dist2 - op;
|
|
133998
134172
|
if (op > whave) {
|
|
133999
134173
|
if (state.sane) {
|
|
134000
134174
|
strm.msg = "invalid distance too far back";
|
|
@@ -134011,7 +134185,7 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
134011
134185
|
do {
|
|
134012
134186
|
output[_out++] = s_window[from2++];
|
|
134013
134187
|
} while (--op);
|
|
134014
|
-
from2 = _out -
|
|
134188
|
+
from2 = _out - dist2;
|
|
134015
134189
|
from_source = output;
|
|
134016
134190
|
}
|
|
134017
134191
|
} else if (wnext < op) {
|
|
@@ -134029,7 +134203,7 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
134029
134203
|
do {
|
|
134030
134204
|
output[_out++] = s_window[from2++];
|
|
134031
134205
|
} while (--op);
|
|
134032
|
-
from2 = _out -
|
|
134206
|
+
from2 = _out - dist2;
|
|
134033
134207
|
from_source = output;
|
|
134034
134208
|
}
|
|
134035
134209
|
}
|
|
@@ -134040,7 +134214,7 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
134040
134214
|
do {
|
|
134041
134215
|
output[_out++] = s_window[from2++];
|
|
134042
134216
|
} while (--op);
|
|
134043
|
-
from2 = _out -
|
|
134217
|
+
from2 = _out - dist2;
|
|
134044
134218
|
from_source = output;
|
|
134045
134219
|
}
|
|
134046
134220
|
}
|
|
@@ -134057,7 +134231,7 @@ var inffast = function inflate_fast(strm, start) {
|
|
|
134057
134231
|
}
|
|
134058
134232
|
}
|
|
134059
134233
|
} else {
|
|
134060
|
-
from2 = _out -
|
|
134234
|
+
from2 = _out - dist2;
|
|
134061
134235
|
do {
|
|
134062
134236
|
output[_out++] = output[from2++];
|
|
134063
134237
|
output[_out++] = output[from2++];
|
|
@@ -134615,7 +134789,7 @@ const fixedtables = (state) => {
|
|
|
134615
134789
|
state.distbits = 5;
|
|
134616
134790
|
};
|
|
134617
134791
|
const updatewindow = (strm, src, end, copy2) => {
|
|
134618
|
-
let
|
|
134792
|
+
let dist2;
|
|
134619
134793
|
const state = strm.state;
|
|
134620
134794
|
if (state.window === null) {
|
|
134621
134795
|
state.wsize = 1 << state.wbits;
|
|
@@ -134628,23 +134802,23 @@ const updatewindow = (strm, src, end, copy2) => {
|
|
|
134628
134802
|
state.wnext = 0;
|
|
134629
134803
|
state.whave = state.wsize;
|
|
134630
134804
|
} else {
|
|
134631
|
-
|
|
134632
|
-
if (
|
|
134633
|
-
|
|
134805
|
+
dist2 = state.wsize - state.wnext;
|
|
134806
|
+
if (dist2 > copy2) {
|
|
134807
|
+
dist2 = copy2;
|
|
134634
134808
|
}
|
|
134635
|
-
state.window.set(src.subarray(end - copy2, end - copy2 +
|
|
134636
|
-
copy2 -=
|
|
134809
|
+
state.window.set(src.subarray(end - copy2, end - copy2 + dist2), state.wnext);
|
|
134810
|
+
copy2 -= dist2;
|
|
134637
134811
|
if (copy2) {
|
|
134638
134812
|
state.window.set(src.subarray(end - copy2, end), 0);
|
|
134639
134813
|
state.wnext = copy2;
|
|
134640
134814
|
state.whave = state.wsize;
|
|
134641
134815
|
} else {
|
|
134642
|
-
state.wnext +=
|
|
134816
|
+
state.wnext += dist2;
|
|
134643
134817
|
if (state.wnext === state.wsize) {
|
|
134644
134818
|
state.wnext = 0;
|
|
134645
134819
|
}
|
|
134646
134820
|
if (state.whave < state.wsize) {
|
|
134647
|
-
state.whave +=
|
|
134821
|
+
state.whave += dist2;
|
|
134648
134822
|
}
|
|
134649
134823
|
}
|
|
134650
134824
|
}
|
|
@@ -138694,7 +138868,7 @@ function padColors({ colors, channelsVisible }) {
|
|
|
138694
138868
|
).reduce((acc, val) => acc.concat(val), []);
|
|
138695
138869
|
return paddedColors;
|
|
138696
138870
|
}
|
|
138697
|
-
const defaultProps$3$
|
|
138871
|
+
const defaultProps$3$2 = {
|
|
138698
138872
|
colors: { type: "array", value: null, compare: true },
|
|
138699
138873
|
opacity: { type: "number", value: 1, compare: true },
|
|
138700
138874
|
transparentColor: { type: "array", value: null, compare: true },
|
|
@@ -138711,9 +138885,9 @@ const ColorPaletteExtension = class extends LayerExtension {
|
|
|
138711
138885
|
const {
|
|
138712
138886
|
colors,
|
|
138713
138887
|
channelsVisible,
|
|
138714
|
-
opacity = defaultProps$3$
|
|
138715
|
-
transparentColor = defaultProps$3$
|
|
138716
|
-
useTransparentColor = defaultProps$3$
|
|
138888
|
+
opacity = defaultProps$3$2.opacity.value,
|
|
138889
|
+
transparentColor = defaultProps$3$2.transparentColor.value,
|
|
138890
|
+
useTransparentColor = defaultProps$3$2.useTransparentColor.value
|
|
138717
138891
|
} = this.props;
|
|
138718
138892
|
const paddedColors = padColors({
|
|
138719
138893
|
channelsVisible: channelsVisible || this.selections.map(() => true),
|
|
@@ -138729,7 +138903,7 @@ const ColorPaletteExtension = class extends LayerExtension {
|
|
|
138729
138903
|
}
|
|
138730
138904
|
};
|
|
138731
138905
|
ColorPaletteExtension.extensionName = "ColorPaletteExtension";
|
|
138732
|
-
ColorPaletteExtension.defaultProps = defaultProps$3$
|
|
138906
|
+
ColorPaletteExtension.defaultProps = defaultProps$3$2;
|
|
138733
138907
|
const fs$4 = `// lens bounds for ellipse
|
|
138734
138908
|
uniform float majorLensAxis;
|
|
138735
138909
|
uniform float minorLensAxis;
|
|
@@ -140024,7 +140198,7 @@ const MultiscaleImageLayer = class extends CompositeLayer {
|
|
|
140024
140198
|
};
|
|
140025
140199
|
MultiscaleImageLayer.layerName = "MultiscaleImageLayer";
|
|
140026
140200
|
MultiscaleImageLayer.defaultProps = defaultProps$4;
|
|
140027
|
-
const defaultProps$3 = {
|
|
140201
|
+
const defaultProps$3$1 = {
|
|
140028
140202
|
pickable: { type: "boolean", value: true, compare: true },
|
|
140029
140203
|
loader: {
|
|
140030
140204
|
type: "object",
|
|
@@ -140111,7 +140285,7 @@ const OverviewLayer = class extends CompositeLayer {
|
|
|
140111
140285
|
}
|
|
140112
140286
|
};
|
|
140113
140287
|
OverviewLayer.layerName = "OverviewLayer";
|
|
140114
|
-
OverviewLayer.defaultProps = defaultProps$3;
|
|
140288
|
+
OverviewLayer.defaultProps = defaultProps$3$1;
|
|
140115
140289
|
function getPosition(boundingBox, position2, length2) {
|
|
140116
140290
|
const viewWidth = boundingBox[2][0] - boundingBox[0][0];
|
|
140117
140291
|
const viewHeight = boundingBox[2][1] - boundingBox[0][1];
|
|
@@ -141124,7 +141298,7 @@ function padWithDefault$1(arr, defaultValue2, padWidth) {
|
|
|
141124
141298
|
}
|
|
141125
141299
|
return newArr;
|
|
141126
141300
|
}
|
|
141127
|
-
const defaultProps$
|
|
141301
|
+
const defaultProps$3 = {
|
|
141128
141302
|
hoveredCell: { type: "number", value: null, compare: true },
|
|
141129
141303
|
// We do not want to deep-compare cellColorData,
|
|
141130
141304
|
// as it is potentially a TypedArray with millions of elements.
|
|
@@ -141241,7 +141415,7 @@ let BitmaskLayer$1 = class BitmaskLayer extends XRLayer {
|
|
|
141241
141415
|
}
|
|
141242
141416
|
};
|
|
141243
141417
|
BitmaskLayer$1.layerName = "BitmaskLayer";
|
|
141244
|
-
BitmaskLayer$1.defaultProps = defaultProps$
|
|
141418
|
+
BitmaskLayer$1.defaultProps = defaultProps$3;
|
|
141245
141419
|
const vs = `
|
|
141246
141420
|
#define SHADER_NAME bitmask-layer-vertex-shader
|
|
141247
141421
|
|
|
@@ -141583,7 +141757,7 @@ function isEqualShallow(prevArr, nextArr) {
|
|
|
141583
141757
|
}
|
|
141584
141758
|
return prevArr === nextArr;
|
|
141585
141759
|
}
|
|
141586
|
-
const defaultProps$
|
|
141760
|
+
const defaultProps$2 = {
|
|
141587
141761
|
channelStrokeWidths: { type: "array", value: null, compare: true },
|
|
141588
141762
|
channelsFilled: { type: "array", value: null, compare: true },
|
|
141589
141763
|
channelOpacities: { type: "array", value: null, compare: true },
|
|
@@ -141847,7 +142021,7 @@ class BitmaskLayer2 extends XRLayer {
|
|
|
141847
142021
|
}
|
|
141848
142022
|
}
|
|
141849
142023
|
BitmaskLayer2.layerName = "BitmaskLayer";
|
|
141850
|
-
BitmaskLayer2.defaultProps = defaultProps$
|
|
142024
|
+
BitmaskLayer2.defaultProps = defaultProps$2;
|
|
141851
142025
|
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
141852
142026
|
function clone(configObject) {
|
|
141853
142027
|
var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
@@ -144790,7 +144964,7 @@ function ringArea(coords) {
|
|
|
144790
144964
|
return total * FACTOR;
|
|
144791
144965
|
}
|
|
144792
144966
|
const DEFAULT_THRESHOLD = 1;
|
|
144793
|
-
const defaultProps = {
|
|
144967
|
+
const defaultProps$1 = {
|
|
144794
144968
|
// for text
|
|
144795
144969
|
obsSetPath: { type: "object" },
|
|
144796
144970
|
sampleSetPath: { type: "object" },
|
|
@@ -144885,9 +145059,9 @@ class ContourLayerWithText extends ContourLayer {
|
|
|
144885
145059
|
const circlePoint = point(circleCoord);
|
|
144886
145060
|
polygonVertices.forEach((polyCoord) => {
|
|
144887
145061
|
const polyPoint = point(polyCoord);
|
|
144888
|
-
const
|
|
144889
|
-
if (
|
|
144890
|
-
minDist =
|
|
145062
|
+
const dist2 = distance$1(circlePoint, polyPoint);
|
|
145063
|
+
if (dist2 < minDist) {
|
|
145064
|
+
minDist = dist2;
|
|
144891
145065
|
minCirclePoint = circleCoord;
|
|
144892
145066
|
minCirclePointI = circlePointI;
|
|
144893
145067
|
minPolygonPoint = polyCoord;
|
|
@@ -144964,7 +145138,1077 @@ class ContourLayerWithText extends ContourLayer {
|
|
|
144964
145138
|
}
|
|
144965
145139
|
}
|
|
144966
145140
|
ContourLayerWithText.layerName = "ContourLayerWithText";
|
|
144967
|
-
ContourLayerWithText.defaultProps = defaultProps;
|
|
145141
|
+
ContourLayerWithText.defaultProps = defaultProps$1;
|
|
145142
|
+
const ARROW_SCREEN_PX = 14;
|
|
145143
|
+
const LABEL_FONT_FAMILY = '"Roboto", "Helvetica", "Arial", sans-serif';
|
|
145144
|
+
const LABEL_FONT_WEIGHT = "bold";
|
|
145145
|
+
const LABEL_FONT_SIZE = 14;
|
|
145146
|
+
const RATIO_CLUSTER = 0.1;
|
|
145147
|
+
const RATIO_DOT = 0.3;
|
|
145148
|
+
const RATIO_GEO_FADE = 0.55;
|
|
145149
|
+
const RATIO_TIPS = 0.7;
|
|
145150
|
+
const RATIO_LABEL = 0.55;
|
|
145151
|
+
const RATIO_LABEL_FULL = 0.75;
|
|
145152
|
+
function textBgColor(strokeColor) {
|
|
145153
|
+
const [r2, g2, b] = strokeColor;
|
|
145154
|
+
const lum = (0.299 * r2 + 0.587 * g2 + 0.114 * b) / 255;
|
|
145155
|
+
return lum > 0.45 ? [20, 20, 20, 210] : [245, 245, 245, 210];
|
|
145156
|
+
}
|
|
145157
|
+
function parseDashArray(strokeDashArray) {
|
|
145158
|
+
if (!strokeDashArray || strokeDashArray === "none")
|
|
145159
|
+
return null;
|
|
145160
|
+
const nums = strokeDashArray.trim().split(/\s+/).map(Number).filter((n2) => !Number.isNaN(n2) && n2 >= 0);
|
|
145161
|
+
return nums.length >= 2 ? [nums[0], nums[1]] : null;
|
|
145162
|
+
}
|
|
145163
|
+
function computeEllipsePolygon(cx, cy, rx, ry, numSegments = 64) {
|
|
145164
|
+
const pts = [];
|
|
145165
|
+
for (let i2 = 0; i2 < numSegments; i2++) {
|
|
145166
|
+
const angle2 = 2 * Math.PI * i2 / numSegments;
|
|
145167
|
+
pts.push([cx + rx * Math.cos(angle2), cy + ry * Math.sin(angle2)]);
|
|
145168
|
+
}
|
|
145169
|
+
return pts;
|
|
145170
|
+
}
|
|
145171
|
+
function createPreviewLayer(inProgress, hoverCoord, strokeColor = [255, 255, 0]) {
|
|
145172
|
+
if (!inProgress || inProgress.vertices.length === 0)
|
|
145173
|
+
return null;
|
|
145174
|
+
const { type, vertices } = inProgress;
|
|
145175
|
+
const base = { coordinateSystem: COORDINATE_SYSTEM.CARTESIAN };
|
|
145176
|
+
const previewColor = [...strokeColor, 160];
|
|
145177
|
+
const cursor2 = hoverCoord ?? vertices[vertices.length - 1];
|
|
145178
|
+
if (type === "rectangle" && vertices.length === 1) {
|
|
145179
|
+
const [ax, ay] = vertices[0];
|
|
145180
|
+
const [bx, by] = cursor2;
|
|
145181
|
+
const path = [[ax, ay], [bx, ay], [bx, by], [ax, by], [ax, ay]];
|
|
145182
|
+
return new PathLayer({
|
|
145183
|
+
...base,
|
|
145184
|
+
id: "annotation-preview-rectangle",
|
|
145185
|
+
data: [{ path }],
|
|
145186
|
+
getPath: (d) => d.path,
|
|
145187
|
+
getColor: previewColor,
|
|
145188
|
+
getWidth: 1,
|
|
145189
|
+
widthUnits: "pixels",
|
|
145190
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145191
|
+
getDashArray: [8, 4]
|
|
145192
|
+
});
|
|
145193
|
+
}
|
|
145194
|
+
if (type === "line" && vertices.length === 1) {
|
|
145195
|
+
const path = [vertices[0], cursor2];
|
|
145196
|
+
return new PathLayer({
|
|
145197
|
+
...base,
|
|
145198
|
+
id: "annotation-preview-line",
|
|
145199
|
+
data: [{ path }],
|
|
145200
|
+
getPath: (d) => d.path,
|
|
145201
|
+
getColor: previewColor,
|
|
145202
|
+
getWidth: 1,
|
|
145203
|
+
widthUnits: "pixels",
|
|
145204
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145205
|
+
getDashArray: [8, 4]
|
|
145206
|
+
});
|
|
145207
|
+
}
|
|
145208
|
+
if (type === "ellipse" && vertices.length === 1) {
|
|
145209
|
+
const [cx, cy] = vertices[0];
|
|
145210
|
+
const [ex, ey] = cursor2;
|
|
145211
|
+
const rx = Math.abs(ex - cx);
|
|
145212
|
+
const ry = Math.abs(ey - cy);
|
|
145213
|
+
if (rx < 1 && ry < 1)
|
|
145214
|
+
return null;
|
|
145215
|
+
const pts = computeEllipsePolygon(cx, cy, Math.max(rx, 1), Math.max(ry, 1));
|
|
145216
|
+
const path = [...pts, pts[0]];
|
|
145217
|
+
return new PathLayer({
|
|
145218
|
+
...base,
|
|
145219
|
+
id: "annotation-preview-ellipse",
|
|
145220
|
+
data: [{ path }],
|
|
145221
|
+
getPath: (d) => d.path,
|
|
145222
|
+
getColor: previewColor,
|
|
145223
|
+
getWidth: 1,
|
|
145224
|
+
widthUnits: "pixels",
|
|
145225
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145226
|
+
getDashArray: [8, 4]
|
|
145227
|
+
});
|
|
145228
|
+
}
|
|
145229
|
+
if ((type === "polygon" || type === "polyline") && vertices.length >= 1) {
|
|
145230
|
+
const path = [...vertices, cursor2];
|
|
145231
|
+
if (type === "polygon" && vertices.length >= 2)
|
|
145232
|
+
path.push(vertices[0]);
|
|
145233
|
+
return new PathLayer({
|
|
145234
|
+
...base,
|
|
145235
|
+
id: `annotation-preview-${type}`,
|
|
145236
|
+
data: [{ path }],
|
|
145237
|
+
getPath: (d) => d.path,
|
|
145238
|
+
getColor: previewColor,
|
|
145239
|
+
getWidth: 1,
|
|
145240
|
+
widthUnits: "pixels",
|
|
145241
|
+
jointRounded: true,
|
|
145242
|
+
capRounded: true,
|
|
145243
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145244
|
+
getDashArray: [8, 4]
|
|
145245
|
+
});
|
|
145246
|
+
}
|
|
145247
|
+
return null;
|
|
145248
|
+
}
|
|
145249
|
+
function computeTickCap(tipX, tipY, dirX, dirY, dataSize) {
|
|
145250
|
+
const len2 = Math.sqrt(dirX * dirX + dirY * dirY);
|
|
145251
|
+
if (len2 === 0)
|
|
145252
|
+
return null;
|
|
145253
|
+
const ux = dirX / len2;
|
|
145254
|
+
const uy = dirY / len2;
|
|
145255
|
+
const px = -uy;
|
|
145256
|
+
const py = ux;
|
|
145257
|
+
const half = dataSize * 0.55;
|
|
145258
|
+
return [
|
|
145259
|
+
[tipX + px * half, tipY + py * half],
|
|
145260
|
+
[tipX - px * half, tipY - py * half]
|
|
145261
|
+
];
|
|
145262
|
+
}
|
|
145263
|
+
function computeArrowhead(tipX, tipY, dirX, dirY, dataSize) {
|
|
145264
|
+
const len2 = Math.sqrt(dirX * dirX + dirY * dirY);
|
|
145265
|
+
if (len2 === 0)
|
|
145266
|
+
return null;
|
|
145267
|
+
const ux = dirX / len2;
|
|
145268
|
+
const uy = dirY / len2;
|
|
145269
|
+
const px = -uy;
|
|
145270
|
+
const py = ux;
|
|
145271
|
+
const halfBase = dataSize * 0.4;
|
|
145272
|
+
const bx = tipX - ux * dataSize;
|
|
145273
|
+
const by = tipY - uy * dataSize;
|
|
145274
|
+
return [
|
|
145275
|
+
[tipX, tipY],
|
|
145276
|
+
[bx + px * halfBase, by + py * halfBase],
|
|
145277
|
+
[bx - px * halfBase, by - py * halfBase]
|
|
145278
|
+
];
|
|
145279
|
+
}
|
|
145280
|
+
function fmtCommas(n2) {
|
|
145281
|
+
return Math.round(n2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
145282
|
+
}
|
|
145283
|
+
function getMeasurementLabel(shape2, physicalPixelSize, viewType = ViewType.SPATIAL) {
|
|
145284
|
+
const pps = physicalPixelSize;
|
|
145285
|
+
const px = pps?.x ?? 1;
|
|
145286
|
+
const py = pps?.y ?? 1;
|
|
145287
|
+
const unit = pps ? pps.unit ?? "" : null;
|
|
145288
|
+
const hasPhys = !!pps;
|
|
145289
|
+
const isEmbedding = viewType === ViewType.SCATTERPLOT;
|
|
145290
|
+
const fmtDist = (d) => {
|
|
145291
|
+
if (hasPhys)
|
|
145292
|
+
return `${d.toFixed(2)} ${unit}`;
|
|
145293
|
+
if (isEmbedding)
|
|
145294
|
+
return d.toFixed(2);
|
|
145295
|
+
return `${fmtCommas(d)} px`;
|
|
145296
|
+
};
|
|
145297
|
+
const fmtArea = (a2) => {
|
|
145298
|
+
if (hasPhys)
|
|
145299
|
+
return `${a2.toFixed(2)} ${unit}²`;
|
|
145300
|
+
if (isEmbedding)
|
|
145301
|
+
return a2.toFixed(2);
|
|
145302
|
+
return `${fmtCommas(a2)} px²`;
|
|
145303
|
+
};
|
|
145304
|
+
if (shape2.type === "line") {
|
|
145305
|
+
const dx = (shape2.x2 ?? 0) - (shape2.x1 ?? 0);
|
|
145306
|
+
const dy = (shape2.y2 ?? 0) - (shape2.y1 ?? 0);
|
|
145307
|
+
const dist2 = hasPhys ? Math.sqrt((dx * px) ** 2 + (dy * py) ** 2) : Math.sqrt(dx * dx + dy * dy);
|
|
145308
|
+
return fmtDist(dist2);
|
|
145309
|
+
}
|
|
145310
|
+
if (shape2.type === "rectangle") {
|
|
145311
|
+
return fmtArea(hasPhys ? Math.abs(shape2.width ?? 0) * px * Math.abs(shape2.height ?? 0) * py : Math.abs((shape2.width ?? 0) * (shape2.height ?? 0)));
|
|
145312
|
+
}
|
|
145313
|
+
if (shape2.type === "ellipse") {
|
|
145314
|
+
const rx = Math.abs(shape2.radiusX ?? 0);
|
|
145315
|
+
const ry = Math.abs(shape2.radiusY ?? 0);
|
|
145316
|
+
return fmtArea(hasPhys ? Math.PI * rx * px * ry * py : Math.PI * rx * ry);
|
|
145317
|
+
}
|
|
145318
|
+
if (shape2.type === "polygon" && shape2.points?.length >= 3) {
|
|
145319
|
+
const pts = shape2.points;
|
|
145320
|
+
let shoelace = 0;
|
|
145321
|
+
for (let i2 = 0; i2 < pts.length; i2++) {
|
|
145322
|
+
const [ax, ay] = pts[i2];
|
|
145323
|
+
const [bx, by] = pts[(i2 + 1) % pts.length];
|
|
145324
|
+
shoelace += (hasPhys ? ax * px : ax) * (hasPhys ? by * py : by) - (hasPhys ? bx * px : bx) * (hasPhys ? ay * py : ay);
|
|
145325
|
+
}
|
|
145326
|
+
return fmtArea(Math.abs(shoelace / 2));
|
|
145327
|
+
}
|
|
145328
|
+
if (shape2.type === "polyline" && shape2.points?.length >= 2) {
|
|
145329
|
+
let total = 0;
|
|
145330
|
+
for (let i2 = 0; i2 < shape2.points.length - 1; i2++) {
|
|
145331
|
+
const [ax, ay] = shape2.points[i2];
|
|
145332
|
+
const [bx, by] = shape2.points[i2 + 1];
|
|
145333
|
+
total += hasPhys ? Math.sqrt(((bx - ax) * px) ** 2 + ((by - ay) * py) ** 2) : Math.sqrt((bx - ax) ** 2 + (by - ay) ** 2);
|
|
145334
|
+
}
|
|
145335
|
+
return fmtDist(total);
|
|
145336
|
+
}
|
|
145337
|
+
return null;
|
|
145338
|
+
}
|
|
145339
|
+
function pickBelowPerp(ux, uy) {
|
|
145340
|
+
const rp = [uy, -ux];
|
|
145341
|
+
const lp = [-uy, ux];
|
|
145342
|
+
return rp[1] > lp[1] || rp[1] === lp[1] && rp[0] > lp[0] ? rp : lp;
|
|
145343
|
+
}
|
|
145344
|
+
function readableAngle(deg) {
|
|
145345
|
+
let a2 = deg;
|
|
145346
|
+
if (a2 > 90)
|
|
145347
|
+
a2 -= 180;
|
|
145348
|
+
if (a2 < -90)
|
|
145349
|
+
a2 += 180;
|
|
145350
|
+
return a2;
|
|
145351
|
+
}
|
|
145352
|
+
function getShapeCentroid(shape2) {
|
|
145353
|
+
if (shape2.type === "rectangle") {
|
|
145354
|
+
return [(shape2.x ?? 0) + (shape2.width ?? 0) / 2, (shape2.y ?? 0) + (shape2.height ?? 0) / 2];
|
|
145355
|
+
}
|
|
145356
|
+
if (shape2.type === "line") {
|
|
145357
|
+
return [((shape2.x1 ?? 0) + (shape2.x2 ?? 0)) / 2, ((shape2.y1 ?? 0) + (shape2.y2 ?? 0)) / 2];
|
|
145358
|
+
}
|
|
145359
|
+
if (shape2.type === "ellipse") {
|
|
145360
|
+
return [shape2.x1 ?? 0, shape2.y1 ?? 0];
|
|
145361
|
+
}
|
|
145362
|
+
if ((shape2.type === "polygon" || shape2.type === "polyline") && shape2.points?.length >= 1) {
|
|
145363
|
+
const mx = shape2.points.reduce((s2, p) => s2 + p[0], 0) / shape2.points.length;
|
|
145364
|
+
const my = shape2.points.reduce((s2, p) => s2 + p[1], 0) / shape2.points.length;
|
|
145365
|
+
return [mx, my];
|
|
145366
|
+
}
|
|
145367
|
+
return [0, 0];
|
|
145368
|
+
}
|
|
145369
|
+
function computeClusters(shapeList, zoom, cellPx = 50) {
|
|
145370
|
+
const cellSize = cellPx / 2 ** Math.floor(zoom);
|
|
145371
|
+
const cells = /* @__PURE__ */ new Map();
|
|
145372
|
+
shapeList.forEach(({ shape: shape2 }) => {
|
|
145373
|
+
const [cx, cy] = getShapeCentroid(shape2);
|
|
145374
|
+
const key = `${Math.floor(cx / cellSize)},${Math.floor(cy / cellSize)}`;
|
|
145375
|
+
if (!cells.has(key)) {
|
|
145376
|
+
cells.set(key, { sumX: 0, sumY: 0, count: 0, color: shape2.strokeColor ?? [255, 255, 255] });
|
|
145377
|
+
}
|
|
145378
|
+
const c = cells.get(key);
|
|
145379
|
+
c.sumX += cx;
|
|
145380
|
+
c.sumY += cy;
|
|
145381
|
+
c.count++;
|
|
145382
|
+
});
|
|
145383
|
+
return Array.from(cells.values()).map((c) => ({
|
|
145384
|
+
position: [c.sumX / c.count, c.sumY / c.count, 0],
|
|
145385
|
+
count: c.count,
|
|
145386
|
+
color: c.color
|
|
145387
|
+
}));
|
|
145388
|
+
}
|
|
145389
|
+
function createAnnotationLayers(shapes = [], zoom = 0, selectedShapeUid = null, physicalPixelSize = null, authoredZoom = null, semanticZoom = true, viewType = ViewType.SPATIAL) {
|
|
145390
|
+
const selectionLayers = [];
|
|
145391
|
+
if (selectedShapeUid) {
|
|
145392
|
+
const sel = shapes.find((s2) => s2.uid === selectedShapeUid);
|
|
145393
|
+
if (sel) {
|
|
145394
|
+
const { uid: sUid, type: sType, strokeWidth: sStrokeWidth = 3 } = sel;
|
|
145395
|
+
const haloColor = [255, 220, 50, 70];
|
|
145396
|
+
const haloWidth = Math.max(sStrokeWidth + 8, 10);
|
|
145397
|
+
const base = { coordinateSystem: COORDINATE_SYSTEM.CARTESIAN };
|
|
145398
|
+
if (sType === "rectangle") {
|
|
145399
|
+
const { x, y, width: width2, height: height2 } = sel;
|
|
145400
|
+
selectionLayers.push(new PathLayer({
|
|
145401
|
+
...base,
|
|
145402
|
+
id: `annotation-select-${sUid}`,
|
|
145403
|
+
data: [{
|
|
145404
|
+
path: [
|
|
145405
|
+
[x, y],
|
|
145406
|
+
[x + width2, y],
|
|
145407
|
+
[x + width2, y + height2],
|
|
145408
|
+
[x, y + height2],
|
|
145409
|
+
[x, y]
|
|
145410
|
+
]
|
|
145411
|
+
}],
|
|
145412
|
+
getPath: (d) => d.path,
|
|
145413
|
+
getColor: haloColor,
|
|
145414
|
+
getWidth: haloWidth,
|
|
145415
|
+
widthUnits: "pixels",
|
|
145416
|
+
jointRounded: true,
|
|
145417
|
+
capRounded: true
|
|
145418
|
+
}));
|
|
145419
|
+
}
|
|
145420
|
+
if (sType === "line") {
|
|
145421
|
+
const { x1: x12, y1: y12, x2, y2 } = sel;
|
|
145422
|
+
selectionLayers.push(new PathLayer({
|
|
145423
|
+
...base,
|
|
145424
|
+
id: `annotation-select-${sUid}`,
|
|
145425
|
+
data: [{ path: [[x12, y12], [x2, y2]] }],
|
|
145426
|
+
getPath: (d) => d.path,
|
|
145427
|
+
getColor: haloColor,
|
|
145428
|
+
getWidth: haloWidth,
|
|
145429
|
+
widthUnits: "pixels",
|
|
145430
|
+
capRounded: true
|
|
145431
|
+
}));
|
|
145432
|
+
}
|
|
145433
|
+
if (sType === "ellipse") {
|
|
145434
|
+
const polygon2 = computeEllipsePolygon(sel.x1, sel.y1, sel.radiusX, sel.radiusY);
|
|
145435
|
+
selectionLayers.push(new PathLayer({
|
|
145436
|
+
...base,
|
|
145437
|
+
id: `annotation-select-${sUid}`,
|
|
145438
|
+
data: [{ path: [...polygon2, polygon2[0]] }],
|
|
145439
|
+
getPath: (d) => d.path,
|
|
145440
|
+
getColor: haloColor,
|
|
145441
|
+
getWidth: haloWidth,
|
|
145442
|
+
widthUnits: "pixels",
|
|
145443
|
+
jointRounded: true
|
|
145444
|
+
}));
|
|
145445
|
+
}
|
|
145446
|
+
if (sType === "polygon" && sel.points?.length >= 3) {
|
|
145447
|
+
selectionLayers.push(new PathLayer({
|
|
145448
|
+
...base,
|
|
145449
|
+
id: `annotation-select-${sUid}`,
|
|
145450
|
+
data: [{ path: [...sel.points, sel.points[0]] }],
|
|
145451
|
+
getPath: (d) => d.path,
|
|
145452
|
+
getColor: haloColor,
|
|
145453
|
+
getWidth: haloWidth,
|
|
145454
|
+
widthUnits: "pixels",
|
|
145455
|
+
jointRounded: true
|
|
145456
|
+
}));
|
|
145457
|
+
}
|
|
145458
|
+
if (sType === "polyline" && sel.points?.length >= 2) {
|
|
145459
|
+
selectionLayers.push(new PathLayer({
|
|
145460
|
+
...base,
|
|
145461
|
+
id: `annotation-select-${sUid}`,
|
|
145462
|
+
data: [{ path: sel.points }],
|
|
145463
|
+
getPath: (d) => d.path,
|
|
145464
|
+
getColor: haloColor,
|
|
145465
|
+
getWidth: haloWidth,
|
|
145466
|
+
widthUnits: "pixels",
|
|
145467
|
+
jointRounded: true,
|
|
145468
|
+
capRounded: true
|
|
145469
|
+
}));
|
|
145470
|
+
}
|
|
145471
|
+
}
|
|
145472
|
+
}
|
|
145473
|
+
const layers = [];
|
|
145474
|
+
const dotShapes = [];
|
|
145475
|
+
const clusterDotShapes = [];
|
|
145476
|
+
shapes.forEach((shape2, i2) => {
|
|
145477
|
+
const { uid: uid2, type, strokeColor = [255, 255, 255], strokeWidth = 3, strokeDashArray } = shape2;
|
|
145478
|
+
const isSelected = uid2 === selectedShapeUid;
|
|
145479
|
+
let shapeOpacity = 1;
|
|
145480
|
+
let tipsOpacity = 1;
|
|
145481
|
+
let labelOpacity = 0;
|
|
145482
|
+
if (isSelected || !semanticZoom || authoredZoom === null) {
|
|
145483
|
+
tipsOpacity = 1;
|
|
145484
|
+
labelOpacity = 1;
|
|
145485
|
+
} else {
|
|
145486
|
+
const zoomRatio = 2 ** (zoom - authoredZoom);
|
|
145487
|
+
if (zoomRatio < RATIO_CLUSTER) {
|
|
145488
|
+
clusterDotShapes.push({ shape: shape2 });
|
|
145489
|
+
return;
|
|
145490
|
+
}
|
|
145491
|
+
if (zoomRatio < RATIO_DOT) {
|
|
145492
|
+
dotShapes.push({ shape: shape2, alpha: 200 });
|
|
145493
|
+
return;
|
|
145494
|
+
}
|
|
145495
|
+
if (zoomRatio < RATIO_GEO_FADE) {
|
|
145496
|
+
const t = (zoomRatio - RATIO_DOT) / (RATIO_GEO_FADE - RATIO_DOT);
|
|
145497
|
+
shapeOpacity = t;
|
|
145498
|
+
dotShapes.push({ shape: shape2, alpha: Math.round((1 - t) * 200) });
|
|
145499
|
+
}
|
|
145500
|
+
tipsOpacity = zoomRatio >= RATIO_TIPS ? shapeOpacity : Math.max(0, (zoomRatio - RATIO_GEO_FADE) / (RATIO_TIPS - RATIO_GEO_FADE) * shapeOpacity);
|
|
145501
|
+
if (zoomRatio >= RATIO_LABEL_FULL) {
|
|
145502
|
+
labelOpacity = shapeOpacity;
|
|
145503
|
+
} else if (zoomRatio >= RATIO_LABEL) {
|
|
145504
|
+
labelOpacity = (zoomRatio - RATIO_LABEL) / (RATIO_LABEL_FULL - RATIO_LABEL) * shapeOpacity;
|
|
145505
|
+
}
|
|
145506
|
+
}
|
|
145507
|
+
const arrowDataSize = Math.max(ARROW_SCREEN_PX, strokeWidth * 4) / 2 ** zoom;
|
|
145508
|
+
const base = { coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, opacity: shapeOpacity };
|
|
145509
|
+
const tipsBase = { coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, opacity: tipsOpacity };
|
|
145510
|
+
const labelBase = { coordinateSystem: COORDINATE_SYSTEM.CARTESIAN, opacity: labelOpacity };
|
|
145511
|
+
const labelBgProps = shape2.labelBackground ? {
|
|
145512
|
+
background: true,
|
|
145513
|
+
getBackgroundColor: textBgColor(strokeColor),
|
|
145514
|
+
backgroundPadding: [3, 1, 3, 2]
|
|
145515
|
+
} : {};
|
|
145516
|
+
const labelProps = { ...labelBgProps };
|
|
145517
|
+
const dashArray = parseDashArray(strokeDashArray);
|
|
145518
|
+
const dashExt = [new PathStyleExtension({ dash: true })];
|
|
145519
|
+
const getDash = dashArray ?? [0, 0];
|
|
145520
|
+
if (type === "rectangle") {
|
|
145521
|
+
const { x, y, width: width2, height: height2, fillColor = strokeColor, fillOpacity = 0 } = shape2;
|
|
145522
|
+
const filled = fillOpacity > 0;
|
|
145523
|
+
const rectPolygon = [[x, y], [x + width2, y], [x + width2, y + height2], [x, y + height2]];
|
|
145524
|
+
layers.push(new PolygonLayer({
|
|
145525
|
+
...base,
|
|
145526
|
+
id: `annotation-rect-${uid2}-${i2}`,
|
|
145527
|
+
data: [{ polygon: rectPolygon }],
|
|
145528
|
+
getPolygon: (d) => d.polygon,
|
|
145529
|
+
filled,
|
|
145530
|
+
stroked: true,
|
|
145531
|
+
getFillColor: filled ? [...fillColor, Math.round(fillOpacity * 255)] : [0, 0, 0, 0],
|
|
145532
|
+
getLineColor: strokeColor,
|
|
145533
|
+
getLineWidth: strokeWidth,
|
|
145534
|
+
lineWidthUnits: "pixels",
|
|
145535
|
+
...dashArray ? {
|
|
145536
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145537
|
+
getDashArray: dashArray
|
|
145538
|
+
} : {}
|
|
145539
|
+
}));
|
|
145540
|
+
if (shape2.text && labelOpacity > 0) {
|
|
145541
|
+
layers.push(new TextLayer({
|
|
145542
|
+
...labelBase,
|
|
145543
|
+
...labelProps,
|
|
145544
|
+
id: `annotation-rect-text-${uid2}-${i2}`,
|
|
145545
|
+
data: [{ position: [x, y], text: shape2.text }],
|
|
145546
|
+
getPosition: (d) => d.position,
|
|
145547
|
+
getText: (d) => d.text,
|
|
145548
|
+
getColor: strokeColor,
|
|
145549
|
+
getSize: LABEL_FONT_SIZE,
|
|
145550
|
+
sizeUnits: "pixels",
|
|
145551
|
+
fontFamily: LABEL_FONT_FAMILY,
|
|
145552
|
+
fontWeight: LABEL_FONT_WEIGHT,
|
|
145553
|
+
getPixelOffset: [3, -7],
|
|
145554
|
+
getTextAnchor: "start",
|
|
145555
|
+
getAlignmentBaseline: "bottom"
|
|
145556
|
+
}));
|
|
145557
|
+
}
|
|
145558
|
+
}
|
|
145559
|
+
if (type === "line") {
|
|
145560
|
+
const { x1: x12, y1: y12, x2, y2, markerStart, markerEnd } = shape2;
|
|
145561
|
+
const dx = x2 - x12;
|
|
145562
|
+
const dy = y2 - y12;
|
|
145563
|
+
const len2 = Math.sqrt(dx * dx + dy * dy);
|
|
145564
|
+
const ux = len2 > 0 ? dx / len2 : 0;
|
|
145565
|
+
const uy = len2 > 0 ? dy / len2 : 0;
|
|
145566
|
+
const srcX = markerStart === "Arrow" ? x12 + ux * arrowDataSize : x12;
|
|
145567
|
+
const srcY = markerStart === "Arrow" ? y12 + uy * arrowDataSize : y12;
|
|
145568
|
+
const tgtX = markerEnd === "Arrow" ? x2 - ux * arrowDataSize : x2;
|
|
145569
|
+
const tgtY = markerEnd === "Arrow" ? y2 - uy * arrowDataSize : y2;
|
|
145570
|
+
layers.push(new PathLayer({
|
|
145571
|
+
...base,
|
|
145572
|
+
id: `annotation-line-${uid2}-${i2}`,
|
|
145573
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145574
|
+
getDashArray: dashArray ?? [0, 0],
|
|
145575
|
+
data: [{ path: [[srcX, srcY], [tgtX, tgtY]] }],
|
|
145576
|
+
getPath: (d) => d.path,
|
|
145577
|
+
getColor: strokeColor,
|
|
145578
|
+
getWidth: strokeWidth,
|
|
145579
|
+
widthUnits: "pixels",
|
|
145580
|
+
capRounded: true
|
|
145581
|
+
}));
|
|
145582
|
+
if (markerEnd === "Arrow" && tipsOpacity > 0) {
|
|
145583
|
+
const head = computeArrowhead(x2, y2, x2 - x12, y2 - y12, arrowDataSize);
|
|
145584
|
+
if (head) {
|
|
145585
|
+
layers.push(new PolygonLayer({
|
|
145586
|
+
...tipsBase,
|
|
145587
|
+
id: `annotation-end-arrow-${uid2}-${i2}`,
|
|
145588
|
+
data: [{ polygon: head }],
|
|
145589
|
+
getPolygon: (d) => d.polygon,
|
|
145590
|
+
filled: true,
|
|
145591
|
+
stroked: false,
|
|
145592
|
+
getFillColor: strokeColor
|
|
145593
|
+
}));
|
|
145594
|
+
}
|
|
145595
|
+
}
|
|
145596
|
+
if (markerStart === "Arrow" && tipsOpacity > 0) {
|
|
145597
|
+
const head = computeArrowhead(x12, y12, x12 - x2, y12 - y2, arrowDataSize);
|
|
145598
|
+
if (head) {
|
|
145599
|
+
layers.push(new PolygonLayer({
|
|
145600
|
+
...tipsBase,
|
|
145601
|
+
id: `annotation-start-arrow-${uid2}-${i2}`,
|
|
145602
|
+
data: [{ polygon: head }],
|
|
145603
|
+
getPolygon: (d) => d.polygon,
|
|
145604
|
+
filled: true,
|
|
145605
|
+
stroked: false,
|
|
145606
|
+
getFillColor: strokeColor
|
|
145607
|
+
}));
|
|
145608
|
+
}
|
|
145609
|
+
}
|
|
145610
|
+
if (markerEnd === "Tick" && tipsOpacity > 0) {
|
|
145611
|
+
const tick = computeTickCap(x2, y2, x2 - x12, y2 - y12, arrowDataSize);
|
|
145612
|
+
if (tick) {
|
|
145613
|
+
layers.push(new PathLayer({
|
|
145614
|
+
...tipsBase,
|
|
145615
|
+
id: `annotation-end-tick-${uid2}-${i2}`,
|
|
145616
|
+
data: [{ path: tick }],
|
|
145617
|
+
getPath: (d) => d.path,
|
|
145618
|
+
getColor: strokeColor,
|
|
145619
|
+
getWidth: strokeWidth,
|
|
145620
|
+
widthUnits: "pixels",
|
|
145621
|
+
capRounded: true
|
|
145622
|
+
}));
|
|
145623
|
+
}
|
|
145624
|
+
}
|
|
145625
|
+
if (markerStart === "Tick" && tipsOpacity > 0) {
|
|
145626
|
+
const tick = computeTickCap(x12, y12, x12 - x2, y12 - y2, arrowDataSize);
|
|
145627
|
+
if (tick) {
|
|
145628
|
+
layers.push(new PathLayer({
|
|
145629
|
+
...tipsBase,
|
|
145630
|
+
id: `annotation-start-tick-${uid2}-${i2}`,
|
|
145631
|
+
data: [{ path: tick }],
|
|
145632
|
+
getPath: (d) => d.path,
|
|
145633
|
+
getColor: strokeColor,
|
|
145634
|
+
getWidth: strokeWidth,
|
|
145635
|
+
widthUnits: "pixels",
|
|
145636
|
+
capRounded: true
|
|
145637
|
+
}));
|
|
145638
|
+
}
|
|
145639
|
+
}
|
|
145640
|
+
if (shape2.text) {
|
|
145641
|
+
const pos = shape2.textPosition ?? "start";
|
|
145642
|
+
let textX;
|
|
145643
|
+
let textY;
|
|
145644
|
+
if (pos === "start") {
|
|
145645
|
+
textX = x12;
|
|
145646
|
+
textY = y12;
|
|
145647
|
+
} else if (pos === "end") {
|
|
145648
|
+
textX = x2;
|
|
145649
|
+
textY = y2;
|
|
145650
|
+
} else {
|
|
145651
|
+
textX = (x12 + x2) / 2;
|
|
145652
|
+
textY = (y12 + y2) / 2;
|
|
145653
|
+
}
|
|
145654
|
+
let pixelOffset = [0, 0];
|
|
145655
|
+
let textAnchor = "middle";
|
|
145656
|
+
let alignmentBaseline = "center";
|
|
145657
|
+
if (pos !== "middle") {
|
|
145658
|
+
const dxT = x2 - x12;
|
|
145659
|
+
const dyT = y2 - y12;
|
|
145660
|
+
const lenT = Math.sqrt(dxT * dxT + dyT * dyT);
|
|
145661
|
+
if (lenT > 0) {
|
|
145662
|
+
const uxT = dxT / lenT;
|
|
145663
|
+
const uyT = dyT / lenT;
|
|
145664
|
+
const sign2 = pos === "start" ? -1 : 1;
|
|
145665
|
+
const bufferPx = shape2.textBufferPx ?? 8;
|
|
145666
|
+
const offsetX = sign2 * uxT * bufferPx;
|
|
145667
|
+
const offsetY = sign2 * uyT * bufferPx;
|
|
145668
|
+
pixelOffset = [offsetX, offsetY];
|
|
145669
|
+
const absX = Math.abs(offsetX);
|
|
145670
|
+
const absY = Math.abs(offsetY);
|
|
145671
|
+
if (absX >= absY) {
|
|
145672
|
+
textAnchor = offsetX > 0 ? "start" : "end";
|
|
145673
|
+
}
|
|
145674
|
+
if (absY >= absX) {
|
|
145675
|
+
alignmentBaseline = offsetY > 0 ? "top" : "bottom";
|
|
145676
|
+
}
|
|
145677
|
+
}
|
|
145678
|
+
} else if (len2 > 0) {
|
|
145679
|
+
const belowPerp = pickBelowPerp(ux, uy);
|
|
145680
|
+
const bufferPx = shape2.textBufferPx ?? 14;
|
|
145681
|
+
pixelOffset = [-belowPerp[0] * bufferPx, -belowPerp[1] * bufferPx];
|
|
145682
|
+
textAnchor = "middle";
|
|
145683
|
+
alignmentBaseline = "center";
|
|
145684
|
+
}
|
|
145685
|
+
const middleAngle = pos === "middle" && len2 > 0 ? -readableAngle(Math.atan2(dy, dx) * 180 / Math.PI) : null;
|
|
145686
|
+
if (labelOpacity <= 0)
|
|
145687
|
+
return;
|
|
145688
|
+
layers.push(new TextLayer({
|
|
145689
|
+
...labelBase,
|
|
145690
|
+
...labelProps,
|
|
145691
|
+
id: `annotation-line-text-${uid2}-${i2}`,
|
|
145692
|
+
data: [{ position: [textX, textY], text: shape2.text }],
|
|
145693
|
+
getPosition: (d) => d.position,
|
|
145694
|
+
getText: (d) => d.text,
|
|
145695
|
+
getColor: strokeColor,
|
|
145696
|
+
getSize: LABEL_FONT_SIZE,
|
|
145697
|
+
sizeUnits: "pixels",
|
|
145698
|
+
fontFamily: LABEL_FONT_FAMILY,
|
|
145699
|
+
fontWeight: LABEL_FONT_WEIGHT,
|
|
145700
|
+
getPixelOffset: pixelOffset,
|
|
145701
|
+
getTextAnchor: textAnchor,
|
|
145702
|
+
getAlignmentBaseline: alignmentBaseline,
|
|
145703
|
+
...middleAngle !== null && { getAngle: middleAngle }
|
|
145704
|
+
}));
|
|
145705
|
+
}
|
|
145706
|
+
}
|
|
145707
|
+
if (type === "ellipse") {
|
|
145708
|
+
const { x1: x12, y1: y12, radiusX, radiusY, fillColor = strokeColor, fillOpacity = 0 } = shape2;
|
|
145709
|
+
const polygon2 = computeEllipsePolygon(x12, y12, radiusX, radiusY);
|
|
145710
|
+
const filled = fillOpacity > 0;
|
|
145711
|
+
layers.push(new PolygonLayer({
|
|
145712
|
+
...base,
|
|
145713
|
+
id: `annotation-ellipse-${uid2}-${i2}`,
|
|
145714
|
+
data: [{ polygon: polygon2 }],
|
|
145715
|
+
getPolygon: (d) => d.polygon,
|
|
145716
|
+
filled,
|
|
145717
|
+
stroked: true,
|
|
145718
|
+
getFillColor: filled ? [...fillColor, Math.round(fillOpacity * 255)] : [0, 0, 0, 0],
|
|
145719
|
+
getLineColor: strokeColor,
|
|
145720
|
+
getLineWidth: strokeWidth,
|
|
145721
|
+
lineWidthUnits: "pixels",
|
|
145722
|
+
...dashArray ? {
|
|
145723
|
+
extensions: [new PathStyleExtension({ dash: true })],
|
|
145724
|
+
getDashArray: dashArray
|
|
145725
|
+
} : {}
|
|
145726
|
+
}));
|
|
145727
|
+
if (shape2.text && labelOpacity > 0) {
|
|
145728
|
+
layers.push(new TextLayer({
|
|
145729
|
+
...labelBase,
|
|
145730
|
+
...labelProps,
|
|
145731
|
+
id: `annotation-ellipse-text-${uid2}-${i2}`,
|
|
145732
|
+
data: [{ position: [x12, y12 - radiusY], text: shape2.text }],
|
|
145733
|
+
getPosition: (d) => d.position,
|
|
145734
|
+
getText: (d) => d.text,
|
|
145735
|
+
getColor: strokeColor,
|
|
145736
|
+
getSize: LABEL_FONT_SIZE,
|
|
145737
|
+
sizeUnits: "pixels",
|
|
145738
|
+
fontFamily: LABEL_FONT_FAMILY,
|
|
145739
|
+
fontWeight: LABEL_FONT_WEIGHT,
|
|
145740
|
+
getPixelOffset: [0, -4],
|
|
145741
|
+
getTextAnchor: "middle",
|
|
145742
|
+
getAlignmentBaseline: "bottom"
|
|
145743
|
+
}));
|
|
145744
|
+
}
|
|
145745
|
+
}
|
|
145746
|
+
if (type === "polygon") {
|
|
145747
|
+
const { points, fillColor = strokeColor, fillOpacity = 0 } = shape2;
|
|
145748
|
+
if (!points || points.length < 3)
|
|
145749
|
+
return;
|
|
145750
|
+
const closedPath = [...points, points[0]];
|
|
145751
|
+
if (fillOpacity > 0) {
|
|
145752
|
+
layers.push(new PolygonLayer({
|
|
145753
|
+
...base,
|
|
145754
|
+
id: `annotation-polygon-fill-${uid2}-${i2}`,
|
|
145755
|
+
data: [{ polygon: points }],
|
|
145756
|
+
getPolygon: (d) => d.polygon,
|
|
145757
|
+
stroked: false,
|
|
145758
|
+
filled: true,
|
|
145759
|
+
getFillColor: [...fillColor, Math.round(fillOpacity * 255)]
|
|
145760
|
+
}));
|
|
145761
|
+
}
|
|
145762
|
+
layers.push(new PathLayer({
|
|
145763
|
+
...base,
|
|
145764
|
+
id: `annotation-polygon-${uid2}-${i2}`,
|
|
145765
|
+
extensions: dashExt,
|
|
145766
|
+
getDashArray: getDash,
|
|
145767
|
+
data: [{ path: closedPath }],
|
|
145768
|
+
getPath: (d) => d.path,
|
|
145769
|
+
getColor: strokeColor,
|
|
145770
|
+
getWidth: strokeWidth,
|
|
145771
|
+
widthUnits: "pixels",
|
|
145772
|
+
jointRounded: true
|
|
145773
|
+
}));
|
|
145774
|
+
if (shape2.text && labelOpacity > 0) {
|
|
145775
|
+
const minX = Math.min(...points.map((p) => p[0]));
|
|
145776
|
+
const maxX = Math.max(...points.map((p) => p[0]));
|
|
145777
|
+
const minY = Math.min(...points.map((p) => p[1]));
|
|
145778
|
+
const topCenterX = (minX + maxX) / 2;
|
|
145779
|
+
layers.push(new TextLayer({
|
|
145780
|
+
...labelBase,
|
|
145781
|
+
...labelProps,
|
|
145782
|
+
id: `annotation-polygon-text-${uid2}-${i2}`,
|
|
145783
|
+
data: [{ position: [topCenterX, minY], text: shape2.text }],
|
|
145784
|
+
getPosition: (d) => d.position,
|
|
145785
|
+
getText: (d) => d.text,
|
|
145786
|
+
getColor: strokeColor,
|
|
145787
|
+
getSize: LABEL_FONT_SIZE,
|
|
145788
|
+
sizeUnits: "pixels",
|
|
145789
|
+
fontFamily: LABEL_FONT_FAMILY,
|
|
145790
|
+
fontWeight: LABEL_FONT_WEIGHT,
|
|
145791
|
+
getPixelOffset: [0, -4],
|
|
145792
|
+
getTextAnchor: "middle",
|
|
145793
|
+
getAlignmentBaseline: "bottom"
|
|
145794
|
+
}));
|
|
145795
|
+
}
|
|
145796
|
+
}
|
|
145797
|
+
if (type === "polyline") {
|
|
145798
|
+
const { points, markerStart, markerEnd } = shape2;
|
|
145799
|
+
if (!points || points.length < 2)
|
|
145800
|
+
return;
|
|
145801
|
+
let pathPoints = points;
|
|
145802
|
+
if (markerStart === "Arrow") {
|
|
145803
|
+
const [x02, y02] = points[0];
|
|
145804
|
+
const [x12, y12] = points[1];
|
|
145805
|
+
const dx = x02 - x12;
|
|
145806
|
+
const dy = y02 - y12;
|
|
145807
|
+
const len2 = Math.sqrt(dx * dx + dy * dy);
|
|
145808
|
+
if (len2 > 0) {
|
|
145809
|
+
const ux = dx / len2;
|
|
145810
|
+
const uy = dy / len2;
|
|
145811
|
+
pathPoints = [[x02 - ux * arrowDataSize, y02 - uy * arrowDataSize], ...pathPoints.slice(1)];
|
|
145812
|
+
}
|
|
145813
|
+
}
|
|
145814
|
+
if (markerEnd === "Arrow") {
|
|
145815
|
+
const last = pathPoints[pathPoints.length - 1];
|
|
145816
|
+
const prev2 = pathPoints[pathPoints.length - 2];
|
|
145817
|
+
const dx = last[0] - prev2[0];
|
|
145818
|
+
const dy = last[1] - prev2[1];
|
|
145819
|
+
const len2 = Math.sqrt(dx * dx + dy * dy);
|
|
145820
|
+
if (len2 > 0) {
|
|
145821
|
+
const ux = dx / len2;
|
|
145822
|
+
const uy = dy / len2;
|
|
145823
|
+
const shortened = [last[0] - ux * arrowDataSize, last[1] - uy * arrowDataSize];
|
|
145824
|
+
pathPoints = [...pathPoints.slice(0, -1), shortened];
|
|
145825
|
+
}
|
|
145826
|
+
}
|
|
145827
|
+
layers.push(new PathLayer({
|
|
145828
|
+
...base,
|
|
145829
|
+
id: `annotation-polyline-${uid2}-${i2}`,
|
|
145830
|
+
extensions: dashExt,
|
|
145831
|
+
getDashArray: getDash,
|
|
145832
|
+
data: [{ path: pathPoints }],
|
|
145833
|
+
getPath: (d) => d.path,
|
|
145834
|
+
getColor: strokeColor,
|
|
145835
|
+
getWidth: strokeWidth,
|
|
145836
|
+
widthUnits: "pixels",
|
|
145837
|
+
jointRounded: true,
|
|
145838
|
+
capRounded: true
|
|
145839
|
+
}));
|
|
145840
|
+
if (markerStart === "Arrow" && tipsOpacity > 0) {
|
|
145841
|
+
const [x02, y02] = points[0];
|
|
145842
|
+
const [x12, y12] = points[1];
|
|
145843
|
+
const head = computeArrowhead(x02, y02, x02 - x12, y02 - y12, arrowDataSize);
|
|
145844
|
+
if (head) {
|
|
145845
|
+
layers.push(new PolygonLayer({
|
|
145846
|
+
...tipsBase,
|
|
145847
|
+
id: `annotation-polyline-start-arrow-${uid2}-${i2}`,
|
|
145848
|
+
data: [{ polygon: head }],
|
|
145849
|
+
getPolygon: (d) => d.polygon,
|
|
145850
|
+
filled: true,
|
|
145851
|
+
stroked: false,
|
|
145852
|
+
getFillColor: strokeColor
|
|
145853
|
+
}));
|
|
145854
|
+
}
|
|
145855
|
+
}
|
|
145856
|
+
if (markerEnd === "Arrow" && tipsOpacity > 0) {
|
|
145857
|
+
const last = points[points.length - 1];
|
|
145858
|
+
const prev2 = points[points.length - 2];
|
|
145859
|
+
const dxArrow = last[0] - prev2[0];
|
|
145860
|
+
const dyArrow = last[1] - prev2[1];
|
|
145861
|
+
const head = computeArrowhead(last[0], last[1], dxArrow, dyArrow, arrowDataSize);
|
|
145862
|
+
if (head) {
|
|
145863
|
+
layers.push(new PolygonLayer({
|
|
145864
|
+
...tipsBase,
|
|
145865
|
+
id: `annotation-polyline-end-arrow-${uid2}-${i2}`,
|
|
145866
|
+
data: [{ polygon: head }],
|
|
145867
|
+
getPolygon: (d) => d.polygon,
|
|
145868
|
+
filled: true,
|
|
145869
|
+
stroked: false,
|
|
145870
|
+
getFillColor: strokeColor
|
|
145871
|
+
}));
|
|
145872
|
+
}
|
|
145873
|
+
}
|
|
145874
|
+
if (markerStart === "Tick" && tipsOpacity > 0) {
|
|
145875
|
+
const [x02, y02] = points[0];
|
|
145876
|
+
const [x12, y12] = points[1];
|
|
145877
|
+
const tick = computeTickCap(x02, y02, x02 - x12, y02 - y12, arrowDataSize);
|
|
145878
|
+
if (tick) {
|
|
145879
|
+
layers.push(new PathLayer({
|
|
145880
|
+
...tipsBase,
|
|
145881
|
+
id: `annotation-polyline-start-tick-${uid2}-${i2}`,
|
|
145882
|
+
data: [{ path: tick }],
|
|
145883
|
+
getPath: (d) => d.path,
|
|
145884
|
+
getColor: strokeColor,
|
|
145885
|
+
getWidth: strokeWidth,
|
|
145886
|
+
widthUnits: "pixels",
|
|
145887
|
+
capRounded: true
|
|
145888
|
+
}));
|
|
145889
|
+
}
|
|
145890
|
+
}
|
|
145891
|
+
if (markerEnd === "Tick" && tipsOpacity > 0) {
|
|
145892
|
+
const last = points[points.length - 1];
|
|
145893
|
+
const prev2 = points[points.length - 2];
|
|
145894
|
+
const dxTick = last[0] - prev2[0];
|
|
145895
|
+
const dyTick = last[1] - prev2[1];
|
|
145896
|
+
const tick = computeTickCap(last[0], last[1], dxTick, dyTick, arrowDataSize);
|
|
145897
|
+
if (tick) {
|
|
145898
|
+
layers.push(new PathLayer({
|
|
145899
|
+
...tipsBase,
|
|
145900
|
+
id: `annotation-polyline-end-tick-${uid2}-${i2}`,
|
|
145901
|
+
data: [{ path: tick }],
|
|
145902
|
+
getPath: (d) => d.path,
|
|
145903
|
+
getColor: strokeColor,
|
|
145904
|
+
getWidth: strokeWidth,
|
|
145905
|
+
widthUnits: "pixels",
|
|
145906
|
+
capRounded: true
|
|
145907
|
+
}));
|
|
145908
|
+
}
|
|
145909
|
+
}
|
|
145910
|
+
if (shape2.text) {
|
|
145911
|
+
const pos = shape2.textPosition ?? "start";
|
|
145912
|
+
const bufferPx = shape2.textBufferPx ?? 8;
|
|
145913
|
+
let textPt;
|
|
145914
|
+
let dirX;
|
|
145915
|
+
let dirY;
|
|
145916
|
+
if (pos === "end") {
|
|
145917
|
+
const last = points[points.length - 1];
|
|
145918
|
+
const prev2 = points[points.length - 2];
|
|
145919
|
+
textPt = last;
|
|
145920
|
+
dirX = last[0] - prev2[0];
|
|
145921
|
+
dirY = last[1] - prev2[1];
|
|
145922
|
+
} else if (pos === "middle") {
|
|
145923
|
+
const mx = points.reduce((s2, p) => s2 + p[0], 0) / points.length;
|
|
145924
|
+
const my = points.reduce((s2, p) => s2 + p[1], 0) / points.length;
|
|
145925
|
+
textPt = [mx, my];
|
|
145926
|
+
dirX = 0;
|
|
145927
|
+
dirY = 0;
|
|
145928
|
+
} else {
|
|
145929
|
+
[textPt] = points;
|
|
145930
|
+
dirX = points[0][0] - points[1][0];
|
|
145931
|
+
dirY = points[0][1] - points[1][1];
|
|
145932
|
+
}
|
|
145933
|
+
const [textX, textY] = textPt;
|
|
145934
|
+
const lenT = Math.sqrt(dirX * dirX + dirY * dirY);
|
|
145935
|
+
let polylinePixelOffset = [0, 0];
|
|
145936
|
+
let polylineTextAnchor = "middle";
|
|
145937
|
+
let polylineAlignmentBaseline = pos === "middle" ? "center" : "bottom";
|
|
145938
|
+
if (lenT > 0) {
|
|
145939
|
+
const uxT = dirX / lenT;
|
|
145940
|
+
const uyT = dirY / lenT;
|
|
145941
|
+
const offX = uxT * bufferPx;
|
|
145942
|
+
const offY = uyT * bufferPx;
|
|
145943
|
+
polylinePixelOffset = [offX, offY];
|
|
145944
|
+
if (Math.abs(offX) >= Math.abs(offY)) {
|
|
145945
|
+
polylineTextAnchor = offX > 0 ? "start" : "end";
|
|
145946
|
+
}
|
|
145947
|
+
if (Math.abs(offY) >= Math.abs(offX)) {
|
|
145948
|
+
polylineAlignmentBaseline = offY > 0 ? "top" : "bottom";
|
|
145949
|
+
}
|
|
145950
|
+
}
|
|
145951
|
+
if (labelOpacity <= 0)
|
|
145952
|
+
return;
|
|
145953
|
+
layers.push(new TextLayer({
|
|
145954
|
+
...labelBase,
|
|
145955
|
+
...labelProps,
|
|
145956
|
+
id: `annotation-polyline-text-${uid2}-${i2}`,
|
|
145957
|
+
data: [{ position: [textX, textY], text: shape2.text }],
|
|
145958
|
+
getPosition: (d) => d.position,
|
|
145959
|
+
getText: (d) => d.text,
|
|
145960
|
+
getColor: strokeColor,
|
|
145961
|
+
getSize: LABEL_FONT_SIZE,
|
|
145962
|
+
sizeUnits: "pixels",
|
|
145963
|
+
fontFamily: LABEL_FONT_FAMILY,
|
|
145964
|
+
fontWeight: LABEL_FONT_WEIGHT,
|
|
145965
|
+
getPixelOffset: polylinePixelOffset,
|
|
145966
|
+
getTextAnchor: polylineTextAnchor,
|
|
145967
|
+
getAlignmentBaseline: polylineAlignmentBaseline
|
|
145968
|
+
}));
|
|
145969
|
+
}
|
|
145970
|
+
}
|
|
145971
|
+
});
|
|
145972
|
+
if (dotShapes.length > 0) {
|
|
145973
|
+
layers.push(new ScatterplotLayer({
|
|
145974
|
+
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
145975
|
+
id: "annotation-dots",
|
|
145976
|
+
data: dotShapes.map(({ shape: s2, alpha: alpha2 }) => ({
|
|
145977
|
+
position: getShapeCentroid(s2),
|
|
145978
|
+
color: [...s2.strokeColor ?? [255, 255, 255], alpha2]
|
|
145979
|
+
})),
|
|
145980
|
+
getPosition: (d) => d.position,
|
|
145981
|
+
getFillColor: (d) => d.color,
|
|
145982
|
+
getRadius: 4,
|
|
145983
|
+
radiusUnits: "pixels",
|
|
145984
|
+
filled: true,
|
|
145985
|
+
stroked: false
|
|
145986
|
+
}));
|
|
145987
|
+
}
|
|
145988
|
+
if (clusterDotShapes.length > 0) {
|
|
145989
|
+
const clusters = computeClusters(clusterDotShapes, zoom);
|
|
145990
|
+
layers.push(new ScatterplotLayer({
|
|
145991
|
+
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
145992
|
+
id: "annotation-clusters",
|
|
145993
|
+
data: clusters,
|
|
145994
|
+
getPosition: (d) => d.position,
|
|
145995
|
+
getFillColor: (d) => [...d.color, 180],
|
|
145996
|
+
getRadius: (d) => Math.max(6, 4 + Math.sqrt(d.count) * 2),
|
|
145997
|
+
radiusUnits: "pixels",
|
|
145998
|
+
filled: true,
|
|
145999
|
+
stroked: true,
|
|
146000
|
+
getLineColor: (d) => [...d.color, 220],
|
|
146001
|
+
lineWidthMinPixels: 1.5
|
|
146002
|
+
}));
|
|
146003
|
+
const multiClusters = clusters.filter((c) => c.count > 1);
|
|
146004
|
+
if (multiClusters.length > 0) {
|
|
146005
|
+
layers.push(new TextLayer({
|
|
146006
|
+
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
146007
|
+
id: "annotation-cluster-counts",
|
|
146008
|
+
data: multiClusters,
|
|
146009
|
+
getPosition: (d) => d.position,
|
|
146010
|
+
getText: (d) => String(d.count),
|
|
146011
|
+
getColor: [255, 255, 255],
|
|
146012
|
+
getSize: 10,
|
|
146013
|
+
sizeUnits: "pixels",
|
|
146014
|
+
fontWeight: "bold",
|
|
146015
|
+
getTextAnchor: "middle",
|
|
146016
|
+
getAlignmentBaseline: "center"
|
|
146017
|
+
}));
|
|
146018
|
+
}
|
|
146019
|
+
}
|
|
146020
|
+
const measureLayers = [];
|
|
146021
|
+
shapes.forEach((shape2) => {
|
|
146022
|
+
if (!shape2.showMeasure)
|
|
146023
|
+
return;
|
|
146024
|
+
const mIsSelected = shape2.uid === selectedShapeUid;
|
|
146025
|
+
const label = getMeasurementLabel(shape2, physicalPixelSize, viewType);
|
|
146026
|
+
if (!label)
|
|
146027
|
+
return;
|
|
146028
|
+
const color2 = shape2.strokeColor ?? [255, 255, 255];
|
|
146029
|
+
let mShapeOpacity = 1;
|
|
146030
|
+
let mLabelFactor = 0;
|
|
146031
|
+
if (mIsSelected || !semanticZoom || authoredZoom === null) {
|
|
146032
|
+
mLabelFactor = 1;
|
|
146033
|
+
} else {
|
|
146034
|
+
const mZoomRatio = 2 ** (zoom - authoredZoom);
|
|
146035
|
+
if (mZoomRatio < RATIO_DOT)
|
|
146036
|
+
return;
|
|
146037
|
+
if (mZoomRatio < RATIO_GEO_FADE) {
|
|
146038
|
+
mShapeOpacity = (mZoomRatio - RATIO_DOT) / (RATIO_GEO_FADE - RATIO_DOT);
|
|
146039
|
+
}
|
|
146040
|
+
if (mZoomRatio >= RATIO_LABEL_FULL) {
|
|
146041
|
+
mLabelFactor = 1;
|
|
146042
|
+
} else if (mZoomRatio >= RATIO_LABEL) {
|
|
146043
|
+
mLabelFactor = (mZoomRatio - RATIO_LABEL) / (RATIO_LABEL_FULL - RATIO_LABEL);
|
|
146044
|
+
}
|
|
146045
|
+
}
|
|
146046
|
+
const measureOpacity = mShapeOpacity * mLabelFactor;
|
|
146047
|
+
if (measureOpacity <= 0)
|
|
146048
|
+
return;
|
|
146049
|
+
const base = {
|
|
146050
|
+
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
|
146051
|
+
opacity: measureOpacity,
|
|
146052
|
+
getText: (d) => d.text,
|
|
146053
|
+
getPosition: (d) => d.position,
|
|
146054
|
+
getColor: color2,
|
|
146055
|
+
getSize: 13,
|
|
146056
|
+
sizeUnits: "pixels",
|
|
146057
|
+
fontFamily: LABEL_FONT_FAMILY,
|
|
146058
|
+
fontWeight: "bold",
|
|
146059
|
+
// 'auto' builds the font atlas from the actual rendered characters (e.g. µ, ²)
|
|
146060
|
+
// instead of deck.gl's default ASCII-only atlas.
|
|
146061
|
+
characterSet: "auto",
|
|
146062
|
+
...shape2.measureBackground ? {
|
|
146063
|
+
background: true,
|
|
146064
|
+
getBackgroundColor: textBgColor(color2),
|
|
146065
|
+
backgroundPadding: [3, 1, 3, 2]
|
|
146066
|
+
} : {}
|
|
146067
|
+
};
|
|
146068
|
+
if (shape2.type === "line") {
|
|
146069
|
+
const mx = ((shape2.x1 ?? 0) + (shape2.x2 ?? 0)) / 2;
|
|
146070
|
+
const my = ((shape2.y1 ?? 0) + (shape2.y2 ?? 0)) / 2;
|
|
146071
|
+
const dx = (shape2.x2 ?? 0) - (shape2.x1 ?? 0);
|
|
146072
|
+
const dy = (shape2.y2 ?? 0) - (shape2.y1 ?? 0);
|
|
146073
|
+
const len2 = Math.sqrt(dx * dx + dy * dy);
|
|
146074
|
+
if (len2 === 0)
|
|
146075
|
+
return;
|
|
146076
|
+
const perp = pickBelowPerp(dx / len2, dy / len2);
|
|
146077
|
+
const angle2 = readableAngle(Math.atan2(dy, dx) * 180 / Math.PI);
|
|
146078
|
+
measureLayers.push(new TextLayer({
|
|
146079
|
+
...base,
|
|
146080
|
+
id: `annotation-measure-${shape2.uid}`,
|
|
146081
|
+
data: [{ position: [mx, my], text: label }],
|
|
146082
|
+
getAngle: -angle2,
|
|
146083
|
+
getTextAnchor: "middle",
|
|
146084
|
+
getAlignmentBaseline: "center",
|
|
146085
|
+
getPixelOffset: [perp[0] * 16, perp[1] * 16]
|
|
146086
|
+
}));
|
|
146087
|
+
} else if (shape2.type === "polyline" && shape2.points?.length >= 2) {
|
|
146088
|
+
const pts = shape2.points;
|
|
146089
|
+
const mi = Math.floor((pts.length - 1) / 2);
|
|
146090
|
+
const [ax, ay] = pts[mi];
|
|
146091
|
+
const [bx, by] = pts[mi + 1];
|
|
146092
|
+
const dx = bx - ax;
|
|
146093
|
+
const dy = by - ay;
|
|
146094
|
+
const len2 = Math.sqrt(dx * dx + dy * dy);
|
|
146095
|
+
if (len2 === 0)
|
|
146096
|
+
return;
|
|
146097
|
+
const perp = pickBelowPerp(dx / len2, dy / len2);
|
|
146098
|
+
const angle2 = readableAngle(Math.atan2(dy, dx) * 180 / Math.PI);
|
|
146099
|
+
measureLayers.push(new TextLayer({
|
|
146100
|
+
...base,
|
|
146101
|
+
id: `annotation-measure-${shape2.uid}`,
|
|
146102
|
+
data: [{ position: [(ax + bx) / 2, (ay + by) / 2], text: label }],
|
|
146103
|
+
getAngle: -angle2,
|
|
146104
|
+
getTextAnchor: "middle",
|
|
146105
|
+
getAlignmentBaseline: "center",
|
|
146106
|
+
getPixelOffset: [perp[0] * 16, perp[1] * 16]
|
|
146107
|
+
}));
|
|
146108
|
+
} else if (shape2.type === "rectangle") {
|
|
146109
|
+
const x02 = shape2.x ?? 0;
|
|
146110
|
+
const y02 = shape2.y ?? 0;
|
|
146111
|
+
const w2 = shape2.width ?? 0;
|
|
146112
|
+
const h = shape2.height ?? 0;
|
|
146113
|
+
const rx = x02 + (w2 >= 0 ? w2 : 0);
|
|
146114
|
+
const ry = y02 + (h >= 0 ? h : 0);
|
|
146115
|
+
measureLayers.push(new TextLayer({
|
|
146116
|
+
...base,
|
|
146117
|
+
id: `annotation-measure-${shape2.uid}`,
|
|
146118
|
+
data: [{ position: [rx, ry], text: label }],
|
|
146119
|
+
getTextAnchor: "end",
|
|
146120
|
+
getAlignmentBaseline: "bottom",
|
|
146121
|
+
getPixelOffset: [-6, -6]
|
|
146122
|
+
}));
|
|
146123
|
+
} else if (shape2.type === "ellipse") {
|
|
146124
|
+
const cx = shape2.x1 ?? 0;
|
|
146125
|
+
const cy = shape2.y1 ?? 0;
|
|
146126
|
+
const ry = Math.abs(shape2.radiusY ?? 0);
|
|
146127
|
+
measureLayers.push(new TextLayer({
|
|
146128
|
+
...base,
|
|
146129
|
+
id: `annotation-measure-${shape2.uid}`,
|
|
146130
|
+
data: [{ position: [cx, cy + ry], text: label }],
|
|
146131
|
+
getTextAnchor: "middle",
|
|
146132
|
+
getAlignmentBaseline: "top",
|
|
146133
|
+
getPixelOffset: [0, 8]
|
|
146134
|
+
}));
|
|
146135
|
+
} else if (shape2.type === "polygon" && shape2.points?.length >= 3) {
|
|
146136
|
+
const xs = shape2.points.map((p) => p[0]);
|
|
146137
|
+
const ys = shape2.points.map((p) => p[1]);
|
|
146138
|
+
const cx = (Math.min(...xs) + Math.max(...xs)) / 2;
|
|
146139
|
+
const maxY = Math.max(...ys);
|
|
146140
|
+
measureLayers.push(new TextLayer({
|
|
146141
|
+
...base,
|
|
146142
|
+
id: `annotation-measure-${shape2.uid}`,
|
|
146143
|
+
data: [{ position: [cx, maxY], text: label }],
|
|
146144
|
+
getTextAnchor: "middle",
|
|
146145
|
+
getAlignmentBaseline: "top",
|
|
146146
|
+
getPixelOffset: [0, 8]
|
|
146147
|
+
}));
|
|
146148
|
+
}
|
|
146149
|
+
});
|
|
146150
|
+
return [...selectionLayers, ...layers, ...measureLayers];
|
|
146151
|
+
}
|
|
146152
|
+
const defaultProps = {
|
|
146153
|
+
// Array of annotation shape objects (see annotationShapeObj in @vitessce/schemas).
|
|
146154
|
+
data: { type: "object", value: [], compare: true },
|
|
146155
|
+
// UID of the shape to highlight with a selection halo.
|
|
146156
|
+
selectedShapeUid: { type: "string", value: null },
|
|
146157
|
+
// { x, y, unit } used to format measurement labels in physical units.
|
|
146158
|
+
physicalPixelSize: { type: "object", value: null, compare: true },
|
|
146159
|
+
// The zoom level at which the shapes were authored (reference for semantic zoom).
|
|
146160
|
+
authoredZoom: { type: "number", value: null },
|
|
146161
|
+
// Whether to apply semantic zoom (level-of-detail) based on authoredZoom.
|
|
146162
|
+
semanticZoom: { type: "boolean", value: true },
|
|
146163
|
+
// The view type in which the layer is rendered (affects measurement label formatting).
|
|
146164
|
+
viewType: { type: "string", value: ViewType.SPATIAL },
|
|
146165
|
+
// In-progress shape being drawn, as { type, vertices }.
|
|
146166
|
+
inProgressShape: { type: "object", value: null, compare: true },
|
|
146167
|
+
// Current mouse position (in data coordinates) while drawing.
|
|
146168
|
+
hoverCoord: { type: "array", value: null, compare: true },
|
|
146169
|
+
// Stroke color [r, g, b] of the in-progress shape preview.
|
|
146170
|
+
previewStrokeColor: { type: "color", value: [255, 255, 0] }
|
|
146171
|
+
};
|
|
146172
|
+
class AnnotationLayer extends CompositeLayer {
|
|
146173
|
+
// The semantic zoom and arrowhead sizes depend on the current zoom level,
|
|
146174
|
+
// so the sublayers must also be re-rendered when the viewport changes.
|
|
146175
|
+
// eslint-disable-next-line class-methods-use-this
|
|
146176
|
+
shouldUpdateState({ changeFlags }) {
|
|
146177
|
+
return changeFlags.propsOrDataChanged || changeFlags.viewportChanged;
|
|
146178
|
+
}
|
|
146179
|
+
/**
|
|
146180
|
+
* Prefix the sublayer ID with this layer's ID (so that multiple
|
|
146181
|
+
* AnnotationLayers can co-exist), and combine this layer's
|
|
146182
|
+
* opacity with the per-shape opacity of the sublayer.
|
|
146183
|
+
* Note: we avoid getSubLayerProps here, since it would
|
|
146184
|
+
* overwrite the sublayer extensions (e.g., PathStyleExtension)
|
|
146185
|
+
* and opacity values.
|
|
146186
|
+
* @param {object} layer A DeckGL layer instance.
|
|
146187
|
+
* @returns {object} The cloned layer instance.
|
|
146188
|
+
*/
|
|
146189
|
+
wrapSubLayer(layer) {
|
|
146190
|
+
const { id, opacity, pickable, visible } = this.props;
|
|
146191
|
+
return layer.clone({
|
|
146192
|
+
id: `${id}-${layer.id}`,
|
|
146193
|
+
opacity: layer.props.opacity * opacity,
|
|
146194
|
+
pickable,
|
|
146195
|
+
visible
|
|
146196
|
+
});
|
|
146197
|
+
}
|
|
146198
|
+
renderLayers() {
|
|
146199
|
+
const { data, selectedShapeUid, physicalPixelSize, authoredZoom, semanticZoom, viewType, inProgressShape, hoverCoord, previewStrokeColor } = this.props;
|
|
146200
|
+
const zoom = this.context.viewport?.zoom ?? 0;
|
|
146201
|
+
const visibleShapes = (data ?? []).filter((shape2) => shape2.visible !== false);
|
|
146202
|
+
const annotationLayers = createAnnotationLayers(visibleShapes, zoom, selectedShapeUid, physicalPixelSize, authoredZoom, semanticZoom, viewType);
|
|
146203
|
+
const previewLayer = createPreviewLayer(inProgressShape, hoverCoord, previewStrokeColor.slice(0, 3));
|
|
146204
|
+
return [
|
|
146205
|
+
...annotationLayers,
|
|
146206
|
+
...previewLayer ? [previewLayer] : []
|
|
146207
|
+
].map((layer) => this.wrapSubLayer(layer));
|
|
146208
|
+
}
|
|
146209
|
+
}
|
|
146210
|
+
AnnotationLayer.layerName = "AnnotationLayer";
|
|
146211
|
+
AnnotationLayer.defaultProps = defaultProps;
|
|
144968
146212
|
const toRgbUIString = (on, arr, theme) => {
|
|
144969
146213
|
const color2 = on || theme !== "dark" && arr?.every((i2) => i2 === 255) ? [220, 220, 220] : arr;
|
|
144970
146214
|
return `rgb(${color2})`;
|
|
@@ -144982,8 +146226,8 @@ async function getSingleSelectionStats2D({ loader, selection }) {
|
|
|
144982
146226
|
const filteredSelection = filterSelection(loader, selection);
|
|
144983
146227
|
const raster = await data.getRaster({ selection: filteredSelection });
|
|
144984
146228
|
const selectionStats = getChannelStats(raster.data);
|
|
144985
|
-
const { domain, contrastLimits: slider } = selectionStats;
|
|
144986
|
-
return { domain, slider };
|
|
146229
|
+
const { domain, contrastLimits: slider, q1, q3 } = selectionStats;
|
|
146230
|
+
return { domain, slider, q1, q3 };
|
|
144987
146231
|
}
|
|
144988
146232
|
async function getSingleSelectionStats3D({ loader, selection }) {
|
|
144989
146233
|
const lowResSource = loader[loader.length - 1];
|
|
@@ -145010,7 +146254,9 @@ async function getSingleSelectionStats3D({ loader, selection }) {
|
|
|
145010
146254
|
slider: [
|
|
145011
146255
|
Math.min(stats0.contrastLimits[0], statsMid.contrastLimits[0], statsTop.contrastLimits[0]),
|
|
145012
146256
|
Math.max(stats0.contrastLimits[1], statsMid.contrastLimits[1], statsTop.contrastLimits[1])
|
|
145013
|
-
]
|
|
146257
|
+
],
|
|
146258
|
+
q1: Math.min(stats0.q1[0], statsMid.q1[0], statsTop.q1[0]),
|
|
146259
|
+
q3: Math.max(stats0.q3[1], statsMid.q3[1], statsTop.q3[1])
|
|
145014
146260
|
};
|
|
145015
146261
|
}
|
|
145016
146262
|
const getSingleSelectionStats = async ({ loader, selection, use3d }) => {
|
|
@@ -145021,7 +146267,9 @@ const getMultiSelectionStats = async ({ loader, selections, use3d }) => {
|
|
|
145021
146267
|
const stats = await Promise.all(selections.map((selection) => getSingleSelectionStats({ loader, selection, use3d })));
|
|
145022
146268
|
const domains = stats.map((stat) => stat.domain);
|
|
145023
146269
|
const sliders = stats.map((stat) => stat.slider);
|
|
145024
|
-
|
|
146270
|
+
const q1s = stats.map((stat) => stat.q1);
|
|
146271
|
+
const q3s = stats.map((stat) => stat.q3);
|
|
146272
|
+
return { domains, sliders, q1s, q3s };
|
|
145025
146273
|
};
|
|
145026
146274
|
function getPhysicalSizeScalingMatrix(loader) {
|
|
145027
146275
|
const { x, y, z } = loader?.meta?.physicalSizes ?? {};
|