Skip to content

Commit

Permalink
chore: v2.3.33 & changelog (#2841)
Browse files Browse the repository at this point in the history
* chore: v2.3.33 & changelog

* chore: 更新 changelog

* docs: 更新公告

* fix: 修复空对象读取

* fix: 修复双轴图 legend 配置
  • Loading branch information
visiky authored Sep 9, 2021
1 parent e2b84c6 commit 6b6ac71
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 14 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
#### 2.3.33 (2021-09-09)

##### Documentation Changes

* set default lang=zh in readme ([#2839](https://github.com/antvis/g2plot/pull/2839)) ([6c2fea3b](https://github.com/antvis/g2plot/commit/6c2fea3bb90add6ff0aff7a4ccd656c7f0b82a28))
* **annotations:** annotations 相关文档完善 ([#2823](https://github.com/antvis/g2plot/pull/2823)) ([0df46052](https://github.com/antvis/g2plot/commit/0df46052724a0c98b75e0923ebe7c9474d7ae000))
* **pattern:** 添加自定义 pattern 的 demo ([a0a42420](https://github.com/antvis/g2plot/commit/a0a4242038782b790b628a3668b09233e899a90f))

##### New Features

* **venn:** 初始化韦恩图 ([#2831](https://github.com/antvis/g2plot/pull/2831)) ([e2b84c6a](https://github.com/antvis/g2plot/commit/e2b84c6a153831f09171b68759738ba6115a3814))
* **dual-axes:** 双轴图支持单轴配置 legend ([#2840](https://github.com/antvis/g2plot/pull/2840)) ([d1e1a527](https://github.com/antvis/g2plot/commit/d1e1a527a046076daf06d96088f28ec19fc415bc))
* **annotations:** 提供更新图标标注方法 ([#2826](https://github.com/antvis/g2plot/pull/2826)) ([d879ad14](https://github.com/antvis/g2plot/commit/d879ad14c516fe6a27ac6cb0d3075f5c1ebb4b39))

##### Bug Fixes

* 修复 demo ([87ae90f9](https://github.com/antvis/g2plot/commit/87ae90f9c034f728222fcc0d4e7437352cc28e8f))

#### 2.3.33 (2021-09-09)

##### Documentation Changes

* set default lang=zh in readme ([#2839](https://github.com/antvis/g2plot/pull/2839)) ([6c2fea3b](https://github.com/antvis/g2plot/commit/6c2fea3bb90add6ff0aff7a4ccd656c7f0b82a28))
* **annotations:** annotations 相关文档完善 ([#2823](https://github.com/antvis/g2plot/pull/2823)) ([0df46052](https://github.com/antvis/g2plot/commit/0df46052724a0c98b75e0923ebe7c9474d7ae000))
* **pattern:** 添加自定义 pattern 的 demo ([a0a42420](https://github.com/antvis/g2plot/commit/a0a4242038782b790b628a3668b09233e899a90f))

##### New Features

* **dual-axes:** 双轴图支持单轴配置 legend ([#2840](https://github.com/antvis/g2plot/pull/2840)) ([d1e1a527](https://github.com/antvis/g2plot/commit/d1e1a527a046076daf06d96088f28ec19fc415bc))
* 提供更新图标标注方法 ([#2826](https://github.com/antvis/g2plot/pull/2826)) ([d879ad14](https://github.com/antvis/g2plot/commit/d879ad14c516fe6a27ac6cb0d3075f5c1ebb4b39))

##### Bug Fixes

* 修复 demo ([87ae90f9](https://github.com/antvis/g2plot/commit/87ae90f9c034f728222fcc0d4e7437352cc28e8f))

#### 2.3.32 (2021-08-25)

##### Documentation Changes
Expand Down
4 changes: 0 additions & 4 deletions examples/case/advanced/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"zh": "联动 Tooltip (饼图)",
"en": "Associate Tooltip for Pie plot"
},
"new": true,
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/VoiPvFL%26U5/pie-tooltip.gif"
},
{
Expand All @@ -19,7 +18,6 @@
"zh": "联动筛选",
"en": "Associate Filter"
},
"new": true,
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/tHF3bgalmB/association-filter.gif"
},
{
Expand All @@ -28,7 +26,6 @@
"zh": "带跳转转化分析图",
"en": "Conversion analysis bar"
},
"new": true,
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/p8r96Xc9o0/conversion-analysis-bar.gif"
},
{
Expand All @@ -37,7 +34,6 @@
"zh": "带跳转转化分析图2",
"en": "Conversion analysis bar2"
},
"new": true,
"screenshot": "https://gw.alipayobjects.com/zos/antfincdn/PojoRGFBN4/conversion-analysis-2.gif"
}
]
Expand Down
4 changes: 2 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ module.exports = {
indexName: 'antv_g2plot',
},
announcement: {
zh: "G2Plot 8月迭代更新详情,见:https://www.yuque.com/antv/g2plot/2021-08",
en: "G2Plot 8月迭代更新详情,见:https://www.yuque.com/antv/g2plot/2021-08"
zh: "G2Plot 韦恩图上新,欢迎到【图表示例】页查看。",
en: "Venn Plot of G2Plot on the new, welcome to see details on the [Examples]"
}
},
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g2plot",
"version": "2.3.32",
"version": "2.3.33",
"description": "An interactive and responsive charting library",
"keywords": [
"chart",
Expand Down Expand Up @@ -144,7 +144,7 @@
"limit-size": [
{
"path": "dist/g2plot.min.js",
"limit": "985 Kb"
"limit": "980 Kb"
},
{
"path": "dist/g2plot.min.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const version = '2.3.32';
export const version = '2.3.33';

// G2 自定义能力透出
import * as G2 from '@antv/g2';
Expand Down
10 changes: 6 additions & 4 deletions src/plots/dual-axes/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,16 @@ export function legend(params: Params<DualAxesOptions>): Params<DualAxesOptions>
} else if (isObject(legend) && legend.custom === true) {
chart.legend(legend);
} else {
const leftLegend = get(geometryOptions, [0, 'legend'], legend);
const rightLegend = get(geometryOptions, [1, 'legend'], legend);
// 均使用自定义图例
chart.once('beforepaint', () => {
const leftItems = data[0].length
? getViewLegendItems({
view: leftView,
geometryOption: geometryOptions[0],
yField: yField[0],
legend: geometryOptions[0].legend || legend,
legend: leftLegend,
})
: [];

Expand All @@ -383,7 +385,7 @@ export function legend(params: Params<DualAxesOptions>): Params<DualAxesOptions>
view: rightView,
geometryOption: geometryOptions[1],
yField: yField[1],
legend: geometryOptions[1].legend || legend,
legend: rightLegend,
})
: [];

Expand All @@ -398,10 +400,10 @@ export function legend(params: Params<DualAxesOptions>): Params<DualAxesOptions>
});

if (geometryOptions[0].seriesField) {
leftView.legend(geometryOptions[0].seriesField, legend);
leftView.legend(geometryOptions[0].seriesField, leftLegend);
}
if (geometryOptions[1].seriesField) {
rightView.legend(geometryOptions[1].seriesField, legend);
rightView.legend(geometryOptions[1].seriesField, rightLegend);
}

// 自定义图例交互
Expand Down
5 changes: 4 additions & 1 deletion src/plots/dual-axes/util/legend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export function getViewLegendItems(params: {
const legendItemName = get(view, `options.scales.${yField}.alias`) || yField;
// 返回 g2 设置的图例
const colorAttribute = geometry.getAttribute('color');
const color = Util.getMappingValue(colorAttribute, legendItemName, colorAttribute.values[0]);
let color = view.getTheme().defaultColor;
if (colorAttribute) {
color = Util.getMappingValue(colorAttribute, legendItemName, get(colorAttribute, ['values', 0], color));
}

const marker =
(isFunction(userMarker)
Expand Down

0 comments on commit 6b6ac71

Please sign in to comment.