editor icon indicating copy to clipboard operation
editor copied to clipboard

Redundant re-rendering on initial load for some specs

Open saulshanabrook opened this issue 4 years ago • 1 comments

I noticed that for some charts, like the interactive_concat_layer Vega Lite example, on the initial load it re-renders the view unnecessarily.

The reason is that the componentDidUpdate for the renderer does a deep equality check and I noticed it is finding the previous vegaSpec different from the current one. However, the only difference between them is that some of the objects values are undefined, and the current library to do deep equality checking finds these as different (epoberezkin/fast-deep-equal#127). I assume that in this case, two vega specs are equal, even if some have keys map to undefined. If I serialize both specs to JSON, the JSON is equal.

saulshanabrook avatar Aug 04 '21 17:08 saulshanabrook

Yes, I have seen this issue before but forgot to file an issue.

domoritz avatar Aug 05 '21 04:08 domoritz