Skip to content

Commit

Permalink
fix: 分面更新出现空白bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Leannechn committed Apr 7, 2021
1 parent 076643b commit 07d9989
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bizcharts",
"version": "4.1.10-beta.1",
"version": "4.1.10-beta.2",
"description": "bizcharts",
"keywords": [
"bizcharts",
Expand Down
1 change: 0 additions & 1 deletion src/components/Chart/chartHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class ChartHelper extends EventEmitter {
}
this.chart.emit(VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA);
}
console.log('====', isEqual)
} else {
this.chart.data(data);
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/Facet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ export interface IFacetProps extends FacetCfg<any>, React.Props<any> {
function Facet(props: IFacetProps) {
const chart = useChartView();
const { type, children, ...cfg } = props;
// @ts-ignore
if (chart.facetInstance) {
// 分面如果已存在不能重复执行,销毁重新配置
// @ts-ignore
chart.facetInstance.destroy();
// @ts-ignore
chart.facetInstance = null;
}
if (_isFunction(children)) {
chart.facet(type, {
...cfg,
Expand Down
2 changes: 1 addition & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ registerEngine('svg', SVGEngine);

// @ts-ignore
export * from '@antv/g2/lib/core';
export const VERSION = '4.1.9';
export const VERSION = '4.1.10-beta.2';



Expand Down
25 changes: 3 additions & 22 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,29 +451,10 @@ export interface IBaseGemoProps extends React.Props<any> {
* @example
* ```ts
* // data: [ {x: 1, y: 2, z: 'a'}, {x: 2, y: 2, z: 'b'} ]
* // 在每个图形上显示 z 字段对应的数值
* label({
* fields: [ 'z' ]
* });
*
* label(false); // 不展示 label
*
* <Interval label="y" />
*
* // 在每个图形上显示 x 字段对应的数值,同时配置文本颜色为红色
* label('x', {
* style: {
* fill: 'red',
* },
* })
*
* // 以 type 类型的 label 渲染每个图形上显示 x 字段对应的数值,同时格式化文本内容
* label('x', (xValue) => {
* return {
* content: xValue + '%',
* };
* }, {
* type: 'base' // 声明 label 类型
* })
* ```
*
* @type {(LabelOption | false | FieldString | [FieldString, GeometryLabelCfg | LabelCallback] | [FieldString, LabelCallback, GeometryLabelCfg])}
* @memberof IBaseGemo
Expand Down

0 comments on commit 07d9989

Please sign in to comment.