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

add Plotly.deleteActiveShape command #6679

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions draftlogs/6679_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- add Plotly.deleteActiveShape command [[#6679](https://github.com/plotly/plotly.js/pull/6679)]
2 changes: 1 addition & 1 deletion src/components/shapes/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ function eraseActiveShape(gd) {

delete gd._fullLayout._activeShapeIndex;

Registry.call('_guiRelayout', gd, {
return Registry.call('_guiRelayout', gd, {
shapes: list
});
}
Expand Down
6 changes: 6 additions & 0 deletions src/plot_api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ exports.deleteFrames = main.deleteFrames;
exports.animate = main.animate;
exports.setPlotConfig = main.setPlotConfig;

var getGraphDiv = require('../lib/dom').getGraphDiv;
var eraseActiveShape = require('../components/shapes/draw').eraseActiveShape;
exports.deleteActiveShape = function(gd) {
return eraseActiveShape(getGraphDiv(gd));
};

exports.toImage = require('./to_image');
exports.validate = require('./validate');
exports.downloadImage = require('../snapshot/download');
Expand Down