ham-systems / temperature-map-gl

Minimalist heat map Javascript library using WebGL
MIT License
16 stars 5 forks source link

Update points value -> WARNING: Too many active WebGL contexts. Oldest context will be lost. #3

Closed frjariello closed 2 years ago

frjariello commented 2 years ago

Hi, first, very thanks for sharing your great work. I would like to be able to update the graph when the temperature values change, or in any case every few minutes, so from the html I recall your js again, but I have two problems connected to each other. The first is that the written values overlap, and the second, (more important) is that after about ten updates in the console I have WARNING: Too many active WebGL contexts. Oldest context will be lost. I tried to figure out how to handle it, with loseContext / restoreContext, but unfortunately I couldn't. Can you help me? Thanks anyway.

ekchatzi commented 2 years ago

@frjariello doesn't the method set_points followed by a draw() work for updating the values?

it shouldn't create more WebGL contextes. It should just update the one it already has.

frjariello commented 2 years ago

Hi, yes you are right, calling set_points and then draw works perfectly 🙂 Thanks!