Skip to content

Unexpect fill connection rendering with extreme values #3147

Closed
@jonmmease

Description

@jonmmease

Plotlyjs translation of plotly/plotly.py#1008

When creating a rectangle using 4 scatter points (3 line segments) and fill: "toself" the connecting edge of the rectangle behaves oddly when the rectangle is much much larger than the viewport.

CodePen: https://codepen.io/jonmmease/pen/WaapQa

var yval = 1e4
fig = {
  "data": [
    {
      "fill": "toself",
      "type": "scatter",
      "x": [
        1,
        10,
        10,
        1
      ],
      "y": [
        yval,
        yval,
        -yval,
        -yval
      ]
    }
  ],
  "layout": {
    "yaxis": {
      "range": [
        -0.5,
        0.5
      ]
    }
  }
}

Plotly.newPlot('div1', fig);

newplot-1

But it looks as expected with yval is 1e2:
newplot-2

It also work as expected with scattergl traces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions