Skip to content

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

@jashsayani

Description

@jashsayani

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions