Quick Search Data Changes Colors
PriyaDoIT opened this issue · 9 comments
This issue was found after release of v1.3.0 to chicago.opengrid.io in production
Originally entered by @reve0716
When grid auto refreshes upon movement the data points changes colors – This actions happens only for Quick Search:
(business_licenses 60602 or 60624) and (business_licenses)
Zooming in and out (using icons and mouse) or moving around the grid.
This has been fixed in the Smart Chicago service repo.
The behavior is slightly different instead of changing to a different color upon each movement, it now changes between two colors when zooming in/ out or moving the grid based off data-sets.
Example:
business_licenses 60602 - color changes between the two colors of blue and pink.
building_permits 60604 and building_permits - color changes between blue and gold.
building_violations - color changes between red and gold.
food_inspections 60601 - color changes between Orange and sky blue.
THis is interesting. Because this does not happen everytime. I will look into this today and see if i can figure out if there is an edgecase causing the process not to grab the cached color.
-David
Hello @nfspeedypur is there any update on this? Thanks
Update from @nfspeedypur
I believe I have found the cause of this issue. However the issue is not easily resolved.
Problem: Quick Search Data Changes Colors
Cause: The OpenGrid.io service layer code is designed to generate the dataset's metadata on start up. This is due to the fact that we are not storing OG related meta data on Plenar.io, which is our only database. This means that each server that is running the service layer code has to generate it's own metadata. The dataset to color mapping is done randomly, which means that each server could have its own mappings. What I don't understand completely is why the standard search does not see this same issue. My only guess is that the standard 'Find Data' search is using the UI layer's cached color for the dataset. I am not sure why the quick search does not use that same value on the UI side.
Possible Solutions:
• I can update the OG service side code to loop through a preset list of colors, in a given order, when assigning a color to a dataset. This would mean that color mappings have a much better chance of being the same. However there is no guarantee that they will be the same.
• I can update the OG code to write this meta data to a central data store, mySQL or DynamoDB. However this update would be much more significant effort as the project does not currently have that integration.
-David
hello @nfspeedypur we would like to proceed with your first solution above.
I have deployed the first solution to production. I not longer see this issue. Tell me if you see this issue come back.
I will begin testing in production.
@PriyaDoIT and @nfspeedypur the data looks good.