Skip to content

Commit 2827283

Browse files
committed
Remove Plotly.Plots.resize call
(It was causing some users errors)
1 parent 663a386 commit 2827283

File tree

1 file changed

+44
-51
lines changed

1 file changed

+44
-51
lines changed

js/src/Figure.js

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -762,59 +762,52 @@ var FigureView = widgets.DOMWidgetView.extend({
762762
var initialTraces = _.cloneDeep(this.model.get("_data"));
763763
var initialLayout = _.cloneDeep(this.model.get("_layout"));
764764

765-
Plotly.newPlot(that.el, [], {
766-
'xaxis': {'showgrid': false, 'showticklabels': false, 'zeroline': false},
767-
'yaxis': {'showgrid': false, 'showticklabels': false, 'zeroline': false}
768-
}).then(function () {
769-
Plotly.Plots.resize(that.el).then(function () {
770-
Plotly.newPlot(that.el, initialTraces, initialLayout).then(
771-
function () {
772-
// Plotly.Plots.resize(that.el);
773-
774-
// ### Send trace deltas ###
775-
// We create an array of deltas corresponding to the new
776-
// traces.
777-
that._sendTraceDeltas(trace_edit_id);
778-
779-
// ### Send layout delta ###
780-
that._sendLayoutDelta(layout_edit_id);
781-
782-
// Wire up plotly event callbacks
783-
that.el.on("plotly_restyle",
784-
function (update) {
785-
that.handle_plotly_restyle(update)
786-
});
787-
that.el.on("plotly_relayout",
788-
function (update) {
789-
that.handle_plotly_relayout(update)
790-
});
791-
that.el.on("plotly_update",
792-
function (update) {
793-
that.handle_plotly_update(update)
794-
});
795-
that.el.on("plotly_click",
796-
function (update) {
797-
that.handle_plotly_click(update)
798-
});
799-
that.el.on("plotly_hover",
800-
function (update) {
801-
that.handle_plotly_hover(update)
802-
});
803-
that.el.on("plotly_unhover",
804-
function (update) {
805-
that.handle_plotly_unhover(update)
806-
});
807-
that.el.on("plotly_selected",
808-
function (update) {
809-
that.handle_plotly_selected(update)
810-
});
811-
that.el.on("plotly_doubleclick",
812-
function (update) {
813-
that.handle_plotly_doubleclick(update)
814-
});
765+
Plotly.newPlot(that.el, initialTraces, initialLayout).then(
766+
function () {
767+
// Plotly.Plots.resize(that.el);
768+
769+
// ### Send trace deltas ###
770+
// We create an array of deltas corresponding to the new
771+
// traces.
772+
that._sendTraceDeltas(trace_edit_id);
773+
774+
// ### Send layout delta ###
775+
that._sendLayoutDelta(layout_edit_id);
776+
777+
// Wire up plotly event callbacks
778+
that.el.on("plotly_restyle",
779+
function (update) {
780+
that.handle_plotly_restyle(update)
781+
});
782+
that.el.on("plotly_relayout",
783+
function (update) {
784+
that.handle_plotly_relayout(update)
785+
});
786+
that.el.on("plotly_update",
787+
function (update) {
788+
that.handle_plotly_update(update)
789+
});
790+
that.el.on("plotly_click",
791+
function (update) {
792+
that.handle_plotly_click(update)
793+
});
794+
that.el.on("plotly_hover",
795+
function (update) {
796+
that.handle_plotly_hover(update)
797+
});
798+
that.el.on("plotly_unhover",
799+
function (update) {
800+
that.handle_plotly_unhover(update)
801+
});
802+
that.el.on("plotly_selected",
803+
function (update) {
804+
that.handle_plotly_selected(update)
805+
});
806+
that.el.on("plotly_doubleclick",
807+
function (update) {
808+
that.handle_plotly_doubleclick(update)
815809
});
816810
});
817-
});
818811
},
819812
/**
820813
* Purge Plotly.js data structures from the notebook output display

0 commit comments

Comments
 (0)