The issue is that each time Refresh() runs, all existing drawings are removed, and unless the conditions are re-triggered exactly, my rectangles are lost.
Since the DOM doesn't use OnBarUpdate(), I can't use a more persistent drawing strategy.
Is there any way to preserve the drawings across Refresh() calls, or re-draw them automatically?
Here's an example of the code inside Refresh():
Comment