With our current implementation, our render invalidation (createSpectrogramElements) causes all the grid tiles to be destroyed and re-created.
At the moment, the only change that causes a render invalidation is the change in the grid size (e.g., through attribute changes, or initialization of the grid size).
Because grid sizes are now user-configurable with #148, render invalidation can be a lot of work for very large grid sizes.
To fix this, we should implement a diff algorithm that:
If the grid size has been decreased, hides (not destroy) the grid size delta
If the grid size has stayed the same, have not effect
If the grid size has increased, keep all the current grid tiles, and add more to the page (without destroying existing tiles)
Notes for implementor: We might be able to use Lits repeat directive with a subject key, so that if the subject is the same, it doesn't mutate the tile
With our current implementation, our render invalidation (
createSpectrogramElements
) causes all the grid tiles to be destroyed and re-created.At the moment, the only change that causes a render invalidation is the change in the grid size (e.g., through attribute changes, or initialization of the grid size).
Because grid sizes are now user-configurable with #148, render invalidation can be a lot of work for very large grid sizes.
To fix this, we should implement a diff algorithm that:
Notes for implementor: We might be able to use Lits
repeat
directive with asubject
key, so that if the subject is the same, it doesn't mutate the tile