plotly.kt icon indicating copy to clipboard operation
plotly.kt copied to clipboard

Javascript example histogram's data doesn't update

Open gsteckman opened this issue 4 years ago • 4 comments

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.

gsteckman avatar Oct 31 '21 18:10 gsteckman

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

altavir avatar Nov 01 '21 07:11 altavir

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

altavir avatar Nov 01 '21 08:11 altavir

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 avatar Nov 02 '21 07:11 altavir

Fixed in 0.5.1-dev-4

altavir avatar Nov 02 '21 07:11 altavir