8000 Images: Call Images.draw in plot step and while dragging · upperwal/plotly.js@c2636ba · GitHub
[go: up one dir, main page]

Skip to content

Commit c2636ba

Browse files
committed
Images: Call Images.draw in plot step and while dragging
1 parent 28a44b3 commit c2636ba

File tree

5 files changed

+6
-2
lines changed

5 files changed

+6
-2
lines changed

src/plot_api/plot_api.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var Fx = require('../plots/cartesian/graph_interact');
2424
var Color = require('../components/color');
2525
var Drawing = require('../components/drawing');
2626
var ErrorBars = require('../components/errorbars');
27+
var Images = require('../components/images');
2728
var Legend = require('../components/legend');
2829
var RangeSlider = require('../components/rangeslider');
2930
var RangeSelector = require('../components/rangeselector');
@@ -301,6 +302,7 @@ Plotly.plot = function(gd, data, layout, config) {
301302
// be set to false before these will work properly.
302303
function finalDraw() {
303304
Shapes.drawAll(gd);
305+
Images.draw(gd);
304306
Plotly.Annotations.drawAll(gd);
305307
Legend.draw(gd);
306308
RangeSlider.draw(gd);

src/plotly.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ exports.ErrorBars = require('./components/errorbars');
4949
exports.Annotations = require('./components/annotations');
5050
exports.Shapes = require('./components/shapes');
5151
exports.Legend = require('./components/legend');
52+
exports.Images = require('./components/images');
5253
exports.ModeBar = require('./components/modebar');
5354

5455
exports.register = function register(_modules) {

src/plots/cartesian/dragbox.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
520520

521521
redrawObjs(fullLayout.annotations || [], Plotly.Annotations);
522522
redrawObjs(fullLayout.shapes || [], Plotly.Shapes);
523+
redrawObjs(fullLayout.images || [], Plotly.Images);
523524
}
524525

525526
function doubleClick() {

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ plots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData) {
781781

782782
// TODO register these
783783
// Legend must come after traces (e.g. it depends on 'barmode')
784-
var moduleLayoutDefaults = ['Fx', 'Annotations', 'Shapes', 'Legend'];
784+
var moduleLayoutDefaults = ['Fx', 'Annotations', 'Shapes', 'Legend', 'Images'];
785785
for(i = 0; i < moduleLayoutDefaults.length; i++) {
786786
_module = moduleLayoutDefaults[i];
787787

src/traces/heatmap/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
var d3 = require('d3');
1313

1414
module.exports = function style(gd) {
15-
d3.select(gd).selectAll('image')
15+
d3.select(gd).selectAll('.hm image')
1616
.style('opacity', function(d) {
1717
return d.trace.opacity;
1818
});

0 commit comments

Comments
 (0)
0