Skip to content

Commit

Permalink
Merge pull request #6679 from plotly/eraseActiveShape-command
Browse files Browse the repository at this point in the history
add `Plotly.deleteActiveShape` command
  • Loading branch information
archmoj committed Jul 24, 2023
2 parents 149c895 + 5c9a7c9 commit e0e79b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit e0e79b4

Please sign in to comment.