Our current implementation allows for the user to shrink their screen and the data is cached so that no further server calls will be needed. The array of 250 words with their sizes is cached and once the map component is finished rendering then we call the cloud with the updated canvas sizes but the words are still original. This is causing the words to collide on screen resize event. I looked at the algolrithm you created to draw the words but nothing obvious stands out. It seems as if the words array is cached in the alrogorithm and getting the same exact words a second time messes up the drawing of the words and they collide. Only if I get a fresh set of data from the server (which is identical) to the one that is cached then the words won't collide. Any pointers?
Hard to say without seeing a reproducible example. There shouldn’t be any issue recalculating a layout for a new canvas size. Perhaps your redraw code has a bug?
Our current implementation allows for the user to shrink their screen and the data is cached so that no further server calls will be needed. The array of 250 words with their sizes is cached and once the map component is finished rendering then we call the cloud with the updated canvas sizes but the words are still original. This is causing the words to collide on screen resize event. I looked at the algolrithm you created to draw the words but nothing obvious stands out. It seems as if the words array is cached in the alrogorithm and getting the same exact words a second time messes up the drawing of the words and they collide. Only if I get a fresh set of data from the server (which is identical) to the one that is cached then the words won't collide. Any pointers?