Skip to content
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

Line plot and step plot draw wrong lines in output when changed via data[-1] #2352

Open
michaeltraxler opened this issue Jun 17, 2024 · 0 comments
Labels
bug Bug in code plot Related to plotting

Comments

@michaeltraxler
Copy link

michaeltraxler commented Jun 17, 2024

Wave SDK Version, OS

1.3.3 20240614125607
OpenSuSE Tumbleweed 20240613

Actual behavior

The plots produced by wave the wave plot_card type "line" and "step" produce in the output wrong lines from the first value to the new added value when using the online update of the data via card.data[-1] .

2024-06-17_01-55

Expected behavior

The horizontal line should be missing.

Steps To Reproduce

The code to reproduce:

from h2o_wave import main, app, Q, ui, data, run_on, on
import random
import time

@app('/')
async def serve(q: Q):
    if not q.client.initialized:

	q.page['example'] = ui.plot_card(
            box='1 1 4 4',
            title='Rate',
            data=data('time rate', -100, rows= []),
		     plot=ui.plot([ui.mark(type='line', x='=time', y='=rate', y_min=0)])
	)
        q.client.initialized = True
	await q.page.save()
        await update_rates(q)

    await q.page.save()

async def update_rates(q):
    card = q.page['example']
    i=100
    while True:
	card.data[-1] = [i, random.random()*100]
	await q.page.save()
	i=i+1
	await q.sleep(0.1)

Can this be fixed somehow?

Thanks, Michael

@michaeltraxler michaeltraxler added the bug Bug in code label Jun 17, 2024
@mturoci mturoci added the plot Related to plotting label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code plot Related to plotting
Projects
None yet
Development

No branches or pull requests

2 participants