Forum How do I...?

jquery :: plotly failure

acowie
Hi,

I am using the plotly.js library to render graphs in the document. This is failing with a javascript error as follows:-

http://localhost:57915/lib/plotly/dist/plotly.min.js:7: error: unexpected token identifier("devicePixelRatio")

I assume that when it queries for the devicePixelRatio that Prince does not implement this and hence it fails. Or do I need to set something?

Thanks.
acowie
Hi. Does anyone know if their is a work-around for this? If not, then I will begin to look for alternatives. Thanks.
mikeday
Do you have a public link to the plotly.js script?
acowie
Thanks for getting back on this.

This page gives details of the CDN links available: https://plot.ly/javascript/getting-started/

e.g. <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>

There is a hello world example on the page as well.

Edited by acowie

acowie
deleted

Edited by acowie

mikeday
Unfortunately it appears to be using JavaScript getter accessor syntax, which Prince does not support yet.
acowie
OK. Thanks. At least I know for sure now and can look for alternatives. Much appreciated.
mikeday
We will add support for the accessor syntax to the roadmap, as accessor properties can already be created using the Object.defineProperty method.