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 #312

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

nibinqtl
Copy link

@nibinqtl nibinqtl commented May 8, 2021

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

@CLAassistant
Copy link

CLAassistant commented May 8, 2021

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.

✅ nibinqtl
❌ 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.

@nibinqtl nibinqtl changed the title Allow longest partial match of keys and array of keys in location json Support Hierarchical and Array of Keys May 10, 2021
@amotl
Copy link

amotl commented May 18, 2021

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

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.

None yet

3 participants