Skip to content

Commit c47747a

Browse files
committed
Remove scroll package
1 parent 8073e74 commit c47747a

3 files changed

Lines changed: 9 additions & 19 deletions

File tree

package-lock.json

Lines changed: 3 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"pub-sub-es": "~1.2.1",
3939
"regl": "~1.3.13",
4040
"regl-line": "~0.1.4",
41-
"scroll-speed": "flekschas/scroll-speed",
4241
"with-raf": "~1.1.1"
4342
},
4443
"peerDependencies": {
@@ -52,7 +51,7 @@
5251
"@babel/preset-env": "^7.8.4",
5352
"@rollup/plugin-commonjs": "^11.0.2",
5453
"@rollup/plugin-json": "^4.0.2",
55-
"@rollup/plugin-node-resolve": "^7.1.0",
54+
"@rollup/plugin-node-resolve": "^7.1.1",
5655
"acorn": "^6.0.4",
5756
"babel-loader": "^8.0.4",
5857
"babel-plugin-lodash": "^3.3.4",

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import withRaf from 'with-raf';
66
import * as mat4 from 'gl-matrix/mat4';
77
import * as vec4 from 'gl-matrix/vec4';
88
import createLine from 'regl-line';
9-
import createScroll from 'scroll-speed';
109

1110
import BG_FS from './bg.fs';
1211
import BG_VS from './bg.vs';
@@ -913,6 +912,10 @@ const createScatterplot = ({
913912
else camera.lookAt([...initialTarget], initialDistance, initialRotation);
914913
};
915914

915+
const wheelHandler = () => {
916+
drawRaf();
917+
};
918+
916919
const init = () => {
917920
updateViewAspectRatio();
918921
initCamera();
@@ -928,12 +931,9 @@ const createScatterplot = ({
928931
width: 1,
929932
is2d: true
930933
});
931-
scroll = createScroll(canvas);
932934

933935
// Event listeners
934-
scroll.on('scroll', () => {
935-
drawRaf();
936-
});
936+
canvas.addEventListener('wheel', wheelHandler);
937937

938938
// Buffers
939939
normalPointsIndexBuffer = regl.buffer();

0 commit comments

Comments
 (0)