grafana-toolbox / panodata-map-panel

Map Panel for Grafana with improved convenience, robustness and features. Friendly fork of the original Grafana Worldmap Panel. Currently not maintained, but verified to work up to Grafana 9.
https://community.panodata.org/t/grafana-map-panel/121
GNU Affero General Public License v3.0
88 stars 31 forks source link

Support Hierarchical and Array of Keys #106

Closed nibinqtl closed 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
amotl commented 3 years ago

Dear Bin,

thanks a stack for your contribution.

While refurbishing this repository recently and renaming the default branch, it looks like this PR got closed. Apologies. I am still wondering why, because other PRs also survived this action.

However, I just wanted to respond to the submission of your patch anyway. Sorry for the late reply.

I still believe your contribution is very valuable. However, when looking at the diff, it looks like it diverged from a very early version of the original Worldmap panel. As this repository already progressed on many details, can I humbly ask you to submit a patch which applies more cleanly to the current development head?

Thank you very much and with kind regards, Andreas.

nibinqtl commented 3 years ago

I just submitted https://github.com/panodata/panodata-map-panel/pull/127