BUG-Blank chart after too much changes
FlorianJacta opened this issue · 5 comments
Description
If a chart's data changes a lot, the corresponding chart will go blank and will not return to its normal behavior without refreshing the page.
How to reproduce
from taipy.gui import Gui
from math import cos, exp
value = 10
page = """
Markdown
# Taipy *Demo*
Value: <|{value}|>
<|{value}|slider|>
<|{compute_data(value)}|chart|>
"""
def compute_data(decay:int)->list:
return [cos(i/6) * exp(-i*decay/600) for i in range(10_000)]
Gui(page).run()
Change the slider a lot of times, play with it. The chart should at one point be blank and it is not possible to see the data even by changing the slider again. The user has to refresh the page.
Expected behavior
When the chart goes blank, Taipy should try to make it work
Screenshots
Runtime environment
Taipy GUI: 2.3.1
I've been trying to reproduce this problem with Taipy GUI 3.0, watching closely the interaction between the client, that triggers the action of recomputing the data sent to the Chart control, and the server that does the update request.
No errors were detected, and after a while (the time it takes to process all the consecutive change requests from the slider), the chart updates properly. This can, however, take time: there are lots of computations done on the server to deliver the new data.
This delay is obviously caused by the fact that the callback takes a while, preventing immediate feedback on the page. And this is exactly why Taipy recommends that you don't spend too much time on the server responding to front-end events.
There's nothing Taipy GUI can do on its own to fix that delay.
A real problem would occur should the page never update, which I cannot reproduce.
I'm willing to close this issue at this point, after your acknowledgment.
I understand.
But I cannot reproduce that behavior.
Are you using Taipy 3.0.0.dev*, and would you consider a screen share of that sometime?
I am using today version of Taipy:
taipy-gui 3.0.0.dev3
The example works best with less points:
from taipy.gui import Gui
from math import cos, exp
value = 10
page = """
Markdown
# Taipy *Demo*
Value: <|{value}|>
<|{value}|slider|>
<|{compute_data(value)}|chart|>
"""
def compute_data(decay:int)->list:
return [cos(i/6) * exp(-i*decay/600) for i in range(100)]
Gui(page).run()