Skip to content

scattergl: infinite loop when there's only 1 datapoint in trace #1173

@jessetabak

Description

@jessetabak

If I create a scattergl plot with only 1 xy datapoint it will get stuck in an infinite loop.
It occurs in the allFastTypesLikely(a) function, the inc variable is always 0. In a normal scatter plot it works fine.

Since it will hang your browser I'll include the code here instead of a codepen:

index.html:

<div id="graph" style="width: 600px; height:800px"></div>
<script src="https://cdn.plot.ly/plotly-latest.js"></script>

main.js:

var div = document.getElementById('graph');

var layout = {
    title: 'My Graph'
};

var traces = [
{
    x: [1],
    y: [4],
    type: 'scattergl',
    mode: 'markers',                         
    marker: {size:8}
}];


Plotly.newPlot(
    div,  
    traces,                                     
    layout);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions