Skip to content

Unexpect fill connection rendering with extreme values #3147

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

Closed
jonmmease opened this issue Oct 24, 2018 · 1 comment · Fixed by #3696
Closed

Unexpect fill connection rendering with extreme values #3147

jonmmease opened this issue Oct 24, 2018 · 1 comment · Fixed by #3696
Labels
bug something broken

Comments

@jonmmease
Copy link
Contributor

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.

@alexcjohnson
Copy link
Collaborator

Thanks @jonmmease - This is happening because we prune away one of those far-offscreen points, since it doesn't affect the visible path. But you're right, to support fills we need to always include the very first and last points.

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

Successfully merging a pull request may close this issue.

2 participants