Skip to content

Conversation

@kc-leung
Copy link

@kc-leung kc-leung commented May 26, 2021

  • Added geo-province.json data file
  • Added geo-province-value.json data file
  • Added geo-province-city.json data file
  • Added Intelligence map component & storybook

@kc-leung kc-leung changed the title [WIP] Intelligence map [G2M] Intelligence map May 26, 2021
@kc-leung kc-leung force-pushed the intelligence-map branch 2 times, most recently from d824419 to ff97faa Compare May 26, 2021 16:01
@kc-leung kc-leung changed the title [G2M] Intelligence map [WIP] Intelligence map May 26, 2021
@kc-leung kc-leung changed the title [WIP] Intelligence map [G2M] Intelligence map May 31, 2021
Copy link
Contributor

@woozyking woozyking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if intelligence-map is just a single file component, then there's no need to nest it within a directory.

look at it from an usage perspective (suppose in storybook):

import IntelligenceMap from '../src/components/intelligence-map'

so in this case, the file structure can either be:

./src
|-- components/
|---- intelligence-map.js

or if it grows in complexity where additional modules are needed:

./src
|-- components/
|---- intelligence-map/
|------ index.js <-- main entrypoint
|------ utils.js
|------ hooks.js
|------ some-support-component.js

the import remains the same even if we change the source structure from the first (module) to the second (sub-package) case.

Copy link
Contributor

@geoerika geoerika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you used the generic map by copying it in your code. Change this by importing the already existing component in your file and pass only the props you need to it. Look at my GeoCohort map, for example you do not use any legend, no need to pass any legend to it. It is designed to work without that. I believe you use your own onHover event, pass that one, and so on. All the props I passed to the generic map in the GeoCohortMap are needed. So you do the same, clean up the props for the Deck core layer for your map.

return toolTipText
}

const useGeoJsonCentroidData = (geoJson) => {
Copy link
Contributor

@geoerika geoerika Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, as above, add this to the hooks folder in the index file and import it from there directly into your InteligenceMap comp file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is only testing purpose for the sample data in storybook which is a parsed based on coordinates version compared to pixel based data in LOCUS atm. A new function will to need to be implemented in LOCUS component to get the Centroid coordinates of each provinces since the data for intelligenceMap in LOCUS currently is parsed and used differently to generate the map.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to look closer, but getting the centroid of each province in a list should be part of the map, it has no place in Locus.... we have the province vector file in react-maps so you can calculate the centroid here as well. This shouldn't be done in Locus. think about it. Only the data values associate with these centroids should be provided from outside react-maps. Will look into it later a bit more.

@woozyking
Copy link
Contributor

file in conflict
conflict

@kc-leung kc-leung changed the title [G2M] Intelligence map [WIP] Intelligence map Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants