Skip to content

Commit 37e5ade

Browse files
author
xuying.xu
committed
chore:调整单测图片
1 parent ecfef2e commit 37e5ade

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

packages/f2/src/components/geometry/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
isNull,
1010
find,
1111
} from '@antv/util';
12-
import chart, { ChartChildProps } from '../../chart';
12+
import { ChartChildProps } from '../../chart';
1313
import Selection, { SelectionProps, SelectionState } from './selection';
1414
import { Adjust, Dodge, Jitter, Stack, Symmetric } from '../../deps/f2-adjust/src';
1515
import { toTimeStamp } from '../../util/index';
@@ -123,7 +123,6 @@ class Geometry<
123123
const { attrController } = this;
124124

125125
const attrOptions = this.getAttrOptions(props);
126-
127126
attrController.create(attrOptions);
128127
}
129128

@@ -394,14 +393,13 @@ class Geometry<
394393

395394
_processData() {
396395
const { props } = this;
397-
const { data: originData, chart } = props;
396+
const { data: originData } = props;
398397

399398
const data = this._saveOrigin(originData);
400399
// 根据分类度量进行数据分组
401400
const records = this._groupData(data);
402401

403402
this._createAdjust();
404-
405403
// 根据adjust分组
406404
const dataArray = this._adjustData(records);
407405

packages/f2/src/components/guide/withGuide.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function<IProps extends GuideProps = GuideProps>(
4747
const percent = rateValue / 100;
4848
return percent;
4949
}
50-
// console.log('value', value, scale.scale(value));
50+
5151
return scale.scale(value);
5252
}
5353

@@ -70,7 +70,7 @@ export default function<IProps extends GuideProps = GuideProps>(
7070
const { props } = this;
7171
const { chart, coord, precise } = props;
7272
const { adjust } = chart;
73-
if (precise && adjust.type === 'dodge') {
73+
if (precise && adjust?.type === 'dodge') {
7474
const xScale = chart.getXScales()[0];
7575
const typeScale = chart.getColorScales()[0];
7676
this._numberic(record);
-14.6 KB
Loading

packages/f2/test/components/guide/preciseGuide.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('precise', () => {
1515
];
1616

1717
const { props } = (
18-
<Canvas context={context} pixelRatio={window.devicePixelRatio} animate={false}>
18+
<Canvas context={context}>
1919
<Chart data={data}>
2020
<Axis field="月份" />
2121
<Axis field="月均降雨量" />
@@ -49,7 +49,7 @@ describe('precise', () => {
4949
const chart = new Canvas(props);
5050
await chart.render();
5151

52-
await delay(50);
52+
await delay(100);
5353
expect(context).toMatchImageSnapshot();
5454
});
5555
});

0 commit comments

Comments
 (0)