-
Notifications
You must be signed in to change notification settings - Fork 5
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
attach drag behaviour to event rectangle #115
attach drag behaviour to event rectangle #115
Conversation
}; | ||
} | ||
|
||
private shiftDraggedTimelineEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private shiftDraggedTimelineEvent( | |
private updateDraggedTimelineEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
repeat() | ||
); | ||
|
||
onDrag(eventRectangle: EventRectangle, event: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onDrag(eventRectangle: EventRectangle, event: any) { | |
onDrag(eventRectangle: EventRectangle, event: EventRectangleDragEvent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
private setupDrag() { | ||
if (this.eventRectangleEl) { | ||
const onDrag = drag() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use https://rxjs.dev/api/index/function/fromEventPattern in some way here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find, although I'm not sure that it will simplify the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created an issue to investigate #118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah not sure either, could be worth keeping it in mind. I used it for a Titan related POC to hook into the map events (I think).
scan( | ||
(acc, curr) => | ||
curr ? { ...curr, dy: acc.dy + curr.dy, dx: acc.dx + curr.dx } : acc, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could declutter this observable/scan by declaring the initial value in its own variable ie:
const dragSeed = {
dx: 0,
dy: 0,
id: null
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
projects/ngx-d3timeline/src/lib/content/event-rectangle.component.spec.ts
Show resolved
Hide resolved
…line into 114-attach-drag-behaviour-to-event-rectangle
closes #114