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

Support Hierarchical and Array of Keys #106

Closed
wants to merge 53 commits into from

Conversation

nibinqtl
Copy link

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"
  }
]
  1. 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".
  2. If the location data has an entry with key="unknown", this entry will be returned for any un-matched input data.
  3. Added a built-in location data file "world_regions", with 2 letter country code and provinces in China and states in the US.
  4. Made circle area (instead of radius) to be linear in data value.
  5. Added 'kMGTP' unit to the data value

@amotl amotl closed this Jul 20, 2021
@amotl amotl deleted the branch grafana-toolbox:master July 20, 2021 18:32
@amotl
Copy link

amotl commented Aug 6, 2021

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
Copy link
Author

I just submitted #127

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.

6 participants