grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
310 stars 199 forks source link

Support Hierarchical and Array of Keys #312

Open nibinqtl opened 3 years ago

nibinqtl commented 3 years ago

The main changes:

  1. Allow the key to be an array in the location data. For example:
    [ 
    {
    "key": "US",
    "latitude": 37.09024,
    "longitude": -95.712891,
    "name": "United States"
    },
    {
    "key": [
      "US.CA",
      "US-CA",
      "US_California"
    ],
    "latitude": 36.17,
    "longitude": -119.7462,
    "name": "California"
    },
    {
    "key": [
      "US.IA",
      "US-IA",
      "US_Iowa"
    ],
    "latitude": 42.0046,
    "longitude": -93.214,
    "name": "Iowa"
    },
    {
    "key": "Unknown",
    "latitude": 66,
    "longitude": 66,
    "name": "Unknown"
    }
    ]
  2. Support hierarchical keys with segments delimited by '.-_'. The longest match at a segment boundary wins. For example, with the location data above, a key of "US.CA.PaloAlto" will be matching "US.CA". "US-Unknown" will match "US".
  3. If the location data has an entry with key="unknown", this entry will be returned for any un-matched input data.
  4. Added a built-in location data file "world_regions", with 2 letter country code and provinces in China and states in the US.
  5. Made circle area (instead of radius) to be linear in data value.
  6. Added 'kMGTP' unit to the data value
CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: nibinqtl
:x: grafana user


grafana user seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

amotl commented 3 years ago

Hi @nibinqtl,

we kind of took over development with our canonical fork [1], you can find setup instructions at [2]. We are semi-actively maintaining this codebase and would appreciate your contribution there very much!

Eventually, we will integrate all of those accumulated improvements we are maintaining there back into mainline.

With kind regards, Andreas.

[1] https://github.com/panodata/grafana-map-panel [2] https://community.panodata.org/t/grafana-map-panel/121#setup