SciProgCentre / plotly.kt

An interactive Kotlin wrapper for plotly visualization tools
https://sciprogcentre.github.io/plotly.kt/
Apache License 2.0
147 stars 21 forks source link

Javascript example histogram's data doesn't update #85

Closed gsteckman closed 1 year ago

gsteckman commented 2 years ago

In the js-demo, the histogram x.numbers are getting updated every 300 ms, with this code:

GlobalScope.launch { while (isActive) { x.numbers = List(500) { rnd.nextDouble() } delay(300) } }

However, in the browser window, the histogram does not get redrawn as expected.

On the trace demo, one of the trace's colors is randomly changing between magenta and blue every 500 ms, as expected.

This behavior was observed on both Firefox and Chrome, and with space.kscience:plotlykt-core-js:0.5.0.

altavir commented 2 years ago

Thanks for reporting, I think it was fixed in dev branch. I will check.

altavir commented 2 years ago

Reproduced. For some reason. DoubleArray works, but List of Doubles does not propagate an update.

altavir commented 2 years ago

I've finally found the problem. It was a convoluted number comparison problem that shows itself only in JS due to number specifics. It will be fixed with the new release of upstream.

altavir commented 2 years ago

Fixed in 0.5.1-dev-4