Skip to content

relayout() fails when adding array item object with constructor #1563

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
fhurta opened this issue Apr 7, 2017 · 4 comments
Closed

relayout() fails when adding array item object with constructor #1563

fhurta opened this issue Apr 7, 2017 · 4 comments

Comments

@fhurta
Copy link
Contributor

fhurta commented Apr 7, 2017

I upgraded plotly.js from 1.17.1 to 1.25.2 and started facing strange behavior when adding shapes into graph programmatically (after newPlot()).

I use Typescript and the shape object I pass into relayout() function is defined as a class in Typescript. The details are not much relevant, I put together a sample to reproduce the misbehavior by simply wrapping the object with Object.create() (Actually it is for images, not shapes, but id does not matter). Please see here http://codepen.io/exavier/pen/RpzRJY?editors=0011

In relayout() it comes to check manageArrays.isAddVal(vi), which in turn does check isPlainObject(val) where the failing check is Object.getPrototypeOf(obj) === Object.prototype.

@etpinard
Copy link
Contributor

etpinard commented Apr 7, 2017

Thanks for bringing this up.

Related to #1405

@fhurta
Copy link
Contributor Author

fhurta commented Apr 10, 2017

Thanks.
Just to choose right workaround - as #1405 status is 'discussion needed' since Feb 22, am I right thinking it is not going to be fixed anytime soon?

@etpinard
Copy link
Contributor

@fhurta correct, this issue is likely not going to be resolved anytime soon.

@etpinard
Copy link
Contributor

... and I'm actually going to merge this ticket with #1405 as it's really two reports of the same issue.

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

No branches or pull requests

2 participants