Skip to content

relayout not working in certain cases #1009

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
fresheneesz opened this issue Oct 5, 2016 · 3 comments
Closed

relayout not working in certain cases #1009

fresheneesz opened this issue Oct 5, 2016 · 3 comments
Labels
bug something broken

Comments

@fresheneesz
Copy link

I have this code that fails to relayout the width and height when an annotation is present:

http://codepen.io/anon/pen/RGxagY?editors=102

<head>
  <script src="https://cdn.plot.ly/plotly-1.0.0.min.js"></script>
</head>
<body>
  <div id="graph"></div>
</body>
<script>
var x = document.createElement('div')

var layout = {annotations: [
    {text:'My Annotation', arrowcolor: 'orange', font:{color:'orange'},
     x:2, y: 2
    }
  ]
}

Plotly.newPlot(x, [{x: [1,2,3],y: [1,2,3],type: 'scatter'}], layout)

document.body.appendChild(x)

layout.width = 100
layout.height = 100

Plotly.relayout(x,layout)
</script>
@fresheneesz
Copy link
Author

Tested on v1.17.1

@etpinard etpinard added the bug something broken label Oct 5, 2016
@etpinard
Copy link
Contributor

etpinard commented Oct 5, 2016

Thanks for the report

I believe this problem is related to #537 - but this requires confirmation.

In the meantime, here's a workaround http://codepen.io/etpinard/pen/kkvEpJ

@etpinard
Copy link
Contributor

etpinard commented Nov 4, 2016

Seems to be working now fine in 1.19.2

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

2 participants