Skip to content

Commit 8955b3f

Browse files
author
荊芥
committed
Merge branch 'master' into fix/0402/addCustomMappingField
2 parents 5dc7d33 + e2aa10c commit 8955b3f

File tree

12 files changed

+77
-21
lines changed

12 files changed

+77
-21
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: Setup Node.js environment
1414
uses: actions/[email protected]
1515
with:
16-
node-version: '14'
16+
node-version: '18'
1717

1818
- name: Run CI
1919
run: |
20-
npm install
20+
npm install --legacy-peer-deps
2121
npm run lint
2222
npm run build
2323
npm run coverage

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
#### 2.4.32 (2024-07-30)
2+
3+
##### Chores
4+
5+
* update github action ([#3608](https://github.com/antvis/G2plot/pull/3608)) ([90020297](https://github.com/antvis/G2plot/commit/90020297669dbe0d213ebae7abebf3f7d9509ec8))
6+
* fix customized stock demo typo ([#3564](https://github.com/antvis/G2plot/pull/3564)) ([99b9f638](https://github.com/antvis/G2plot/commit/99b9f63863684dc592f79388c99888c5d24184bd))
7+
* update version of @antv/component to 0.8.34 for dist build ([#3545](https://github.com/antvis/G2plot/pull/3545)) ([ec015ea5](https://github.com/antvis/G2plot/commit/ec015ea55490621de20cc2e8cdae872272f3789d))
8+
9+
##### Documentation Changes
10+
11+
* update readme ([#3757](https://github.com/antvis/G2plot/pull/3757)) ([3725803e](https://github.com/antvis/G2plot/commit/3725803e982e7b4eb6595742462afbc23172ea76))
12+
* fix link ([#3514](https://github.com/antvis/G2plot/pull/3514)) ([0f570eb0](https://github.com/antvis/G2plot/commit/0f570eb085612910651cd9cd57b3c95cea97a1db))
13+
* Fix a few typos ([#3525](https://github.com/antvis/G2plot/pull/3525)) ([ce615a2a](https://github.com/antvis/G2plot/commit/ce615a2a17fae845fd6badf044491447a713cb90))
14+
15+
##### Bug Fixes
16+
17+
* line,area,radar label style with callback ([02bf66f3](https://github.com/antvis/G2plot/commit/02bf66f36a39539a326d15689bd22f5f0a9b6025))
18+
19+
##### Other Changes
20+
21+
* the default value of isPercent option should be false ([#3725](https://github.com/antvis/G2plot/pull/3725)) ([bdc1342e](https://github.com/antvis/G2plot/commit/bdc1342e3cc8a71d8cb1284acec9299b64648774))
22+
* **demo:** heatmap-base parameter error ([#3679](https://github.com/antvis/G2plot/pull/3679)) ([bd6af004](https://github.com/antvis/G2plot/commit/bd6af0044efe869b503c2d388adac8326d1e6f31))
23+
124
#### 2.4.31 (2023-05-10)
225

326
##### Chores

__tests__/bugs/issue-3804-spec.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { get } from '@antv/util';
2+
import { Line } from '../../src';
3+
import { createDiv } from '../utils/dom';
4+
5+
describe('#3804', () => {
6+
it('line label style with callback', () => {
7+
const line = new Line(createDiv(), {
8+
width: 400,
9+
height: 300,
10+
autoFit: false,
11+
data: [
12+
{ year: '1991', value: 3 },
13+
{ year: '1992', value: 4 },
14+
{ year: '1993', value: 3.5 },
15+
{ year: '1994', value: 5 },
16+
{ year: '1995', value: 4.9 },
17+
{ year: '1996', value: 6 },
18+
{ year: '1997', value: 7 },
19+
{ year: '1998', value: 9 },
20+
{ year: '1999', value: 13 },
21+
],
22+
xField: 'year',
23+
yField: 'value',
24+
label: {
25+
fields: ['year', 'value'],
26+
callback: (year, value) => {
27+
return {
28+
style: {
29+
text: value,
30+
fill: value > 10 ? '#f24' : '#000',
31+
},
32+
};
33+
},
34+
},
35+
});
36+
line.render();
37+
const geometry = line.chart.geometries[0];
38+
expect(get(geometry, ['labelOption', 'fields'])).toEqual(['year', 'value']);
39+
line.destroy();
40+
});
41+
});

__tests__/unit/utils/pattern/line-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('utils: line pattern', () => {
2929
drawLine(ctx, cfg as LinePatternCfg, d);
3030
// 传入的是呈现的位置
3131
expect(getPixelColor(canvas, 0, 0).hex).toEqual('#ff0000');
32-
expect(getPixelColor(canvas, 0, height - 1).hex).toEqual('#ff0000');
32+
expect(getPixelColor(canvas, 0, height - 1).hex).toEqual('#000000');
3333
});
3434

3535
it('lineUnitPattern with strokeOpacity', () => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g2plot",
3-
"version": "2.4.31",
3+
"version": "2.4.32",
44
"description": "An interactive and responsive charting library",
55
"keywords": [
66
"chart",

site/docs/manual/contact.en.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,3 @@ If you have any questions, suggestions, feedback or willingness to communicate,
1414
- Zhihu:https://zhuanlan.zhihu.com/aiux-antv
1515

1616
- Contribution Guide:https://www.yuque.com/antv/g2plot/apubgw
17-
18-
- DingTalk Group Number: 30233731 / 35686967 (Group 2) / 44788198 (Group 3)
19-
20-
<img src="https://gw.alipayobjects.com/zos/antfincdn/hTzzaqgHgQ/Antv%252520G2%252520%26%252520G2Plot.png" width="200" height="266" />

site/docs/manual/contact.zh.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,3 @@ order: 9
1414
- 知乎专栏:https://zhuanlan.zhihu.com/aiux-antv
1515

1616
- 共建指南:https://www.yuque.com/antv/g2plot/apubgw
17-
18-
- 钉钉群组号码: 30233731 / 35686967 (2 群) / 44788198 (3 群)
19-
20-
<img src="https://gw.alipayobjects.com/zos/antfincdn/hTzzaqgHgQ/Antv%252520G2%252520%26%252520G2Plot.png" width="200" height="266" />

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const version = '2.4.31';
1+
export const version = '2.4.32';
22

33
// G2 自定义能力透出
44
import * as G2 from '@antv/g2';

src/plots/area/adaptor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ function label(params: Params<AreaOptions>): Params<AreaOptions> {
118118
if (!label) {
119119
areaGeometry.label(false);
120120
} else {
121-
const { callback, ...cfg } = label;
121+
const { fields, callback, ...cfg } = label;
122122
areaGeometry.label({
123-
fields: [yField],
123+
fields: fields || [yField],
124124
callback,
125125
cfg: {
126126
layout: [

src/plots/dual-axes/util/render-sider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
2121
const values = valuesOfKey(data, xScale.field);
2222
const xValues = isHorizontal ? values : values.reverse();
2323
const xTickCount = size(xValues);
24-
const minIndex = Math.floor(min * (xTickCount - 1));
25-
const maxIndex = Math.floor(max * (xTickCount - 1));
24+
const minIndex = Math.round(min * (xTickCount - 1));
25+
const maxIndex = Math.round(max * (xTickCount - 1));
2626

2727
// 增加 x 轴的过滤器
2828
view.filter(xScale.field, (value: any) => {

0 commit comments

Comments
 (0)