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

subplot duplication in overlayed axis #2347

Closed
vinipitta opened this issue Feb 7, 2018 · 3 comments
Closed

subplot duplication in overlayed axis #2347

vinipitta opened this issue Feb 7, 2018 · 3 comments
Labels
bug something broken

Comments

@vinipitta
Copy link

vinipitta commented Feb 7, 2018

Scenario: I have a plot with two y axis overlayed where trace data is loaded asynchronously so there is no guarantee of order. When a trace that belongs to the y axis overlaying the main y axis is loaded first, the plot generate 2 set o graphic elements on SVG representing the trace: the first as a subplot and the second as an overplot of the mainplot.

Here is a live example: https://codepen.io/vinipitta/pen/WMGdbx
(Just drag the defective trace (trace 1) to see the duplicated trace remain still while a copy moves on the right y axis.)

Looks like since there is no trace loaded in the main y axis, the plotinfo.mainplot is undefined when the trace is added to the overlayed axis generating a subplot. When a trace is added to the mainplot, the overplot group is populated with the previous trace and the former subplot ins't removed.

function makeSubplotLayer(plotinfo) {
    var plotgroup = plotinfo.plotgroup;
    var id = plotinfo.id;
    var xLayer = constants.layerValue2layerClass[plotinfo.xaxis.layer];
    var yLayer = constants.layerValue2layerClass[plotinfo.yaxis.layer];

    if(!plotinfo.mainplot) {

The simplest workaround is to set the layout.yaxis.overlaying or layout.yaxis2.overlaying based on where the first loaded trace belongs to.

This issue seems related to: #2227

@alexcjohnson alexcjohnson added the bug something broken label Feb 7, 2018
@alexcjohnson
Copy link
Collaborator

Thanks for the report. This specific manifestation indeed came in with #2227 though I suspect you could have caused the same failure in other ways before that.

@etpinard
Copy link
Contributor

etpinard commented Oct 4, 2018

This seems to be fixed using 1.41.3

image


Related: #3074

@alexcjohnson
Copy link
Collaborator

Seems to have been fixed in fact in v1.39.3 - presumably by #2831 - 🏆 @etpinard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants