From 18986aecd01081a65b81b7e2c0c0ff877a4dbfa9 Mon Sep 17 00:00:00 2001 From: stephenogg Date: Sat, 15 May 2021 16:34:57 -0600 Subject: [PATCH 1/5] Added data for Canadian Provinces and Territories --- src/data/states.json | 80 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/src/data/states.json b/src/data/states.json index 4d7a6f3..4f82fd2 100644 --- a/src/data/states.json +++ b/src/data/states.json @@ -1,4 +1,10 @@ [ + { + "key": "AB", + "latitude": 53.9333, + "longitude": -116.5675, + "name": "Alberta" + }, { "key": "AK", "latitude": 61.3850, @@ -29,6 +35,12 @@ "longitude": -111.3877, "name": "Arizona" }, + { + "key": "BC", + "latitude": 53.7267, + "longitude": -127.6476, + "name": "British Columbia" + }, { "key": "CA", "latitude": 36.1700, @@ -125,6 +137,12 @@ "longitude": -71.5314, "name": "Massachusetts" }, + { + "key": "MB", + "latitude": 56.4152, + "longitude": -98.7390, + "name": "Manitoba" + }, { "key": "MD", "latitude": 39.0724, @@ -173,6 +191,12 @@ "longitude": -110.3261, "name": "Montana" }, + { + "key": "NB", + "latitude": 46.5653, + "longitude": -66.4619, + "name": "New Brunswick" + }, { "key": "NC", "latitude": 35.6411, @@ -203,12 +227,36 @@ "longitude": -74.5089, "name": "New Jersey" }, + { + "key": "NL", + "latitude": 53.1355, + "longitude": -57.6604, + "name": "Newfoundland and Laborador" + }, { "key": "NM", "latitude": 34.8375, "longitude": -106.2371, "name": "New Mexico" }, + { + "key": "NS", + "latitude": 44.6820, + "longitude": -63.7443, + "name": "Nova Scotia" + }, + { + "key": "NT", + "latitude": 614.8255, + "longitude": -124.8457, + "name": "Northwest Territories" + }, + { + "key": "NU", + "latitude": 61.3850, + "longitude": -152.2683, + "name": "Nunavut" + }, { "key": "NV", "latitude": 38.4199, @@ -233,6 +281,12 @@ "longitude": -96.9247, "name": "Oklahoma" }, + { + "key": "ON", + "latitude": 51.2538, + "longitude": -85.3232, + "name": "Ontario" + }, { "key": "OR", "latitude": 44.5672, @@ -245,12 +299,24 @@ "longitude": -77.2640, "name": "Pennsylvania" }, + { + "key": "PE", + "latitude": 46.5107, + "longitude": -63.4168, + "name": "Prince Edward Island" + }, { "key": "PR", "latitude": 18.2766, "longitude": -66.3350, "name": "Puerto Rico" }, + { + "key": "QC", + "latitude": 46.8139, + "longitude": -71.2080, + "name": "Quebec" + }, { "key": "RI", "latitude": 41.6772, @@ -269,6 +335,12 @@ "longitude": -99.4632, "name": "South Dakota" }, + { + "key": "SK", + "latitude": 52.9399, + "longitude": -106.4509, + "name": "Saskatchewan" + }, { "key": "TN", "latitude": 35.7449, @@ -328,5 +400,11 @@ "latitude": 42.7475, "longitude": -107.2085, "name": "Wyoming" + }, + { + "key": "YT", + "latitude": 64.2823, + "longitude": -135.0000, + "name": "Yukon" } -] +] \ No newline at end of file From f9c3643dd67e68a1b4a3ac134d97574e7b683131 Mon Sep 17 00:00:00 2001 From: stephenogg Date: Sat, 15 May 2021 16:35:52 -0600 Subject: [PATCH 2/5] Add text to indicate Canadian Provinces are included in the states data. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a0a44a..4cd8bb5 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ It supports any datasource capable of generating a JSON response with a a custo There are four ways to provide data for the worldmap panel: - *countries*: This is a list of all the countries in the world. It works by matching a country code (US, FR, AU) to a node alias in a time series query. - - *states*: Similar to countries but for the states in USA e.g. CA for California + - *states*: Similar to countries but for the states in USA and Provinces in Canada e.g. CA for California, AB for Alberta - *geohash*: An ElasticSearch query that returns geohashes. - *json*: A json endpoint that returns custom json. Examples of the format are the [countries data used in first option](https://github.com/grafana/worldmap-panel/blob/master/src/data/countries.json) or [this list of cities](https://github.com/grafana/worldmap-panel/blob/master/src/data/probes.json). - *jsonp*: A jsonp endpoint that returns custom json wrapped as jsonp. Use this if you are having problems with CORS. From ce0f311c380a1e93965c6bb6792d8cbaf7915afd Mon Sep 17 00:00:00 2001 From: Steve Ogg <58494569+stephenogg@users.noreply.github.com> Date: Sat, 15 May 2021 16:41:31 -0600 Subject: [PATCH 3/5] Add Canadian Provinces --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4cd8bb5..786ce09 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ The following location files are included in the plugin: - Countries (2 letter codes) - Countries (3 letter codes) -- US states +- US states and Canadian Provinces Alternatively, you can provide your own location lists by using: From 97793fa5e4e28b520200aed94d3fe5ca285c88e7 Mon Sep 17 00:00:00 2001 From: Steve Ogg <58494569+stephenogg@users.noreply.github.com> Date: Sat, 15 May 2021 17:03:55 -0600 Subject: [PATCH 4/5] Added Canadian provinces to US states referenece --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 786ce09..7ee410c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If it is in the **Time Series format** then the metric name needs to match a key The list of locations can be provided in several ways: -- json files with locations and their coordinates (the plugin includes list for countries and US states) +- json files with locations and their coordinates (the plugin includes list for countries and US states/Canadian Provinces) - json endpoints that return a list of locations and their coordinates Time Series data contains a timestamp, a metric name and a numeric value. In other words, a typical query for a time series database. Here is some time series data from Graphite: From c73ec2d5f436555883cf62a0ee661e172be425fb Mon Sep 17 00:00:00 2001 From: stephenogg Date: Wed, 19 May 2021 09:39:00 -0600 Subject: [PATCH 5/5] Fix Provincial coordinates --- src/data/states.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/data/states.json b/src/data/states.json index 4f82fd2..cb07064 100644 --- a/src/data/states.json +++ b/src/data/states.json @@ -2,7 +2,7 @@ { "key": "AB", "latitude": 53.9333, - "longitude": -116.5675, + "longitude": -114.5700, "name": "Alberta" }, { @@ -229,8 +229,8 @@ }, { "key": "NL", - "latitude": 53.1355, - "longitude": -57.6604, + "latitude": 54.1355, + "longitude": -61.6604, "name": "Newfoundland and Laborador" }, { @@ -247,14 +247,14 @@ }, { "key": "NT", - "latitude": 614.8255, + "latitude": 64.8255, "longitude": -124.8457, "name": "Northwest Territories" }, { "key": "NU", - "latitude": 61.3850, - "longitude": -152.2683, + "latitude": 70.2998, + "longitude": -83.1076, "name": "Nunavut" }, { @@ -301,8 +301,8 @@ }, { "key": "PE", - "latitude": 46.5107, - "longitude": -63.4168, + "latitude": 46.3107, + "longitude": -63.2168, "name": "Prince Edward Island" }, { @@ -313,8 +313,8 @@ }, { "key": "QC", - "latitude": 46.8139, - "longitude": -71.2080, + "latitude": 50.8139, + "longitude": -73.2080, "name": "Quebec" }, { @@ -407,4 +407,4 @@ "longitude": -135.0000, "name": "Yukon" } -] \ No newline at end of file +]