@visactor/react-vchart 2.1.2-alpha.9 → 2.1.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +57 -26
- 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/MarkArea.js +2 -1
- package/cjs/components/ScrollBar.js +1 -2
- 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 -1
- 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 -2
- 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 -1
- 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 -2
- package/cjs/series/Sankey.js +1 -1
- package/cjs/series/Scatter.js +1 -1
- package/cjs/series/Series.js +1 -1
- package/cjs/series/Sunburst.js +1 -1
- package/cjs/series/Treemap.js +1 -1
- package/cjs/series/Venn.js +1 -1
- package/cjs/series/Waterfall.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/MarkArea.js +2 -1
- package/esm/components/ScrollBar.js +1 -2
- 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 -1
- 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 -2
- 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 -1
- 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 -2
- package/esm/series/Sankey.js +1 -1
- package/esm/series/Scatter.js +1 -1
- package/esm/series/Series.js +1 -1
- package/esm/series/Sunburst.js +1 -1
- package/esm/series/Treemap.js +1 -1
- package/esm/series/Venn.js +1 -1
- package/esm/series/Waterfall.js +1 -1
- package/package.json +7 -7
package/build/index.js
CHANGED
|
@@ -18646,14 +18646,14 @@
|
|
|
18646
18646
|
get dpr() {
|
|
18647
18647
|
return this._handler.getDpr();
|
|
18648
18648
|
}
|
|
18649
|
-
constructor(
|
|
18649
|
+
constructor(vRenderGlobal = application.global, handlerFactory = defaultWindowHandlerFactory) {
|
|
18650
18650
|
super(), this.handlerFactory = handlerFactory, this.hooks = {
|
|
18651
18651
|
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
18652
18652
|
}, this.active = () => {
|
|
18653
|
-
const
|
|
18654
|
-
if (!
|
|
18655
|
-
this.handlerFactory(
|
|
18656
|
-
}, this._uid = Generator.GenAutoIncrementId(), this.global =
|
|
18653
|
+
const vRenderGlobal = this.global;
|
|
18654
|
+
if (!vRenderGlobal.env || this.actived) return;
|
|
18655
|
+
this.handlerFactory(vRenderGlobal.env).configure(this, vRenderGlobal), this.actived = !0;
|
|
18656
|
+
}, this._uid = Generator.GenAutoIncrementId(), this.global = vRenderGlobal, this.postInit();
|
|
18657
18657
|
}
|
|
18658
18658
|
_nativeAddEventListener(type, listener, options) {
|
|
18659
18659
|
return this._handler.addEventListener(type, listener, options);
|
|
@@ -30806,6 +30806,37 @@
|
|
|
30806
30806
|
});
|
|
30807
30807
|
}
|
|
30808
30808
|
|
|
30809
|
+
const factoryRegistry = {
|
|
30810
|
+
charts: {},
|
|
30811
|
+
series: {},
|
|
30812
|
+
components: {},
|
|
30813
|
+
graphicComponents: {},
|
|
30814
|
+
marks: {},
|
|
30815
|
+
regions: {},
|
|
30816
|
+
animations: {},
|
|
30817
|
+
implements: {},
|
|
30818
|
+
chartPlugin: {},
|
|
30819
|
+
vChartPlugin: {},
|
|
30820
|
+
componentPlugin: {},
|
|
30821
|
+
transforms: {
|
|
30822
|
+
fields: fields,
|
|
30823
|
+
filter: filter,
|
|
30824
|
+
fold: fold
|
|
30825
|
+
},
|
|
30826
|
+
dataParser: {
|
|
30827
|
+
csv: csvParser,
|
|
30828
|
+
dsv: dsvParser,
|
|
30829
|
+
tsv: tsvParser
|
|
30830
|
+
},
|
|
30831
|
+
layout: {},
|
|
30832
|
+
grammarTransforms: {},
|
|
30833
|
+
stageEventPlugins: {},
|
|
30834
|
+
interactionTriggers: {},
|
|
30835
|
+
composedEventMap: {},
|
|
30836
|
+
tooltipProcessors: {},
|
|
30837
|
+
formatter: void 0
|
|
30838
|
+
};
|
|
30839
|
+
|
|
30809
30840
|
class Factory {
|
|
30810
30841
|
static registerChart(key, chart) {
|
|
30811
30842
|
Factory._charts[key] = chart;
|
|
@@ -30954,10 +30985,11 @@
|
|
|
30954
30985
|
return Factory._componentPlugin[type];
|
|
30955
30986
|
}
|
|
30956
30987
|
static registerFormatter(func) {
|
|
30957
|
-
this._formatter = func;
|
|
30988
|
+
this._formatter = func, factoryRegistry.formatter = func;
|
|
30958
30989
|
}
|
|
30959
30990
|
static getFormatter() {
|
|
30960
|
-
|
|
30991
|
+
var _a;
|
|
30992
|
+
return null !== (_a = factoryRegistry.formatter) && void 0 !== _a ? _a : this._formatter;
|
|
30961
30993
|
}
|
|
30962
30994
|
static createInteractionTrigger(interactionType, options) {
|
|
30963
30995
|
const Ctor = Factory._interactionTriggers[interactionType];
|
|
@@ -30970,21 +31002,13 @@
|
|
|
30970
31002
|
return Factory._composedEventMap[eType];
|
|
30971
31003
|
}
|
|
30972
31004
|
}
|
|
30973
|
-
Factory._charts =
|
|
30974
|
-
fields: fields,
|
|
30975
|
-
filter: filter,
|
|
30976
|
-
fold: fold
|
|
30977
|
-
}, Factory.dataParser = {
|
|
30978
|
-
csv: csvParser,
|
|
30979
|
-
dsv: dsvParser,
|
|
30980
|
-
tsv: tsvParser
|
|
30981
|
-
}, Factory._layout = {}, Factory._grammarTransforms = {}, Factory._stageEventPlugins = {}, Factory.registerStageEventPlugin = (type, Plugin) => {
|
|
31005
|
+
Factory._charts = factoryRegistry.charts, Factory._series = factoryRegistry.series, Factory._components = factoryRegistry.components, Factory._graphicComponents = factoryRegistry.graphicComponents, Factory._marks = factoryRegistry.marks, Factory._regions = factoryRegistry.regions, Factory._animations = factoryRegistry.animations, Factory._implements = factoryRegistry.implements, Factory._chartPlugin = factoryRegistry.chartPlugin, Factory._vChartPlugin = factoryRegistry.vChartPlugin, Factory._componentPlugin = factoryRegistry.componentPlugin, Factory.transforms = factoryRegistry.transforms, Factory.dataParser = factoryRegistry.dataParser, Factory._layout = factoryRegistry.layout, Factory._grammarTransforms = factoryRegistry.grammarTransforms, Factory._stageEventPlugins = factoryRegistry.stageEventPlugins, Factory.registerStageEventPlugin = (type, Plugin) => {
|
|
30982
31006
|
Factory._stageEventPlugins[type] = Plugin;
|
|
30983
|
-
}, Factory.getStageEventPlugin = type => Factory._stageEventPlugins[type], Factory._interactionTriggers =
|
|
31007
|
+
}, Factory.getStageEventPlugin = type => Factory._stageEventPlugins[type], Factory._interactionTriggers = factoryRegistry.interactionTriggers, Factory.registerInteractionTrigger = (interactionType, interaction) => {
|
|
30984
31008
|
Factory._interactionTriggers[interactionType] = interaction;
|
|
30985
|
-
}, Factory._composedEventMap =
|
|
31009
|
+
}, Factory._composedEventMap = factoryRegistry.composedEventMap, Factory.registerComposedEvent = (eType, composedEvent) => {
|
|
30986
31010
|
Factory._composedEventMap[eType] = composedEvent;
|
|
30987
|
-
}, Factory._tooltipProcessors =
|
|
31011
|
+
}, Factory._tooltipProcessors = factoryRegistry.tooltipProcessors, Factory.registerTooltipProcessor = (type, processor) => {
|
|
30988
31012
|
Factory._tooltipProcessors[type] = processor;
|
|
30989
31013
|
}, Factory.createTooltipProcessor = (type, tooltip) => {
|
|
30990
31014
|
const Cror = Factory._tooltipProcessors[type];
|
|
@@ -33731,7 +33755,8 @@
|
|
|
33731
33755
|
params.canvas ? this.createWindowByCanvas(params) : this.createWindowByConfig(params), this.postInit();
|
|
33732
33756
|
}
|
|
33733
33757
|
postInit() {
|
|
33734
|
-
|
|
33758
|
+
var _a;
|
|
33759
|
+
if (null === (_a = this.global) || void 0 === _a ? void 0 : _a.optimizeVisible) try {
|
|
33735
33760
|
this.observerCanvas();
|
|
33736
33761
|
} catch (err) {
|
|
33737
33762
|
console.error("发生错误,该环境不存在IntersectionObserver");
|
|
@@ -33772,10 +33797,10 @@
|
|
|
33772
33797
|
this.canvas = new BrowserCanvas(options);
|
|
33773
33798
|
}
|
|
33774
33799
|
createWindowByCanvas(params) {
|
|
33775
|
-
var _a, _b;
|
|
33800
|
+
var _a, _b, _c;
|
|
33776
33801
|
let canvas;
|
|
33777
33802
|
if ("string" == typeof params.canvas) {
|
|
33778
|
-
if (canvas = this.global.getElementById(params.canvas), canvas || "undefined" == typeof document || (canvas = document.getElementById(params.canvas)), !canvas) throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom");
|
|
33803
|
+
if (canvas = null === (_a = this.global) || void 0 === _a ? void 0 : _a.getElementById(params.canvas), canvas || "undefined" == typeof document || (canvas = document.getElementById(params.canvas)), !canvas) throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom");
|
|
33779
33804
|
} else canvas = params.canvas;
|
|
33780
33805
|
if (!canvas) throw new Error("发生错误,传入的canvas不正确");
|
|
33781
33806
|
let width = params.width,
|
|
@@ -33786,14 +33811,14 @@
|
|
|
33786
33811
|
}
|
|
33787
33812
|
let dpr = params.dpr;
|
|
33788
33813
|
if (null == dpr) {
|
|
33789
|
-
dpr = null !== (
|
|
33814
|
+
dpr = null !== (_b = canvas.getContext("2d").pixelRatio) && void 0 !== _b ? _b : canvas.width / width;
|
|
33790
33815
|
}
|
|
33791
33816
|
this.canvas = new BrowserCanvas({
|
|
33792
33817
|
width: width,
|
|
33793
33818
|
height: height,
|
|
33794
33819
|
dpr: dpr,
|
|
33795
33820
|
nativeCanvas: canvas,
|
|
33796
|
-
canvasControled: null !== (
|
|
33821
|
+
canvasControled: null !== (_c = params.canvasControled) && void 0 !== _c && _c
|
|
33797
33822
|
});
|
|
33798
33823
|
}
|
|
33799
33824
|
releaseWindow() {
|
|
@@ -47244,6 +47269,12 @@
|
|
|
47244
47269
|
_hasDiffAttrs(g) {
|
|
47245
47270
|
return !!g.context.diffAttrs && Object.keys(g.context.diffAttrs).length > 0;
|
|
47246
47271
|
}
|
|
47272
|
+
_commitPreventedAnimationStaticAttrs(g, attrs) {
|
|
47273
|
+
var _a, _b;
|
|
47274
|
+
if (!attrs || !Object.keys(attrs).length) return;
|
|
47275
|
+
const graphic = g;
|
|
47276
|
+
null === (_a = graphic.setFinalAttributes) || void 0 === _a || _a.call(graphic, attrs), graphic._commitAnimationStaticAttributes ? graphic._commitAnimationStaticAttributes(attrs) : null === (_b = graphic.commitInternalBaseAttributes) || void 0 === _b || _b.call(graphic, attrs);
|
|
47277
|
+
}
|
|
47247
47278
|
_runApplyGraphic(graphics) {
|
|
47248
47279
|
const hasAnimation = this.hasAnimation();
|
|
47249
47280
|
graphics.forEach((g, index) => {
|
|
@@ -47252,7 +47283,7 @@
|
|
|
47252
47283
|
hasStateAnimation = this.hasAnimationByState(g.context.animationState);
|
|
47253
47284
|
if (g.setAttributes) {
|
|
47254
47285
|
const diffAttrs = this._excludeStateControlledDiffAttrs(g, getDiffAttributesOfGraphic(g, finalAttrs));
|
|
47255
|
-
g.context.diffAttrs = diffAttrs, g.context.reusing ? (g.context.lastAttrs = g.attribute, g.initAttributes(finalAttrs), g.context.reusing = !1) : hasStateAnimation || (hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs)), !(null === (_b = this.renderContext) || void 0 === _b ? void 0 : _b.progressive) && this._product && g.parent !== this._product && this._product.appendChild(g);
|
|
47286
|
+
g.context.diffAttrs = diffAttrs, g.context.reusing ? (g.context.lastAttrs = g.attribute, g.initAttributes(finalAttrs), g.context.reusing = !1) : hasStateAnimation || (hasAnimation ? (g.setAttributesAndPreventAnimate(diffAttrs), this._commitPreventedAnimationStaticAttrs(g, diffAttrs)) : g.setAttributes(diffAttrs)), !(null === (_b = this.renderContext) || void 0 === _b ? void 0 : _b.progressive) && this._product && g.parent !== this._product && this._product.appendChild(g);
|
|
47256
47287
|
} else {
|
|
47257
47288
|
const mockGraphic = g;
|
|
47258
47289
|
(g = this._createGraphic(finalAttrs)).context = mockGraphic.context, g.context.diffAttrs = finalAttrs, g.stateSort = this._stateSort;
|
|
@@ -47555,7 +47586,7 @@
|
|
|
47555
47586
|
if (this._product.context.finalAttrs = newAttrs, this._product.context.diffState === DiffState.update) {
|
|
47556
47587
|
const hasAnimation = this.hasAnimation(),
|
|
47557
47588
|
diffAttrs = getDiffAttributesOfGraphic(this._product, newAttrs);
|
|
47558
|
-
this._product.context.diffAttrs = diffAttrs, this.hasAnimationByState(this._product.context.animationState) || (hasAnimation ? this._product.setAttributesAndPreventAnimate(diffAttrs) : this._product.setAttributes(diffAttrs));
|
|
47589
|
+
this._product.context.diffAttrs = diffAttrs, this.hasAnimationByState(this._product.context.animationState) || (hasAnimation ? (this._product.setAttributesAndPreventAnimate(diffAttrs), this._commitPreventedAnimationStaticAttrs(this._product, diffAttrs)) : this._product.setAttributes(diffAttrs));
|
|
47559
47590
|
} else this._product.setAttributes(newAttrs);
|
|
47560
47591
|
this.needClear = !0;
|
|
47561
47592
|
}
|