@visactor/react-vchart 2.1.3-alpha.3 → 2.1.3-alpha.5
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/build/index.js +1024 -929
- package/build/index.min.js +3 -3
- package/cjs/charts/AreaChart.js +1 -1
- package/cjs/charts/Bar3dChart.js +1 -1
- package/cjs/charts/BarChart.js +1 -1
- package/cjs/charts/BaseChart.js +1 -1
- package/cjs/charts/BoxPlotChart.js +1 -1
- package/cjs/charts/CirclePackingChart.js +1 -1
- package/cjs/charts/CircularProgressChart.js +1 -1
- package/cjs/charts/CommonChart.js +1 -1
- package/cjs/charts/CorrelationChart.js +1 -1
- package/cjs/charts/Funnel3dChart.js +1 -1
- package/cjs/charts/FunnelChart.js +1 -1
- package/cjs/charts/GaugeChart.js +1 -1
- package/cjs/charts/HeatmapChart.js +1 -1
- package/cjs/charts/Histogram3dChart.js +1 -1
- package/cjs/charts/HistogramChart.js +2 -1
- package/cjs/charts/LineChart.js +1 -1
- package/cjs/charts/LinearProgressChart.js +1 -1
- package/cjs/charts/LiquidChart.js +1 -1
- package/cjs/charts/MapChart.js +1 -1
- package/cjs/charts/MosaicChart.js +1 -1
- package/cjs/charts/PictogramChart.js +1 -1
- package/cjs/charts/Pie3dChart.js +1 -1
- package/cjs/charts/PieChart.js +1 -1
- package/cjs/charts/RadarChart.js +1 -1
- package/cjs/charts/RangeAreaChart.js +1 -1
- package/cjs/charts/RangeColumn3dChart.js +1 -1
- package/cjs/charts/RangeColumnChart.js +1 -1
- package/cjs/charts/RoseChart.js +1 -1
- package/cjs/charts/SankeyChart.js +1 -1
- package/cjs/charts/ScatterChart.js +1 -1
- package/cjs/charts/SequenceChart.js +2 -1
- package/cjs/charts/SunburstChart.js +1 -1
- package/cjs/charts/TreemapChart.js +1 -1
- package/cjs/charts/VennChart.js +1 -1
- package/cjs/charts/WaterfallChart.js +1 -1
- package/cjs/charts/WordCloud3dChart.js +1 -1
- package/cjs/charts/WordCloudChart.js +1 -1
- package/cjs/components/MarkPoint.js +1 -2
- package/cjs/components/ScrollBar.js +2 -1
- package/cjs/components/tooltip/BaseTooltip.js +1 -1
- package/cjs/components/tooltip/CanvasTooltip.js +1 -1
- package/cjs/components/tooltip/Tooltip.js +1 -1
- package/cjs/components/tooltip/util.js +1 -1
- package/cjs/context/chart.js +1 -1
- package/cjs/context/stage.js +1 -1
- package/cjs/series/Area.js +1 -1
- package/cjs/series/Bar.js +1 -1
- package/cjs/series/Bar3d.js +1 -1
- package/cjs/series/BaseSeries.js +1 -1
- package/cjs/series/BoxPlot.js +1 -1
- package/cjs/series/CirclePacking.js +1 -1
- package/cjs/series/CircularProgress.js +1 -1
- package/cjs/series/Correlation.js +1 -2
- package/cjs/series/Dot.js +1 -1
- package/cjs/series/Funnel.js +1 -1
- package/cjs/series/Funnel3d.js +1 -1
- package/cjs/series/Gauge.js +1 -1
- package/cjs/series/GaugePointer.js +1 -1
- package/cjs/series/Heatmap.js +1 -1
- package/cjs/series/Line.js +1 -1
- package/cjs/series/LinearProgress.js +1 -1
- package/cjs/series/Link.js +1 -1
- package/cjs/series/Liquid.js +1 -1
- package/cjs/series/Map.js +1 -1
- package/cjs/series/Mosaic.js +1 -1
- package/cjs/series/Pictogram.js +1 -1
- package/cjs/series/Pie.js +1 -1
- package/cjs/series/Pie3d.js +1 -1
- package/cjs/series/Radar.js +1 -2
- package/cjs/series/RangeArea.js +1 -1
- package/cjs/series/RangeColumn.js +1 -1
- package/cjs/series/RangeColumn3d.js +1 -1
- package/cjs/series/Rose.js +1 -1
- package/cjs/series/Sankey.js +1 -1
- package/cjs/series/Scatter.js +1 -1
- package/cjs/series/Series.js +1 -1
- package/esm/charts/AreaChart.js +1 -1
- package/esm/charts/Bar3dChart.js +1 -1
- package/esm/charts/BarChart.js +1 -1
- package/esm/charts/BaseChart.js +1 -1
- package/esm/charts/BoxPlotChart.js +1 -1
- package/esm/charts/CirclePackingChart.js +1 -1
- package/esm/charts/CircularProgressChart.js +1 -1
- package/esm/charts/CommonChart.js +1 -1
- package/esm/charts/CorrelationChart.js +1 -1
- package/esm/charts/Funnel3dChart.js +1 -1
- package/esm/charts/FunnelChart.js +1 -1
- package/esm/charts/GaugeChart.js +1 -1
- package/esm/charts/HeatmapChart.js +1 -1
- package/esm/charts/Histogram3dChart.js +1 -1
- package/esm/charts/HistogramChart.js +2 -1
- package/esm/charts/LineChart.js +1 -1
- package/esm/charts/LinearProgressChart.js +1 -1
- package/esm/charts/LiquidChart.js +1 -1
- package/esm/charts/MapChart.js +1 -1
- package/esm/charts/MosaicChart.js +1 -1
- package/esm/charts/PictogramChart.js +1 -1
- package/esm/charts/Pie3dChart.js +1 -1
- package/esm/charts/PieChart.js +1 -1
- package/esm/charts/RadarChart.js +1 -1
- package/esm/charts/RangeAreaChart.js +1 -1
- package/esm/charts/RangeColumn3dChart.js +1 -1
- package/esm/charts/RangeColumnChart.js +1 -1
- package/esm/charts/RoseChart.js +1 -1
- package/esm/charts/SankeyChart.js +1 -1
- package/esm/charts/ScatterChart.js +1 -1
- package/esm/charts/SequenceChart.js +2 -1
- package/esm/charts/SunburstChart.js +1 -1
- package/esm/charts/TreemapChart.js +1 -1
- package/esm/charts/VennChart.js +1 -1
- package/esm/charts/WaterfallChart.js +1 -1
- package/esm/charts/WordCloud3dChart.js +1 -1
- package/esm/charts/WordCloudChart.js +1 -1
- package/esm/components/MarkPoint.js +1 -2
- package/esm/components/ScrollBar.js +2 -1
- package/esm/components/tooltip/BaseTooltip.js +1 -1
- package/esm/components/tooltip/CanvasTooltip.js +1 -1
- package/esm/components/tooltip/Tooltip.js +1 -1
- package/esm/components/tooltip/util.js +1 -1
- package/esm/context/chart.js +1 -1
- package/esm/context/stage.js +1 -1
- package/esm/series/Area.js +1 -1
- package/esm/series/Bar.js +1 -1
- package/esm/series/Bar3d.js +1 -1
- package/esm/series/BaseSeries.js +1 -1
- package/esm/series/BoxPlot.js +1 -1
- package/esm/series/CirclePacking.js +1 -1
- package/esm/series/CircularProgress.js +1 -1
- package/esm/series/Correlation.js +1 -2
- package/esm/series/Dot.js +1 -1
- package/esm/series/Funnel.js +1 -1
- package/esm/series/Funnel3d.js +1 -1
- package/esm/series/Gauge.js +1 -1
- package/esm/series/GaugePointer.js +1 -1
- package/esm/series/Heatmap.js +1 -1
- package/esm/series/Line.js +1 -1
- package/esm/series/LinearProgress.js +1 -1
- package/esm/series/Link.js +1 -1
- package/esm/series/Liquid.js +1 -1
- package/esm/series/Map.js +1 -1
- package/esm/series/Mosaic.js +1 -1
- package/esm/series/Pictogram.js +1 -1
- package/esm/series/Pie.js +1 -1
- package/esm/series/Pie3d.js +1 -1
- package/esm/series/Radar.js +1 -2
- package/esm/series/RangeArea.js +1 -1
- package/esm/series/RangeColumn.js +1 -1
- package/esm/series/RangeColumn3d.js +1 -1
- package/esm/series/Rose.js +1 -1
- package/esm/series/Sankey.js +1 -1
- package/esm/series/Scatter.js +1 -1
- package/esm/series/Series.js +1 -1
- package/package.json +7 -7
package/build/index.js
CHANGED
|
@@ -10245,7 +10245,17 @@
|
|
|
10245
10245
|
});
|
|
10246
10246
|
|
|
10247
10247
|
class Application {}
|
|
10248
|
-
const
|
|
10248
|
+
const APPLICATION_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/application-state");
|
|
10249
|
+
function createApplicationState() {
|
|
10250
|
+
return {
|
|
10251
|
+
application: new Application()
|
|
10252
|
+
};
|
|
10253
|
+
}
|
|
10254
|
+
function getApplicationState() {
|
|
10255
|
+
const scope = globalThis;
|
|
10256
|
+
return scope[APPLICATION_STATE_SYMBOL] || (scope[APPLICATION_STATE_SYMBOL] = createApplicationState()), scope[APPLICATION_STATE_SYMBOL];
|
|
10257
|
+
}
|
|
10258
|
+
const application = getApplicationState().application;
|
|
10249
10259
|
|
|
10250
10260
|
class ResourceLoader {
|
|
10251
10261
|
static GetImage(url, mark) {
|
|
@@ -13306,12 +13316,12 @@
|
|
|
13306
13316
|
cursor: 1,
|
|
13307
13317
|
html: 1
|
|
13308
13318
|
};
|
|
13309
|
-
class
|
|
13319
|
+
class GraphicImpl extends Node {
|
|
13310
13320
|
static mixin(source) {
|
|
13311
13321
|
const keys = Object.keys(source);
|
|
13312
13322
|
for (let i = 0; i < keys.length; ++i) {
|
|
13313
13323
|
const propertyName = keys[i];
|
|
13314
|
-
Object.defineProperty(
|
|
13324
|
+
Object.defineProperty(this.prototype, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));
|
|
13315
13325
|
}
|
|
13316
13326
|
}
|
|
13317
13327
|
get AABBBounds() {
|
|
@@ -14550,13 +14560,26 @@
|
|
|
14550
14560
|
return null;
|
|
14551
14561
|
}
|
|
14552
14562
|
}
|
|
14563
|
+
GraphicImpl.userSymbolMap = {};
|
|
14564
|
+
const GRAPHIC_CLASS_SYMBOL = Symbol.for("@visactor/vrender-core/graphic-class");
|
|
14565
|
+
function createGraphicClassState() {
|
|
14566
|
+
return {
|
|
14567
|
+
Graphic: GraphicImpl
|
|
14568
|
+
};
|
|
14569
|
+
}
|
|
14570
|
+
function getGraphicClassState() {
|
|
14571
|
+
var _a;
|
|
14572
|
+
const globalScope = globalThis;
|
|
14573
|
+
return null !== (_a = globalScope[GRAPHIC_CLASS_SYMBOL]) && void 0 !== _a || (globalScope[GRAPHIC_CLASS_SYMBOL] = createGraphicClassState()), globalScope[GRAPHIC_CLASS_SYMBOL];
|
|
14574
|
+
}
|
|
14575
|
+
const Graphic = getGraphicClassState().Graphic;
|
|
14553
14576
|
function backgroundNotImage(image) {
|
|
14554
14577
|
return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
|
|
14555
14578
|
}
|
|
14556
14579
|
function isExternalTexture(texture) {
|
|
14557
14580
|
return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
|
|
14558
14581
|
}
|
|
14559
|
-
Graphic.
|
|
14582
|
+
Graphic.mixin(EventTarget);
|
|
14560
14583
|
|
|
14561
14584
|
const defaultThemeObj = {
|
|
14562
14585
|
arc: DefaultArcAttribute,
|
|
@@ -17717,7 +17740,6 @@
|
|
|
17717
17740
|
}
|
|
17718
17741
|
};
|
|
17719
17742
|
}
|
|
17720
|
-
const sharedGraphicFactory = new GraphicFactory();
|
|
17721
17743
|
class GraphicCreator {
|
|
17722
17744
|
constructor() {
|
|
17723
17745
|
this.store = new Map();
|
|
@@ -17732,13 +17754,25 @@
|
|
|
17732
17754
|
return this.store.has(name) ? createGraphic$1(name, attributes) : null;
|
|
17733
17755
|
}
|
|
17734
17756
|
}
|
|
17735
|
-
const
|
|
17757
|
+
const GRAPHIC_REGISTRY_SYMBOL = Symbol.for("@visactor/vrender-core/graphic-registry");
|
|
17758
|
+
function createGraphicRegistryState() {
|
|
17759
|
+
return {
|
|
17760
|
+
graphicCreator: new GraphicCreator(),
|
|
17761
|
+
graphicFactory: new GraphicFactory()
|
|
17762
|
+
};
|
|
17763
|
+
}
|
|
17764
|
+
function getGraphicRegistryState() {
|
|
17765
|
+
const scope = globalThis;
|
|
17766
|
+
return scope[GRAPHIC_REGISTRY_SYMBOL] || (scope[GRAPHIC_REGISTRY_SYMBOL] = createGraphicRegistryState()), scope[GRAPHIC_REGISTRY_SYMBOL];
|
|
17767
|
+
}
|
|
17768
|
+
const sharedGraphicRegistry = getGraphicRegistryState();
|
|
17769
|
+
const graphicCreator$1 = sharedGraphicRegistry.graphicCreator;
|
|
17736
17770
|
function registerGraphic(name, creator) {
|
|
17737
17771
|
if (!name) throw new Error("Graphic registration requires a non-empty graphic type");
|
|
17738
|
-
graphicCreator$1.registerStore(name, creator),
|
|
17772
|
+
graphicCreator$1.registerStore(name, creator), sharedGraphicRegistry.graphicFactory.register(name, createGraphicCtor(creator));
|
|
17739
17773
|
}
|
|
17740
17774
|
function createGraphic$1(name, attributes) {
|
|
17741
|
-
return
|
|
17775
|
+
return sharedGraphicRegistry.graphicFactory.create(name, attributes);
|
|
17742
17776
|
}
|
|
17743
17777
|
|
|
17744
17778
|
class Hook {
|
|
@@ -18447,6 +18481,17 @@
|
|
|
18447
18481
|
}
|
|
18448
18482
|
}
|
|
18449
18483
|
|
|
18484
|
+
const FACTORY_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/factory-state");
|
|
18485
|
+
function createFactoryState() {
|
|
18486
|
+
return {
|
|
18487
|
+
pluginClasses: {}
|
|
18488
|
+
};
|
|
18489
|
+
}
|
|
18490
|
+
function getFactoryState() {
|
|
18491
|
+
const scope = globalThis;
|
|
18492
|
+
return scope[FACTORY_STATE_SYMBOL] || (scope[FACTORY_STATE_SYMBOL] = createFactoryState()), scope[FACTORY_STATE_SYMBOL];
|
|
18493
|
+
}
|
|
18494
|
+
|
|
18450
18495
|
class DefaultGlobalPickerService {
|
|
18451
18496
|
constructor() {
|
|
18452
18497
|
this.global = application.global, this.global.hooks.onSetEnv.tap("global-picker-service", (lastEnv, env, global) => {
|
|
@@ -20351,7 +20396,7 @@
|
|
|
20351
20396
|
return Factory._pluginClasses[pluginKey];
|
|
20352
20397
|
}
|
|
20353
20398
|
};
|
|
20354
|
-
Factory$1._pluginClasses =
|
|
20399
|
+
Factory$1._pluginClasses = getFactoryState().pluginClasses;
|
|
20355
20400
|
|
|
20356
20401
|
function defaultLayerHandlerFactory(layerMode) {
|
|
20357
20402
|
const handlerFactory = application.layerHandlerFactory;
|
|
@@ -20431,6 +20476,17 @@
|
|
|
20431
20476
|
const DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution");
|
|
20432
20477
|
const VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
|
|
20433
20478
|
|
|
20479
|
+
const CONTRIBUTION_STORE_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/contribution-store-state");
|
|
20480
|
+
function createContributionStoreState() {
|
|
20481
|
+
return {
|
|
20482
|
+
store: new Map()
|
|
20483
|
+
};
|
|
20484
|
+
}
|
|
20485
|
+
function getContributionStoreState() {
|
|
20486
|
+
const scope = globalThis;
|
|
20487
|
+
return scope[CONTRIBUTION_STORE_STATE_SYMBOL] || (scope[CONTRIBUTION_STORE_STATE_SYMBOL] = createContributionStoreState()), scope[CONTRIBUTION_STORE_STATE_SYMBOL];
|
|
20488
|
+
}
|
|
20489
|
+
|
|
20434
20490
|
const ContributionProvider = Symbol("ContributionProvider");
|
|
20435
20491
|
class ContributionProviderCache {
|
|
20436
20492
|
constructor(serviceIdentifier, container) {
|
|
@@ -20473,7 +20529,7 @@
|
|
|
20473
20529
|
});
|
|
20474
20530
|
}
|
|
20475
20531
|
}
|
|
20476
|
-
ContributionStore.store =
|
|
20532
|
+
ContributionStore.store = getContributionStoreState().store;
|
|
20477
20533
|
|
|
20478
20534
|
class ATextMeasure {
|
|
20479
20535
|
constructor() {
|
|
@@ -22795,13 +22851,26 @@
|
|
|
22795
22851
|
return new LegacyBindingContext();
|
|
22796
22852
|
}
|
|
22797
22853
|
|
|
22798
|
-
const
|
|
22854
|
+
const LEGACY_BOOTSTRAP_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/legacy-bootstrap-state");
|
|
22855
|
+
function createLegacyBootstrapState() {
|
|
22856
|
+
return {
|
|
22857
|
+
legacyBindingContext: createLegacyBindingContext(),
|
|
22858
|
+
preloaded: !1
|
|
22859
|
+
};
|
|
22860
|
+
}
|
|
22861
|
+
function getLegacyBootstrapState() {
|
|
22862
|
+
const scope = globalThis;
|
|
22863
|
+
return scope[LEGACY_BOOTSTRAP_STATE_SYMBOL] || (scope[LEGACY_BOOTSTRAP_STATE_SYMBOL] = createLegacyBootstrapState()), scope[LEGACY_BOOTSTRAP_STATE_SYMBOL];
|
|
22864
|
+
}
|
|
22865
|
+
|
|
22866
|
+
const legacyBootstrapState = getLegacyBootstrapState(),
|
|
22867
|
+
legacyBindingContext = legacyBootstrapState.legacyBindingContext;
|
|
22799
22868
|
function getLegacyTarget(resolver) {
|
|
22800
22869
|
let target;
|
|
22801
22870
|
return () => (void 0 === target && (target = resolver()), target);
|
|
22802
22871
|
}
|
|
22803
22872
|
function preLoadAllModule() {
|
|
22804
|
-
|
|
22873
|
+
legacyBootstrapState.preloaded || (legacyBootstrapState.preloaded = !0, bindCoreModules({
|
|
22805
22874
|
bind: legacyBindingContext.bind
|
|
22806
22875
|
}), bindGraphicModules({
|
|
22807
22876
|
bind: legacyBindingContext.bind
|
|
@@ -22814,7 +22883,6 @@
|
|
|
22814
22883
|
bind: legacyBindingContext.bind
|
|
22815
22884
|
}), load$1(legacyBindingContext), load(legacyBindingContext));
|
|
22816
22885
|
}
|
|
22817
|
-
preLoadAllModule.__loaded = !1;
|
|
22818
22886
|
function getLegacyBindingContext() {
|
|
22819
22887
|
return legacyBindingContext;
|
|
22820
22888
|
}
|
|
@@ -27076,126 +27144,7 @@
|
|
|
27076
27144
|
}
|
|
27077
27145
|
const textModule = bindTextRenderModule;
|
|
27078
27146
|
|
|
27079
|
-
|
|
27080
|
-
constructor(dir, color, ambient = .8) {
|
|
27081
|
-
this.dir = dir, this.color = color, this.colorRgb = ColorStore.Get(color, ColorType.Color1), this.ambient = ambient;
|
|
27082
|
-
const length = sqrt$3(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
|
|
27083
|
-
this.formatedDir = [dir[0] / length, dir[1] / length, dir[2] / length];
|
|
27084
|
-
}
|
|
27085
|
-
computeColor(normal, color) {
|
|
27086
|
-
const lightDir = this.formatedDir,
|
|
27087
|
-
brightness = min$1(max$1((normal[0] * lightDir[0] + normal[1] * lightDir[1] + normal[2] * lightDir[2]) * (1 - this.ambient / 2), 0) + this.ambient, 1);
|
|
27088
|
-
let colorArray;
|
|
27089
|
-
colorArray = isString$1(color) ? ColorStore.Get(color, ColorType.Color1) : color;
|
|
27090
|
-
const lightColorArray = this.colorRgb;
|
|
27091
|
-
return `rgb(${lightColorArray[0] * colorArray[0] * brightness}, ${lightColorArray[1] * colorArray[1] * brightness}, ${lightColorArray[2] * colorArray[2] * brightness})`;
|
|
27092
|
-
}
|
|
27093
|
-
}
|
|
27094
|
-
const registerDirectionalLight = () => {
|
|
27095
|
-
Factory$1.registerPlugin("DirectionalLight", DirectionalLight);
|
|
27096
|
-
};
|
|
27097
|
-
|
|
27098
|
-
class OrthoCamera {
|
|
27099
|
-
set params(params) {
|
|
27100
|
-
this._params = Object.assign({}, params), this._projectionMatrixCached = this.forceGetProjectionMatrix(), this._viewMatrixCached = this.forceGetViewMatrix();
|
|
27101
|
-
}
|
|
27102
|
-
get params() {
|
|
27103
|
-
return Object.assign({}, this._params);
|
|
27104
|
-
}
|
|
27105
|
-
constructor(params) {
|
|
27106
|
-
this.params = params;
|
|
27107
|
-
}
|
|
27108
|
-
getViewMatrix() {
|
|
27109
|
-
return this._viewMatrixCached || (this._viewMatrixCached = mat4Allocate.allocate()), this._viewMatrixCached;
|
|
27110
|
-
}
|
|
27111
|
-
forceGetViewMatrix() {
|
|
27112
|
-
this._viewMatrixCached || (this._viewMatrixCached = mat4Allocate.allocate());
|
|
27113
|
-
const {
|
|
27114
|
-
pos: pos,
|
|
27115
|
-
center: center,
|
|
27116
|
-
up: up
|
|
27117
|
-
} = this.params.viewParams;
|
|
27118
|
-
return lookAt(this._viewMatrixCached, pos, center, up), this._vp || (this._vp = mat4Allocate.allocate()), this._vp = multiplyMat4Mat4(this._vp, this.getProjectionMatrix(), this.getViewMatrix()), this._viewMatrixCached;
|
|
27119
|
-
}
|
|
27120
|
-
getProjectionMatrix() {
|
|
27121
|
-
return this._projectionMatrixCached || (this._projectionMatrixCached = mat4Allocate.allocate()), this._projectionMatrixCached;
|
|
27122
|
-
}
|
|
27123
|
-
forceGetProjectionMatrix() {
|
|
27124
|
-
this._projectionMatrixCached || (this._projectionMatrixCached = mat4Allocate.allocate());
|
|
27125
|
-
const {
|
|
27126
|
-
left: left,
|
|
27127
|
-
top: top,
|
|
27128
|
-
right: right,
|
|
27129
|
-
bottom: bottom
|
|
27130
|
-
} = this._params;
|
|
27131
|
-
return ortho(this._projectionMatrixCached, left, right, bottom, top, 0, -2e6), this._vp || (this._vp = mat4Allocate.allocate()), this._vp = multiplyMat4Mat4(this._vp, this.getProjectionMatrix(), this.getViewMatrix()), this._projectionMatrixCached;
|
|
27132
|
-
}
|
|
27133
|
-
getField() {
|
|
27134
|
-
const {
|
|
27135
|
-
fieldRatio = .8,
|
|
27136
|
-
fieldDepth: fieldDepth,
|
|
27137
|
-
left: left,
|
|
27138
|
-
right: right
|
|
27139
|
-
} = this._params;
|
|
27140
|
-
return (null != fieldDepth ? fieldDepth : right - left) * fieldRatio;
|
|
27141
|
-
}
|
|
27142
|
-
getProjectionScale(z) {
|
|
27143
|
-
const field = this.getField();
|
|
27144
|
-
return field / (field + z);
|
|
27145
|
-
}
|
|
27146
|
-
view(x, y, z) {
|
|
27147
|
-
const outP = [0, 0, 0];
|
|
27148
|
-
return transformMat4(outP, [x, y, z], this._viewMatrixCached), outP;
|
|
27149
|
-
}
|
|
27150
|
-
vp(x, y, z) {
|
|
27151
|
-
const outP = [0, 0, 0],
|
|
27152
|
-
{
|
|
27153
|
-
pos: pos
|
|
27154
|
-
} = this._params.viewParams;
|
|
27155
|
-
transformMat4(outP, [x, y, z], this._viewMatrixCached), x = outP[0], y = outP[1], z = outP[2];
|
|
27156
|
-
const sizeProjection = this.getProjectionScale(z);
|
|
27157
|
-
return {
|
|
27158
|
-
x: x * sizeProjection + pos[0],
|
|
27159
|
-
y: y * sizeProjection + pos[1]
|
|
27160
|
-
};
|
|
27161
|
-
}
|
|
27162
|
-
}
|
|
27163
|
-
const registerOrthoCamera = () => {
|
|
27164
|
-
Factory$1.registerPlugin("OrthoCamera", OrthoCamera);
|
|
27165
|
-
};
|
|
27166
|
-
|
|
27167
|
-
class ViewTransform3dPlugin {
|
|
27168
|
-
constructor() {
|
|
27169
|
-
this.name = "ViewTransform3dPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.onMouseDown = e => {
|
|
27170
|
-
this.option3d || (this.option3d = this.pluginService.stage.option3d), this.option3d && (this.mousedown = !0, this.pageX = e.page.x, this.pageY = e.page.y);
|
|
27171
|
-
}, this.onMouseUp = e => {
|
|
27172
|
-
this.option3d || (this.option3d = this.pluginService.stage.option3d), this.option3d && (this.mousedown = !1);
|
|
27173
|
-
}, this.onMouseMove = e => {
|
|
27174
|
-
var _a, _b;
|
|
27175
|
-
const stage = this.pluginService.stage;
|
|
27176
|
-
if (this.option3d || (this.option3d = stage.option3d), this.option3d && this.mousedown) if (this.pageX && this.pageY) {
|
|
27177
|
-
const deltaX = e.page.x - this.pageX,
|
|
27178
|
-
deltaY = e.page.y - this.pageY;
|
|
27179
|
-
this.pageX = e.page.x, this.pageY = e.page.y;
|
|
27180
|
-
const angle1 = deltaX / 100,
|
|
27181
|
-
angle2 = deltaY / 100;
|
|
27182
|
-
this.option3d.alpha = (null !== (_a = this.option3d.alpha) && void 0 !== _a ? _a : 0) + angle1, this.option3d.beta = (null !== (_b = this.option3d.beta) && void 0 !== _b ? _b : 0) + angle2, stage.set3dOptions(this.option3d), stage.renderNextFrame();
|
|
27183
|
-
} else this.pageX = e.page.x, this.pageY = e.page.y;
|
|
27184
|
-
};
|
|
27185
|
-
}
|
|
27186
|
-
activate(context) {
|
|
27187
|
-
this.pluginService = context;
|
|
27188
|
-
const stage = context.stage;
|
|
27189
|
-
this.option3d = stage.option3d, stage.addEventListener("mousedown", this.onMouseDown), stage.addEventListener("mouseup", this.onMouseUp), stage.addEventListener("mousemove", this.onMouseMove);
|
|
27190
|
-
}
|
|
27191
|
-
deactivate(context) {
|
|
27192
|
-
const stage = context.stage;
|
|
27193
|
-
stage.removeEventListener("mousedown", this.onMouseDown), stage.removeEventListener("mouseup", this.onMouseUp), stage.removeEventListener("mousemove", this.onMouseMove);
|
|
27194
|
-
}
|
|
27195
|
-
}
|
|
27196
|
-
const registerViewTransform3dPlugin = () => {
|
|
27197
|
-
Factory$1.registerPlugin("ViewTransform3dPlugin", ViewTransform3dPlugin);
|
|
27198
|
-
};
|
|
27147
|
+
const browser = isBrowserEnv();
|
|
27199
27148
|
|
|
27200
27149
|
function resolveContainerBinding$1(container, serviceIdentifier) {
|
|
27201
27150
|
const [instance] = container.getAll(serviceIdentifier);
|
|
@@ -27409,6 +27358,94 @@
|
|
|
27409
27358
|
}
|
|
27410
27359
|
}
|
|
27411
27360
|
|
|
27361
|
+
class DirectionalLight {
|
|
27362
|
+
constructor(dir, color, ambient = .8) {
|
|
27363
|
+
this.dir = dir, this.color = color, this.colorRgb = ColorStore.Get(color, ColorType.Color1), this.ambient = ambient;
|
|
27364
|
+
const length = sqrt$3(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
|
|
27365
|
+
this.formatedDir = [dir[0] / length, dir[1] / length, dir[2] / length];
|
|
27366
|
+
}
|
|
27367
|
+
computeColor(normal, color) {
|
|
27368
|
+
const lightDir = this.formatedDir,
|
|
27369
|
+
brightness = min$1(max$1((normal[0] * lightDir[0] + normal[1] * lightDir[1] + normal[2] * lightDir[2]) * (1 - this.ambient / 2), 0) + this.ambient, 1);
|
|
27370
|
+
let colorArray;
|
|
27371
|
+
colorArray = isString$1(color) ? ColorStore.Get(color, ColorType.Color1) : color;
|
|
27372
|
+
const lightColorArray = this.colorRgb;
|
|
27373
|
+
return `rgb(${lightColorArray[0] * colorArray[0] * brightness}, ${lightColorArray[1] * colorArray[1] * brightness}, ${lightColorArray[2] * colorArray[2] * brightness})`;
|
|
27374
|
+
}
|
|
27375
|
+
}
|
|
27376
|
+
const registerDirectionalLight = () => {
|
|
27377
|
+
Factory$1.registerPlugin("DirectionalLight", DirectionalLight);
|
|
27378
|
+
};
|
|
27379
|
+
|
|
27380
|
+
class OrthoCamera {
|
|
27381
|
+
set params(params) {
|
|
27382
|
+
this._params = Object.assign({}, params), this._projectionMatrixCached = this.forceGetProjectionMatrix(), this._viewMatrixCached = this.forceGetViewMatrix();
|
|
27383
|
+
}
|
|
27384
|
+
get params() {
|
|
27385
|
+
return Object.assign({}, this._params);
|
|
27386
|
+
}
|
|
27387
|
+
constructor(params) {
|
|
27388
|
+
this.params = params;
|
|
27389
|
+
}
|
|
27390
|
+
getViewMatrix() {
|
|
27391
|
+
return this._viewMatrixCached || (this._viewMatrixCached = mat4Allocate.allocate()), this._viewMatrixCached;
|
|
27392
|
+
}
|
|
27393
|
+
forceGetViewMatrix() {
|
|
27394
|
+
this._viewMatrixCached || (this._viewMatrixCached = mat4Allocate.allocate());
|
|
27395
|
+
const {
|
|
27396
|
+
pos: pos,
|
|
27397
|
+
center: center,
|
|
27398
|
+
up: up
|
|
27399
|
+
} = this.params.viewParams;
|
|
27400
|
+
return lookAt(this._viewMatrixCached, pos, center, up), this._vp || (this._vp = mat4Allocate.allocate()), this._vp = multiplyMat4Mat4(this._vp, this.getProjectionMatrix(), this.getViewMatrix()), this._viewMatrixCached;
|
|
27401
|
+
}
|
|
27402
|
+
getProjectionMatrix() {
|
|
27403
|
+
return this._projectionMatrixCached || (this._projectionMatrixCached = mat4Allocate.allocate()), this._projectionMatrixCached;
|
|
27404
|
+
}
|
|
27405
|
+
forceGetProjectionMatrix() {
|
|
27406
|
+
this._projectionMatrixCached || (this._projectionMatrixCached = mat4Allocate.allocate());
|
|
27407
|
+
const {
|
|
27408
|
+
left: left,
|
|
27409
|
+
top: top,
|
|
27410
|
+
right: right,
|
|
27411
|
+
bottom: bottom
|
|
27412
|
+
} = this._params;
|
|
27413
|
+
return ortho(this._projectionMatrixCached, left, right, bottom, top, 0, -2e6), this._vp || (this._vp = mat4Allocate.allocate()), this._vp = multiplyMat4Mat4(this._vp, this.getProjectionMatrix(), this.getViewMatrix()), this._projectionMatrixCached;
|
|
27414
|
+
}
|
|
27415
|
+
getField() {
|
|
27416
|
+
const {
|
|
27417
|
+
fieldRatio = .8,
|
|
27418
|
+
fieldDepth: fieldDepth,
|
|
27419
|
+
left: left,
|
|
27420
|
+
right: right
|
|
27421
|
+
} = this._params;
|
|
27422
|
+
return (null != fieldDepth ? fieldDepth : right - left) * fieldRatio;
|
|
27423
|
+
}
|
|
27424
|
+
getProjectionScale(z) {
|
|
27425
|
+
const field = this.getField();
|
|
27426
|
+
return field / (field + z);
|
|
27427
|
+
}
|
|
27428
|
+
view(x, y, z) {
|
|
27429
|
+
const outP = [0, 0, 0];
|
|
27430
|
+
return transformMat4(outP, [x, y, z], this._viewMatrixCached), outP;
|
|
27431
|
+
}
|
|
27432
|
+
vp(x, y, z) {
|
|
27433
|
+
const outP = [0, 0, 0],
|
|
27434
|
+
{
|
|
27435
|
+
pos: pos
|
|
27436
|
+
} = this._params.viewParams;
|
|
27437
|
+
transformMat4(outP, [x, y, z], this._viewMatrixCached), x = outP[0], y = outP[1], z = outP[2];
|
|
27438
|
+
const sizeProjection = this.getProjectionScale(z);
|
|
27439
|
+
return {
|
|
27440
|
+
x: x * sizeProjection + pos[0],
|
|
27441
|
+
y: y * sizeProjection + pos[1]
|
|
27442
|
+
};
|
|
27443
|
+
}
|
|
27444
|
+
}
|
|
27445
|
+
const registerOrthoCamera = () => {
|
|
27446
|
+
Factory$1.registerPlugin("OrthoCamera", OrthoCamera);
|
|
27447
|
+
};
|
|
27448
|
+
|
|
27412
27449
|
const EMPTY_PICK_ITEM_INTERCEPTOR_PROVIDER = {
|
|
27413
27450
|
getContributions: () => []
|
|
27414
27451
|
},
|
|
@@ -27721,18 +27758,32 @@
|
|
|
27721
27758
|
}
|
|
27722
27759
|
}
|
|
27723
27760
|
|
|
27724
|
-
const
|
|
27725
|
-
|
|
27726
|
-
|
|
27727
|
-
|
|
27761
|
+
const RUNTIME_INSTALLER_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/runtime-installer-state");
|
|
27762
|
+
function createRuntimeInstallerState() {
|
|
27763
|
+
return {
|
|
27764
|
+
runtimeInstallerContext: createLegacyBindingContext(),
|
|
27765
|
+
preloaded: !1,
|
|
27766
|
+
runtimeEntryKeys: new WeakMap(),
|
|
27767
|
+
runtimeDrawContributions: new WeakMap(),
|
|
27768
|
+
loadedRuntimeContributionModules: new WeakMap()
|
|
27769
|
+
};
|
|
27770
|
+
}
|
|
27771
|
+
function getRuntimeInstallerState() {
|
|
27772
|
+
const scope = globalThis;
|
|
27773
|
+
return scope[RUNTIME_INSTALLER_STATE_SYMBOL] || (scope[RUNTIME_INSTALLER_STATE_SYMBOL] = createRuntimeInstallerState()), scope[RUNTIME_INSTALLER_STATE_SYMBOL];
|
|
27774
|
+
}
|
|
27775
|
+
|
|
27776
|
+
const runtimeInstallerState = getRuntimeInstallerState(),
|
|
27777
|
+
runtimeInstallerContext = runtimeInstallerState.runtimeInstallerContext,
|
|
27778
|
+
RUNTIME_RENDERER_NAMESPACE = "vrender:runtime-renderer",
|
|
27728
27779
|
RUNTIME_PICKER_NAMESPACE = "vrender:runtime-picker",
|
|
27729
|
-
runtimeEntryKeys =
|
|
27730
|
-
runtimeDrawContributions =
|
|
27731
|
-
loadedRuntimeContributionModules =
|
|
27780
|
+
runtimeEntryKeys = runtimeInstallerState.runtimeEntryKeys,
|
|
27781
|
+
runtimeDrawContributions = runtimeInstallerState.runtimeDrawContributions,
|
|
27782
|
+
loadedRuntimeContributionModules = runtimeInstallerState.loadedRuntimeContributionModules,
|
|
27732
27783
|
DEFAULT_RUNTIME_CONTRIBUTION_TARGETS = ["graphic-renderer"],
|
|
27733
27784
|
noopUnbindRuntimeContributionService = () => {};
|
|
27734
27785
|
function ensureRuntimeInstallerPreloaded() {
|
|
27735
|
-
|
|
27786
|
+
runtimeInstallerState.preloaded || (runtimeInstallerState.preloaded = !0, bindCoreModules({
|
|
27736
27787
|
bind: runtimeInstallerContext.bind
|
|
27737
27788
|
}), bindGraphicModules({
|
|
27738
27789
|
bind: runtimeInstallerContext.bind
|
|
@@ -27777,7 +27828,8 @@
|
|
|
27777
27828
|
ContributionStore.refreshAllContributions();
|
|
27778
27829
|
}
|
|
27779
27830
|
function getRuntimeInstallerGlobal() {
|
|
27780
|
-
|
|
27831
|
+
var _a;
|
|
27832
|
+
return ensureRuntimeInstallerPreloaded(), null !== (_a = runtimeInstallerState.runtimeGlobal) && void 0 !== _a || (runtimeInstallerState.runtimeGlobal = new DefaultGlobal(createContributionProvider$1(EnvContribution, runtimeInstallerContext))), runtimeInstallerState.runtimeGlobal;
|
|
27781
27833
|
}
|
|
27782
27834
|
function configureRuntimeApplicationForApp(app) {
|
|
27783
27835
|
const bindingContext = getRuntimeInstallerBindingContext(),
|
|
@@ -29612,19 +29664,52 @@
|
|
|
29612
29664
|
return instance;
|
|
29613
29665
|
}
|
|
29614
29666
|
|
|
29615
|
-
|
|
29616
|
-
class FlexLayoutPlugin {
|
|
29667
|
+
class ViewTransform3dPlugin {
|
|
29617
29668
|
constructor() {
|
|
29618
|
-
this.name = "
|
|
29619
|
-
|
|
29620
|
-
|
|
29621
|
-
|
|
29622
|
-
|
|
29623
|
-
|
|
29624
|
-
|
|
29625
|
-
|
|
29626
|
-
|
|
29627
|
-
|
|
29669
|
+
this.name = "ViewTransform3dPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.onMouseDown = e => {
|
|
29670
|
+
this.option3d || (this.option3d = this.pluginService.stage.option3d), this.option3d && (this.mousedown = !0, this.pageX = e.page.x, this.pageY = e.page.y);
|
|
29671
|
+
}, this.onMouseUp = e => {
|
|
29672
|
+
this.option3d || (this.option3d = this.pluginService.stage.option3d), this.option3d && (this.mousedown = !1);
|
|
29673
|
+
}, this.onMouseMove = e => {
|
|
29674
|
+
var _a, _b;
|
|
29675
|
+
const stage = this.pluginService.stage;
|
|
29676
|
+
if (this.option3d || (this.option3d = stage.option3d), this.option3d && this.mousedown) if (this.pageX && this.pageY) {
|
|
29677
|
+
const deltaX = e.page.x - this.pageX,
|
|
29678
|
+
deltaY = e.page.y - this.pageY;
|
|
29679
|
+
this.pageX = e.page.x, this.pageY = e.page.y;
|
|
29680
|
+
const angle1 = deltaX / 100,
|
|
29681
|
+
angle2 = deltaY / 100;
|
|
29682
|
+
this.option3d.alpha = (null !== (_a = this.option3d.alpha) && void 0 !== _a ? _a : 0) + angle1, this.option3d.beta = (null !== (_b = this.option3d.beta) && void 0 !== _b ? _b : 0) + angle2, stage.set3dOptions(this.option3d), stage.renderNextFrame();
|
|
29683
|
+
} else this.pageX = e.page.x, this.pageY = e.page.y;
|
|
29684
|
+
};
|
|
29685
|
+
}
|
|
29686
|
+
activate(context) {
|
|
29687
|
+
this.pluginService = context;
|
|
29688
|
+
const stage = context.stage;
|
|
29689
|
+
this.option3d = stage.option3d, stage.addEventListener("mousedown", this.onMouseDown), stage.addEventListener("mouseup", this.onMouseUp), stage.addEventListener("mousemove", this.onMouseMove);
|
|
29690
|
+
}
|
|
29691
|
+
deactivate(context) {
|
|
29692
|
+
const stage = context.stage;
|
|
29693
|
+
stage.removeEventListener("mousedown", this.onMouseDown), stage.removeEventListener("mouseup", this.onMouseUp), stage.removeEventListener("mousemove", this.onMouseMove);
|
|
29694
|
+
}
|
|
29695
|
+
}
|
|
29696
|
+
const registerViewTransform3dPlugin = () => {
|
|
29697
|
+
Factory$1.registerPlugin("ViewTransform3dPlugin", ViewTransform3dPlugin);
|
|
29698
|
+
};
|
|
29699
|
+
|
|
29700
|
+
const _tempBounds = new AABBBounds();
|
|
29701
|
+
class FlexLayoutPlugin {
|
|
29702
|
+
constructor() {
|
|
29703
|
+
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
29704
|
+
}
|
|
29705
|
+
pauseLayout(p) {
|
|
29706
|
+
this.pause = p;
|
|
29707
|
+
}
|
|
29708
|
+
tryLayoutChildren(graphic) {
|
|
29709
|
+
graphic.firstChild && this.tryLayout(graphic.firstChild);
|
|
29710
|
+
}
|
|
29711
|
+
tryLayout(graphic, force = !0) {
|
|
29712
|
+
if (this.pause) return;
|
|
29628
29713
|
const p = graphic.parent;
|
|
29629
29714
|
if (!(force || p && graphic.needUpdateLayout())) return;
|
|
29630
29715
|
const theme = getTheme$1(p).group,
|
|
@@ -29883,6 +29968,7 @@
|
|
|
29883
29968
|
|
|
29884
29969
|
var VRenderCore = /*#__PURE__*/Object.freeze({
|
|
29885
29970
|
__proto__: null,
|
|
29971
|
+
APPLICATION_STATE_SYMBOL: APPLICATION_STATE_SYMBOL,
|
|
29886
29972
|
ARC3D_NUMBER_TYPE: ARC3D_NUMBER_TYPE,
|
|
29887
29973
|
ARC_NUMBER_TYPE: ARC_NUMBER_TYPE,
|
|
29888
29974
|
AREA_NUMBER_TYPE: AREA_NUMBER_TYPE,
|
|
@@ -29914,6 +30000,7 @@
|
|
|
29914
30000
|
BoundsPicker: BoundsPicker,
|
|
29915
30001
|
BrowserEntry: BrowserEntry,
|
|
29916
30002
|
CIRCLE_NUMBER_TYPE: CIRCLE_NUMBER_TYPE,
|
|
30003
|
+
CONTRIBUTION_STORE_STATE_SYMBOL: CONTRIBUTION_STORE_STATE_SYMBOL,
|
|
29917
30004
|
Canvas3DDrawItemInterceptor: Canvas3DDrawItemInterceptor,
|
|
29918
30005
|
Canvas3DPickItemInterceptor: Canvas3DPickItemInterceptor,
|
|
29919
30006
|
CanvasFactory: CanvasFactory,
|
|
@@ -30026,6 +30113,7 @@
|
|
|
30026
30113
|
EventManager: EventManager,
|
|
30027
30114
|
EventSystem: EventSystem,
|
|
30028
30115
|
EventTarget: EventTarget,
|
|
30116
|
+
FACTORY_STATE_SYMBOL: FACTORY_STATE_SYMBOL,
|
|
30029
30117
|
FORMAT_ALL_TEXT_COMMAND: FORMAT_ALL_TEXT_COMMAND,
|
|
30030
30118
|
FORMAT_ELEMENT_COMMAND: FORMAT_ELEMENT_COMMAND,
|
|
30031
30119
|
FORMAT_TEXT_COMMAND: FORMAT_TEXT_COMMAND,
|
|
@@ -30036,6 +30124,8 @@
|
|
|
30036
30124
|
FederatedWheelEvent: FederatedWheelEvent,
|
|
30037
30125
|
FlexLayoutPlugin: FlexLayoutPlugin,
|
|
30038
30126
|
GLYPH_NUMBER_TYPE: GLYPH_NUMBER_TYPE,
|
|
30127
|
+
GRAPHIC_CLASS_SYMBOL: GRAPHIC_CLASS_SYMBOL,
|
|
30128
|
+
GRAPHIC_REGISTRY_SYMBOL: GRAPHIC_REGISTRY_SYMBOL,
|
|
30039
30129
|
GRAPHIC_UPDATE_TAG_KEY: GRAPHIC_UPDATE_TAG_KEY,
|
|
30040
30130
|
GROUP_NUMBER_TYPE: GROUP_NUMBER_TYPE,
|
|
30041
30131
|
Generator: Generator,
|
|
@@ -30104,6 +30194,7 @@
|
|
|
30104
30194
|
RECT3D_NUMBER_TYPE: RECT3D_NUMBER_TYPE,
|
|
30105
30195
|
RECT_NUMBER_TYPE: RECT_NUMBER_TYPE,
|
|
30106
30196
|
RICHTEXT_NUMBER_TYPE: RICHTEXT_NUMBER_TYPE,
|
|
30197
|
+
RUNTIME_INSTALLER_STATE_SYMBOL: RUNTIME_INSTALLER_STATE_SYMBOL,
|
|
30107
30198
|
RafBasedSTO: RafBasedSTO,
|
|
30108
30199
|
ReactAttributePlugin: ReactAttributePlugin,
|
|
30109
30200
|
Rect: Rect,
|
|
@@ -30312,17 +30403,23 @@
|
|
|
30312
30403
|
genStepClosedSegments: genStepClosedSegments,
|
|
30313
30404
|
genStepSegments: genStepSegments,
|
|
30314
30405
|
genStepTypeSegments: genStepTypeSegments,
|
|
30406
|
+
getApplicationState: getApplicationState,
|
|
30315
30407
|
getAttributeFromDefaultAttrList: getAttributeFromDefaultAttrList,
|
|
30316
30408
|
getBackgroundImage: getBackgroundImage,
|
|
30317
30409
|
getConicGradientAt: getConicGradientAt,
|
|
30410
|
+
getContributionStoreState: getContributionStoreState,
|
|
30318
30411
|
getCurrentEnv: getCurrentEnv,
|
|
30319
30412
|
getDefaultCharacterConfig: getDefaultCharacterConfig,
|
|
30320
30413
|
getExtraModelMatrix: getExtraModelMatrix,
|
|
30414
|
+
getFactoryState: getFactoryState,
|
|
30415
|
+
getGraphicClassState: getGraphicClassState,
|
|
30416
|
+
getGraphicRegistryState: getGraphicRegistryState,
|
|
30321
30417
|
getLegacyBindingContext: getLegacyBindingContext,
|
|
30322
30418
|
getModelMatrix: getModelMatrix,
|
|
30323
30419
|
getRichTextBounds: getRichTextBounds,
|
|
30324
30420
|
getRuntimeInstallerBindingContext: getRuntimeInstallerBindingContext,
|
|
30325
30421
|
getRuntimeInstallerGlobal: getRuntimeInstallerGlobal,
|
|
30422
|
+
getRuntimeInstallerState: getRuntimeInstallerState,
|
|
30326
30423
|
getScaledStroke: getScaledStroke,
|
|
30327
30424
|
getTextBounds: getTextBounds,
|
|
30328
30425
|
getTheme: getTheme$1,
|
|
@@ -30464,6 +30561,70 @@
|
|
|
30464
30561
|
xul: xul
|
|
30465
30562
|
});
|
|
30466
30563
|
|
|
30564
|
+
class PickerBase {
|
|
30565
|
+
contains(graphic, point, params) {
|
|
30566
|
+
if (!graphic.AABBBounds.containsPoint(point)) return !1;
|
|
30567
|
+
if ("imprecise" === graphic.attribute.pickMode) return !0;
|
|
30568
|
+
if (!this.canvasRenderer) return !0;
|
|
30569
|
+
const {
|
|
30570
|
+
pickContext: pickContext
|
|
30571
|
+
} = null != params ? params : {};
|
|
30572
|
+
if (!pickContext) return !1;
|
|
30573
|
+
const attribute = graphic.getGraphicTheme();
|
|
30574
|
+
pickContext.highPerformanceSave();
|
|
30575
|
+
let {
|
|
30576
|
+
x = attribute.x,
|
|
30577
|
+
y = attribute.y
|
|
30578
|
+
} = graphic.attribute;
|
|
30579
|
+
if (graphic.transMatrix.onlyTranslate()) {
|
|
30580
|
+
const point = graphic.getOffsetXY(attribute);
|
|
30581
|
+
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
30582
|
+
} else x = 0, y = 0, pickContext.transformFromMatrix(graphic.transMatrix, !0);
|
|
30583
|
+
let picked = !1,
|
|
30584
|
+
_final = !1;
|
|
30585
|
+
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute, final) => !(!picked && !_final) || (picked = context.isPointInPath(point.x, point.y), _final = final || _final, picked), (context, arcAttribute, themeAttribute, final) => {
|
|
30586
|
+
if (picked || _final) return !0;
|
|
30587
|
+
const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
30588
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
30589
|
+
keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
30590
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), _final = final || _final, picked;
|
|
30591
|
+
}), pickContext.highPerformanceRestore(), picked;
|
|
30592
|
+
}
|
|
30593
|
+
}
|
|
30594
|
+
|
|
30595
|
+
class DefaultCanvasArcPicker extends PickerBase {
|
|
30596
|
+
constructor(canvasRenderer) {
|
|
30597
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "arc", this.numberType = ARC_NUMBER_TYPE;
|
|
30598
|
+
}
|
|
30599
|
+
}
|
|
30600
|
+
|
|
30601
|
+
let loadArcPick$1 = !1;
|
|
30602
|
+
function bindArcCanvasPickerContribution(container) {
|
|
30603
|
+
loadArcPick$1 || (loadArcPick$1 = !0, container.bind(CanvasArcPicker).toDynamicValue(() => new DefaultCanvasArcPicker(resolveContainerBinding$1(container, ArcRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasArcPicker));
|
|
30604
|
+
}
|
|
30605
|
+
|
|
30606
|
+
class DefaultMathArcPicker extends PickerBase {
|
|
30607
|
+
constructor(canvasRenderer) {
|
|
30608
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "arc", this.numberType = ARC_NUMBER_TYPE;
|
|
30609
|
+
}
|
|
30610
|
+
}
|
|
30611
|
+
|
|
30612
|
+
let loadArcPick = !1;
|
|
30613
|
+
function bindArcMathPickerContribution(container) {
|
|
30614
|
+
loadArcPick || (loadArcPick = !0, container.bind(MathArcPicker).toDynamicValue(() => new DefaultMathArcPicker(resolveContainerBinding$1(container, ArcRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathArcPicker));
|
|
30615
|
+
}
|
|
30616
|
+
|
|
30617
|
+
function _registerArc() {
|
|
30618
|
+
if (_registerArc.__loaded) return;
|
|
30619
|
+
_registerArc.__loaded = !0;
|
|
30620
|
+
const legacyContext = getLegacyBindingContext();
|
|
30621
|
+
registerArcGraphic(), arcModule({
|
|
30622
|
+
bind: legacyContext.bind
|
|
30623
|
+
}), browser ? bindArcCanvasPickerContribution(legacyContext) : bindArcMathPickerContribution(legacyContext);
|
|
30624
|
+
}
|
|
30625
|
+
_registerArc.__loaded = !1;
|
|
30626
|
+
const registerArc = _registerArc;
|
|
30627
|
+
|
|
30467
30628
|
class Base3dPicker extends BaseRender {
|
|
30468
30629
|
contains(graphic, point, params) {
|
|
30469
30630
|
const {
|
|
@@ -30514,128 +30675,670 @@
|
|
|
30514
30675
|
_registerArc3d.__loaded = !1;
|
|
30515
30676
|
const registerArc3d = _registerArc3d;
|
|
30516
30677
|
|
|
30517
|
-
class
|
|
30678
|
+
class DefaultCanvasAreaPicker extends PickerBase {
|
|
30518
30679
|
constructor(canvasRenderer) {
|
|
30519
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "
|
|
30680
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "area", this.numberType = AREA_NUMBER_TYPE;
|
|
30520
30681
|
}
|
|
30521
30682
|
}
|
|
30522
30683
|
|
|
30523
|
-
let
|
|
30524
|
-
function
|
|
30525
|
-
|
|
30526
|
-
loadPyramid3dPick || (null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, Pyramid3dRender)) && (loadPyramid3dPick = !0, container.bind(CanvasPyramid3dPicker).toDynamicValue(() => new DefaultCanvasPyramid3dPicker(resolveContainerBinding$1(container, Pyramid3dRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasPyramid3dPicker));
|
|
30527
|
-
}
|
|
30528
|
-
|
|
30529
|
-
function _registerPyramid3d() {
|
|
30530
|
-
if (_registerPyramid3d.__loaded) return;
|
|
30531
|
-
_registerPyramid3d.__loaded = !0;
|
|
30532
|
-
const legacyContext = getLegacyBindingContext();
|
|
30533
|
-
registerPyramid3dGraphic(), registerDirectionalLight(), registerOrthoCamera(), pyramid3dModule({
|
|
30534
|
-
bind: legacyContext.bind
|
|
30535
|
-
}), bindPyramid3dCanvasPickerContribution(legacyContext);
|
|
30684
|
+
let loadAreaPick$1 = !1;
|
|
30685
|
+
function bindAreaCanvasPickerContribution(container) {
|
|
30686
|
+
loadAreaPick$1 || (loadAreaPick$1 = !0, container.bind(CanvasAreaPicker).toDynamicValue(() => new DefaultCanvasAreaPicker(resolveContainerBinding$1(container, AreaRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasAreaPicker));
|
|
30536
30687
|
}
|
|
30537
|
-
_registerPyramid3d.__loaded = !1;
|
|
30538
|
-
const registerPyramid3d = _registerPyramid3d;
|
|
30539
30688
|
|
|
30540
|
-
class
|
|
30689
|
+
class DefaultMathAreaPicker extends PickerBase {
|
|
30541
30690
|
constructor(canvasRenderer) {
|
|
30542
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "
|
|
30691
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "area", this.numberType = AREA_NUMBER_TYPE;
|
|
30543
30692
|
}
|
|
30544
30693
|
}
|
|
30545
30694
|
|
|
30546
|
-
let
|
|
30547
|
-
function
|
|
30548
|
-
|
|
30549
|
-
loadRect3dPick || (null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, Rect3DRender)) && (loadRect3dPick = !0, container.bind(CanvasRect3dPicker).toDynamicValue(() => new DefaultCanvasRect3dPicker(resolveContainerBinding$1(container, Rect3DRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasRect3dPicker));
|
|
30695
|
+
let loadAreaPick = !1;
|
|
30696
|
+
function bindAreaMathPickerContribution(container) {
|
|
30697
|
+
loadAreaPick || (loadAreaPick = !0, container.bind(MathAreaPicker).toDynamicValue(() => new DefaultMathAreaPicker(resolveContainerBinding$1(container, AreaRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathAreaPicker));
|
|
30550
30698
|
}
|
|
30551
30699
|
|
|
30552
|
-
function
|
|
30553
|
-
if (
|
|
30554
|
-
|
|
30700
|
+
function _registerArea() {
|
|
30701
|
+
if (_registerArea.__loaded) return;
|
|
30702
|
+
_registerArea.__loaded = !0;
|
|
30555
30703
|
const legacyContext = getLegacyBindingContext();
|
|
30556
|
-
|
|
30704
|
+
registerAreaGraphic(), areaModule({
|
|
30557
30705
|
bind: legacyContext.bind
|
|
30558
|
-
}),
|
|
30706
|
+
}), browser ? bindAreaCanvasPickerContribution(legacyContext) : bindAreaMathPickerContribution(legacyContext);
|
|
30559
30707
|
}
|
|
30560
|
-
|
|
30561
|
-
const
|
|
30562
|
-
|
|
30563
|
-
const createArc3d = attributes => (registerArc3d(), createGraphic$1("arc3d", attributes));
|
|
30564
|
-
const createPyramid3d = attributes => (registerPyramid3d(), createGraphic$1("pyramid3d", attributes));
|
|
30565
|
-
const createRect3d = attributes => (registerRect3d(), createGraphic$1("rect3d", attributes));
|
|
30566
|
-
const waitForAllSubLayers = stage => new Promise(resolve => {
|
|
30567
|
-
vglobal.getRequestAnimationFrame()(() => {
|
|
30568
|
-
resolve(null);
|
|
30569
|
-
});
|
|
30570
|
-
}).then(() => {
|
|
30571
|
-
const promiseList = [];
|
|
30572
|
-
return stage.getChildren().forEach(layer => {
|
|
30573
|
-
var _a;
|
|
30574
|
-
(null === (_a = layer.subLayers) || void 0 === _a ? void 0 : _a.size) && layer.subLayers.forEach(subLayer => {
|
|
30575
|
-
const drawContribution = subLayer.drawContribution;
|
|
30576
|
-
(null == drawContribution ? void 0 : drawContribution.hooks) && drawContribution.rendering && promiseList.push(new Promise(resolve => {
|
|
30577
|
-
drawContribution.hooks.completeDraw.tap("outWait", () => {
|
|
30578
|
-
drawContribution.hooks.completeDraw.taps = drawContribution.hooks.completeDraw.taps.filter(item => "outWait" !== item.name), resolve(null);
|
|
30579
|
-
});
|
|
30580
|
-
}));
|
|
30581
|
-
});
|
|
30582
|
-
}), Promise.all(promiseList);
|
|
30583
|
-
});
|
|
30708
|
+
_registerArea.__loaded = !1;
|
|
30709
|
+
const registerArea = _registerArea;
|
|
30584
30710
|
|
|
30585
|
-
|
|
30586
|
-
|
|
30587
|
-
|
|
30588
|
-
|
|
30589
|
-
|
|
30711
|
+
class GlyphPickerBase {
|
|
30712
|
+
constructor() {
|
|
30713
|
+
this.type = "glyph", this.numberType = GLYPH_NUMBER_TYPE;
|
|
30714
|
+
}
|
|
30715
|
+
contains(glyph, point, params) {
|
|
30716
|
+
if (!glyph.AABBBounds.containsPoint(point)) return !1;
|
|
30717
|
+
if ("imprecise" === glyph.attribute.pickMode) return !0;
|
|
30718
|
+
const {
|
|
30719
|
+
pickContext: pickContext
|
|
30720
|
+
} = null != params ? params : {};
|
|
30721
|
+
if (!pickContext) return !1;
|
|
30722
|
+
const pickerService = null == params ? void 0 : params.pickerService;
|
|
30723
|
+
if (pickerService) {
|
|
30724
|
+
let picked = !1;
|
|
30725
|
+
return glyph.getSubGraphic().forEach(g => {
|
|
30726
|
+
if (picked) return;
|
|
30727
|
+
const data = pickerService.pickItem(g, point, null, params);
|
|
30728
|
+
picked = !(!data || !data.graphic);
|
|
30729
|
+
}), picked;
|
|
30730
|
+
}
|
|
30731
|
+
return !1;
|
|
30590
30732
|
}
|
|
30591
|
-
return result;
|
|
30592
|
-
}
|
|
30593
|
-
function moveAfterInArray(array, target, ref) {
|
|
30594
|
-
const index = array.indexOf(target),
|
|
30595
|
-
refIndex = array.indexOf(ref);
|
|
30596
|
-
index >= 0 && refIndex >= 0 && index < refIndex && (array.splice(index, 1), array.splice(refIndex, 0, target));
|
|
30597
30733
|
}
|
|
30598
30734
|
|
|
30599
|
-
|
|
30600
|
-
|
|
30601
|
-
|
|
30602
|
-
{
|
|
30603
|
-
if (!isFunction$1(config.errorHandler)) throw new Error(msg);
|
|
30604
|
-
config.errorHandler.call(null, msg, detail);
|
|
30735
|
+
class DefaultCanvasGlyphPicker extends GlyphPickerBase {
|
|
30736
|
+
constructor(canvasRenderer) {
|
|
30737
|
+
super(), this.canvasRenderer = canvasRenderer;
|
|
30605
30738
|
}
|
|
30606
|
-
};
|
|
30607
|
-
const config = {
|
|
30608
|
-
silent: !1,
|
|
30609
|
-
warnHandler: !1,
|
|
30610
|
-
errorHandler: !1
|
|
30611
|
-
};
|
|
30612
|
-
|
|
30613
|
-
const isBrowser = isBrowserEnv();
|
|
30614
|
-
const domDocument = isBrowser && globalThis ? globalThis.document : void 0;
|
|
30615
|
-
function isTrueBrowser(mode) {
|
|
30616
|
-
return ("desktop-browser" === mode || "mobile-browser" === mode) && isBrowser;
|
|
30617
|
-
}
|
|
30618
|
-
function isMobileLikeMode(mode) {
|
|
30619
|
-
return isMiniAppLikeMode(mode) || "mobile-browser" === mode;
|
|
30620
|
-
}
|
|
30621
|
-
function isMiniAppLikeMode(mode) {
|
|
30622
|
-
return mode.includes("miniApp") || "lynx" === mode || "wx" === mode || "harmony" === mode;
|
|
30623
30739
|
}
|
|
30624
30740
|
|
|
30625
|
-
let
|
|
30626
|
-
function
|
|
30627
|
-
|
|
30741
|
+
let loadGlyphPick$1 = !1;
|
|
30742
|
+
function bindGlyphCanvasPickerContribution(container) {
|
|
30743
|
+
loadGlyphPick$1 || (loadGlyphPick$1 = !0, container.bind(CanvasGlyphPicker).toDynamicValue(() => new DefaultCanvasGlyphPicker(resolveContainerBinding$1(container, GlyphRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasGlyphPicker));
|
|
30628
30744
|
}
|
|
30629
30745
|
|
|
30630
|
-
|
|
30631
|
-
|
|
30746
|
+
class DefaultMathGlyphPicker extends GlyphPickerBase {
|
|
30747
|
+
constructor(canvasRenderer) {
|
|
30748
|
+
super(), this.canvasRenderer = canvasRenderer;
|
|
30749
|
+
}
|
|
30632
30750
|
}
|
|
30633
|
-
|
|
30634
|
-
|
|
30635
|
-
|
|
30636
|
-
|
|
30751
|
+
|
|
30752
|
+
let loadGlyphPick = !1;
|
|
30753
|
+
function bindGlyphMathPickerContribution(container) {
|
|
30754
|
+
loadGlyphPick || (loadGlyphPick = !0, container.bind(MathGlyphPicker).toDynamicValue(() => new DefaultMathGlyphPicker(resolveContainerBinding$1(container, GlyphRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathGlyphPicker));
|
|
30637
30755
|
}
|
|
30638
|
-
|
|
30756
|
+
|
|
30757
|
+
function _registerGlyph() {
|
|
30758
|
+
if (_registerGlyph.__loaded) return;
|
|
30759
|
+
_registerGlyph.__loaded = !0;
|
|
30760
|
+
const legacyContext = getLegacyBindingContext();
|
|
30761
|
+
registerGlyphGraphic(), glyphModule({
|
|
30762
|
+
bind: legacyContext.bind
|
|
30763
|
+
}), browser ? bindGlyphCanvasPickerContribution(legacyContext) : bindGlyphMathPickerContribution(legacyContext);
|
|
30764
|
+
}
|
|
30765
|
+
_registerGlyph.__loaded = !1;
|
|
30766
|
+
const registerGlyph = _registerGlyph;
|
|
30767
|
+
|
|
30768
|
+
function _registerGroup() {
|
|
30769
|
+
_registerGroup.__loaded || (_registerGroup.__loaded = !0, registerGroupGraphic());
|
|
30770
|
+
}
|
|
30771
|
+
_registerGroup.__loaded = !1;
|
|
30772
|
+
const registerGroup = _registerGroup;
|
|
30773
|
+
|
|
30774
|
+
class DefaultCanvasImagePicker extends PickerBase {
|
|
30775
|
+
constructor(canvasRenderer) {
|
|
30776
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "image", this.numberType = IMAGE_NUMBER_TYPE;
|
|
30777
|
+
}
|
|
30778
|
+
}
|
|
30779
|
+
|
|
30780
|
+
let loadImagePick$1 = !1;
|
|
30781
|
+
function bindImageCanvasPickerContribution(container) {
|
|
30782
|
+
loadImagePick$1 || (loadImagePick$1 = !0, container.bind(CanvasImagePicker).toDynamicValue(() => new DefaultCanvasImagePicker(resolveContainerBinding$1(container, ImageRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasImagePicker));
|
|
30783
|
+
}
|
|
30784
|
+
|
|
30785
|
+
class DefaultMathImagePicker {
|
|
30786
|
+
constructor() {
|
|
30787
|
+
this.type = "image", this.numberType = IMAGE_NUMBER_TYPE;
|
|
30788
|
+
}
|
|
30789
|
+
contains(image, point, params) {
|
|
30790
|
+
const {
|
|
30791
|
+
pickContext: pickContext
|
|
30792
|
+
} = null != params ? params : {};
|
|
30793
|
+
return !!pickContext && !!image.AABBBounds.containsPoint(point);
|
|
30794
|
+
}
|
|
30795
|
+
}
|
|
30796
|
+
|
|
30797
|
+
let loadImagePick = !1;
|
|
30798
|
+
function bindImageMathPickerContribution(container) {
|
|
30799
|
+
loadImagePick || (loadImagePick = !0, container.bind(MathImagePicker).toDynamicValue(() => new DefaultMathImagePicker()).inSingletonScope(), container.bind(MathPickerContribution).toService(MathImagePicker));
|
|
30800
|
+
}
|
|
30801
|
+
|
|
30802
|
+
function _registerImage() {
|
|
30803
|
+
if (_registerImage.__loaded) return;
|
|
30804
|
+
_registerImage.__loaded = !0;
|
|
30805
|
+
const legacyContext = getLegacyBindingContext();
|
|
30806
|
+
registerImageGraphic(), imageModule({
|
|
30807
|
+
bind: legacyContext.bind
|
|
30808
|
+
}), browser ? bindImageCanvasPickerContribution(legacyContext) : bindImageMathPickerContribution(legacyContext);
|
|
30809
|
+
}
|
|
30810
|
+
_registerImage.__loaded = !1;
|
|
30811
|
+
const registerImage = _registerImage;
|
|
30812
|
+
|
|
30813
|
+
class BaseLinePicker extends BaseRender {
|
|
30814
|
+
contains(graphic, point, params) {
|
|
30815
|
+
if (!graphic.AABBBounds.containsPoint(point)) return !1;
|
|
30816
|
+
if ("imprecise" === graphic.attribute.pickMode) return !0;
|
|
30817
|
+
const {
|
|
30818
|
+
pickContext: pickContext
|
|
30819
|
+
} = null != params ? params : {};
|
|
30820
|
+
if (!pickContext) return !1;
|
|
30821
|
+
pickContext.highPerformanceSave();
|
|
30822
|
+
const lineAttribute = graphic.getGraphicTheme(),
|
|
30823
|
+
data = this.transform(graphic, lineAttribute, pickContext),
|
|
30824
|
+
{
|
|
30825
|
+
x: x,
|
|
30826
|
+
y: y,
|
|
30827
|
+
z: z,
|
|
30828
|
+
lastModelMatrix: lastModelMatrix
|
|
30829
|
+
} = data;
|
|
30830
|
+
let pickPoint = point;
|
|
30831
|
+
if (pickContext.camera) {
|
|
30832
|
+
pickPoint = point.clone();
|
|
30833
|
+
const globalMatrix = graphic.parent.globalTransMatrix;
|
|
30834
|
+
pickPoint.x = globalMatrix.a * point.x + globalMatrix.c * point.y + globalMatrix.e, pickPoint.y = globalMatrix.b * point.x + globalMatrix.d * point.y + globalMatrix.f;
|
|
30835
|
+
}
|
|
30836
|
+
this.canvasRenderer.z = z;
|
|
30837
|
+
let picked = !1;
|
|
30838
|
+
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
|
|
30839
|
+
if (picked) return !0;
|
|
30840
|
+
const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
30841
|
+
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
30842
|
+
keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
30843
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
30844
|
+
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
30845
|
+
}
|
|
30846
|
+
}
|
|
30847
|
+
|
|
30848
|
+
class DefaultCanvasLinePicker extends BaseLinePicker {
|
|
30849
|
+
constructor(canvasRenderer) {
|
|
30850
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
30851
|
+
}
|
|
30852
|
+
}
|
|
30853
|
+
|
|
30854
|
+
let loadLinePick$1 = !1;
|
|
30855
|
+
function bindLineCanvasPickerContribution(container) {
|
|
30856
|
+
loadLinePick$1 || (loadLinePick$1 = !0, container.bind(CanvasLinePicker).toDynamicValue(() => new DefaultCanvasLinePicker(resolveContainerBinding$1(container, LineRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasLinePicker));
|
|
30857
|
+
}
|
|
30858
|
+
|
|
30859
|
+
class DefaultMathLinePicker extends PickerBase {
|
|
30860
|
+
constructor(canvasRenderer) {
|
|
30861
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
30862
|
+
}
|
|
30863
|
+
}
|
|
30864
|
+
|
|
30865
|
+
let loadLinePick = !1;
|
|
30866
|
+
function bindLineMathPickerContribution(container) {
|
|
30867
|
+
loadLinePick || (loadLinePick = !0, container.bind(MathLinePicker).toDynamicValue(() => new DefaultMathLinePicker(resolveContainerBinding$1(container, LineRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathLinePicker));
|
|
30868
|
+
}
|
|
30869
|
+
|
|
30870
|
+
function _registerLine() {
|
|
30871
|
+
if (_registerLine.__loaded) return;
|
|
30872
|
+
_registerLine.__loaded = !0;
|
|
30873
|
+
const legacyContext = getLegacyBindingContext();
|
|
30874
|
+
registerLineGraphic(), lineModule({
|
|
30875
|
+
bind: legacyContext.bind
|
|
30876
|
+
}), browser ? bindLineCanvasPickerContribution(legacyContext) : bindLineMathPickerContribution(legacyContext);
|
|
30877
|
+
}
|
|
30878
|
+
_registerLine.__loaded = !1;
|
|
30879
|
+
const registerLine = _registerLine;
|
|
30880
|
+
|
|
30881
|
+
class DefaultCanvasPathPicker extends BaseLinePicker {
|
|
30882
|
+
constructor(canvasRenderer) {
|
|
30883
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "path", this.numberType = PATH_NUMBER_TYPE;
|
|
30884
|
+
}
|
|
30885
|
+
}
|
|
30886
|
+
|
|
30887
|
+
let loadPathPick$1 = !1;
|
|
30888
|
+
function bindPathCanvasPickerContribution(container) {
|
|
30889
|
+
loadPathPick$1 || (loadPathPick$1 = !0, container.bind(CanvasPathPicker).toDynamicValue(() => new DefaultCanvasPathPicker(resolveContainerBinding$1(container, PathRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasPathPicker));
|
|
30890
|
+
}
|
|
30891
|
+
|
|
30892
|
+
class DefaultMathPathPicker extends PickerBase {
|
|
30893
|
+
constructor(canvasRenderer) {
|
|
30894
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "path", this.numberType = PATH_NUMBER_TYPE;
|
|
30895
|
+
}
|
|
30896
|
+
}
|
|
30897
|
+
|
|
30898
|
+
let loadPathPick = !1;
|
|
30899
|
+
function bindPathMathPickerContribution(container) {
|
|
30900
|
+
loadPathPick || (loadPathPick = !0, container.bind(MathPathPicker).toDynamicValue(() => new DefaultMathPathPicker(resolveContainerBinding$1(container, PathRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathPathPicker));
|
|
30901
|
+
}
|
|
30902
|
+
|
|
30903
|
+
function _registerPath() {
|
|
30904
|
+
if (_registerPath.__loaded) return;
|
|
30905
|
+
_registerPath.__loaded = !0;
|
|
30906
|
+
const legacyContext = getLegacyBindingContext();
|
|
30907
|
+
registerPathGraphic(), pathModule({
|
|
30908
|
+
bind: legacyContext.bind
|
|
30909
|
+
}), browser ? bindPathCanvasPickerContribution(legacyContext) : bindPathMathPickerContribution(legacyContext);
|
|
30910
|
+
}
|
|
30911
|
+
_registerPath.__loaded = !1;
|
|
30912
|
+
const registerPath = _registerPath;
|
|
30913
|
+
|
|
30914
|
+
class DefaultCanvasPolygonPicker extends PickerBase {
|
|
30915
|
+
constructor(canvasRenderer) {
|
|
30916
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "polygon", this.numberType = POLYGON_NUMBER_TYPE;
|
|
30917
|
+
}
|
|
30918
|
+
}
|
|
30919
|
+
|
|
30920
|
+
let loadPolygonPick$1 = !1;
|
|
30921
|
+
function bindPolygonCanvasPickerContribution(container) {
|
|
30922
|
+
loadPolygonPick$1 || (loadPolygonPick$1 = !0, container.bind(CanvasPolygonPicker).toDynamicValue(() => new DefaultCanvasPolygonPicker(resolveContainerBinding$1(container, PolygonRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasPolygonPicker));
|
|
30923
|
+
}
|
|
30924
|
+
|
|
30925
|
+
class DefaultMathPolygonPicker extends PickerBase {
|
|
30926
|
+
constructor(canvasRenderer) {
|
|
30927
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "polygon", this.numberType = POLYGON_NUMBER_TYPE;
|
|
30928
|
+
}
|
|
30929
|
+
}
|
|
30930
|
+
|
|
30931
|
+
let loadPolygonPick = !1;
|
|
30932
|
+
function bindPolygonMathPickerContribution(container) {
|
|
30933
|
+
loadPolygonPick || (loadPolygonPick = !0, container.bind(MathPolygonPicker).toDynamicValue(() => new DefaultMathPolygonPicker(resolveContainerBinding$1(container, PolygonRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathPolygonPicker));
|
|
30934
|
+
}
|
|
30935
|
+
|
|
30936
|
+
function _registerPolygon() {
|
|
30937
|
+
if (_registerPolygon.__loaded) return;
|
|
30938
|
+
_registerPolygon.__loaded = !0;
|
|
30939
|
+
const legacyContext = getLegacyBindingContext();
|
|
30940
|
+
registerPolygonGraphic(), polygonModule({
|
|
30941
|
+
bind: legacyContext.bind
|
|
30942
|
+
}), browser ? bindPolygonCanvasPickerContribution(legacyContext) : bindPolygonMathPickerContribution(legacyContext);
|
|
30943
|
+
}
|
|
30944
|
+
_registerPolygon.__loaded = !1;
|
|
30945
|
+
const registerPolygon = _registerPolygon;
|
|
30946
|
+
|
|
30947
|
+
class DefaultCanvasPyramid3dPicker extends Base3dPicker {
|
|
30948
|
+
constructor(canvasRenderer) {
|
|
30949
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "pyramid3d", this.numberType = PYRAMID3D_NUMBER_TYPE, this.themeType = "polygon";
|
|
30950
|
+
}
|
|
30951
|
+
}
|
|
30952
|
+
|
|
30953
|
+
let loadPyramid3dPick = !1;
|
|
30954
|
+
function bindPyramid3dCanvasPickerContribution(container) {
|
|
30955
|
+
var _a;
|
|
30956
|
+
loadPyramid3dPick || (null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, Pyramid3dRender)) && (loadPyramid3dPick = !0, container.bind(CanvasPyramid3dPicker).toDynamicValue(() => new DefaultCanvasPyramid3dPicker(resolveContainerBinding$1(container, Pyramid3dRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasPyramid3dPicker));
|
|
30957
|
+
}
|
|
30958
|
+
|
|
30959
|
+
function _registerPyramid3d() {
|
|
30960
|
+
if (_registerPyramid3d.__loaded) return;
|
|
30961
|
+
_registerPyramid3d.__loaded = !0;
|
|
30962
|
+
const legacyContext = getLegacyBindingContext();
|
|
30963
|
+
registerPyramid3dGraphic(), registerDirectionalLight(), registerOrthoCamera(), pyramid3dModule({
|
|
30964
|
+
bind: legacyContext.bind
|
|
30965
|
+
}), bindPyramid3dCanvasPickerContribution(legacyContext);
|
|
30966
|
+
}
|
|
30967
|
+
_registerPyramid3d.__loaded = !1;
|
|
30968
|
+
const registerPyramid3d = _registerPyramid3d;
|
|
30969
|
+
|
|
30970
|
+
const _bounds = new AABBBounds();
|
|
30971
|
+
class RectPickerBase {
|
|
30972
|
+
constructor() {
|
|
30973
|
+
this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
30974
|
+
}
|
|
30975
|
+
contains(rect, point, params) {
|
|
30976
|
+
if (!rect.AABBBounds.containsPoint(point)) return !1;
|
|
30977
|
+
if ("imprecise" === rect.attribute.pickMode) return !0;
|
|
30978
|
+
const {
|
|
30979
|
+
pickContext: pickContext
|
|
30980
|
+
} = null != params ? params : {};
|
|
30981
|
+
if (!pickContext) return !1;
|
|
30982
|
+
const rectAttribute = rect.getGraphicTheme(),
|
|
30983
|
+
{
|
|
30984
|
+
cornerRadius = rectAttribute.cornerRadius
|
|
30985
|
+
} = rect.attribute;
|
|
30986
|
+
let {
|
|
30987
|
+
x = rectAttribute.x,
|
|
30988
|
+
y = rectAttribute.y
|
|
30989
|
+
} = rect.attribute;
|
|
30990
|
+
pickContext.highPerformanceSave();
|
|
30991
|
+
let onlyTranslate = !0;
|
|
30992
|
+
if (rect.transMatrix.onlyTranslate()) {
|
|
30993
|
+
const point = rect.getOffsetXY(rectAttribute);
|
|
30994
|
+
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
30995
|
+
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
30996
|
+
let picked = !0;
|
|
30997
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
30998
|
+
if (picked) return !0;
|
|
30999
|
+
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
31000
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
31001
|
+
keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
31002
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
31003
|
+
});else {
|
|
31004
|
+
const {
|
|
31005
|
+
fill = rectAttribute.fill,
|
|
31006
|
+
stroke = rectAttribute.stroke,
|
|
31007
|
+
lineWidth = rectAttribute.lineWidth
|
|
31008
|
+
} = rect.attribute;
|
|
31009
|
+
if (fill) picked = !0;else if (stroke) {
|
|
31010
|
+
const bounds = rect.AABBBounds;
|
|
31011
|
+
_bounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), _bounds.expand(-lineWidth / 2), picked = !_bounds.containsPoint(point);
|
|
31012
|
+
}
|
|
31013
|
+
}
|
|
31014
|
+
return pickContext.highPerformanceRestore(), picked;
|
|
31015
|
+
}
|
|
31016
|
+
}
|
|
31017
|
+
|
|
31018
|
+
class DefaultCanvasRectPicker extends RectPickerBase {
|
|
31019
|
+
constructor(canvasRenderer) {
|
|
31020
|
+
super(), this.canvasRenderer = canvasRenderer;
|
|
31021
|
+
}
|
|
31022
|
+
}
|
|
31023
|
+
|
|
31024
|
+
let loadRectPick$1 = !1;
|
|
31025
|
+
function bindRectCanvasPickerContribution(container) {
|
|
31026
|
+
loadRectPick$1 || (loadRectPick$1 = !0, container.bind(CanvasRectPicker).toDynamicValue(() => new DefaultCanvasRectPicker(resolveContainerBinding$1(container, RectRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasRectPicker));
|
|
31027
|
+
}
|
|
31028
|
+
|
|
31029
|
+
class DefaultMathRectPicker extends RectPickerBase {
|
|
31030
|
+
constructor(canvasRenderer) {
|
|
31031
|
+
super(), this.canvasRenderer = canvasRenderer;
|
|
31032
|
+
}
|
|
31033
|
+
}
|
|
31034
|
+
|
|
31035
|
+
let loadRectPick = !1;
|
|
31036
|
+
function bindRectMathPickerContribution(container) {
|
|
31037
|
+
loadRectPick || (loadRectPick = !0, container.bind(MathRectPicker).toDynamicValue(() => new DefaultMathRectPicker(resolveContainerBinding$1(container, RectRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathRectPicker));
|
|
31038
|
+
}
|
|
31039
|
+
|
|
31040
|
+
function _registerRect() {
|
|
31041
|
+
if (_registerRect.__loaded) return;
|
|
31042
|
+
_registerRect.__loaded = !0;
|
|
31043
|
+
const legacyContext = getLegacyBindingContext();
|
|
31044
|
+
registerRectGraphic(), rectModule({
|
|
31045
|
+
bind: legacyContext.bind
|
|
31046
|
+
}), browser ? bindRectCanvasPickerContribution(legacyContext) : bindRectMathPickerContribution(legacyContext);
|
|
31047
|
+
}
|
|
31048
|
+
_registerRect.__loaded = !1;
|
|
31049
|
+
const registerRect = _registerRect;
|
|
31050
|
+
|
|
31051
|
+
class DefaultCanvasRect3dPicker extends Base3dPicker {
|
|
31052
|
+
constructor(canvasRenderer) {
|
|
31053
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE, this.themeType = "rect";
|
|
31054
|
+
}
|
|
31055
|
+
}
|
|
31056
|
+
|
|
31057
|
+
let loadRect3dPick = !1;
|
|
31058
|
+
function bindRect3dCanvasPickerContribution(container) {
|
|
31059
|
+
var _a;
|
|
31060
|
+
loadRect3dPick || (null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, Rect3DRender)) && (loadRect3dPick = !0, container.bind(CanvasRect3dPicker).toDynamicValue(() => new DefaultCanvasRect3dPicker(resolveContainerBinding$1(container, Rect3DRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasRect3dPicker));
|
|
31061
|
+
}
|
|
31062
|
+
|
|
31063
|
+
function _registerRect3d() {
|
|
31064
|
+
if (_registerRect3d.__loaded) return;
|
|
31065
|
+
_registerRect3d.__loaded = !0;
|
|
31066
|
+
const legacyContext = getLegacyBindingContext();
|
|
31067
|
+
registerRect3dGraphic(), rect3dModule({
|
|
31068
|
+
bind: legacyContext.bind
|
|
31069
|
+
}), bindRect3dCanvasPickerContribution(legacyContext);
|
|
31070
|
+
}
|
|
31071
|
+
_registerRect3d.__loaded = !1;
|
|
31072
|
+
const registerRect3d = _registerRect3d;
|
|
31073
|
+
|
|
31074
|
+
class DefaultCanvasRichTextPicker {
|
|
31075
|
+
constructor(canvasRenderer) {
|
|
31076
|
+
this.canvasRenderer = canvasRenderer, this.type = "richtext", this.numberType = RICHTEXT_NUMBER_TYPE;
|
|
31077
|
+
}
|
|
31078
|
+
contains(richtext, point, params) {
|
|
31079
|
+
return !!richtext.AABBBounds.containsPoint(point);
|
|
31080
|
+
}
|
|
31081
|
+
}
|
|
31082
|
+
|
|
31083
|
+
let loadRichtextPick = !1;
|
|
31084
|
+
function bindRichtextCanvasPickerContribution(container) {
|
|
31085
|
+
loadRichtextPick || (loadRichtextPick = !0, container.bind(CanvasRichTextPicker).toDynamicValue(() => new DefaultCanvasRichTextPicker(resolveContainerBinding$1(container, RichTextRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasRichTextPicker));
|
|
31086
|
+
}
|
|
31087
|
+
|
|
31088
|
+
class DefaultMathRichTextPicker {
|
|
31089
|
+
constructor(canvasRenderer) {
|
|
31090
|
+
this.canvasRenderer = canvasRenderer, this.type = "richtext", this.numberType = RICHTEXT_NUMBER_TYPE;
|
|
31091
|
+
}
|
|
31092
|
+
contains(richtext, point, params) {
|
|
31093
|
+
return !!richtext.AABBBounds.containsPoint(point);
|
|
31094
|
+
}
|
|
31095
|
+
}
|
|
31096
|
+
|
|
31097
|
+
let loadRichTextPick = !1;
|
|
31098
|
+
function bindRichTextMathPickerContribution(container) {
|
|
31099
|
+
loadRichTextPick || (loadRichTextPick = !0, container.bind(MathRichTextPicker).toDynamicValue(() => new DefaultMathRichTextPicker(resolveContainerBinding$1(container, RichTextRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathRichTextPicker));
|
|
31100
|
+
}
|
|
31101
|
+
|
|
31102
|
+
function _registerRichtext() {
|
|
31103
|
+
if (_registerRichtext.__loaded) return;
|
|
31104
|
+
_registerRichtext.__loaded = !0;
|
|
31105
|
+
const legacyContext = getLegacyBindingContext();
|
|
31106
|
+
registerRichtextGraphic(), richtextModule({
|
|
31107
|
+
bind: legacyContext.bind
|
|
31108
|
+
}), browser ? bindRichtextCanvasPickerContribution(legacyContext) : bindRichTextMathPickerContribution(legacyContext);
|
|
31109
|
+
}
|
|
31110
|
+
_registerRichtext.__loaded = !1;
|
|
31111
|
+
const registerRichtext = _registerRichtext;
|
|
31112
|
+
|
|
31113
|
+
function _registerShadowRoot() {
|
|
31114
|
+
_registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
|
|
31115
|
+
}
|
|
31116
|
+
_registerShadowRoot.__loaded = !1;
|
|
31117
|
+
const registerShadowRoot = _registerShadowRoot;
|
|
31118
|
+
|
|
31119
|
+
class DefaultCanvasSymbolPicker extends Base3dPicker {
|
|
31120
|
+
constructor(canvasRenderer) {
|
|
31121
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
31122
|
+
}
|
|
31123
|
+
contains(symbol, point, params) {
|
|
31124
|
+
const {
|
|
31125
|
+
pickContext: pickContext
|
|
31126
|
+
} = null != params ? params : {};
|
|
31127
|
+
if (!pickContext) return !1;
|
|
31128
|
+
const parsedPath = symbol.getParsedPath();
|
|
31129
|
+
if (!pickContext.camera) {
|
|
31130
|
+
if (!symbol.AABBBounds.containsPoint(point)) return !1;
|
|
31131
|
+
if (parsedPath.isSvg || "imprecise" === symbol.attribute.pickMode) return !0;
|
|
31132
|
+
}
|
|
31133
|
+
pickContext.highPerformanceSave();
|
|
31134
|
+
const symbolAttribute = symbol.getGraphicTheme(),
|
|
31135
|
+
data = this.transform(symbol, symbolAttribute, pickContext),
|
|
31136
|
+
{
|
|
31137
|
+
x: x,
|
|
31138
|
+
y: y,
|
|
31139
|
+
z: z,
|
|
31140
|
+
lastModelMatrix: lastModelMatrix
|
|
31141
|
+
} = data;
|
|
31142
|
+
let pickPoint = point;
|
|
31143
|
+
if (pickContext.camera) {
|
|
31144
|
+
pickPoint = point.clone();
|
|
31145
|
+
const globalMatrix = symbol.parent.globalTransMatrix;
|
|
31146
|
+
pickPoint.x = globalMatrix.a * point.x + globalMatrix.c * point.y + globalMatrix.e, pickPoint.y = globalMatrix.b * point.x + globalMatrix.d * point.y + globalMatrix.f;
|
|
31147
|
+
}
|
|
31148
|
+
this.canvasRenderer.z = z;
|
|
31149
|
+
let picked = !1;
|
|
31150
|
+
return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
|
|
31151
|
+
if (picked) return !0;
|
|
31152
|
+
const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
31153
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
31154
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
31155
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
31156
|
+
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
31157
|
+
}
|
|
31158
|
+
}
|
|
31159
|
+
|
|
31160
|
+
let loadSymbolPick$1 = !1;
|
|
31161
|
+
function bindSymbolCanvasPickerContribution(container) {
|
|
31162
|
+
loadSymbolPick$1 || (loadSymbolPick$1 = !0, container.bind(CanvasSymbolPicker).toDynamicValue(() => new DefaultCanvasSymbolPicker(resolveContainerBinding$1(container, SymbolRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasSymbolPicker));
|
|
31163
|
+
}
|
|
31164
|
+
|
|
31165
|
+
class DefaultMathSymbolPicker extends PickerBase {
|
|
31166
|
+
constructor(canvasRenderer) {
|
|
31167
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
31168
|
+
}
|
|
31169
|
+
}
|
|
31170
|
+
|
|
31171
|
+
let loadSymbolPick = !1;
|
|
31172
|
+
function bindSymbolMathPickerContribution(container) {
|
|
31173
|
+
loadSymbolPick || (loadSymbolPick = !0, container.bind(MathSymbolPicker).toDynamicValue(() => new DefaultMathSymbolPicker(resolveContainerBinding$1(container, SymbolRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathSymbolPicker));
|
|
31174
|
+
}
|
|
31175
|
+
|
|
31176
|
+
function _registerSymbol() {
|
|
31177
|
+
if (_registerSymbol.__loaded) return;
|
|
31178
|
+
_registerSymbol.__loaded = !0;
|
|
31179
|
+
const legacyContext = getLegacyBindingContext();
|
|
31180
|
+
registerSymbolGraphic(), symbolModule({
|
|
31181
|
+
bind: legacyContext.bind
|
|
31182
|
+
}), browser ? bindSymbolCanvasPickerContribution(legacyContext) : bindSymbolMathPickerContribution(legacyContext);
|
|
31183
|
+
}
|
|
31184
|
+
_registerSymbol.__loaded = !1;
|
|
31185
|
+
const registerSymbol = _registerSymbol;
|
|
31186
|
+
|
|
31187
|
+
class DefaultCanvasTextPicker extends Base3dPicker {
|
|
31188
|
+
constructor(canvasRenderer) {
|
|
31189
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "text", this.numberType = TEXT_NUMBER_TYPE;
|
|
31190
|
+
}
|
|
31191
|
+
contains(text, point, params) {
|
|
31192
|
+
const {
|
|
31193
|
+
pickContext: pickContext
|
|
31194
|
+
} = null != params ? params : {};
|
|
31195
|
+
if (!pickContext) return !1;
|
|
31196
|
+
const bounds = text.AABBBounds;
|
|
31197
|
+
if (!pickContext.camera) return !!bounds.containsPoint(point);
|
|
31198
|
+
pickContext.highPerformanceSave();
|
|
31199
|
+
const textAttribute = text.getGraphicTheme(),
|
|
31200
|
+
{
|
|
31201
|
+
keepDirIn3d = textAttribute.keepDirIn3d
|
|
31202
|
+
} = text.attribute,
|
|
31203
|
+
computed3dMatrix = !keepDirIn3d,
|
|
31204
|
+
data = this.transform(text, textAttribute, pickContext, computed3dMatrix),
|
|
31205
|
+
{
|
|
31206
|
+
x: x,
|
|
31207
|
+
y: y,
|
|
31208
|
+
z: z,
|
|
31209
|
+
lastModelMatrix: lastModelMatrix
|
|
31210
|
+
} = data;
|
|
31211
|
+
this.canvasRenderer.z = z;
|
|
31212
|
+
let pickPoint = point;
|
|
31213
|
+
if (pickContext.camera) {
|
|
31214
|
+
pickPoint = point.clone();
|
|
31215
|
+
const globalMatrix = text.parent.globalTransMatrix;
|
|
31216
|
+
pickPoint.x = globalMatrix.a * point.x + globalMatrix.c * point.y + globalMatrix.e, pickPoint.y = globalMatrix.b * point.x + globalMatrix.d * point.y + globalMatrix.f;
|
|
31217
|
+
}
|
|
31218
|
+
let picked = !1;
|
|
31219
|
+
return this.canvasRenderer.drawShape(text, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => {
|
|
31220
|
+
if (picked) return !0;
|
|
31221
|
+
const {
|
|
31222
|
+
fontSize = textAttribute.fontSize,
|
|
31223
|
+
textBaseline = textAttribute.textBaseline,
|
|
31224
|
+
textAlign = textAttribute.textAlign
|
|
31225
|
+
} = text.attribute,
|
|
31226
|
+
bounds = text.AABBBounds,
|
|
31227
|
+
height = bounds.height(),
|
|
31228
|
+
width = bounds.width(),
|
|
31229
|
+
offsetY = textLayoutOffsetY(textBaseline, height, fontSize),
|
|
31230
|
+
offsetX = textDrawOffsetX(textAlign, width);
|
|
31231
|
+
return context.rect(offsetX + x, offsetY + y, width, height, z), picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked;
|
|
31232
|
+
}, (context, symbolAttribute, themeAttribute) => picked), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
31233
|
+
}
|
|
31234
|
+
}
|
|
31235
|
+
|
|
31236
|
+
let loadTextPick$1 = !1;
|
|
31237
|
+
function bindTextCanvasPickerContribution(container) {
|
|
31238
|
+
loadTextPick$1 || (loadTextPick$1 = !0, container.bind(CanvasTextPicker).toDynamicValue(() => new DefaultCanvasTextPicker(resolveContainerBinding$1(container, TextRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasTextPicker));
|
|
31239
|
+
}
|
|
31240
|
+
|
|
31241
|
+
class DefaultMathTextPicker {
|
|
31242
|
+
constructor() {
|
|
31243
|
+
this.type = "text", this.numberType = TEXT_NUMBER_TYPE;
|
|
31244
|
+
}
|
|
31245
|
+
contains(text, point, params) {
|
|
31246
|
+
return !!text.AABBBounds.containsPoint(point);
|
|
31247
|
+
}
|
|
31248
|
+
}
|
|
31249
|
+
|
|
31250
|
+
let loadTextPick = !1;
|
|
31251
|
+
function bindTextMathPickerContribution(container) {
|
|
31252
|
+
loadTextPick || (loadTextPick = !0, container.bind(MathTextPicker).toDynamicValue(() => new DefaultMathTextPicker()).inSingletonScope(), container.bind(MathPickerContribution).toService(MathTextPicker));
|
|
31253
|
+
}
|
|
31254
|
+
|
|
31255
|
+
function _registerText() {
|
|
31256
|
+
if (_registerText.__loaded) return;
|
|
31257
|
+
_registerText.__loaded = !0;
|
|
31258
|
+
const legacyContext = getLegacyBindingContext();
|
|
31259
|
+
registerTextGraphic(), textModule({
|
|
31260
|
+
bind: legacyContext.bind
|
|
31261
|
+
}), browser ? bindTextCanvasPickerContribution(legacyContext) : bindTextMathPickerContribution(legacyContext);
|
|
31262
|
+
}
|
|
31263
|
+
_registerText.__loaded = !1;
|
|
31264
|
+
const registerText = _registerText;
|
|
31265
|
+
|
|
31266
|
+
const createArc3d = attributes => (registerArc3d(), createGraphic$1("arc3d", attributes));
|
|
31267
|
+
const createPyramid3d = attributes => (registerPyramid3d(), createGraphic$1("pyramid3d", attributes));
|
|
31268
|
+
const createRect3d = attributes => (registerRect3d(), createGraphic$1("rect3d", attributes));
|
|
31269
|
+
const waitForAllSubLayers = stage => new Promise(resolve => {
|
|
31270
|
+
vglobal.getRequestAnimationFrame()(() => {
|
|
31271
|
+
resolve(null);
|
|
31272
|
+
});
|
|
31273
|
+
}).then(() => {
|
|
31274
|
+
const promiseList = [];
|
|
31275
|
+
return stage.getChildren().forEach(layer => {
|
|
31276
|
+
var _a;
|
|
31277
|
+
(null === (_a = layer.subLayers) || void 0 === _a ? void 0 : _a.size) && layer.subLayers.forEach(subLayer => {
|
|
31278
|
+
const drawContribution = subLayer.drawContribution;
|
|
31279
|
+
(null == drawContribution ? void 0 : drawContribution.hooks) && drawContribution.rendering && promiseList.push(new Promise(resolve => {
|
|
31280
|
+
drawContribution.hooks.completeDraw.tap("outWait", () => {
|
|
31281
|
+
drawContribution.hooks.completeDraw.taps = drawContribution.hooks.completeDraw.taps.filter(item => "outWait" !== item.name), resolve(null);
|
|
31282
|
+
});
|
|
31283
|
+
}));
|
|
31284
|
+
});
|
|
31285
|
+
}), Promise.all(promiseList);
|
|
31286
|
+
});
|
|
31287
|
+
|
|
31288
|
+
function combineDomains(domains) {
|
|
31289
|
+
const result = [];
|
|
31290
|
+
for (let index = 0; index < domains.length; index++) {
|
|
31291
|
+
const domain = domains[index];
|
|
31292
|
+
0 !== index && domain[0] === result[result.length - 1] || result.push(domain[0]), result.push(domain[1]);
|
|
31293
|
+
}
|
|
31294
|
+
return result;
|
|
31295
|
+
}
|
|
31296
|
+
function moveAfterInArray(array, target, ref) {
|
|
31297
|
+
const index = array.indexOf(target),
|
|
31298
|
+
refIndex = array.indexOf(ref);
|
|
31299
|
+
index >= 0 && refIndex >= 0 && index < refIndex && (array.splice(index, 1), array.splice(refIndex, 0, target));
|
|
31300
|
+
}
|
|
31301
|
+
|
|
31302
|
+
const log = (msg, ...args) => Logger.getInstance().info(`[VChart log]: ${msg}`, ...args);
|
|
31303
|
+
const warn = (msg, detail) => (isFunction$1(config.warnHandler) && config.warnHandler.call(null, msg, detail), detail ? Logger.getInstance().warn(`[VChart warn]: ${msg}`, detail) : Logger.getInstance().warn(`[VChart warn]: ${msg}`));
|
|
31304
|
+
const error = (msg, detail, err) => {
|
|
31305
|
+
{
|
|
31306
|
+
if (!isFunction$1(config.errorHandler)) throw new Error(msg);
|
|
31307
|
+
config.errorHandler.call(null, msg, detail);
|
|
31308
|
+
}
|
|
31309
|
+
};
|
|
31310
|
+
const config = {
|
|
31311
|
+
silent: !1,
|
|
31312
|
+
warnHandler: !1,
|
|
31313
|
+
errorHandler: !1
|
|
31314
|
+
};
|
|
31315
|
+
|
|
31316
|
+
const isBrowser = isBrowserEnv();
|
|
31317
|
+
const domDocument = isBrowser && globalThis ? globalThis.document : void 0;
|
|
31318
|
+
function isTrueBrowser(mode) {
|
|
31319
|
+
return ("desktop-browser" === mode || "mobile-browser" === mode) && isBrowser;
|
|
31320
|
+
}
|
|
31321
|
+
function isMobileLikeMode(mode) {
|
|
31322
|
+
return isMiniAppLikeMode(mode) || "mobile-browser" === mode;
|
|
31323
|
+
}
|
|
31324
|
+
function isMiniAppLikeMode(mode) {
|
|
31325
|
+
return mode.includes("miniApp") || "lynx" === mode || "wx" === mode || "harmony" === mode;
|
|
31326
|
+
}
|
|
31327
|
+
|
|
31328
|
+
let VChartId = 0;
|
|
31329
|
+
function createID() {
|
|
31330
|
+
return VChartId >= 9999999 && (VChartId = 0), VChartId++;
|
|
31331
|
+
}
|
|
31332
|
+
|
|
31333
|
+
function couldBeValidNumber(v) {
|
|
31334
|
+
return null != v && "" !== v && (!!isNumber$2(v) || +v == +v);
|
|
31335
|
+
}
|
|
31336
|
+
function toValidNumber(v) {
|
|
31337
|
+
if (isValidNumber$1(v)) return v;
|
|
31338
|
+
const value = +v;
|
|
31339
|
+
return isValidNumber$1(value) ? value : 0;
|
|
31340
|
+
}
|
|
31341
|
+
function isDataDomainSpec(domain) {
|
|
30639
31342
|
return !(!domain || 0 === domain.length) && !isNil$1(domain[0]) && !isNil$1(domain[0].dataId) && isArray$1(domain[0].fields);
|
|
30640
31343
|
}
|
|
30641
31344
|
function isClass(obj) {
|
|
@@ -35196,269 +35899,29 @@
|
|
|
35196
35899
|
|
|
35197
35900
|
let loaded$1 = !1;
|
|
35198
35901
|
function bindCanvasPickerContribution(c) {
|
|
35199
|
-
loaded$1 || (loaded$1 = !0, c.bind(CanvasGroupPicker).toDynamicValue(() => new DefaultCanvasGroupPicker()).inSingletonScope(), c.bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(c.bind.bind(c), CanvasPickerContribution));
|
|
35200
|
-
}
|
|
35201
|
-
|
|
35202
|
-
class PickerBase {
|
|
35203
|
-
contains(graphic, point, params) {
|
|
35204
|
-
if (!graphic.AABBBounds.containsPoint(point)) return !1;
|
|
35205
|
-
if ("imprecise" === graphic.attribute.pickMode) return !0;
|
|
35206
|
-
if (!this.canvasRenderer) return !0;
|
|
35207
|
-
const {
|
|
35208
|
-
pickContext: pickContext
|
|
35209
|
-
} = null != params ? params : {};
|
|
35210
|
-
if (!pickContext) return !1;
|
|
35211
|
-
const attribute = graphic.getGraphicTheme();
|
|
35212
|
-
pickContext.highPerformanceSave();
|
|
35213
|
-
let {
|
|
35214
|
-
x = attribute.x,
|
|
35215
|
-
y = attribute.y
|
|
35216
|
-
} = graphic.attribute;
|
|
35217
|
-
if (graphic.transMatrix.onlyTranslate()) {
|
|
35218
|
-
const point = graphic.getOffsetXY(attribute);
|
|
35219
|
-
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
35220
|
-
} else x = 0, y = 0, pickContext.transformFromMatrix(graphic.transMatrix, !0);
|
|
35221
|
-
let picked = !1,
|
|
35222
|
-
_final = !1;
|
|
35223
|
-
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute, final) => !(!picked && !_final) || (picked = context.isPointInPath(point.x, point.y), _final = final || _final, picked), (context, arcAttribute, themeAttribute, final) => {
|
|
35224
|
-
if (picked || _final) return !0;
|
|
35225
|
-
const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
35226
|
-
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
35227
|
-
keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
35228
|
-
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), _final = final || _final, picked;
|
|
35229
|
-
}), pickContext.highPerformanceRestore(), picked;
|
|
35230
|
-
}
|
|
35231
|
-
}
|
|
35232
|
-
|
|
35233
|
-
class DefaultCanvasArcPicker extends PickerBase {
|
|
35234
|
-
constructor(canvasRenderer) {
|
|
35235
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "arc", this.numberType = ARC_NUMBER_TYPE;
|
|
35236
|
-
}
|
|
35237
|
-
}
|
|
35238
|
-
|
|
35239
|
-
let loadArcPick$1 = !1;
|
|
35240
|
-
function bindArcCanvasPickerContribution(container) {
|
|
35241
|
-
loadArcPick$1 || (loadArcPick$1 = !0, container.bind(CanvasArcPicker).toDynamicValue(() => new DefaultCanvasArcPicker(resolveContainerBinding$1(container, ArcRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasArcPicker));
|
|
35242
|
-
}
|
|
35243
|
-
|
|
35244
|
-
class DefaultCanvasAreaPicker extends PickerBase {
|
|
35245
|
-
constructor(canvasRenderer) {
|
|
35246
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "area", this.numberType = AREA_NUMBER_TYPE;
|
|
35247
|
-
}
|
|
35248
|
-
}
|
|
35249
|
-
|
|
35250
|
-
let loadAreaPick$1 = !1;
|
|
35251
|
-
function bindAreaCanvasPickerContribution(container) {
|
|
35252
|
-
loadAreaPick$1 || (loadAreaPick$1 = !0, container.bind(CanvasAreaPicker).toDynamicValue(() => new DefaultCanvasAreaPicker(resolveContainerBinding$1(container, AreaRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasAreaPicker));
|
|
35253
|
-
}
|
|
35254
|
-
|
|
35255
|
-
class DefaultCanvasCirclePicker extends PickerBase {
|
|
35256
|
-
constructor(canvasRenderer) {
|
|
35257
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
35258
|
-
}
|
|
35259
|
-
}
|
|
35260
|
-
|
|
35261
|
-
let loadCirclePick$1 = !1;
|
|
35262
|
-
function bindCircleCanvasPickerContribution(container) {
|
|
35263
|
-
loadCirclePick$1 || (loadCirclePick$1 = !0, container.bind(CanvasCirclePicker).toDynamicValue(() => new DefaultCanvasCirclePicker(resolveContainerBinding$1(container, CircleRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasCirclePicker));
|
|
35264
|
-
}
|
|
35265
|
-
|
|
35266
|
-
class GlyphPickerBase {
|
|
35267
|
-
constructor() {
|
|
35268
|
-
this.type = "glyph", this.numberType = GLYPH_NUMBER_TYPE;
|
|
35269
|
-
}
|
|
35270
|
-
contains(glyph, point, params) {
|
|
35271
|
-
if (!glyph.AABBBounds.containsPoint(point)) return !1;
|
|
35272
|
-
if ("imprecise" === glyph.attribute.pickMode) return !0;
|
|
35273
|
-
const {
|
|
35274
|
-
pickContext: pickContext
|
|
35275
|
-
} = null != params ? params : {};
|
|
35276
|
-
if (!pickContext) return !1;
|
|
35277
|
-
const pickerService = null == params ? void 0 : params.pickerService;
|
|
35278
|
-
if (pickerService) {
|
|
35279
|
-
let picked = !1;
|
|
35280
|
-
return glyph.getSubGraphic().forEach(g => {
|
|
35281
|
-
if (picked) return;
|
|
35282
|
-
const data = pickerService.pickItem(g, point, null, params);
|
|
35283
|
-
picked = !(!data || !data.graphic);
|
|
35284
|
-
}), picked;
|
|
35285
|
-
}
|
|
35286
|
-
return !1;
|
|
35287
|
-
}
|
|
35288
|
-
}
|
|
35289
|
-
|
|
35290
|
-
class DefaultCanvasGlyphPicker extends GlyphPickerBase {
|
|
35291
|
-
constructor(canvasRenderer) {
|
|
35292
|
-
super(), this.canvasRenderer = canvasRenderer;
|
|
35293
|
-
}
|
|
35294
|
-
}
|
|
35295
|
-
|
|
35296
|
-
let loadGlyphPick$1 = !1;
|
|
35297
|
-
function bindGlyphCanvasPickerContribution(container) {
|
|
35298
|
-
loadGlyphPick$1 || (loadGlyphPick$1 = !0, container.bind(CanvasGlyphPicker).toDynamicValue(() => new DefaultCanvasGlyphPicker(resolveContainerBinding$1(container, GlyphRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasGlyphPicker));
|
|
35299
|
-
}
|
|
35300
|
-
|
|
35301
|
-
class DefaultCanvasImagePicker extends PickerBase {
|
|
35302
|
-
constructor(canvasRenderer) {
|
|
35303
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "image", this.numberType = IMAGE_NUMBER_TYPE;
|
|
35304
|
-
}
|
|
35305
|
-
}
|
|
35306
|
-
|
|
35307
|
-
let loadImagePick$1 = !1;
|
|
35308
|
-
function bindImageCanvasPickerContribution(container) {
|
|
35309
|
-
loadImagePick$1 || (loadImagePick$1 = !0, container.bind(CanvasImagePicker).toDynamicValue(() => new DefaultCanvasImagePicker(resolveContainerBinding$1(container, ImageRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasImagePicker));
|
|
35310
|
-
}
|
|
35311
|
-
|
|
35312
|
-
class BaseLinePicker extends BaseRender {
|
|
35313
|
-
contains(graphic, point, params) {
|
|
35314
|
-
if (!graphic.AABBBounds.containsPoint(point)) return !1;
|
|
35315
|
-
if ("imprecise" === graphic.attribute.pickMode) return !0;
|
|
35316
|
-
const {
|
|
35317
|
-
pickContext: pickContext
|
|
35318
|
-
} = null != params ? params : {};
|
|
35319
|
-
if (!pickContext) return !1;
|
|
35320
|
-
pickContext.highPerformanceSave();
|
|
35321
|
-
const lineAttribute = graphic.getGraphicTheme(),
|
|
35322
|
-
data = this.transform(graphic, lineAttribute, pickContext),
|
|
35323
|
-
{
|
|
35324
|
-
x: x,
|
|
35325
|
-
y: y,
|
|
35326
|
-
z: z,
|
|
35327
|
-
lastModelMatrix: lastModelMatrix
|
|
35328
|
-
} = data;
|
|
35329
|
-
let pickPoint = point;
|
|
35330
|
-
if (pickContext.camera) {
|
|
35331
|
-
pickPoint = point.clone();
|
|
35332
|
-
const globalMatrix = graphic.parent.globalTransMatrix;
|
|
35333
|
-
pickPoint.x = globalMatrix.a * point.x + globalMatrix.c * point.y + globalMatrix.e, pickPoint.y = globalMatrix.b * point.x + globalMatrix.d * point.y + globalMatrix.f;
|
|
35334
|
-
}
|
|
35335
|
-
this.canvasRenderer.z = z;
|
|
35336
|
-
let picked = !1;
|
|
35337
|
-
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
|
|
35338
|
-
if (picked) return !0;
|
|
35339
|
-
const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
35340
|
-
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
35341
|
-
keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
35342
|
-
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
35343
|
-
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
35344
|
-
}
|
|
35345
|
-
}
|
|
35346
|
-
|
|
35347
|
-
class DefaultCanvasLinePicker extends BaseLinePicker {
|
|
35348
|
-
constructor(canvasRenderer) {
|
|
35349
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
35350
|
-
}
|
|
35351
|
-
}
|
|
35352
|
-
|
|
35353
|
-
let loadLinePick$1 = !1;
|
|
35354
|
-
function bindLineCanvasPickerContribution(container) {
|
|
35355
|
-
loadLinePick$1 || (loadLinePick$1 = !0, container.bind(CanvasLinePicker).toDynamicValue(() => new DefaultCanvasLinePicker(resolveContainerBinding$1(container, LineRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasLinePicker));
|
|
35356
|
-
}
|
|
35357
|
-
|
|
35358
|
-
const _bounds = new AABBBounds();
|
|
35359
|
-
class RectPickerBase {
|
|
35360
|
-
constructor() {
|
|
35361
|
-
this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
35362
|
-
}
|
|
35363
|
-
contains(rect, point, params) {
|
|
35364
|
-
if (!rect.AABBBounds.containsPoint(point)) return !1;
|
|
35365
|
-
if ("imprecise" === rect.attribute.pickMode) return !0;
|
|
35366
|
-
const {
|
|
35367
|
-
pickContext: pickContext
|
|
35368
|
-
} = null != params ? params : {};
|
|
35369
|
-
if (!pickContext) return !1;
|
|
35370
|
-
const rectAttribute = rect.getGraphicTheme(),
|
|
35371
|
-
{
|
|
35372
|
-
cornerRadius = rectAttribute.cornerRadius
|
|
35373
|
-
} = rect.attribute;
|
|
35374
|
-
let {
|
|
35375
|
-
x = rectAttribute.x,
|
|
35376
|
-
y = rectAttribute.y
|
|
35377
|
-
} = rect.attribute;
|
|
35378
|
-
pickContext.highPerformanceSave();
|
|
35379
|
-
let onlyTranslate = !0;
|
|
35380
|
-
if (rect.transMatrix.onlyTranslate()) {
|
|
35381
|
-
const point = rect.getOffsetXY(rectAttribute);
|
|
35382
|
-
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
35383
|
-
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
35384
|
-
let picked = !0;
|
|
35385
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$2(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
35386
|
-
if (picked) return !0;
|
|
35387
|
-
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
35388
|
-
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
35389
|
-
keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
35390
|
-
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
35391
|
-
});else {
|
|
35392
|
-
const {
|
|
35393
|
-
fill = rectAttribute.fill,
|
|
35394
|
-
stroke = rectAttribute.stroke,
|
|
35395
|
-
lineWidth = rectAttribute.lineWidth
|
|
35396
|
-
} = rect.attribute;
|
|
35397
|
-
if (fill) picked = !0;else if (stroke) {
|
|
35398
|
-
const bounds = rect.AABBBounds;
|
|
35399
|
-
_bounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), _bounds.expand(-lineWidth / 2), picked = !_bounds.containsPoint(point);
|
|
35400
|
-
}
|
|
35401
|
-
}
|
|
35402
|
-
return pickContext.highPerformanceRestore(), picked;
|
|
35403
|
-
}
|
|
35404
|
-
}
|
|
35405
|
-
|
|
35406
|
-
class DefaultCanvasLottiePicker extends RectPickerBase {
|
|
35407
|
-
constructor(canvasRenderer) {
|
|
35408
|
-
super(), this.canvasRenderer = canvasRenderer;
|
|
35409
|
-
}
|
|
35410
|
-
}
|
|
35411
|
-
|
|
35412
|
-
let loadLottiePick = !1;
|
|
35413
|
-
function bindLottieCanvasPickerContribution(container) {
|
|
35414
|
-
loadLottiePick || (loadLottiePick = !0, container.bind(CanvasLottiePicker).toDynamicValue(() => new DefaultCanvasLottiePicker(resolveContainerBinding$1(container, RectRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasLottiePicker));
|
|
35415
|
-
}
|
|
35416
|
-
|
|
35417
|
-
class DefaultCanvasPathPicker extends BaseLinePicker {
|
|
35418
|
-
constructor(canvasRenderer) {
|
|
35419
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "path", this.numberType = PATH_NUMBER_TYPE;
|
|
35420
|
-
}
|
|
35421
|
-
}
|
|
35422
|
-
|
|
35423
|
-
let loadPathPick$1 = !1;
|
|
35424
|
-
function bindPathCanvasPickerContribution(container) {
|
|
35425
|
-
loadPathPick$1 || (loadPathPick$1 = !0, container.bind(CanvasPathPicker).toDynamicValue(() => new DefaultCanvasPathPicker(resolveContainerBinding$1(container, PathRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasPathPicker));
|
|
35426
|
-
}
|
|
35427
|
-
|
|
35428
|
-
class DefaultCanvasPolygonPicker extends PickerBase {
|
|
35429
|
-
constructor(canvasRenderer) {
|
|
35430
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "polygon", this.numberType = POLYGON_NUMBER_TYPE;
|
|
35431
|
-
}
|
|
35432
|
-
}
|
|
35433
|
-
|
|
35434
|
-
let loadPolygonPick$1 = !1;
|
|
35435
|
-
function bindPolygonCanvasPickerContribution(container) {
|
|
35436
|
-
loadPolygonPick$1 || (loadPolygonPick$1 = !0, container.bind(CanvasPolygonPicker).toDynamicValue(() => new DefaultCanvasPolygonPicker(resolveContainerBinding$1(container, PolygonRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasPolygonPicker));
|
|
35902
|
+
loaded$1 || (loaded$1 = !0, c.bind(CanvasGroupPicker).toDynamicValue(() => new DefaultCanvasGroupPicker()).inSingletonScope(), c.bind(CanvasPickerContribution).toService(CanvasGroupPicker), bindContributionProvider(c.bind.bind(c), CanvasPickerContribution));
|
|
35437
35903
|
}
|
|
35438
35904
|
|
|
35439
|
-
class
|
|
35905
|
+
class DefaultCanvasCirclePicker extends PickerBase {
|
|
35440
35906
|
constructor(canvasRenderer) {
|
|
35441
|
-
super(), this.canvasRenderer = canvasRenderer;
|
|
35907
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
35442
35908
|
}
|
|
35443
35909
|
}
|
|
35444
35910
|
|
|
35445
|
-
let
|
|
35446
|
-
function
|
|
35447
|
-
|
|
35911
|
+
let loadCirclePick$1 = !1;
|
|
35912
|
+
function bindCircleCanvasPickerContribution(container) {
|
|
35913
|
+
loadCirclePick$1 || (loadCirclePick$1 = !0, container.bind(CanvasCirclePicker).toDynamicValue(() => new DefaultCanvasCirclePicker(resolveContainerBinding$1(container, CircleRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasCirclePicker));
|
|
35448
35914
|
}
|
|
35449
35915
|
|
|
35450
|
-
class
|
|
35916
|
+
class DefaultCanvasLottiePicker extends RectPickerBase {
|
|
35451
35917
|
constructor(canvasRenderer) {
|
|
35452
|
-
this.canvasRenderer = canvasRenderer
|
|
35453
|
-
}
|
|
35454
|
-
contains(richtext, point, params) {
|
|
35455
|
-
return !!richtext.AABBBounds.containsPoint(point);
|
|
35918
|
+
super(), this.canvasRenderer = canvasRenderer;
|
|
35456
35919
|
}
|
|
35457
35920
|
}
|
|
35458
35921
|
|
|
35459
|
-
let
|
|
35460
|
-
function
|
|
35461
|
-
|
|
35922
|
+
let loadLottiePick = !1;
|
|
35923
|
+
function bindLottieCanvasPickerContribution(container) {
|
|
35924
|
+
loadLottiePick || (loadLottiePick = !0, container.bind(CanvasLottiePicker).toDynamicValue(() => new DefaultCanvasLottiePicker(resolveContainerBinding$1(container, RectRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasLottiePicker));
|
|
35462
35925
|
}
|
|
35463
35926
|
|
|
35464
35927
|
class DefaultCanvasStarPicker extends PickerBase {
|
|
@@ -35473,106 +35936,6 @@
|
|
|
35473
35936
|
loadStarPick || (null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, StarRender)) && (loadStarPick = !0, container.bind(CanvasStarPicker).toDynamicValue(() => new DefaultCanvasStarPicker(resolveContainerBinding$1(container, StarRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasStarPicker));
|
|
35474
35937
|
}
|
|
35475
35938
|
|
|
35476
|
-
class DefaultCanvasSymbolPicker extends Base3dPicker {
|
|
35477
|
-
constructor(canvasRenderer) {
|
|
35478
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
35479
|
-
}
|
|
35480
|
-
contains(symbol, point, params) {
|
|
35481
|
-
const {
|
|
35482
|
-
pickContext: pickContext
|
|
35483
|
-
} = null != params ? params : {};
|
|
35484
|
-
if (!pickContext) return !1;
|
|
35485
|
-
const parsedPath = symbol.getParsedPath();
|
|
35486
|
-
if (!pickContext.camera) {
|
|
35487
|
-
if (!symbol.AABBBounds.containsPoint(point)) return !1;
|
|
35488
|
-
if (parsedPath.isSvg || "imprecise" === symbol.attribute.pickMode) return !0;
|
|
35489
|
-
}
|
|
35490
|
-
pickContext.highPerformanceSave();
|
|
35491
|
-
const symbolAttribute = symbol.getGraphicTheme(),
|
|
35492
|
-
data = this.transform(symbol, symbolAttribute, pickContext),
|
|
35493
|
-
{
|
|
35494
|
-
x: x,
|
|
35495
|
-
y: y,
|
|
35496
|
-
z: z,
|
|
35497
|
-
lastModelMatrix: lastModelMatrix
|
|
35498
|
-
} = data;
|
|
35499
|
-
let pickPoint = point;
|
|
35500
|
-
if (pickContext.camera) {
|
|
35501
|
-
pickPoint = point.clone();
|
|
35502
|
-
const globalMatrix = symbol.parent.globalTransMatrix;
|
|
35503
|
-
pickPoint.x = globalMatrix.a * point.x + globalMatrix.c * point.y + globalMatrix.e, pickPoint.y = globalMatrix.b * point.x + globalMatrix.d * point.y + globalMatrix.f;
|
|
35504
|
-
}
|
|
35505
|
-
this.canvasRenderer.z = z;
|
|
35506
|
-
let picked = !1;
|
|
35507
|
-
return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
|
|
35508
|
-
if (picked) return !0;
|
|
35509
|
-
const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
35510
|
-
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
35511
|
-
keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
35512
|
-
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
35513
|
-
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
35514
|
-
}
|
|
35515
|
-
}
|
|
35516
|
-
|
|
35517
|
-
let loadSymbolPick$1 = !1;
|
|
35518
|
-
function bindSymbolCanvasPickerContribution(container) {
|
|
35519
|
-
loadSymbolPick$1 || (loadSymbolPick$1 = !0, container.bind(CanvasSymbolPicker).toDynamicValue(() => new DefaultCanvasSymbolPicker(resolveContainerBinding$1(container, SymbolRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasSymbolPicker));
|
|
35520
|
-
}
|
|
35521
|
-
|
|
35522
|
-
class DefaultCanvasTextPicker extends Base3dPicker {
|
|
35523
|
-
constructor(canvasRenderer) {
|
|
35524
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "text", this.numberType = TEXT_NUMBER_TYPE;
|
|
35525
|
-
}
|
|
35526
|
-
contains(text, point, params) {
|
|
35527
|
-
const {
|
|
35528
|
-
pickContext: pickContext
|
|
35529
|
-
} = null != params ? params : {};
|
|
35530
|
-
if (!pickContext) return !1;
|
|
35531
|
-
const bounds = text.AABBBounds;
|
|
35532
|
-
if (!pickContext.camera) return !!bounds.containsPoint(point);
|
|
35533
|
-
pickContext.highPerformanceSave();
|
|
35534
|
-
const textAttribute = text.getGraphicTheme(),
|
|
35535
|
-
{
|
|
35536
|
-
keepDirIn3d = textAttribute.keepDirIn3d
|
|
35537
|
-
} = text.attribute,
|
|
35538
|
-
computed3dMatrix = !keepDirIn3d,
|
|
35539
|
-
data = this.transform(text, textAttribute, pickContext, computed3dMatrix),
|
|
35540
|
-
{
|
|
35541
|
-
x: x,
|
|
35542
|
-
y: y,
|
|
35543
|
-
z: z,
|
|
35544
|
-
lastModelMatrix: lastModelMatrix
|
|
35545
|
-
} = data;
|
|
35546
|
-
this.canvasRenderer.z = z;
|
|
35547
|
-
let pickPoint = point;
|
|
35548
|
-
if (pickContext.camera) {
|
|
35549
|
-
pickPoint = point.clone();
|
|
35550
|
-
const globalMatrix = text.parent.globalTransMatrix;
|
|
35551
|
-
pickPoint.x = globalMatrix.a * point.x + globalMatrix.c * point.y + globalMatrix.e, pickPoint.y = globalMatrix.b * point.x + globalMatrix.d * point.y + globalMatrix.f;
|
|
35552
|
-
}
|
|
35553
|
-
let picked = !1;
|
|
35554
|
-
return this.canvasRenderer.drawShape(text, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => {
|
|
35555
|
-
if (picked) return !0;
|
|
35556
|
-
const {
|
|
35557
|
-
fontSize = textAttribute.fontSize,
|
|
35558
|
-
textBaseline = textAttribute.textBaseline,
|
|
35559
|
-
textAlign = textAttribute.textAlign
|
|
35560
|
-
} = text.attribute,
|
|
35561
|
-
bounds = text.AABBBounds,
|
|
35562
|
-
height = bounds.height(),
|
|
35563
|
-
width = bounds.width(),
|
|
35564
|
-
offsetY = textLayoutOffsetY(textBaseline, height, fontSize),
|
|
35565
|
-
offsetX = textDrawOffsetX(textAlign, width);
|
|
35566
|
-
return context.rect(offsetX + x, offsetY + y, width, height, z), picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked;
|
|
35567
|
-
}, (context, symbolAttribute, themeAttribute) => picked), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
35568
|
-
}
|
|
35569
|
-
}
|
|
35570
|
-
|
|
35571
|
-
let loadTextPick$1 = !1;
|
|
35572
|
-
function bindTextCanvasPickerContribution(container) {
|
|
35573
|
-
loadTextPick$1 || (loadTextPick$1 = !0, container.bind(CanvasTextPicker).toDynamicValue(() => new DefaultCanvasTextPicker(resolveContainerBinding$1(container, TextRender))).inSingletonScope(), container.bind(CanvasPickerContribution).toService(CanvasTextPicker));
|
|
35574
|
-
}
|
|
35575
|
-
|
|
35576
35939
|
const GIFIMAGE_NUMBER_TYPE = genNumberType();
|
|
35577
35940
|
genNumberType();
|
|
35578
35941
|
|
|
@@ -36121,216 +36484,83 @@
|
|
|
36121
36484
|
}
|
|
36122
36485
|
dispatchEvent(event) {
|
|
36123
36486
|
const {
|
|
36124
|
-
type: type
|
|
36125
|
-
} = event;
|
|
36126
|
-
return !!this.eventManager.cache[type] && (event.changedTouches && event.changedTouches[0] && (event.offsetX = event.changedTouches[0].x, event.changedTouches[0].offsetX = event.changedTouches[0].x, event.changedTouches[0].clientX = event.changedTouches[0].x, event.offsetY = event.changedTouches[0].y, event.changedTouches[0].offsetY = event.changedTouches[0].y, event.changedTouches[0].clientY = event.changedTouches[0].y), event.preventDefault = () => {}, event.stopPropagation = () => {}, this.eventManager.cache[type].listener && this.eventManager.cache[type].listener.forEach(f => {
|
|
36127
|
-
f(event);
|
|
36128
|
-
}), !0);
|
|
36129
|
-
}
|
|
36130
|
-
getStyle() {
|
|
36131
|
-
return {};
|
|
36132
|
-
}
|
|
36133
|
-
setStyle(style) {}
|
|
36134
|
-
getBoundingClientRect() {
|
|
36135
|
-
const wh = this.getWH();
|
|
36136
|
-
return {
|
|
36137
|
-
x: 0,
|
|
36138
|
-
y: 0,
|
|
36139
|
-
width: wh.width,
|
|
36140
|
-
height: wh.height,
|
|
36141
|
-
left: 0,
|
|
36142
|
-
top: 0,
|
|
36143
|
-
right: 0,
|
|
36144
|
-
bottom: 0
|
|
36145
|
-
};
|
|
36146
|
-
}
|
|
36147
|
-
clearViewBox(color) {
|
|
36148
|
-
const vb = this.viewBox,
|
|
36149
|
-
context = this.getContext(),
|
|
36150
|
-
dpr = this.getDpr();
|
|
36151
|
-
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
36152
|
-
}
|
|
36153
|
-
}
|
|
36154
|
-
FeishuWindowHandlerContribution.env = "feishu";
|
|
36155
|
-
function bindFeishuWindowContribution(container) {
|
|
36156
|
-
var _a, _b;
|
|
36157
|
-
(null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, FeishuWindowHandlerContribution)) || container.bind(FeishuWindowHandlerContribution).toSelf(), (null === (_b = container.getNamed) || void 0 === _b ? void 0 : _b.call(container, WindowHandlerContribution, FeishuWindowHandlerContribution.env)) || container.bind(WindowHandlerContribution).toService(FeishuWindowHandlerContribution).whenTargetNamed(FeishuWindowHandlerContribution.env);
|
|
36158
|
-
}
|
|
36159
|
-
|
|
36160
|
-
class DefaultMathPickerService extends DefaultPickService {
|
|
36161
|
-
constructor(contributions, pickItemInterceptorContributions, pickServiceInterceptorContributions) {
|
|
36162
|
-
super(pickItemInterceptorContributions, pickServiceInterceptorContributions), this.contributions = contributions, this.pickItemInterceptorContributions = pickItemInterceptorContributions, this.pickServiceInterceptorContributions = pickServiceInterceptorContributions, this.global.hooks.onSetEnv.tap("math-picker-service", (lastEnv, env, global) => {
|
|
36163
|
-
this.configure(global, env);
|
|
36164
|
-
}), this.configure(this.global, this.global.env), this.pickerMap = new Map(), this.init();
|
|
36165
|
-
}
|
|
36166
|
-
init() {
|
|
36167
|
-
this.contributions.getContributions().forEach(item => {
|
|
36168
|
-
this.pickerMap.set(item.numberType, item);
|
|
36169
|
-
}), super._init();
|
|
36170
|
-
}
|
|
36171
|
-
configure(global, env) {
|
|
36172
|
-
this.pickContext = new EmptyContext2d(null, 1);
|
|
36173
|
-
}
|
|
36174
|
-
pickItem(graphic, point, parentMatrix, params) {
|
|
36175
|
-
if (!1 === graphic.attribute.pickable) return null;
|
|
36176
|
-
const picker = this.pickerMap.get(graphic.numberType);
|
|
36177
|
-
if (!picker) return null;
|
|
36178
|
-
const pd = picker.contains(graphic, point, params),
|
|
36179
|
-
g = pd ? graphic : null;
|
|
36180
|
-
return g ? {
|
|
36181
|
-
graphic: g,
|
|
36182
|
-
params: pd
|
|
36183
|
-
} : null;
|
|
36184
|
-
}
|
|
36185
|
-
}
|
|
36186
|
-
|
|
36187
|
-
let loaded = !1;
|
|
36188
|
-
function bindMathPickerContribution(c) {
|
|
36189
|
-
loaded || (loaded = !0, bindContributionProvider(c.bind.bind(c), MathPickerContribution));
|
|
36190
|
-
}
|
|
36191
|
-
|
|
36192
|
-
class DefaultMathArcPicker extends PickerBase {
|
|
36193
|
-
constructor(canvasRenderer) {
|
|
36194
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "arc", this.numberType = ARC_NUMBER_TYPE;
|
|
36195
|
-
}
|
|
36196
|
-
}
|
|
36197
|
-
|
|
36198
|
-
let loadArcPick = !1;
|
|
36199
|
-
function bindArcMathPickerContribution(container) {
|
|
36200
|
-
loadArcPick || (loadArcPick = !0, container.bind(MathArcPicker).toDynamicValue(() => new DefaultMathArcPicker(resolveContainerBinding$1(container, ArcRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathArcPicker));
|
|
36201
|
-
}
|
|
36202
|
-
|
|
36203
|
-
class DefaultMathAreaPicker extends PickerBase {
|
|
36204
|
-
constructor(canvasRenderer) {
|
|
36205
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "area", this.numberType = AREA_NUMBER_TYPE;
|
|
36206
|
-
}
|
|
36207
|
-
}
|
|
36208
|
-
|
|
36209
|
-
let loadAreaPick = !1;
|
|
36210
|
-
function bindAreaMathPickerContribution(container) {
|
|
36211
|
-
loadAreaPick || (loadAreaPick = !0, container.bind(MathAreaPicker).toDynamicValue(() => new DefaultMathAreaPicker(resolveContainerBinding$1(container, AreaRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathAreaPicker));
|
|
36212
|
-
}
|
|
36213
|
-
|
|
36214
|
-
class DefaultMathCirclePicker extends PickerBase {
|
|
36215
|
-
constructor(canvasRenderer) {
|
|
36216
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
36217
|
-
}
|
|
36218
|
-
}
|
|
36219
|
-
|
|
36220
|
-
let loadCirclePick = !1;
|
|
36221
|
-
function bindCircleMathPickerContribution(container) {
|
|
36222
|
-
loadCirclePick || (loadCirclePick = !0, container.bind(MathCirclePicker).toDynamicValue(() => new DefaultMathCirclePicker(resolveContainerBinding$1(container, CircleRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathCirclePicker));
|
|
36223
|
-
}
|
|
36224
|
-
|
|
36225
|
-
class DefaultMathGlyphPicker extends GlyphPickerBase {
|
|
36226
|
-
constructor(canvasRenderer) {
|
|
36227
|
-
super(), this.canvasRenderer = canvasRenderer;
|
|
36228
|
-
}
|
|
36229
|
-
}
|
|
36230
|
-
|
|
36231
|
-
let loadGlyphPick = !1;
|
|
36232
|
-
function bindGlyphMathPickerContribution(container) {
|
|
36233
|
-
loadGlyphPick || (loadGlyphPick = !0, container.bind(MathGlyphPicker).toDynamicValue(() => new DefaultMathGlyphPicker(resolveContainerBinding$1(container, GlyphRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathGlyphPicker));
|
|
36234
|
-
}
|
|
36235
|
-
|
|
36236
|
-
class DefaultMathImagePicker {
|
|
36237
|
-
constructor() {
|
|
36238
|
-
this.type = "image", this.numberType = IMAGE_NUMBER_TYPE;
|
|
36239
|
-
}
|
|
36240
|
-
contains(image, point, params) {
|
|
36241
|
-
const {
|
|
36242
|
-
pickContext: pickContext
|
|
36243
|
-
} = null != params ? params : {};
|
|
36244
|
-
return !!pickContext && !!image.AABBBounds.containsPoint(point);
|
|
36245
|
-
}
|
|
36246
|
-
}
|
|
36247
|
-
|
|
36248
|
-
let loadImagePick = !1;
|
|
36249
|
-
function bindImageMathPickerContribution(container) {
|
|
36250
|
-
loadImagePick || (loadImagePick = !0, container.bind(MathImagePicker).toDynamicValue(() => new DefaultMathImagePicker()).inSingletonScope(), container.bind(MathPickerContribution).toService(MathImagePicker));
|
|
36251
|
-
}
|
|
36252
|
-
|
|
36253
|
-
class DefaultMathLinePicker extends PickerBase {
|
|
36254
|
-
constructor(canvasRenderer) {
|
|
36255
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
36487
|
+
type: type
|
|
36488
|
+
} = event;
|
|
36489
|
+
return !!this.eventManager.cache[type] && (event.changedTouches && event.changedTouches[0] && (event.offsetX = event.changedTouches[0].x, event.changedTouches[0].offsetX = event.changedTouches[0].x, event.changedTouches[0].clientX = event.changedTouches[0].x, event.offsetY = event.changedTouches[0].y, event.changedTouches[0].offsetY = event.changedTouches[0].y, event.changedTouches[0].clientY = event.changedTouches[0].y), event.preventDefault = () => {}, event.stopPropagation = () => {}, this.eventManager.cache[type].listener && this.eventManager.cache[type].listener.forEach(f => {
|
|
36490
|
+
f(event);
|
|
36491
|
+
}), !0);
|
|
36256
36492
|
}
|
|
36257
|
-
|
|
36258
|
-
|
|
36259
|
-
let loadLinePick = !1;
|
|
36260
|
-
function bindLineMathPickerContribution(container) {
|
|
36261
|
-
loadLinePick || (loadLinePick = !0, container.bind(MathLinePicker).toDynamicValue(() => new DefaultMathLinePicker(resolveContainerBinding$1(container, LineRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathLinePicker));
|
|
36262
|
-
}
|
|
36263
|
-
|
|
36264
|
-
class DefaultMathPolygonPicker extends PickerBase {
|
|
36265
|
-
constructor(canvasRenderer) {
|
|
36266
|
-
super(), this.canvasRenderer = canvasRenderer, this.type = "polygon", this.numberType = POLYGON_NUMBER_TYPE;
|
|
36493
|
+
getStyle() {
|
|
36494
|
+
return {};
|
|
36267
36495
|
}
|
|
36268
|
-
|
|
36269
|
-
|
|
36270
|
-
|
|
36271
|
-
|
|
36272
|
-
|
|
36273
|
-
|
|
36274
|
-
|
|
36275
|
-
|
|
36276
|
-
|
|
36277
|
-
|
|
36496
|
+
setStyle(style) {}
|
|
36497
|
+
getBoundingClientRect() {
|
|
36498
|
+
const wh = this.getWH();
|
|
36499
|
+
return {
|
|
36500
|
+
x: 0,
|
|
36501
|
+
y: 0,
|
|
36502
|
+
width: wh.width,
|
|
36503
|
+
height: wh.height,
|
|
36504
|
+
left: 0,
|
|
36505
|
+
top: 0,
|
|
36506
|
+
right: 0,
|
|
36507
|
+
bottom: 0
|
|
36508
|
+
};
|
|
36278
36509
|
}
|
|
36279
|
-
|
|
36280
|
-
|
|
36281
|
-
|
|
36282
|
-
|
|
36283
|
-
|
|
36284
|
-
}
|
|
36285
|
-
|
|
36286
|
-
class DefaultMathRectPicker extends RectPickerBase {
|
|
36287
|
-
constructor(canvasRenderer) {
|
|
36288
|
-
super(), this.canvasRenderer = canvasRenderer;
|
|
36510
|
+
clearViewBox(color) {
|
|
36511
|
+
const vb = this.viewBox,
|
|
36512
|
+
context = this.getContext(),
|
|
36513
|
+
dpr = this.getDpr();
|
|
36514
|
+
context.nativeContext.save(), context.nativeContext.setTransform(dpr, 0, 0, dpr, 0, 0), context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1), color && (context.fillStyle = color, context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1)), context.nativeContext.restore();
|
|
36289
36515
|
}
|
|
36290
36516
|
}
|
|
36291
|
-
|
|
36292
|
-
|
|
36293
|
-
|
|
36294
|
-
|
|
36517
|
+
FeishuWindowHandlerContribution.env = "feishu";
|
|
36518
|
+
function bindFeishuWindowContribution(container) {
|
|
36519
|
+
var _a, _b;
|
|
36520
|
+
(null === (_a = container.isBound) || void 0 === _a ? void 0 : _a.call(container, FeishuWindowHandlerContribution)) || container.bind(FeishuWindowHandlerContribution).toSelf(), (null === (_b = container.getNamed) || void 0 === _b ? void 0 : _b.call(container, WindowHandlerContribution, FeishuWindowHandlerContribution.env)) || container.bind(WindowHandlerContribution).toService(FeishuWindowHandlerContribution).whenTargetNamed(FeishuWindowHandlerContribution.env);
|
|
36295
36521
|
}
|
|
36296
36522
|
|
|
36297
|
-
class
|
|
36298
|
-
constructor(
|
|
36299
|
-
this.
|
|
36523
|
+
class DefaultMathPickerService extends DefaultPickService {
|
|
36524
|
+
constructor(contributions, pickItemInterceptorContributions, pickServiceInterceptorContributions) {
|
|
36525
|
+
super(pickItemInterceptorContributions, pickServiceInterceptorContributions), this.contributions = contributions, this.pickItemInterceptorContributions = pickItemInterceptorContributions, this.pickServiceInterceptorContributions = pickServiceInterceptorContributions, this.global.hooks.onSetEnv.tap("math-picker-service", (lastEnv, env, global) => {
|
|
36526
|
+
this.configure(global, env);
|
|
36527
|
+
}), this.configure(this.global, this.global.env), this.pickerMap = new Map(), this.init();
|
|
36300
36528
|
}
|
|
36301
|
-
|
|
36302
|
-
|
|
36529
|
+
init() {
|
|
36530
|
+
this.contributions.getContributions().forEach(item => {
|
|
36531
|
+
this.pickerMap.set(item.numberType, item);
|
|
36532
|
+
}), super._init();
|
|
36303
36533
|
}
|
|
36304
|
-
|
|
36305
|
-
|
|
36306
|
-
|
|
36307
|
-
|
|
36308
|
-
|
|
36309
|
-
|
|
36310
|
-
|
|
36311
|
-
|
|
36312
|
-
|
|
36313
|
-
|
|
36534
|
+
configure(global, env) {
|
|
36535
|
+
this.pickContext = new EmptyContext2d(null, 1);
|
|
36536
|
+
}
|
|
36537
|
+
pickItem(graphic, point, parentMatrix, params) {
|
|
36538
|
+
if (!1 === graphic.attribute.pickable) return null;
|
|
36539
|
+
const picker = this.pickerMap.get(graphic.numberType);
|
|
36540
|
+
if (!picker) return null;
|
|
36541
|
+
const pd = picker.contains(graphic, point, params),
|
|
36542
|
+
g = pd ? graphic : null;
|
|
36543
|
+
return g ? {
|
|
36544
|
+
graphic: g,
|
|
36545
|
+
params: pd
|
|
36546
|
+
} : null;
|
|
36314
36547
|
}
|
|
36315
36548
|
}
|
|
36316
36549
|
|
|
36317
|
-
let
|
|
36318
|
-
function
|
|
36319
|
-
|
|
36550
|
+
let loaded = !1;
|
|
36551
|
+
function bindMathPickerContribution(c) {
|
|
36552
|
+
loaded || (loaded = !0, bindContributionProvider(c.bind.bind(c), MathPickerContribution));
|
|
36320
36553
|
}
|
|
36321
36554
|
|
|
36322
|
-
class
|
|
36323
|
-
constructor() {
|
|
36324
|
-
this.type = "
|
|
36325
|
-
}
|
|
36326
|
-
contains(text, point, params) {
|
|
36327
|
-
return !!text.AABBBounds.containsPoint(point);
|
|
36555
|
+
class DefaultMathCirclePicker extends PickerBase {
|
|
36556
|
+
constructor(canvasRenderer) {
|
|
36557
|
+
super(), this.canvasRenderer = canvasRenderer, this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
36328
36558
|
}
|
|
36329
36559
|
}
|
|
36330
36560
|
|
|
36331
|
-
let
|
|
36332
|
-
function
|
|
36333
|
-
|
|
36561
|
+
let loadCirclePick = !1;
|
|
36562
|
+
function bindCircleMathPickerContribution(container) {
|
|
36563
|
+
loadCirclePick || (loadCirclePick = !0, container.bind(MathCirclePicker).toDynamicValue(() => new DefaultMathCirclePicker(resolveContainerBinding$1(container, CircleRender))).inSingletonScope(), container.bind(MathPickerContribution).toService(MathCirclePicker));
|
|
36334
36564
|
}
|
|
36335
36565
|
|
|
36336
36566
|
function bindMathPicker(c) {
|
|
@@ -39149,30 +39379,6 @@
|
|
|
39149
39379
|
installNodePickersToApp(app);
|
|
39150
39380
|
}
|
|
39151
39381
|
|
|
39152
|
-
const browser = isBrowserEnv();
|
|
39153
|
-
|
|
39154
|
-
function _registerArc() {
|
|
39155
|
-
if (_registerArc.__loaded) return;
|
|
39156
|
-
_registerArc.__loaded = !0;
|
|
39157
|
-
const legacyContext = getLegacyBindingContext();
|
|
39158
|
-
registerArcGraphic(), arcModule({
|
|
39159
|
-
bind: legacyContext.bind
|
|
39160
|
-
}), browser ? bindArcCanvasPickerContribution(legacyContext) : bindArcMathPickerContribution(legacyContext);
|
|
39161
|
-
}
|
|
39162
|
-
_registerArc.__loaded = !1;
|
|
39163
|
-
const registerArc = _registerArc;
|
|
39164
|
-
|
|
39165
|
-
function _registerArea() {
|
|
39166
|
-
if (_registerArea.__loaded) return;
|
|
39167
|
-
_registerArea.__loaded = !0;
|
|
39168
|
-
const legacyContext = getLegacyBindingContext();
|
|
39169
|
-
registerAreaGraphic(), areaModule({
|
|
39170
|
-
bind: legacyContext.bind
|
|
39171
|
-
}), browser ? bindAreaCanvasPickerContribution(legacyContext) : bindAreaMathPickerContribution(legacyContext);
|
|
39172
|
-
}
|
|
39173
|
-
_registerArea.__loaded = !1;
|
|
39174
|
-
const registerArea = _registerArea;
|
|
39175
|
-
|
|
39176
39382
|
function _registerCircle() {
|
|
39177
39383
|
if (_registerCircle.__loaded) return;
|
|
39178
39384
|
_registerCircle.__loaded = !0;
|
|
@@ -39184,95 +39390,6 @@
|
|
|
39184
39390
|
_registerCircle.__loaded = !1;
|
|
39185
39391
|
const registerCircle = _registerCircle;
|
|
39186
39392
|
|
|
39187
|
-
function _registerGlyph() {
|
|
39188
|
-
if (_registerGlyph.__loaded) return;
|
|
39189
|
-
_registerGlyph.__loaded = !0;
|
|
39190
|
-
const legacyContext = getLegacyBindingContext();
|
|
39191
|
-
registerGlyphGraphic(), glyphModule({
|
|
39192
|
-
bind: legacyContext.bind
|
|
39193
|
-
}), browser ? bindGlyphCanvasPickerContribution(legacyContext) : bindGlyphMathPickerContribution(legacyContext);
|
|
39194
|
-
}
|
|
39195
|
-
_registerGlyph.__loaded = !1;
|
|
39196
|
-
const registerGlyph = _registerGlyph;
|
|
39197
|
-
|
|
39198
|
-
function _registerGroup() {
|
|
39199
|
-
_registerGroup.__loaded || (_registerGroup.__loaded = !0, registerGroupGraphic());
|
|
39200
|
-
}
|
|
39201
|
-
_registerGroup.__loaded = !1;
|
|
39202
|
-
const registerGroup = _registerGroup;
|
|
39203
|
-
|
|
39204
|
-
function _registerImage() {
|
|
39205
|
-
if (_registerImage.__loaded) return;
|
|
39206
|
-
_registerImage.__loaded = !0;
|
|
39207
|
-
const legacyContext = getLegacyBindingContext();
|
|
39208
|
-
registerImageGraphic(), imageModule({
|
|
39209
|
-
bind: legacyContext.bind
|
|
39210
|
-
}), browser ? bindImageCanvasPickerContribution(legacyContext) : bindImageMathPickerContribution(legacyContext);
|
|
39211
|
-
}
|
|
39212
|
-
_registerImage.__loaded = !1;
|
|
39213
|
-
const registerImage = _registerImage;
|
|
39214
|
-
|
|
39215
|
-
function _registerLine() {
|
|
39216
|
-
if (_registerLine.__loaded) return;
|
|
39217
|
-
_registerLine.__loaded = !0;
|
|
39218
|
-
const legacyContext = getLegacyBindingContext();
|
|
39219
|
-
registerLineGraphic(), lineModule({
|
|
39220
|
-
bind: legacyContext.bind
|
|
39221
|
-
}), browser ? bindLineCanvasPickerContribution(legacyContext) : bindLineMathPickerContribution(legacyContext);
|
|
39222
|
-
}
|
|
39223
|
-
_registerLine.__loaded = !1;
|
|
39224
|
-
const registerLine = _registerLine;
|
|
39225
|
-
|
|
39226
|
-
function _registerPath() {
|
|
39227
|
-
if (_registerPath.__loaded) return;
|
|
39228
|
-
_registerPath.__loaded = !0;
|
|
39229
|
-
const legacyContext = getLegacyBindingContext();
|
|
39230
|
-
registerPathGraphic(), pathModule({
|
|
39231
|
-
bind: legacyContext.bind
|
|
39232
|
-
}), browser ? bindPathCanvasPickerContribution(legacyContext) : bindPathMathPickerContribution(legacyContext);
|
|
39233
|
-
}
|
|
39234
|
-
_registerPath.__loaded = !1;
|
|
39235
|
-
const registerPath = _registerPath;
|
|
39236
|
-
|
|
39237
|
-
function _registerPolygon() {
|
|
39238
|
-
if (_registerPolygon.__loaded) return;
|
|
39239
|
-
_registerPolygon.__loaded = !0;
|
|
39240
|
-
const legacyContext = getLegacyBindingContext();
|
|
39241
|
-
registerPolygonGraphic(), polygonModule({
|
|
39242
|
-
bind: legacyContext.bind
|
|
39243
|
-
}), browser ? bindPolygonCanvasPickerContribution(legacyContext) : bindPolygonMathPickerContribution(legacyContext);
|
|
39244
|
-
}
|
|
39245
|
-
_registerPolygon.__loaded = !1;
|
|
39246
|
-
const registerPolygon = _registerPolygon;
|
|
39247
|
-
|
|
39248
|
-
function _registerRect() {
|
|
39249
|
-
if (_registerRect.__loaded) return;
|
|
39250
|
-
_registerRect.__loaded = !0;
|
|
39251
|
-
const legacyContext = getLegacyBindingContext();
|
|
39252
|
-
registerRectGraphic(), rectModule({
|
|
39253
|
-
bind: legacyContext.bind
|
|
39254
|
-
}), browser ? bindRectCanvasPickerContribution(legacyContext) : bindRectMathPickerContribution(legacyContext);
|
|
39255
|
-
}
|
|
39256
|
-
_registerRect.__loaded = !1;
|
|
39257
|
-
const registerRect = _registerRect;
|
|
39258
|
-
|
|
39259
|
-
function _registerRichtext() {
|
|
39260
|
-
if (_registerRichtext.__loaded) return;
|
|
39261
|
-
_registerRichtext.__loaded = !0;
|
|
39262
|
-
const legacyContext = getLegacyBindingContext();
|
|
39263
|
-
registerRichtextGraphic(), richtextModule({
|
|
39264
|
-
bind: legacyContext.bind
|
|
39265
|
-
}), browser ? bindRichtextCanvasPickerContribution(legacyContext) : bindRichTextMathPickerContribution(legacyContext);
|
|
39266
|
-
}
|
|
39267
|
-
_registerRichtext.__loaded = !1;
|
|
39268
|
-
const registerRichtext = _registerRichtext;
|
|
39269
|
-
|
|
39270
|
-
function _registerShadowRoot() {
|
|
39271
|
-
_registerShadowRoot.__loaded || (_registerShadowRoot.__loaded = !0, registerShadowRootGraphic());
|
|
39272
|
-
}
|
|
39273
|
-
_registerShadowRoot.__loaded = !1;
|
|
39274
|
-
const registerShadowRoot = _registerShadowRoot;
|
|
39275
|
-
|
|
39276
39393
|
function _registerStar() {
|
|
39277
39394
|
if (_registerStar.__loaded) return;
|
|
39278
39395
|
_registerStar.__loaded = !0;
|
|
@@ -39284,28 +39401,6 @@
|
|
|
39284
39401
|
_registerStar.__loaded = !1;
|
|
39285
39402
|
const registerStar = _registerStar;
|
|
39286
39403
|
|
|
39287
|
-
function _registerSymbol() {
|
|
39288
|
-
if (_registerSymbol.__loaded) return;
|
|
39289
|
-
_registerSymbol.__loaded = !0;
|
|
39290
|
-
const legacyContext = getLegacyBindingContext();
|
|
39291
|
-
registerSymbolGraphic(), symbolModule({
|
|
39292
|
-
bind: legacyContext.bind
|
|
39293
|
-
}), browser ? bindSymbolCanvasPickerContribution(legacyContext) : bindSymbolMathPickerContribution(legacyContext);
|
|
39294
|
-
}
|
|
39295
|
-
_registerSymbol.__loaded = !1;
|
|
39296
|
-
const registerSymbol = _registerSymbol;
|
|
39297
|
-
|
|
39298
|
-
function _registerText() {
|
|
39299
|
-
if (_registerText.__loaded) return;
|
|
39300
|
-
_registerText.__loaded = !0;
|
|
39301
|
-
const legacyContext = getLegacyBindingContext();
|
|
39302
|
-
registerTextGraphic(), textModule({
|
|
39303
|
-
bind: legacyContext.bind
|
|
39304
|
-
}), browser ? bindTextCanvasPickerContribution(legacyContext) : bindTextMathPickerContribution(legacyContext);
|
|
39305
|
-
}
|
|
39306
|
-
_registerText.__loaded = !1;
|
|
39307
|
-
const registerText = _registerText;
|
|
39308
|
-
|
|
39309
39404
|
function _registerWrapText() {
|
|
39310
39405
|
_registerWrapText.__loaded || (_registerWrapText.__loaded = !0, registerWrapTextGraphic());
|
|
39311
39406
|
}
|