-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
First attempt at a click anywhere #5416
Conversation
@nicolaskruchten Any idea why the following happens when running
It looks like the build artifact has a weird encoding? (I am on Windows 10) Build: https://app.circleci.com/pipelines/github/plotly/plotly.js/2698/workflows/3daf50ac-fa3d-4b15-a0c5-838e0c413153/jobs/100591/artifacts |
And when running |
Also, is there a good place to add a demo? <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../plotly.js/dist/plotly.js"></script>
</head>
<body>
<div id="tester" style="width:600px;height:250px;"></div>
<script>
var TESTER = document.getElementById('tester');
Plotly.newPlot(TESTER, [{
x: [1, 2, 3, 4],
y: [4, 1, 3, 5],
mode: "lines+markers",
marker: {size: 12},
}], {
margin: { t: 0 },
clickmode: "event+anywhere"
});
TESTER.on('plotly_click', function(clickData) {
var x = clickData["points"][0]["x"];
Plotly.relayout(TESTER, {
shapes: [
{
type: "line",
x0: x,
y0: 0,
x1: x,
y1: 1,
yref: "paper",
line: {color: "RoyalBlue", width:3},
}
]
});
});
</script>
</body>
</html> |
Similar to #5382 |
Thanks for the new PR. |
src/components/fx/click.js
Outdated
|
||
// why do we get a double event without this??? | ||
if(evt.stopImmediatePropagation) evt.stopImmediatePropagation(); | ||
} | ||
}; | ||
}; |
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.
Please add a new line to the end of this file.
To catch syntax errors you could run
npm run test-syntax && npm run lint
Thanks for running them locally. |
Thanks for pointing that out. I have been in a hurry and must have missed that... again. Should I open another new PR to be able to stay in sync with the plotly:master? I guess I've to wait for your geo fix to pass to be able to run |
The bundles are fixed on master after #5426. |
Moved code to a new branch on my end to keep up with changes in master: PR is now at #5443 |
I unfortunately messed up the repository and had to recreate my PR.
This is a reference to #5138