1
It is possible to create a chart in Chord using the library d3
?
Follows graph data structure in format JSON
:
{"links": [
{
"id": "11",
"color": "#d96500\r\n\r\n",
"source": "Norte ",
"target": "Norte",
"id2": "11",
"value": "110042",
"total": "112827",
"percentagem": "97.53"
},
{
"id": "11",
"color": "#bdb66c\r\n",
"source": "Norte ",
"target": "Algarve",
"id2": "15",
"value": "148",
"total": "112827",
"percentagem": "0.13"
},
{
"id": "11",
"color": "#bdaf57\r\n",
"source": "Norte ",
"target": "Centro",
"id2": "16",
"value": "1533",
"total": "112827",
"percentagem": "1.36"
},
{
"id": "11",
"color": "#fffbc4\r\n",
"source": "Norte ",
"target": "Lisboa",
"id2": "17",
"value": "810",
"total": "112827",
"percentagem": "0.72"
},
{
"id": "11",
"color": "#f5b367",
"source": "Norte ",
"target": "Alentejo",
"id2": "18",
"value": "180",
"total": "112827",
"percentagem": "0.16"
},
{
"id": "11",
"color": "#f5b367\r\n",
"source": "Norte ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "66",
"total": "112827",
"percentagem": "0.06"
},
{
"id": "11",
"color": "#decf00\r\n",
"source": "Norte ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "48",
"total": "112827",
"percentagem": "0.04"
},
{
"id": "15",
"color": "#d96500\r\n\r\n",
"source": "Algarve ",
"target": "Norte",
"id2": "11",
"value": "37",
"total": "11633",
"percentagem": "0.32"
},
{
"id": "15",
"color": "#bdb66c\r\n",
"source": "Algarve ",
"target": "Algarve",
"id2": "15",
"value": "11202",
"total": "11633",
"percentagem": "96.30"
},
{
"id": "15",
"color": "#bdaf57\r\n",
"source": "Algarve ",
"target": "Centro",
"id2": "16",
"value": "53",
"total": "11633",
"percentagem": "0.46"
},
{
"id": "15",
"color": "#fffbc4\r\n",
"source": "Algarve ",
"target": "Lisboa",
"id2": "17",
"value": "240",
"total": "11633",
"percentagem": "2.06"
},
{
"id": "15",
"color": "#f5b367",
"source": "Algarve ",
"target": "Alentejo",
"id2": "18",
"value": "95",
"total": "11633",
"percentagem": "0.82"
},
{
"id": "15",
"color": "#f5b367\r\n",
"source": "Algarve ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "4",
"total": "11633",
"percentagem": "0.03"
},
{
"id": "15",
"color": "#decf00\r\n",
"source": "Algarve ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "2",
"total": "11633",
"percentagem": "0.02"
},
{
"id": "16",
"color": "#d96500\r\n\r\n",
"source": "Centro ",
"target": "Norte",
"id2": "11",
"value": "1211",
"total": "68002",
"percentagem": "1.78"
},
{
"id": "16",
"color": "#bdb66c\r\n",
"source": "Centro ",
"target": "Algarve",
"id2": "15",
"value": "143",
"total": "68002",
"percentagem": "0.21"
},
{
"id": "16",
"color": "#bdaf57\r\n",
"source": "Centro ",
"target": "Centro",
"id2": "16",
"value": "63709",
"total": "68002",
"percentagem": "93.69"
},
{
"id": "16",
"color": "#fffbc4\r\n",
"source": "Centro ",
"target": "Lisboa",
"id2": "17",
"value": "2249",
"total": "68002",
"percentagem": "3.31"
},
{
"id": "16",
"color": "#f5b367",
"source": "Centro ",
"target": "Alentejo",
"id2": "18",
"value": "617",
"total": "68002",
"percentagem": "0.91"
},
{
"id": "16",
"color": "#f5b367\r\n",
"source": "Centro ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "39",
"total": "68002",
"percentagem": "0.06"
},
{
"id": "16",
"color": "#decf00\r\n",
"source": "Centro ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "34",
"total": "68002",
"percentagem": "0.05"
},
{
"id": "17",
"color": "#d96500\r\n\r\n",
"source": "Lisboa ",
"target": "Norte",
"id2": "11",
"value": "279",
"total": "83584",
"percentagem": "0.33"
},
{
"id": "17",
"color": "#bdb66c\r\n",
"source": "Lisboa ",
"target": "Algarve",
"id2": "15",
"value": "272",
"total": "83584",
"percentagem": "0.33"
},
{
"id": "17",
"color": "#bdaf57\r\n",
"source": "Lisboa ",
"target": "Centro",
"id2": "16",
"value": "960",
"total": "83584",
"percentagem": "1.15"
},
{
"id": "17",
"color": "#fffbc4\r\n",
"source": "Lisboa ",
"target": "Lisboa",
"id2": "17",
"value": "81247",
"total": "83584",
"percentagem": "97.20"
},
{
"id": "17",
"color": "#f5b367",
"source": "Lisboa ",
"target": "Alentejo",
"id2": "18",
"value": "726",
"total": "83584",
"percentagem": "0.87"
},
{
"id": "17",
"color": "#f5b367\r\n",
"source": "Lisboa ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "46",
"total": "83584",
"percentagem": "0.06"
},
{
"id": "17",
"color": "#decf00\r\n",
"source": "Lisboa ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "54",
"total": "83584",
"percentagem": "0.06"
},
{
"id": "18",
"color": "#d96500\r\n\r\n",
"source": "Alentejo ",
"target": "Norte",
"id2": "11",
"value": "46",
"total": "21572",
"percentagem": "0.21"
},
{
"id": "18",
"color": "#bdb66c\r\n",
"source": "Alentejo ",
"target": "Algarve",
"id2": "15",
"value": "195",
"total": "21572",
"percentagem": "0.90"
},
{
"id": "18",
"color": "#bdaf57\r\n",
"source": "Alentejo ",
"target": "Centro",
"id2": "16",
"value": "508",
"total": "21572",
"percentagem": "2.35"
},
{
"id": "18",
"color": "#fffbc4\r\n",
"source": "Alentejo ",
"target": "Lisboa",
"id2": "17",
"value": "1265",
"total": "21572",
"percentagem": "5.86"
},
{
"id": "18",
"color": "#f5b367",
"source": "Alentejo ",
"target": "Alentejo",
"id2": "18",
"value": "19542",
"total": "21572",
"percentagem": "90.59"
},
{
"id": "18",
"color": "#f5b367\r\n",
"source": "Alentejo ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "8",
"total": "21572",
"percentagem": "0.04"
},
{
"id": "18",
"color": "#decf00\r\n",
"source": "Alentejo ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "8",
"total": "21572",
"percentagem": "0.04"
},
{
"id": "20",
"color": "#d96500\r\n\r\n",
"source": "Região Autónoma dos Açores ",
"target": "Norte",
"id2": "11",
"value": "33",
"total": "7079",
"percentagem": "0.47"
},
{
"id": "20",
"color": "#bdb66c\r\n",
"source": "Região Autónoma dos Açores ",
"target": "Algarve",
"id2": "15",
"value": "8",
"total": "7079",
"percentagem": "0.11"
},
{
"id": "20",
"color": "#bdaf57\r\n",
"source": "Região Autónoma dos Açores ",
"target": "Centro",
"id2": "16",
"value": "42",
"total": "7079",
"percentagem": "0.59"
},
{
"id": "20",
"color": "#fffbc4\r\n",
"source": "Região Autónoma dos Açores ",
"target": "Lisboa",
"id2": "17",
"value": "132",
"total": "7079",
"percentagem": "1.86"
},
{
"id": "20",
"color": "#f5b367",
"source": "Região Autónoma dos Açores ",
"target": "Alentejo",
"id2": "18",
"value": "11",
"total": "7079",
"percentagem": "0.16"
},
{
"id": "20",
"color": "#f5b367\r\n",
"source": "Região Autónoma dos Açores ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "6838",
"total": "7079",
"percentagem": "96.60"
},
{
"id": "20",
"color": "#decf00\r\n",
"source": "Região Autónoma dos Açores ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "15",
"total": "7079",
"percentagem": "0.21"
},
{
"id": "30",
"color": "#d96500\r\n\r\n",
"source": "Região Autónoma da Madeira ",
"target": "Norte",
"id2": "11",
"value": "71",
"total": "7537",
"percentagem": "0.94"
},
{
"id": "30",
"color": "#bdb66c\r\n",
"source": "Região Autónoma da Madeira ",
"target": "Algarve",
"id2": "15",
"value": "6",
"total": "7537",
"percentagem": "0.08"
},
{
"id": "30",
"color": "#bdaf57\r\n",
"source": "Região Autónoma da Madeira ",
"target": "Centro",
"id2": "16",
"value": "53",
"total": "7537",
"percentagem": "0.70"
},
{
"id": "30",
"color": "#fffbc4\r\n",
"source": "Região Autónoma da Madeira ",
"target": "Lisboa",
"id2": "17",
"value": "92",
"total": "7537",
"percentagem": "1.22"
},
{
"id": "30",
"color": "#f5b367",
"source": "Região Autónoma da Madeira ",
"target": "Alentejo",
"id2": "18",
"value": "17",
"total": "7537",
"percentagem": "0.23"
},
{
"id": "30",
"color": "#f5b367\r\n",
"source": "Região Autónoma da Madeira ",
"target": "Região Autónoma dos Açores",
"id2": "20",
"value": "7",
"total": "7537",
"percentagem": "0.09"
},
{
"id": "30",
"color": "#decf00\r\n",
"source": "Região Autónoma da Madeira ",
"target": "Região Autónoma da Madeira",
"id2": "30",
"value": "7291",
"total": "7537",
"percentagem": "96.74"
}
] ,"nodes": [
{
"name": "Norte ",
"color": "#d96500\r\n\r\n",
"xpos": "0"
},
{
"name": "Norte",
"color": "#d96500\r\n\r\n",
"xpos": "1"
},
{
"name": "Algarve ",
"color": "#bdb66c\r\n",
"xpos": "0"
},
{
"name": "Algarve",
"color": "#bdb66c\r\n",
"xpos": "1"
},
{
"name": "Centro ",
"color": "#bdaf57\r\n",
"xpos": "0"
},
{
"name": "Centro",
"color": "#bdaf57\r\n",
"xpos": "1"
},
{
"name": "Lisboa ",
"color": "#fffbc4\r\n",
"xpos": "0"
},
{
"name": "Lisboa",
"color": "#fffbc4\r\n",
"xpos": "1"
},
{
"name": "Alentejo ",
"color": "#f5b367",
"xpos": "0"
},
{
"name": "Alentejo",
"color": "#f5b367",
"xpos": "1"
},
{
"name": "Região Autónoma dos Açores ",
"color": "#f5b367\r\n",
"xpos": "0"
},
{
"name": "Região Autónoma dos Açores",
"color": "#f5b367\r\n",
"xpos": "1"
},
{
"name": "Região Autónoma da Madeira ",
"color": "#decf00\r\n",
"xpos": "0"
},
{
"name": "Região Autónoma da Madeira",
"color": "#decf00\r\n",
"xpos": "1"
}
]}
other data other data from the file
You want to know if the library receives a json as a parameter?
– durtto
with this example instead of Matrix.json I have to generate from origin , destination ,quantiadade http://answall.com/questions/150496/gr%C3%A1fico-Chord-usado-o-D3-js
– usersantos
Colleague, welcome to SOPT. This site is not a forum. If you haven’t done it yet, do the [tour] and mainly read [Ask]. You even posted the link to another question of yours that looks exactly the same.
– Luiz Vieira
@Luizvieira agree that the question referenced in the link should be even closed, now this one can even be portrayed, agree. BS: I’ll copy your sentence, it was good.
– durtto
@user2964140 I do not know a single diagram that cannot be done using the
D3.js
. you can consult the documentation for this type of chart: D3-Chord and the following examples: Uber Rides by Neighborhood, The Euro Debt Crisis and Chord Diagram– Tobias Mesquita
your comment failed to help your question. Stop, think, reflect on where you want to go, understand your doubt, this is essential. Try to do this, otherwise it will be difficult for you to express yourself. This is a tip for your life. Express yourself objectively.
– durtto
my doubt is even in the matrix
– usersantos
@durtto Hi. I don’t know if I understood what you meant. You suggested to leave this open and close the other as duplicate of this? If yes, whatever. The PA can (should actually) [Edit] this (any one, in fact) to improve it.
– Luiz Vieira
User[...], which matrix? So, what is the doubt about the matrix? Anyway, both in this and in the other question your question is "Is it possible to create a graph"? And the answer is yes. Edit the question to make it directly clear exactly what your difficulty is.
– Luiz Vieira
P.S.: And, seriously, read [Ask]. It will help you. :)
– Luiz Vieira