EQWorks / widget-studio

Widget-creating tool for charts, maps, tables, stats
https://eqworks.github.io/widget-studio/
2 stars 3 forks source link

[G2M] Map widget - separate map state from chart state; abstract map layer config object #42

Closed geoerika closed 2 years ago

geoerika commented 2 years ago

Changes:

  1. Activate map symbol, for now only in the case we have coords for POIs or a geo_ca key as a mapGroupKey - mvt layers for the last case will come in the next PR

  2. Separate valueKeys state for charts and maps by adding mapValueKeys to state and using it for map widget case

    • the reason for this is that map has an extra key in the mapValueKeys obj (mapVis), and state for mapVis is lost when switching between map and chart widget type. The easiest way to deal with this is to have the two states independent of each other, as it would anyway hard to infer, upon changing a key value in charts, whether this key would be used for radius or fill in the map.
    • valueKeys obj: { key: ..., agg: ... }
    • mapValueKeys obj: { key: ..., agg: ..., mapVis: ... } See record of how it works without state separation: https://user-images.githubusercontent.com/41120953/140615570-0d092ba7-3b70-45c6-82e0-3a971ca6cdaf.mov
  3. Separate groupKey state for charts and maps as well by adding mapGroupKey. The main reason would be that the groupKey values are not restricted in charts, whereas the mapGroupKey in maps can only be a geo key in maps (poi, fsa, postalcode, ct, etc.. type)

  4. The process of creating the map layer config object is now automatic, using the state and the config keys in the adapter/react-maps. This, most probably, still needs to be adjusted for other layers, which will be in the next PR.

github-actions[bot] commented 2 years ago

📚 Storybook preview (updated to f0a416801dd976fa6afb5629368aaf2b6793db2d)

geoerika commented 2 years ago

theres a hook dependency warning

squashed