Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create emit before we use it; make move accept an event. #84

Merged
merged 3 commits into from
Jun 10, 2021
Merged

Conversation

@Fil Fil requested a review from mbostock March 12, 2021 14:27
@Fil Fil mentioned this pull request Apr 27, 2021
4 tasks
src/brush.js Outdated
@@ -227,7 +227,7 @@ function brush(dim) {
function tween(t) {
state.selection = t === 1 && selection1 === null ? null : i(t);
redraw.call(that);
emit.brush();
emit.brush(event);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn’t feel appropriate to use the event here because time has passed—we’re now inside a transition.

@mbostock mbostock merged commit 9741b14 into main Jun 10, 2021
@mbostock mbostock deleted the issue-83 branch June 10, 2021 00:02
@lauvigne
Copy link

lauvigne commented Jan 24, 2022

Hello,

with 3.0.0, I have this following error,
ERROR TypeError: emitter(...).moved is not a function at SVGGElement.touchmoved (brush.js:581:1)
And
core.js:6479 ERROR TypeError: emitter(...).ended is not a function at SVGGElement.touchended (brush.js:585:1)

Is it a similar problem of this fix ?

on :
`function touchmoved(event) {
emitter(this, arguments).moved(event);
}

function touchended(event) {
emitter(this, arguments).ended(event);
}`

@Fil
Copy link
Member Author

Fil commented Jan 24, 2022

Hard to tell—can you give a bit more context?

@lauvigne
Copy link

I have this error on a brush with a filter.
Theses errors arrive on mobile with touch event, not in my code but in the brush.js.

`this.brush = d3Brush
.brush()
.filter(event => event.touches?.length === 2)
.extent([
[0, 0],
[this.context.width, this.height],
])
.on('end', this.brushEnded.bind(this));

this.graphique.append('g').attr('class', 'brush').attr('id', this.indexGraphe).call(this.brush);
`

I will try to do with your sample to reproduce.

Thanks

@Fil
Copy link
Member Author

Fil commented Jan 24, 2022 via email

@lauvigne
Copy link

OK ! I understood...So It's perhaps a problem with this filter.
Thanks Fil.

I will investigate on a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants