i am using loopback.js for my pet project. I am using loopback explorer to post some data. When i post, i get this error
{
"error": {
"statusCode": 400,
"name": "SyntaxError",
"message": "Unexpected token s in JSON at position 19",
"expose": true,
"status": 400,
"body": "{\n \"project\": {\n selectedroom:\"\",\n setcolor:false,\n hours:2,\n searchterm:\"\",\n user:\"restlessankur#gmail.com\",\n\ndropdownvalue:1,\ndropdownvaluetwo:1,\nchatrooms:[\n {\n saved:true,\n key:1,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"private-messages\",\n\n notepad:\"first one\",\n text:\"ankur\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 1 , Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 1 ,Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'a',value: 'a'},\n {text: 'b',value: 'b'},\n {text: 'c',value: 'c'},\n {text: 'd',value: 'd'},\n {text: 's',value: 's'},\n {text: 'e',value: 'e'},\n ],\n tasks:[\n {\n id:0,\n taskname:\"private message go to school\",\n doer:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"3Thailand\" }, { id: 1, text: \"3India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[{text: ' 2 2 2 Jenny ank Hess',value: 'Jenny Hess'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n {\n key:2,\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }],\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project2\",\n notepad:\"this is great\",\n text:\"megha\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 2, Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 2, Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'rajpura',value: 'rajpura'},\n {text: 'patiala',value: 'patiala'},\n {text: 'sangrur',value: 'sangrur'},\n {text: 'bathinda',value: 'bathinda'},\n {text: 'delhi',value: 'delhi'},\n {text: 'gur',value: 'gur'},\n ],\n tasks:[\n {\n id:0,\n taskname:\"project 2 go to school\",\n doer:[{text: 'patiala',value: 'patiala'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"4Thailand\" }, { id: 1, text: \"4India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n {\n key:3,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project3\",\n notepad:\"awesome is awesome\",\n text:\"yeah\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 3,Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 3, Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'pen',value: 'pen'},\n {text: 'pencil',value: 'pencil'},\n {text: 'lo',value: 'lo'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"project 3 go to school\",\n doer:[{text: 'rajpura',value: 'rajpura'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n {\n key:4,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project 4\",\n notepad:\"hulk hulk\",\n text:\"shimla\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 4, Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 4 ,Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'laptop',value: 'laptop'},\n {text: 'mouse',value: 'mouse'},\n {text: 'pc',value: 'pc'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"project 4 go to school\",\n doer:[{text: 'barnala',value: 'barnala'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n {\n key:5,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project 5\",\n notepad:\"going to new york\",\n text:\"delhi\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 5 Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 5 Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'ko',value: 'ko'},\n {text: 'jo',value: 'jo'},\n {text: 'co',value: 'co'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"project 5 go to school\",\n doer:[{text: 'almirah',value: 'almirah'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n {\n key:6,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project 6\",\n notepad:\"coming back to london\",\n text:\"rajpura\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 6 Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 6 Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'fan',value: 'fan'},\n {text: 'pan',value: 'pan'},\n {text: 'can',value: 'can'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"project 7 go to school\",\n doer:[{text: 'laptop',value: 'laptop'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n {\n key:7,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project 7\",\n notepad:\"the charger is lit\",\n text:\"paper\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 7 Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 7 Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'boy',value: 'boy'},\n {text: 'girl',value: 'girl'},\n {text: 'parent',value: 'parent'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"project 7 go to school\",\n doer:[{text: 'get u ',value: 'get u'}],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n\n //start task\n {\n key:8,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project 8\",\n notepad:\"running in the ground\",\n text:\"bharthal\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 8 Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 8 Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'tv',value: 'tv'},\n {text: 'bv',value: 'bv'},\n {text: 'pv',value: 'pv'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"go to school\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"Thailand\" }, { id: 1, text: \"India\" }]\n }\n\n\n\n ]\n },\n\n //ends task\n {\n key:9,\n\n tasktagssuggestions:[\"mango\", \"pineapple\", \"orange\", \"pear\"],\n color:false,\n name:\"project 9\",\n notepad:\"abra ka dabra\",\n text:\"iphone\",\n \"messages\":[{\n \"type\" : 0,\n \"image\": \"https://i2.wp.com/charlottelifeandhome.com/wp-content/uploads/2015/06/Headshot-round.png\",\n \"text\": \"project 9 Hello! Good Morning!,how are you ankur\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }, {\n \"type\": 1,\n \"image\": \"https://static1.squarespace.com/static/53a7236ee4b0370cf58d8c89/5478ceefe4b0542adccf11df/5478ceeee4b0542adccf11c4/1417203462225/Will-headshot-round-small.jpg\",\n \"text\": \"project 9 Hello! Good Afternoon!\",\n \"date\":\"Wed Oct 11 2017 11:32:19 GMT+0530 (IST)\"\n }],\n expandtask:null,\n membersofproject:[\n {text: 'mkm',value: 'mkm'},\n {text: 'bkm',value: 'bkm'},\n {text: 'ckm',value: 'ckm'},\n\n ],\n tasks:[\n {\n id:0,\n taskname:\"go to school\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"high\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"1Thailand\" }, { id: 1, text: \"1India\" }]\n },\n {\n id:1,\n taskname:\"web design\",\n doer:[\"ankur\",\"megha\"],\n startdate:\"\",\n taskStatusLive:true,\n enddate:\"\",\n description:\"description for project 1\",\n files:[\"file.docs\",\"doc1.txt\"],\n priority:\"low\",\n followers:[{key:\"jenny\",text: 'Jenny ank Hess',value: 'Jenny Hess'}],\n repeats:\"\",\n reminders:[],\n tags:[],\n tasktags:[{ id: 0, text: \"2Thailand\" }, { id: 1, text: \"2India\" }]\n }\n\n\n\n ]\n }\n ]}}",
"type": "entity.parse.failed",
"stack": "SyntaxError: Unexpected token s in JSON at position 19\n at Object.parse (native)\n at parse (/Users/ankursharma/Documents/projects/meetupz/node_modules/body-parser/lib/types/json.js:89:19)\n at /Users/ankursharma/Documents/projects/meetupz/node_modules/body-parser/lib/read.js:121:18\n at invokeCallback (/Users/ankursharma/Documents/projects/meetupz/node_modules/raw-body/index.js:224:16)\n at done (/Users/ankursharma/Documents/projects/meetupz/node_modules/raw-body/index.js:213:7)\n at IncomingMessage.onEnd (/Users/ankursharma/Documents/projects/meetupz/node_modules/raw-body/index.js:273:7)\n at emitNone (events.js:86:13)\n at IncomingMessage.emit (events.js:185:7)\n at endReadableNT (_stream_readable.js:974:12)\n at _combinedTickCallback (internal/process/next_tick.js:80:11)\n at process._tickCallback (internal/process/next_tick.js:104:9)"
}
}
what does this error means? I have an object. It contains lot of stuff. Thats why when i selected the model, i choose "any" . I am experimenting. But, this isnt working.
Related
My issue is that legends and color encoding are functionning correclty appart on different layer of my visualization, but when I have the color encoding of two layered mark together, nothing works correctly.
As you can see below, there is two color encoding, on two different mark, but only the first one is showing up
Vega Editor
I have tried to resolve legends and colors multiple times, at multiple places but can't make it work correctly.
I would like the two legends to show separatly and the two marks to have their own colors according to their own encoding.
I'm still not really following. Do you mean like this?
{
"title": {
"text": "Concordance Produit / Projet, réalisé à partir du planning "
},
"data": {
"values": [
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product 1 V1 ",
"Signification_bis": "MES",
"Date_value": "Confirmed",
"Date_value_MAD": "Confirmed",
"Date_Début": "2023-04-28",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Produit",
"Signification": "MAD",
"Référentiel": "Product 1 V1 ",
"Signification_bis": "START",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-03-31",
"Date_Fin": "2022-07-07"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product1 V2",
"Signification_bis": "MES",
"Date_value_MAD": "Confirmed",
"Date_value": "ToBeConfirmed ",
"Date_Début": "2023-04-28",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Produit",
"Signification": "MAD",
"Référentiel": "Product1 V2",
"Date_value_MAD": "Confirmed",
"Signification_bis": "START",
"Date_value": "Confirmed",
"Date_Début": "2023-05-26",
"Date_Fin": "2022-07-07"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product1 V3",
"Signification_bis": "MES",
"Date_value_MAD": "Confirmed",
"Date_value": "ToBeConfirmed ",
"Date_Début": "2023-04-28",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Produit",
"Signification": "MAD",
"Référentiel": "Product1 V3",
"Signification_bis": "START",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-06-30",
"Date_Fin": "2022-07-07"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product1 V4",
"Signification_bis": "MES",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2024-06-28",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Produit",
"Signification": "MAD",
"Référentiel": "Product1 V4",
"Signification_bis": "START",
"Date_value_MAD": "ToBeConfirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-11-02",
"Date_Fin": "2022-07-07"
},
{
"Projet": "Project",
"Produit": "Product2",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product2 V1",
"Signification_bis": "MES",
"Date_value_MAD": "ToBeConfirmed",
"Date_value": "Confirmed",
"Date_Début": "2022-07-04",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product2",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product2 V2",
"Signification_bis": "MES",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-01-31",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product2",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product2 V3",
"Signification_bis": "MES",
"Date_value_MAD": "ToBeConfirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-07-03",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product2",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product2 V4",
"Signification_bis": "MES",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-08-18",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Projet",
"Signification": "BESOIN",
"Référentiel": "Product1 V5",
"Signification_bis": "MES",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-06-30",
"Date_Fin": "2023-11-15"
},
{
"Projet": "Project",
"Produit": "Product1",
"ID_task": "Produit",
"Signification": "MAD",
"Référentiel": "Product1 V5",
"Signification_bis": "START",
"Date_value_MAD": "Confirmed",
"Date_value": "Confirmed",
"Date_Début": "2023-04-03",
"Date_Fin": "2022-07-07"
}
]
},
"facet": {"row": {"field": "Produit"}},
"autosize": "pad",
"config": {"tick": {"thickness": 20, "bandSize": 500}},
"spec": {
"width": 800,
"height": 90,
"layer": [
{
"layer": [
{
"params": [
{"name": "grid", "select": "interval", "bind": "scales"}
],
"transform": [
{"filter": {"field": "ID_task", "oneOf": ["Produit"]}}
],
"mark": {
"type": "bar",
"opacity": 1,
"cornerRadius": 10,
"fillOpacity": 0.5,
"height": 15
},
"encoding": {
"fill": {
"field": "Date_value_MAD",
"scale": {
"domain": ["Confirmed", "ToBeConfirmed"],
"range": ["#009999", "#333333"]
},
"legend": {"title": "Date_value_MAD", "type": "symbol"}
}
}
}
],
"encoding": {
"x": {
"field": "Date_Début",
"type": "temporal",
"axis": {
"title": null,
"grid": true,
"labelExpr": "[timeFormat(datum.value, '%b'), timeFormat(datum.value, '%m') == '01' ? timeFormat(datum.value, '%Y') : '']",
"gridDash": {
"condition": {
"test": {"field": "value", "timeUnit": "month", "equal": 1},
"value": []
},
"value": [2, 2]
},
"tickDash": {
"condition": {
"test": {"field": "value", "timeUnit": "month", "equal": 1},
"value": []
},
"value": [2, 2]
}
}
},
"x2": {"field": "Date_Fin"},
"y": {
"field": "Référentiel",
"type": "nominal",
"axis": {"title": null, "grid": true, "tickBand": "extent"}
}
}
},
{
"transform": [{"calculate": "now()", "as": "now_field"}],
"mark": {"type": "rule", "color": "#FE8389", "size": 1, "opacity": 0.4},
"encoding": {"x": {"field": "now_field", "type": "temporal"}}
},
{
"transform": [{"filter": {"field": "ID_task", "oneOf": ["Projet"]}}],
"mark": {
"type": "point",
"color": "#EC6602",
"size": 150,
"orient": "horizontal",
"opacity": 0.8,
"shape": "triangle-up"
},
"encoding": {
"color": {
"field": "Date_value",
"scale": {"range": ["#EC6602", "#FFB400"]},
"legend": {"orient": "bottom"}
},
"x": {"field": "Date_Début", "type": "temporal"},
"y": {"field": "Référentiel", "type": "nominal"}
}
}
]
},
"resolve": {"scale": {"y": "independent"}}
}
I want to assign green for an uptrend in line chart in chart-js and red for a downtrend in chart-js. I am relatively new to chartjs and I am not sure how to access the data elements to spot an uptrend or a downtrend.
import React, { useEffect } from "react";
import {Paper,Grid,Box} from '#mui/material'
import { Line } from "react-chartjs-2";
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend,
} from 'chart.js';
import { Button, Typography } from "#mui/material";
ChartJS.register(
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend
);
export default function Nifty50() {
const dataset = [
{
"Close": 17069.1,
"Date": "2022-05-02T10:00:00.000Z",
"High": 17092.25,
"Low": 16917.25,
"Open": 16924.45,
"Volume": 0,
"id": 1
},
{
"Close": 16677.6,
"Date": "2022-05-04T10:00:00.000Z",
"High": 17132.85,
"Low": 16623.95,
"Open": 17096.6,
"Volume": 0,
"id": 2
},
{
"Close": 16682.65,
"Date": "2022-05-05T10:00:00.000Z",
"High": 16945.7,
"Low": 16651.85,
"Open": 16854.75,
"Volume": 0,
"id": 3
},
{
"Close": 16411.25,
"Date": "2022-05-06T10:00:00.000Z",
"High": 16484.2,
"Low": 16340.9,
"Open": 16415.55,
"Volume": 0,
"id": 4
},
{
"Close": 16301.85,
"Date": "2022-05-09T10:00:00.000Z",
"High": 16403.7,
"Low": 16142.1,
"Open": 16227.7,
"Volume": 0,
"id": 5
},
{
"Close": 16240.05,
"Date": "2022-05-10T10:00:00.000Z",
"High": 16404.55,
"Low": 16197.3,
"Open": 16248.9,
"Volume": 0,
"id": 6
},
{
"Close": 16167.1,
"Date": "2022-05-11T10:00:00.000Z",
"High": 16318.75,
"Low": 15992.6,
"Open": 16270.05,
"Volume": 0,
"id": 7
},
{
"Close": 15808,
"Date": "2022-05-12T10:00:00.000Z",
"High": 16041.95,
"Low": 15735.75,
"Open": 16021.1,
"Volume": 0,
"id": 8
},
{
"Close": 15782.15,
"Date": "2022-05-13T10:00:00.000Z",
"High": 16083.6,
"Low": 15740.85,
"Open": 15977,
"Volume": 0,
"id": 9
},
{
"Close": 15842.3,
"Date": "2022-05-16T10:00:00.000Z",
"High": 15977.95,
"Low": 15739.65,
"Open": 15845.1,
"Volume": 0,
"id": 10
},
{
"Close": 16259.3,
"Date": "2022-05-17T10:00:00.000Z",
"High": 16284.25,
"Low": 15900.8,
"Open": 15912.6,
"Volume": 0,
"id": 11
},
{
"Close": 16240.3,
"Date": "2022-05-18T10:00:00.000Z",
"High": 16399.8,
"Low": 16211.2,
"Open": 16318.15,
"Volume": 0,
"id": 12
},
{
"Close": 15809.4,
"Date": "2022-05-19T10:00:00.000Z",
"High": 15984.75,
"Low": 15775.2,
"Open": 15917.4,
"Volume": 0,
"id": 13
},
{
"Close": 16266.15,
"Date": "2022-05-20T10:00:00.000Z",
"High": 16283.05,
"Low": 16003.85,
"Open": 16043.8,
"Volume": 0,
"id": 14
},
{
"Close": 16214.7,
"Date": "2022-05-23T10:00:00.000Z",
"High": 16414.7,
"Low": 16185.75,
"Open": 16290.95,
"Volume": 0,
"id": 15
},
{
"Close": 16125.15,
"Date": "2022-05-24T10:00:00.000Z",
"High": 16262.8,
"Low": 16078.6,
"Open": 16225.55,
"Volume": 0,
"id": 16
},
{
"Close": 16025.8,
"Date": "2022-05-25T10:00:00.000Z",
"High": 16223.35,
"Low": 16006.95,
"Open": 16196.35,
"Volume": 0,
"id": 17
},
{
"Close": 16170.15,
"Date": "2022-05-26T10:00:00.000Z",
"High": 16204.45,
"Low": 15903.7,
"Open": 16105,
"Volume": 0,
"id": 18
},
{
"Close": 16352.45,
"Date": "2022-05-27T10:00:00.000Z",
"High": 16370.6,
"Low": 16221.95,
"Open": 16296.6,
"Volume": 0,
"id": 19
},
{
"Close": 16661.4,
"Date": "2022-05-30T10:00:00.000Z",
"High": 16695.5,
"Low": 16506.15,
"Open": 16527.9,
"Volume": 0,
"id": 20
},
{
"Close": 16584.55,
"Date": "2022-05-31T10:00:00.000Z",
"High": 16690.75,
"Low": 16521.9,
"Open": 16578.45,
"Volume": 0,
"id": 21
},
{
"Close": 16522.75,
"Date": "2022-06-01T10:00:00.000Z",
"High": 16649.2,
"Low": 16438.85,
"Open": 16594.4,
"Volume": 0,
"id": 22
},
{
"Close": 16628,
"Date": "2022-06-02T10:00:00.000Z",
"High": 16646.4,
"Low": 16443.05,
"Open": 16481.65,
"Volume": 0,
"id": 23
},
{
"Close": 16584.3,
"Date": "2022-06-03T10:00:00.000Z",
"High": 16793.85,
"Low": 16567.9,
"Open": 16761.65,
"Volume": 0,
"id": 24
},
{
"Close": 16569.55,
"Date": "2022-06-06T10:00:00.000Z",
"High": 16610.95,
"Low": 16444.55,
"Open": 16530.7,
"Volume": 0,
"id": 25
},
{
"Close": 16416.35,
"Date": "2022-06-07T10:00:00.000Z",
"High": 16487.25,
"Low": 16347.1,
"Open": 16469.6,
"Volume": 0,
"id": 26
},
{
"Close": 16356.25,
"Date": "2022-06-08T10:00:00.000Z",
"High": 16514.3,
"Low": 16293.35,
"Open": 16474.95,
"Volume": 0,
"id": 27
},
{
"Close": 16478.1,
"Date": "2022-06-09T10:00:00.000Z",
"High": 16492.8,
"Low": 16243.85,
"Open": 16263.85,
"Volume": 0,
"id": 28
},
{
"Close": 16201.8,
"Date": "2022-06-10T10:00:00.000Z",
"High": 16324.7,
"Low": 16172.6,
"Open": 16283.95,
"Volume": 0,
"id": 29
},
{
"Close": 15774.4,
"Date": "2022-06-13T10:00:00.000Z",
"High": 15886.15,
"Low": 15684,
"Open": 15877.55,
"Volume": 0,
"id": 30
},
{
"Close": 15732.1,
"Date": "2022-06-14T10:00:00.000Z",
"High": 15858,
"Low": 15659.45,
"Open": 15674.25,
"Volume": 0,
"id": 31
},
{
"Close": 15692.15,
"Date": "2022-06-15T10:00:00.000Z",
"High": 15783.65,
"Low": 15678.9,
"Open": 15729.25,
"Volume": 0,
"id": 32
},
{
"Close": 15360.6,
"Date": "2022-06-16T10:00:00.000Z",
"High": 15863.15,
"Low": 15335.1,
"Open": 15832.25,
"Volume": 0,
"id": 33
},
{
"Close": 15293.5,
"Date": "2022-06-17T10:00:00.000Z",
"High": 15400.4,
"Low": 15183.4,
"Open": 15272.65,
"Volume": 0,
"id": 34
},
{
"Close": 15350.15,
"Date": "2022-06-20T10:00:00.000Z",
"High": 15382.5,
"Low": 15191.1,
"Open": 15334.5,
"Volume": 0,
"id": 35
},
{
"Close": 15638.8,
"Date": "2022-06-21T10:00:00.000Z",
"High": 15707.25,
"Low": 15419.85,
"Open": 15455.95,
"Volume": 0,
"id": 36
}
]
var dataReqdFormat = {
labels: [],
datasets: [{
data: [],
label: "Nifty",
fill: true,
borderColor: "rgba(75,192,192,1)"
}]
};
dataset.forEach((datapoint) => {
dataReqdFormat.labels.push(datapoint.Date.split('T')[0]);
dataReqdFormat.datasets[0].data.push(datapoint.Close);
})
const [duration, setDuration] = React.useState(dataset.length);
const [chartData, setChartData] = React.useState(dataReqdFormat);
const changeData = (duration) => {
setDuration(duration);
console.log(dataReqdFormat);
var tempData = dataReqdFormat;
tempData.labels = dataReqdFormat.labels.slice(-duration);
for (var i = 0; i < dataReqdFormat.datasets.length; i++) {
tempData.datasets[i].data = dataReqdFormat.datasets[i].data.slice(-duration);
}
console.log(tempData);
setChartData(tempData);
}
useEffect(() => {
changeData(30);
}, [])
const options = {
plugins: {
legend: {
display: false,
},
},
};
return (
<div>
<Grid sx={{alignItems:"center"}}>
<Button onClick={() => changeData(3)} variant={duration === 3 ? "contained" : "outlined"} style={{ margin: "5px", marginBottom: "0", background: "white", color: "black" }}>
3D
</Button>
<Button onClick={() => changeData(7)} variant={duration === 7 ? "contained" : "outlined"} style={{ margin: "5px", marginBottom: "0", background: "white", color: "black" }}>
1W
</Button>
<Button onClick={() => changeData(30)} variant={duration === 30 ? "contained" : "outlined"} style={{ margin: "5px", marginBottom: "0", background: "white", color: "black" }}>
1M
</Button>
<Line data={chartData} options={options} />
</Grid>
</div>
)
}
I have currently assigned rgba(75,192,192,1) to lines irrespective of the trend.
Any help is appreciated.
You can use segments for this:
var dataReqdFormat = {
labels: [],
datasets: [{
data: [],
label: "Nifty",
fill: true,
segment: {
borderColor: ctx => ctx.p1.parsed.y <= ctx.p0.parsed.y ? 'red' : 'green'
}
}]
};
Live example:
const options = {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange", "Silver"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3, 4],
segment: {
borderColor: ctx => ctx.p1.parsed.y <= ctx.p0.parsed.y ? 'red' : 'green'
}
}]
}
}
const ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
<body>
<canvas id="chartJSContainer" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/chart.js"></script>
</body>
Edit:
You can use a scriptable function for this:
var dataReqdFormat = {
labels: [],
datasets: [{
data: [],
label: "Nifty",
fill: true,
borderColor: (ctx) => {
const data = ctx.chart.data.datasets[ctx.datasetIndex].data;
return data[0] >= data[data.length - 1] ? 'red' : 'green'
}
}]
};
Live example:
const options = {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange", "Silver"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3, 40],
borderColor: (ctx) => {
const data = ctx.chart.data.datasets[ctx.datasetIndex].data;
return data[0] >= data[data.length - 1] ? 'red' : 'green'
}
}]
}
}
const ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
<body>
<canvas id="chartJSContainer" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.8.0/chart.js"></script>
</body>
I have implemented Charts JS library in one of my web apps and am having an issue. Right now i need to add multiple y values to one single x-axis point. however did not come to solution.
var ctx = document.getElementById("myChart").getContext("2d");
new Chart(ctx, config);
var config = {
type: 'line',
data: {
labels: [['01', '11' ,'2018'],
['01', '11' ,'2018'],
['01', '11' ,'2018'],
['01','11','2018'], '02','02','02','02','02','05','05','05','05','06','06','06','06','07','07','07','07','07','07','07','07','08','08','08','08','08','08','08','08','09','09','09','09',['20','02','2019'],['20','02','2019'],'21','21','21','21',['06','03'],['06','03'] ,'','','','' ,
],
datasets: [{
label: "My First dataset",
data: [35.48 ,35.50 ,35.5 ,35.49 ,35.49 ,35.50 ,35.50 ,35.49 ,35.45 ,35.38 ,35.42 ,35.4 ,35.49 ,35.50 ,35.49 ,35.49 ,35.49 ,35.49 ,35.50 ,35.50 ,35.48 ,35.47 ,35.48 ,35.47 ,35.49 ,35.50 ,35.50 ,35.49 ,35.48 ,35.47 ,35.48 ,35.47 ,35.50 ,35.49 ,35.49 ,35.50 ,37 ,37 ,38 ,39 ,40 ,51 ,28 ,29 ],
}]
},
options: {
scales: {
xAxes:[{
ticks: {
autoSkip: false,
}
}],
},
}
};
var ctx = document.getElementById("myChart").getContext("2d");
new Chart(ctx, config);
<canvas id="myChart"></canvas>
You can add multiple datasets which will plot a separate line on the graph.
Here is your example.
function newDate() {
return moment().add(days, 'd');
}
var config = {
type: 'line',
data: {
labels: [
["01", "11", "2018"],
['01', '11', '2018'],
['01', '11', '2018'],
['01', '11', '2018'], , '02', '02', '02', '02', '05', '05', '05', '05', '06', '06', '06', '06', '07', '07', '07', '07', '07', '07', '07', '07', '08', '08', '08', '08', '08', '08', '08', '08', '09', '09', '09', '09', ['20', '02', '2019'],
['20', '02', '2019'], '21', '21', '21', '21', ['06', '03'],
['06', '03'], '', '', '', '', '', '', '', '', '', '', '', '', '', ''
],
datasets: [{
label: "My First dataset",
data: [35.48, 35.50, 35.5, 35.49, 35.49, 35.50, 35.50, 35.49, 35.45, 35.38, 35.42, 35.4, 35.49, 35.50, 35.49, 35.49, 35.49, 35.49, 35.50, 35.50, 35.48, 35.47, 35.48, 35.47, 35.49, 35.50, 35.50, 35.49, 35.48, 35.47, 35.48, 35.47, 35.50, 35.49, 35.49, 35.50, 37, 37, 38, 39, 40, 51, 28, 29],
},
{
label: "My second dataset",
data: [35.48, 35.50, 35.5, 35.49, 35.49, 35.50, 35.50, 35.49, 35.45, 35.38, 35.42, 35.4, 35.49, 35.50, 35.49, 35.49, 35.49, 35.49, 35.50, 35.50, 35.48, 35.47, 35.48, 35.47, 35.49, 35.50, 35.50, 35.49, 35.48, 35.47, 35.48, 35.47, 35.50, 35.49, 35.49, 35.50, 37, 37, 38, 39, 40, 51, 28, 29].map(a => a + 20),
}
]
},
options: {
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
},
}
};
var ctx = document.getElementById("myChart").getContext("2d");
new Chart(ctx, config);
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.0/Chart.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<canvas id="myChart"></canvas>
So, I am trying to figure out how to get URL to an image in Freebase database. I want an image of San Francisco. This is how I get the San Francisco topic:
https://www.googleapis.com/freebase/v1sandbox/topic/%2Fen%2Fsan_francisco?key=MY_API_KEY
The response contains images, for example:
{
text: "San Francisco Skyline",
lang: "en",
id: "/m/04j74yh",
creator: "/user/carmenmfenn1",
timestamp: "2008-09-01T13:37:22.000Z"
}
So I then call the GET API again to get the image:
https://www.googleapis.com/freebase/v1sandbox/topic/%2Fm%2F04j74yh?key=MY_API_KEY
This returns lots of information about the image such as media type, size etc. But I don't see any URL there. There are some IDs (blob id, mid). I am not sure how to proceed to get a URL to the image. Any ideas?
This is the full response:
{
id: "/m/04j74yh",
property: {
/common/image/appears_in_topic_gallery: {
valuetype: "object",
values: [
{
text: "San Francisco",
lang: "en",
id: "/m/0d6lp",
creator: "/user/carmenmfenn1",
timestamp: "2008-09-01T13:37:22.000Z"
}
],
count: 1
},
/common/image/size: {
valuetype: "compound",
values: [
{
text: "640.0 - 330.0 - Freebase Data Team - Rectangle Size",
lang: "en",
id: "/m/02bpzld",
creator: "/user/carmenmfenn1",
timestamp: "2008-09-01T13:37:22.000Z",
property: {
/measurement_unit/rect_size/x: {
valuetype: "float",
values: [
{
text: "640.0",
lang: "en",
value: 640,
creator: "/user/mwcl_images",
timestamp: "2007-04-15T23:03:01.001Z"
}
],
count: 1
},
/measurement_unit/rect_size/y: {
valuetype: "float",
values: [
{
text: "330.0",
lang: "en",
value: 330,
creator: "/user/mwcl_images",
timestamp: "2007-04-15T23:03:01.001Z"
}
],
count: 1
},
/type/object/attribution: {
valuetype: "object",
values: [
{
text: "Freebase Data Team",
lang: "en",
id: "/m/0220tm0",
creator: "/user/mwcl_images",
timestamp: "2007-04-15T23:03:01.001Z"
}
],
count: 1
},
/type/object/type: {
valuetype: "object",
values: [
{
text: "Rectangle Size",
lang: "en",
id: "/measurement_unit/rect_size",
creator: "/user/mwcl_images",
timestamp: "2007-04-15T23:03:01.001Z"
}
],
count: 1
}
}
}
],
count: 1
},
/common/licensed_object/license: {
valuetype: "object",
values: [
{
text: "CC-BY-2.5",
lang: "en",
id: "/m/01xrw11",
creator: "/user/carmenmfenn1",
timestamp: "2008-09-01T13:37:22.000Z"
}
],
count: 1
},
/common/topic/notable_for: {
valuetype: "object",
values: [
{
text: "Content",
lang: "en",
id: "/type/content"
}
],
count: 1
},
/common/topic/notable_types: {
valuetype: "object",
values: [
{
text: "Content",
lang: "en",
id: "/type/content",
timestamp: "2013-05-17T00:04:43.942Z"
}
],
count: 1
},
/type/content/blob_id: {
valuetype: "string",
values: [
{
text: "8debf723b25edb43b413bcb2890c4f4fe6ec5e5b2c7ce9c7e1f2aee273b0d0fe",
lang: "",
value: "8debf723b25edb43b413bcb2890c4f4fe6ec5e5b2c7ce9c7e1f2aee273b0d0fe",
creator: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
}
],
count: 1
},
/type/content/length: {
valuetype: "int",
values: [
{
text: "47162",
lang: "en",
value: 47162,
creator: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
}
],
count: 1
},
/type/content/media_type: {
valuetype: "object",
values: [
{
text: "image/jpeg",
lang: "en",
id: "/m/08x8",
creator: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
}
],
count: 1
},
/type/object/attribution: {
valuetype: "object",
values: [
{
text: "Freebase Staff",
lang: "en",
id: "/m/05g",
creator: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
}
],
count: 1
},
/type/object/mid: {
valuetype: "key",
values: [
{
text: "/m/04j74yh",
lang: "",
value: "/m/04j74yh"
}
],
count: 1
},
/type/object/name: {
valuetype: "string",
values: [
{
text: "San Francisco Skyline",
lang: "en",
value: "San Francisco Skyline",
creator: "/user/carmenmfenn1",
timestamp: "2008-09-01T13:42:34.000Z"
}
],
count: 1
},
/type/object/type: {
valuetype: "object",
values: [
{
text: "Image",
lang: "en",
id: "/common/image",
creator: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
},
{
text: "Content",
lang: "en",
id: "/type/content",
creator: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
}
],
count: 2
},
/type/object/guid: {
valuetype: "string",
values: [
{
text: "#9202a8c04000641f80000000090393af",
lang: "",
value: "#9202a8c04000641f80000000090393af"
}
],
count: 1
},
/type/object/creator: {
valuetype: "object",
values: [
{
text: "content_administrator",
lang: "",
id: "/user/content_administrator",
timestamp: "2008-09-01T13:37:20.000Z"
}
],
count: 1
},
/type/object/timestamp: {
valuetype: "datetime",
values: [
{
text: "2008-09-01T13:37:20.000Z",
lang: "en",
value: "2008-09-01T13:37:20.000Z"
}
],
count: 1
},
/type/object/permission: {
valuetype: "object",
values: [
{
text: "/boot/all_permission",
lang: "",
id: "/boot/all_permission"
}
],
count: 1
}
}
}
It's kind of buried in the documentation since it doesn't have a section of its own, but is instead referenced from the Topic API documentation, but you can find the necessary info here
URLs are of the form:
https://usercontent.googleapis.com/freebase/v1/image/<image ID>
I am trying to create a server with the lowest possible latency for my target audience. I get the difference between regions and Availability Zones (I think). It sounds like the Availability Zones are in different cities. Where are they exactly?
The best that Amazon provide in terms of public information is on their EC2 FAQ. If you want the lowest possible latency can you not just ping servers in each availability zone from your target location and find the lowest latency that way? There's no guarantee that physical proximity == lowest latency anyway.
You can assume that all availability zones in the same region have the similar latency. (as they are all very close). Also as far as I know not necessary the availability zones are the same for all users. (i.e. us-east-1a can be different datacenter for different users)
To achieve the optimum experience for your users, you should pick the region that's geographically closest to your users. EC2 Availability Zones within an AWS Region should offer effectively the same latency to external users (as opposed to other services deployed within the same region or AZ as your own service). All AZs are highly interconnected to the Internet infrastructure in their geographic region. Within that region, you ideally want to architect your application so that its components are replicated across multiple AZs to achieve the best possible availability.
As the name suggests, Availability Zones are primarily an availability/reliability construct: by deploying your application across multiple AZs, you can protect yourself against certain failure modes. The promise that AWS EC2 makes to customers is that no two AZs should fail at the same time for related reasons.
Availability Zones comprise of one or more data centres within close proximity such that the latency is low enough for highly distributed applications to operate effectively at "local network" speeds. A region is a collection of such AZs in close enough proximity to one another. However, since they need to be meaningfully separated from one another by distance, the speed of light implies a higher minimum latency across AZs. Peter DeSantis breaks it down very well in his re:Invent 2018 keynote.
This is technically inaccurate but may be a helpful simplified model: you can think of AZs as "logical data centres" and regions as "groups of data centres within the same metro area". Features like synchronous replication might work great within an AZ, but you should probably be more careful creating topologies that span across AZs for example. Conversely, for cluster applications that are extremely latency-sensitive, such as message-passing compute grids, you can optionally use EC2 Placement Groups to ensure the best possible locality inside an AZ's internal topology. The exact latency numbers will vary between regions and you should do your own measurements to inform your architecture decisions.
if you query an ip address to location mapping service for a bunch of instances started in different availability zones, you will end up with a mapping similar to this:
- az: af-south-1c
longitude: 18.424100875854492
latitude: -33.92490005493164
continent:
code: AF
name: Africa
country:
code: ZA
name: South Africa
flag: "\U0001F1FF\U0001F1E6"
region:
code: WC
name: Western Cape
city:
name: Cape Town
postcode: 8001
- az: ap-northeast-1a
longitude: 139.73855590820312
latitude: 35.69628143310547
continent:
code: AS
name: Asia
country:
code: JP
name: Japan
flag: "\U0001F1EF\U0001F1F5"
region:
code: 13
name: Tokyo
city:
name: Tokyo
postcode: 162-0843
- az: ap-northeast-1c
longitude: 139.73855590820312
latitude: 35.69628143310547
continent:
code: AS
name: Asia
country:
code: JP
name: Japan
flag: "\U0001F1EF\U0001F1F5"
region:
code: 13
name: Tokyo
city:
name: Tokyo
postcode: 162-0843
- az: ap-northeast-1d
longitude: 139.73855590820312
latitude: 35.69628143310547
continent:
code: AS
name: Asia
country:
code: JP
name: Japan
flag: "\U0001F1EF\U0001F1F5"
region:
code: 13
name: Tokyo
city:
name: Tokyo
postcode: 162-0843
- az: ap-northeast-2a
longitude: 126.620361328125
latitude: 37.473548889160156
continent:
code: AS
name: Asia
country:
code: KR
name: South Korea
flag: "\U0001F1F0\U0001F1F7"
region:
code: 28
name: Incheon
city:
name: Incheon
postcode: 400-011
- az: ap-northeast-3c
longitude: 135.50750732421875
latitude: 34.67094039916992
continent:
code: AS
name: Asia
country:
code: JP
name: Japan
flag: "\U0001F1EF\U0001F1F5"
region:
code: 27
name: Ōsaka
city:
name: Osaka
postcode: 542-0082
- az: ap-southeast-1a
longitude: 103.8517837524414
latitude: 1.287950038909912
continent:
code: AS
name: Asia
country:
code: SG
name: Singapore
flag: "\U0001F1F8\U0001F1EC"
region:
code: 1
name: Central Singapore
city:
name: Singapore
postcode: null
- az: ap-southeast-1c
longitude: -73.44097137451172
latitude: 41.126861572265625
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: CT
name: Connecticut
city:
name: East Norwalk
postcode: 06850
- az: ap-southeast-2a
longitude: 151.2071075439453
latitude: -33.86714172363281
continent:
code: OC
name: Oceania
country:
code: AU
name: Australia
flag: "\U0001F1E6\U0001F1FA"
region:
code: NSW
name: New South Wales
city:
name: Sydney
postcode: 2000
- az: ap-southeast-2b
longitude: 151.2071075439453
latitude: -33.86714172363281
continent:
code: OC
name: Oceania
country:
code: AU
name: Australia
flag: "\U0001F1E6\U0001F1FA"
region:
code: NSW
name: New South Wales
city:
name: Sydney
postcode: 2000
- az: ca-central-1a
longitude: -73.56201171875
latitude: 45.502079010009766
continent:
code: NA
name: North America
country:
code: CA
name: Canada
flag: "\U0001F1E8\U0001F1E6"
region:
code: QC
name: Quebec
city:
name: Montréal
postcode: H2Y 2J7
- az: ca-central-1b
longitude: -73.56201171875
latitude: 45.502079010009766
continent:
code: NA
name: North America
country:
code: CA
name: Canada
flag: "\U0001F1E8\U0001F1E6"
region:
code: QC
name: Quebec
city:
name: Montréal
postcode: H2Y 2J7
- az: eu-central-1c
longitude: 8.682100296020508
latitude: 50.11090087890625
continent:
code: EU
name: Europe
country:
code: DE
name: Germany
flag: "\U0001F1E9\U0001F1EA"
region:
code: HE
name: Hesse
city:
name: Frankfurt am Main
postcode: 60311
- az: eu-north-1a
longitude: 18.051319122314453
latitude: 59.315120697021484
continent:
code: EU
name: Europe
country:
code: SE
name: Sweden
flag: "\U0001F1F8\U0001F1EA"
region:
code: AB
name: Stockholm
city:
name: Stockholm
postcode: 118 58
- az: eu-north-1b
longitude: 18.051319122314453
latitude: 59.315120697021484
continent:
code: EU
name: Europe
country:
code: SE
name: Sweden
flag: "\U0001F1F8\U0001F1EA"
region:
code: AB
name: Stockholm
city:
name: Stockholm
postcode: 118 58
- az: eu-north-1c
longitude: 18.051319122314453
latitude: 59.315120697021484
continent:
code: EU
name: Europe
country:
code: SE
name: Sweden
flag: "\U0001F1F8\U0001F1EA"
region:
code: AB
name: Stockholm
city:
name: Stockholm
postcode: 118 58
- az: eu-south-1a
longitude: 9.192000389099121
latitude: 45.47200012207031
continent:
code: EU
name: Europe
country:
code: IT
name: Italy
flag: "\U0001F1EE\U0001F1F9"
region:
code: 25
name: Lombardy
city:
name: Milan
postcode: 20121
- az: eu-south-1b
longitude: 9.192000389099121
latitude: 45.47200012207031
continent:
code: EU
name: Europe
country:
code: IT
name: Italy
flag: "\U0001F1EE\U0001F1F9"
region:
code: 25
name: Lombardy
city:
name: Milan
postcode: 20121
- az: eu-south-1b
longitude: 9.192899703979492
latitude: 45.48379898071289
continent:
code: EU
name: Europe
country:
code: IT
name: Italy
flag: "\U0001F1EE\U0001F1F9"
region:
code: 25
name: Lombardy
city:
name: Milan
postcode: 20124
- az: eu-south-1c
longitude: 9.192000389099121
latitude: 45.47200012207031
continent:
code: EU
name: Europe
country:
code: IT
name: Italy
flag: "\U0001F1EE\U0001F1F9"
region:
code: 25
name: Lombardy
city:
name: Milan
postcode: 20121
- az: eu-west-1a
longitude: -6.243330001831055
latitude: 53.35388946533203
continent:
code: EU
name: Europe
country:
code: IE
name: Ireland
flag: "\U0001F1EE\U0001F1EA"
region:
code: L
name: Leinster
city:
name: Dublin
postcode: null
- az: eu-west-1b
longitude: -6.243330001831055
latitude: 53.35388946533203
continent:
code: EU
name: Europe
country:
code: IE
name: Ireland
flag: "\U0001F1EE\U0001F1EA"
region:
code: L
name: Leinster
city:
name: Dublin
postcode: null
- az: eu-west-1c
longitude: -6.243330001831055
latitude: 53.35388946533203
continent:
code: EU
name: Europe
country:
code: IE
name: Ireland
flag: "\U0001F1EE\U0001F1EA"
region:
code: L
name: Leinster
city:
name: Dublin
postcode: null
- az: eu-west-2c
longitude: -0.12574
latitude: 51.5122184753418
continent:
code: EU
name: Europe
country:
code: GB
name: United Kingdom
flag: "\U0001F1EC\U0001F1E7"
region:
code: ENG
name: England
city:
name: Blackheath
postcode: EC1M
- az: eu-west-2c
longitude: 0
latitude: 51.5122184753418
continent:
code: EU
name: Europe
country:
code: GB
name: United Kingdom
flag: "\U0001F1EC\U0001F1E7"
region:
code: ENG
name: England
city:
name: Blackheath
postcode: EC1M
- az: eu-west-3a
longitude: 2.3410699367523193
latitude: 48.8602294921875
continent:
code: EU
name: Europe
country:
code: FR
name: France
flag: "\U0001F1EB\U0001F1F7"
region:
code: IDF
name: Île-de-France
city:
name: Saint-Ouen
postcode: 75001
- az: eu-west-3c
longitude: 2.3410699367523193
latitude: 48.8602294921875
continent:
code: EU
name: Europe
country:
code: FR
name: France
flag: "\U0001F1EB\U0001F1F7"
region:
code: IDF
name: Île-de-France
city:
name: Saint-Ouen
postcode: 75001
- az: us-east-1b
longitude: -77.47419738769531
latitude: 39.043701171875
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: VA
name: Virginia
city:
name: Ashburn
postcode: 20147
- az: us-east-1c
longitude: -77.47419738769531
latitude: 39.043701171875
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: VA
name: Virginia
city:
name: Ashburn
postcode: 20147
- az: us-east-1d
longitude: -77.47419738769531
latitude: 39.043701171875
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: VA
name: Virginia
city:
name: Ashburn
postcode: 20147
- az: us-east-1f
longitude: -77.47419738769531
latitude: 39.043701171875
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: VA
name: Virginia
city:
name: Ashburn
postcode: 20147
- az: us-east-2b
longitude: -82.99945831298828
latitude: 39.99557876586914
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: OH
name: Ohio
city:
name: Columbus
postcode: 43201
- az: us-east-2c
longitude: -82.99945831298828
latitude: 39.99557876586914
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: OH
name: Ohio
city:
name: Columbus
postcode: 43201
- az: us-west-1a
longitude: -121.83822631835938
latitude: 37.330528259277344
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: CA
name: California
city:
name: San Jose
postcode: 95122
- az: us-west-1b
longitude: -121.83822631835938
latitude: 37.330528259277344
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: CA
name: California
city:
name: San Jose
postcode: 95122
- az: us-west-2d
longitude: -119.81143188476562
latitude: 45.73722839355469
continent:
code: NA
name: North America
country:
code: US
name: United States
flag: "\U0001F1FA\U0001F1F8"
region:
code: OR
name: Oregon
city:
name: Boardman
postcode: 97818
[
{
"az": "af-south-1c",
"longitude": 18.424100875854492,
"latitude": -33.92490005493164,
"continent": {
"code": "AF",
"name": "Africa"
},
"country": {
"code": "ZA",
"name": "South Africa",
"flag": "🇿🇦"
},
"region": {
"code": "WC",
"name": "Western Cape"
},
"city": {
"name": "Cape Town"
},
"postcode": 8001
},
{
"az": "ap-northeast-1a",
"longitude": 139.73855590820312,
"latitude": 35.69628143310547,
"continent": {
"code": "AS",
"name": "Asia"
},
"country": {
"code": "JP",
"name": "Japan",
"flag": "🇯🇵"
},
"region": {
"code": 13,
"name": "Tokyo"
},
"city": {
"name": "Tokyo"
},
"postcode": "162-0843"
},
{
"az": "ap-northeast-1c",
"longitude": 139.73855590820312,
"latitude": 35.69628143310547,
"continent": {
"code": "AS",
"name": "Asia"
},
"country": {
"code": "JP",
"name": "Japan",
"flag": "🇯🇵"
},
"region": {
"code": 13,
"name": "Tokyo"
},
"city": {
"name": "Tokyo"
},
"postcode": "162-0843"
},
{
"az": "ap-northeast-1d",
"longitude": 139.73855590820312,
"latitude": 35.69628143310547,
"continent": {
"code": "AS",
"name": "Asia"
},
"country": {
"code": "JP",
"name": "Japan",
"flag": "🇯🇵"
},
"region": {
"code": 13,
"name": "Tokyo"
},
"city": {
"name": "Tokyo"
},
"postcode": "162-0843"
},
{
"az": "ap-northeast-2a",
"longitude": 126.620361328125,
"latitude": 37.473548889160156,
"continent": {
"code": "AS",
"name": "Asia"
},
"country": {
"code": "KR",
"name": "South Korea",
"flag": "🇰🇷"
},
"region": {
"code": 28,
"name": "Incheon"
},
"city": {
"name": "Incheon"
},
"postcode": "400-011"
},
{
"az": "ap-northeast-3c",
"longitude": 135.50750732421875,
"latitude": 34.67094039916992,
"continent": {
"code": "AS",
"name": "Asia"
},
"country": {
"code": "JP",
"name": "Japan",
"flag": "🇯🇵"
},
"region": {
"code": 27,
"name": "Ōsaka"
},
"city": {
"name": "Osaka"
},
"postcode": "542-0082"
},
{
"az": "ap-southeast-1a",
"longitude": 103.8517837524414,
"latitude": 1.287950038909912,
"continent": {
"code": "AS",
"name": "Asia"
},
"country": {
"code": "SG",
"name": "Singapore",
"flag": "🇸🇬"
},
"region": {
"code": 1,
"name": "Central Singapore"
},
"city": {
"name": "Singapore"
},
"postcode": null
},
{
"az": "ap-southeast-1c",
"longitude": -73.44097137451172,
"latitude": 41.126861572265625,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "CT",
"name": "Connecticut"
},
"city": {
"name": "East Norwalk"
},
"postcode": "06850"
},
{
"az": "ap-southeast-2a",
"longitude": 151.2071075439453,
"latitude": -33.86714172363281,
"continent": {
"code": "OC",
"name": "Oceania"
},
"country": {
"code": "AU",
"name": "Australia",
"flag": "🇦🇺"
},
"region": {
"code": "NSW",
"name": "New South Wales"
},
"city": {
"name": "Sydney"
},
"postcode": 2000
},
{
"az": "ap-southeast-2b",
"longitude": 151.2071075439453,
"latitude": -33.86714172363281,
"continent": {
"code": "OC",
"name": "Oceania"
},
"country": {
"code": "AU",
"name": "Australia",
"flag": "🇦🇺"
},
"region": {
"code": "NSW",
"name": "New South Wales"
},
"city": {
"name": "Sydney"
},
"postcode": 2000
},
{
"az": "ca-central-1a",
"longitude": -73.56201171875,
"latitude": 45.502079010009766,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "CA",
"name": "Canada",
"flag": "🇨🇦"
},
"region": {
"code": "QC",
"name": "Quebec"
},
"city": {
"name": "Montréal"
},
"postcode": "H2Y 2J7"
},
{
"az": "ca-central-1b",
"longitude": -73.56201171875,
"latitude": 45.502079010009766,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "CA",
"name": "Canada",
"flag": "🇨🇦"
},
"region": {
"code": "QC",
"name": "Quebec"
},
"city": {
"name": "Montréal"
},
"postcode": "H2Y 2J7"
},
{
"az": "eu-central-1c",
"longitude": 8.682100296020508,
"latitude": 50.11090087890625,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "DE",
"name": "Germany",
"flag": "🇩🇪"
},
"region": {
"code": "HE",
"name": "Hesse"
},
"city": {
"name": "Frankfurt am Main"
},
"postcode": 60311
},
{
"az": "eu-north-1a",
"longitude": 18.051319122314453,
"latitude": 59.315120697021484,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "SE",
"name": "Sweden",
"flag": "🇸🇪"
},
"region": {
"code": "AB",
"name": "Stockholm"
},
"city": {
"name": "Stockholm"
},
"postcode": "118 58"
},
{
"az": "eu-north-1b",
"longitude": 18.051319122314453,
"latitude": 59.315120697021484,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "SE",
"name": "Sweden",
"flag": "🇸🇪"
},
"region": {
"code": "AB",
"name": "Stockholm"
},
"city": {
"name": "Stockholm"
},
"postcode": "118 58"
},
{
"az": "eu-north-1c",
"longitude": 18.051319122314453,
"latitude": 59.315120697021484,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "SE",
"name": "Sweden",
"flag": "🇸🇪"
},
"region": {
"code": "AB",
"name": "Stockholm"
},
"city": {
"name": "Stockholm"
},
"postcode": "118 58"
},
{
"az": "eu-south-1a",
"longitude": 9.192000389099121,
"latitude": 45.47200012207031,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IT",
"name": "Italy",
"flag": "🇮🇹"
},
"region": {
"code": 25,
"name": "Lombardy"
},
"city": {
"name": "Milan"
},
"postcode": 20121
},
{
"az": "eu-south-1b",
"longitude": 9.192000389099121,
"latitude": 45.47200012207031,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IT",
"name": "Italy",
"flag": "🇮🇹"
},
"region": {
"code": 25,
"name": "Lombardy"
},
"city": {
"name": "Milan"
},
"postcode": 20121
},
{
"az": "eu-south-1b",
"longitude": 9.192899703979492,
"latitude": 45.48379898071289,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IT",
"name": "Italy",
"flag": "🇮🇹"
},
"region": {
"code": 25,
"name": "Lombardy"
},
"city": {
"name": "Milan"
},
"postcode": 20124
},
{
"az": "eu-south-1c",
"longitude": 9.192000389099121,
"latitude": 45.47200012207031,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IT",
"name": "Italy",
"flag": "🇮🇹"
},
"region": {
"code": 25,
"name": "Lombardy"
},
"city": {
"name": "Milan"
},
"postcode": 20121
},
{
"az": "eu-west-1a",
"longitude": -6.243330001831055,
"latitude": 53.35388946533203,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IE",
"name": "Ireland",
"flag": "🇮🇪"
},
"region": {
"code": "L",
"name": "Leinster"
},
"city": {
"name": "Dublin"
},
"postcode": null
},
{
"az": "eu-west-1b",
"longitude": -6.243330001831055,
"latitude": 53.35388946533203,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IE",
"name": "Ireland",
"flag": "🇮🇪"
},
"region": {
"code": "L",
"name": "Leinster"
},
"city": {
"name": "Dublin"
},
"postcode": null
},
{
"az": "eu-west-1c",
"longitude": -6.243330001831055,
"latitude": 53.35388946533203,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "IE",
"name": "Ireland",
"flag": "🇮🇪"
},
"region": {
"code": "L",
"name": "Leinster"
},
"city": {
"name": "Dublin"
},
"postcode": null
},
{
"az": "eu-west-2c",
"longitude": -0.12574,
"latitude": 51.5122184753418,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "GB",
"name": "United Kingdom",
"flag": "🇬🇧"
},
"region": {
"code": "ENG",
"name": "England"
},
"city": {
"name": "Blackheath"
},
"postcode": "EC1M"
},
{
"az": "eu-west-2c",
"longitude": 0,
"latitude": 51.5122184753418,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "GB",
"name": "United Kingdom",
"flag": "🇬🇧"
},
"region": {
"code": "ENG",
"name": "England"
},
"city": {
"name": "Blackheath"
},
"postcode": "EC1M"
},
{
"az": "eu-west-3a",
"longitude": 2.3410699367523193,
"latitude": 48.8602294921875,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "FR",
"name": "France",
"flag": "🇫🇷"
},
"region": {
"code": "IDF",
"name": "Île-de-France"
},
"city": {
"name": "Saint-Ouen"
},
"postcode": 75001
},
{
"az": "eu-west-3c",
"longitude": 2.3410699367523193,
"latitude": 48.8602294921875,
"continent": {
"code": "EU",
"name": "Europe"
},
"country": {
"code": "FR",
"name": "France",
"flag": "🇫🇷"
},
"region": {
"code": "IDF",
"name": "Île-de-France"
},
"city": {
"name": "Saint-Ouen"
},
"postcode": 75001
},
{
"az": "us-east-1b",
"longitude": -77.47419738769531,
"latitude": 39.043701171875,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "VA",
"name": "Virginia"
},
"city": {
"name": "Ashburn"
},
"postcode": 20147
},
{
"az": "us-east-1c",
"longitude": -77.47419738769531,
"latitude": 39.043701171875,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "VA",
"name": "Virginia"
},
"city": {
"name": "Ashburn"
},
"postcode": 20147
},
{
"az": "us-east-1d",
"longitude": -77.47419738769531,
"latitude": 39.043701171875,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "VA",
"name": "Virginia"
},
"city": {
"name": "Ashburn"
},
"postcode": 20147
},
{
"az": "us-east-1f",
"longitude": -77.47419738769531,
"latitude": 39.043701171875,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "VA",
"name": "Virginia"
},
"city": {
"name": "Ashburn"
},
"postcode": 20147
},
{
"az": "us-east-2b",
"longitude": -82.99945831298828,
"latitude": 39.99557876586914,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "OH",
"name": "Ohio"
},
"city": {
"name": "Columbus"
},
"postcode": 43201
},
{
"az": "us-east-2c",
"longitude": -82.99945831298828,
"latitude": 39.99557876586914,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "OH",
"name": "Ohio"
},
"city": {
"name": "Columbus"
},
"postcode": 43201
},
{
"az": "us-west-1a",
"longitude": -121.83822631835938,
"latitude": 37.330528259277344,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "CA",
"name": "California"
},
"city": {
"name": "San Jose"
},
"postcode": 95122
},
{
"az": "us-west-1b",
"longitude": -121.83822631835938,
"latitude": 37.330528259277344,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "CA",
"name": "California"
},
"city": {
"name": "San Jose"
},
"postcode": 95122
},
{
"az": "us-west-2d",
"longitude": -119.81143188476562,
"latitude": 45.73722839355469,
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States",
"flag": "🇺🇸"
},
"region": {
"code": "OR",
"name": "Oregon"
},
"city": {
"name": "Boardman"
},
"postcode": 97818
}
]
note that this is not an accurate representation of az locations. it's just the result of running geolocation queries against the public ip addresses of multiple ec2 instances.
You can read on this Amazon doc page that Availability Zones are not map to a specific place :
To ensure that resources are distributed across the Availability Zones for a region, we independently map Availability Zones to identifiers for each account. For example, your Availability Zone us-east-1a might not be the same location as us-east-1a for another account. Note that there's no way for you to coordinate Availability Zones between accounts.
UPADTE : according to Pavel comment below, please note that now you can use unique identifier for availability zone AZ ID :
To coordinate Availability Zones across accounts, you must use the AZ ID, which is a unique and consistent identifier for an Availability Zone. For example, use1-az1 is an AZ ID for the us-east-1 Region and it has the same location in every AWS account.
Source aws documentation