Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting a "weight" to Map in new "non-interactive" mode #18

Open
jashsayani opened this issue Jan 31, 2021 · 0 comments
Open

Allow setting a "weight" to Map in new "non-interactive" mode #18

jashsayani opened this issue Jan 31, 2021 · 0 comments

Comments

@jashsayani
Copy link

What?

Allow setting a weight to each continent (70% North America & EU; 10% Africa; 20% Asia, etc). This can be done in a new "non-interactive" view-only mode where map is displayed.

Why?

Simple On/Off can convey 1 dimension of information. But having a "weight" on each continent can allow the map to convey much more information.

Proposal

const myData = {
  'na': 0.7,
  'eu': 0.7,
  'sa': 0.45,
  'af': 0.1,
  'as': 0.5,
  'oc': 0.5
};

<WorldMap
  multiple={ true }
  nonInteractive={ true }
  selected = { myData }
/>

NOTE: Weight would require (1) multiple = true (2) nonInteractive = true; only then selected can be a complex object with continent : weight.

This can display something like:

Screen Shot 2021-01-30 at 9 05 14 PM

Implementation

This is pretty easy. If the multiple and nonInteractive props are true, then parse the selected as continent : weight object; and set weight as CSS opacity on each continent. Default value can be 0.1 if weight is undefined.

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

No branches or pull requests

1 participant