Skip to content

Commit

Permalink
feat: 依赖scale 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cycgit committed Jul 17, 2020
1 parent 77c440f commit d55d316
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
},
"dependencies": {
"@antv/adjust": "~0.1.1",
"@antv/scale": "^0.3.1",
"@antv/scale": "~0.3.2",
"@antv/util": "~2.0.6",
"@babel/runtime": "^7.7.7",
"@types/hammerjs": "^2.0.36",
Expand Down
4 changes: 3 additions & 1 deletion test/unit/interaction/pan-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ describe('chart pan', function() {

const hBar = chart.get('_horizontalBar');
const highlightLine = hBar.get('children')[1];
expect([ highlightLine.attr('x1'), highlightLine.attr('x2') ]).toEqual([ 125.65473054584703, 309.78315654553865 ]);

expect(highlightLine.attr('x1')).toBeCloseTo(125.65473054584703, 2);
expect(highlightLine.attr('x2')).toBeCloseTo(309.78315654553865, 2);

setTimeout(() => {
const interaction = chart._interactions.pan;
Expand Down
5 changes: 3 additions & 2 deletions test/unit/interaction/pinch-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ describe('Pinch', function() {
pinch.process(eventObj);
const xScale = chart.getXScale();

expect(xScale.min).to.equal(2.1459594373204514);
expect(xScale.max).to.equal(18.08442097578199);

expect(snapEqual(xScale.min, 2.1459594373204514)).to.be.true;
expect(snapEqual(xScale.max, 18.08442097578199)).to.be.true;

pinch.end(eventObj);
expect(pinch.currentPinchScaling).to.be.null;
Expand Down

0 comments on commit d55d316

Please sign in to comment.