-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fire perspective-config-update
event on D3FC legend and axis events
#1748
Conversation
|
||
pinned = unpinNodeFromTopRight(node, pinned); | ||
drag.on("end", function (event) { |
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.
👍 Thanks for making this update. It did cross my mind that we probably want to fire the event after the user stops updating the position, but wasn't 100% sure how to do that here.
// Await the table load | ||
await viewer.getTable(); | ||
|
||
viewer.restore({ |
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.
viewer.restore({ | |
await viewer.restore({ |
Good catch on the test above. Probably want to do the same 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.
fixed
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.
Actually this was more nefarious than it appears - turns out that this test had a similar issue, mouse.down()
was called to initiate the drag in the test, but not mouse.up()
which fires the drag end event. The test "worked" by asserting the perspective-config-update
which was fired by restore()
.
@@ -125,6 +125,7 @@ utils.with_server({}, () => { | |||
await page.mouse.move(start.x, start.y); | |||
await page.mouse.down(); | |||
await page.mouse.move(target.x, target.y); | |||
await page.mouse.up(); |
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.
d'oh
Rebased and fixed-up version of #1732. Fixes #1729. Changes from #1732
drag
toend
. For many apps which use<perspective-viewer>
, the operations which listen for theperspective-config-update
event may be relatively expensive, e.g. sending an event to a server, so we want to generally conserve these to applicable changes. With this change, only 1 event is triggered when the drag operation completes, as opposed to 100s while the legend is moved.scatter.html
andtreemap.html
I think was introduced in Virtual column selector #1722 - this PR does not modify these results (as validated in the reference HTML and PNG output I have from previous runs), so theseresults.json
changes are reverted..restore()
, then clicks on the parent element of the axis label which has the click event listener. The result is, the event for the axis switch is not fired, but the.restore()
methods which is not awaited sometimes does, causing this test to flake. Fixed byawait
-ingrestore()
and changing the click selector to pick the label itself.