Skip to content

Instantly share code, notes, and snippets.

@senthilthyagarajan
Created May 1, 2017 04:18
Show Gist options
  • Save senthilthyagarajan/a829a9f335a4e18e9d9aac0aadfafa25 to your computer and use it in GitHub Desktop.
Save senthilthyagarajan/a829a9f335a4e18e9d9aac0aadfafa25 to your computer and use it in GitHub Desktop.
Harry Potter Vs Voldemort
license: gpl-3.0
height: 900
{
"nodes": [{
"bio": "Brother of Sirius. Used to be a Death Eater but defected.",
"name": "Regulus Arcturus Black",
"group" :"0",
"id" : "0"
},
{
"bio": "Best friend of James Potter and godfather of Harry.",
"name": "Sirius Black",
"group" :"0",
"id" : "1"
},
{
"bio": "Killed by a werewolf. She was a gryffindor student who dated Ron. ",
"name": "Lavender Brown",
"group" :"0",
"id" : "2"
},
{
"bio": "Ravenclaw student who dated Cedric Diggory and Harry Potter.",
"name": "Cho Chang",
"group" :"0",
"id" : "3"
},
{
"bio": "Father of Crabbe and death0eater who escaped Azkaban.",
"name": "Vincent Crabbe Sr.",
"group" :"1",
"id" : "4"
},
{
"bio": "Slytherin student who was best friends with Goyle and followed Draco.",
"name": "Vincent Crabbe",
"group" :"1",
"id" : "5"
},
{
"bio": "Head of the department of Internation Magical Cooperation. Killed by his son.",
"name": "Bartemius \"Barty\" Crouch Sr.",
"group" :"0",
"id" : "6"
},
{
"bio": "Death Eater who impersonated Alastor Moody.",
"name": "Bartemius \"Barty\" Crouch Jr.",
"group" :"1",
"id" : "7"
},
{
"bio": "Participated in the Triwizard tournament and married Bill Weasley.",
"name": "Fleur Delacour",
"group" :"0",
"id" : "8"
},
{
"bio": "Participated in the Triwizard tournament and got killed by Voldemort.",
"name": "Cedric Diggory",
"group" :"0",
"id" : "9"
},
{
"bio": "Albus' brother and owner of Hog's Head.",
"name": "Alberforth Dumbledore",
"group" :"0",
"id" : "10"
},
{
"bio": "Headmaster of Hogwards killed by Snape.",
"name": "Albus Dumbledore",
"group" :"0",
"id" : "11"
},
{
"bio": "Muggle son of Vernon and Petunia and first0cousin of Harry.",
"name": "Dudley Dursley",
"group" :"0",
"id" : "12"
},
{
"bio": "Harry's aunt and sister of Lily.",
"name": "Petunia Dursley",
"group" :"0",
"id" : "13"
},
{
"bio": "Harry's muggle uncle.",
"name": "Vernon Dursley",
"group" :"0",
"id" : "14"
},
{
"bio": "Squib caretake of Hogwards.",
"name": "Argus Filch",
"group" :"0",
"id" : "15"
},
{
"bio": "Harry's friend and member of Dumbledore's army.",
"name": "Seamus Finnigan",
"group" :"0",
"id" : "16"
},
{
"bio": "Creator of the Philosopher's Stone.",
"name": "Nicolas Flamel",
"group" :"0",
"id" : "17"
},
{
"bio": "Minister of Magic that was forced to resign.",
"name": "Cornelius Fudge",
"group" :"0",
"id" : "18"
},
{
"bio": "Death Eater and father of Gregory Goyle.",
"name": "Goyle Sr.",
"group" :"1",
"id" : "19"
},
{
"bio": "Best friend of Crabbe. Slytherin student and dies by falling into Fiendfyre.",
"name": "Gregory Goyle",
"group" :"1",
"id" : "20"
},
{
"bio": "One of Harry's best friend and marries Ron Weasley.",
"name": "Hermione Granger",
"group" :"0",
"id" : "21"
},
{
"bio": "Half0giant who loves Harry. He was the keeper of Keys and Grounds at Hogwards.",
"name": "Rubeus Hagrname",
"group" :"0",
"id" : "22"
},
{
"bio": "Highmaster of Durmstrang and reformed death0eater.",
"name": "Igor Karkaroff",
"group" :"1",
"id" : "23"
},
{
"bio": "Participant in the Triwizard tournament. Dated Hermione.",
"name": "Viktor Krum",
"group" :"0",
"id" : "24"
},
{
"bio": "Death Eater who was killed by Molly Weasley.",
"name": "Bellatrix Lestrange",
"group" :"1",
"id" : "25"
},
{
"bio": "Mother of Neville who was tortured by Bellatrix.",
"name": "Alice Longbottom",
"group" :"0",
"id" : "26"
},
{
"bio": "Father of Neville who was tortured by Bellatrix.",
"name": "Frank Longbottom",
"group" :"0",
"id" : "27"
},
{
"bio": "Gryffindor student who was a member of Dumbledore's army.",
"name": "Neville Longbottom",
"group" :"0",
"id" : "28"
},
{
"bio": "Ravenclaw student who was a member of Dumbledore's army.",
"name": "Luna Lovegood",
"group" :"0",
"id" : "29"
},
{
"bio": "Father of Luna and editor of The Quibbler.",
"name": "Xenophilius Lovegood",
"group" :"0",
"id" : "30"
},
{
"bio": "Friend of James Potter and werewolf. He married Nymphadora.",
"name": "Remus Lupin",
"group" :"0",
"id" : "31"
},
{
"bio": "Slytherin student who had many arguments with Harry.",
"name": "Draco Malfoy",
"group" :"1",
"id" : "32"
},
{
"bio": "Father of Draco and influential Death0Eater.",
"name": "Lucius Malfoy",
"group" :"1",
"id" : "33"
},
{
"bio": "Mother of Draco and sister of Bellatrix.",
"name": "Narcissa Malfoy",
"group" :"1",
"id" : "34"
},
{
"bio": "Half0giantess and headmistress of Beauxbatons.",
"name": "Olympe Maxime",
"group" :"0",
"id" : "35"
},
{
"bio": "Professor of Transfiguration and head of Gryffindor.",
"name": "Minerva McGonagall",
"group" :"0",
"id" : "36"
},
{
"bio": "Retired auror and member of the order of the Phoenix. Killed by Voldemort.",
"name": "Alastor \"Mad0Eye\" Moody",
"group" :"0",
"id" : "37"
},
{
"bio": "Betrays James and Lily Potter. Follower of Voldemort.",
"name": "Peter Pettigrew",
"group" :"1",
"id" : "38"
},
{
"bio": "The boy who lived. Main character of the series.",
"name": "Harry Potter",
"group" :"2",
"id" : "39"
},
{
"bio": "Father of Harry. Murdered by Voldemort.",
"name": "James Potter",
"group" :"0",
"id" : "40"
},
{
"bio": "Mother of Harry. Murdered by Voldemort.",
"name": "Lily Potter",
"group" :"0",
"id" : "41"
},
{
"bio": "Possessed by Voldemort. Defence against the Dark Arts professor.",
"name": "Quirinus Quirrell",
"group" :"1",
"id" : "42"
},
{
"bio": "Muggle father of Voldemort who was killed by him.",
"name": "Tom Rnamedle Sr.",
"group" :"1",
"id" : "43"
},
{
"bio": "Muggle mother of Voldemort who was killed by him.",
"name": "Mary Rnamedle",
"group" :"1",
"id" : "44"
},
{
"bio": "The antagonist of the series who murdered many.",
"name": "Lord Voldemort",
"group" :"3",
"id" : "45"
},
{
"bio": "Reporter at the Daily Prophet.",
"name": "Rita Skeeter",
"group" :"1",
"id" : "46"
},
{
"bio": "Head of the Slytherin house and saved Harry in many occasions.",
"name": "Severus Snape",
"group" :"0",
"id" : "47"
},
{
"bio": "Married Remus Lupin and was killed by Bellatrix.",
"name": "Nymphadora Tonks",
"group" :"0",
"id" : "48"
},
{
"bio": "Senior undersecretary to the Ministry of Magic. Eventually sent to Azkaban.",
"name": "Dolores Janes Umbrnamege",
"group" :"1",
"id" : "49"
},
{
"bio": "Father of the Weasleys and member of the Order of the Phoenix.",
"name": "Arthur Weasley",
"group" :"0",
"id" : "50"
},
{
"bio": "Oldest son of Arthur and Molly. Husband of Fleur. ",
"name": "Bill Weasley",
"group" :"0",
"id" : "51"
},
{
"bio": "Second son of Arthur and Molly. Works with dragons in Romania.",
"name": "Charlie Weasley",
"group" :"0",
"id" : "52"
},
{
"bio": "nameentical twin with George and co0owner of Weasleys' Wizard Wheezes",
"name": "Fred Weasley",
"group" :"0",
"id" : "53"
},
{
"bio": "nameentical twin with Fred and co0owner of Weasleys' Wizard Wheezes",
"name": "George Weasley",
"group" :"0",
"id" : "54"
},
{
"bio": "Marries Harry Potter and only daughter of Molly and Arthur.",
"name": "Ginny Weasley",
"group" :"0",
"id" : "55"
},
{
"bio": "Wife of Arthur and mother of the Weasleys. Kills Bellatrix.",
"name": "Molly Weasley",
"group" :"0",
"id" : "56"
},
{
"bio": "Third son of Arthur and Molly. He is a Gryffindor prefect.",
"name": "Percy Weasley",
"group" :"0",
"id" : "57"
},
{
"bio": "Harry's best friend. Marries Hermione.",
"name": "Ron Weasley",
"group" :"0",
"id" : "58"
},
{
"bio": "House elf and friend of Harry. He is killed by Bellatrix.",
"name": "Dobby",
"group" :"0",
"id" : "59"
},
{
"bio": "Three0headed dog belonging to Rubeus Hagrname.",
"name": "Fluffy",
"group" :"0",
"id" : "60"
},
{
"bio": "Harry's owl.",
"name": "Hedwig",
"group" :"0",
"id" : "61"
},
{
"bio": "Ghost at Hogwards.",
"name": "Moaning Myrtle",
"group" :"0",
"id" : "62"
},
{
"bio": "Acromantula belonging to Rubeus Hagrname.",
"name": "Aragog",
"group" :"0",
"id" : "63"
},
{
"bio": "Giant0half brother of Hagrname.",
"name": "Grawp",
"group" :"0",
"id" : "64"
}],
"links": [{
"source": "58",
"target": "49",
"value": "0",
"triads": ["T1"]
},
{
"source": "55",
"target": "53",
"triads": ["T3",
"T1"]
},
{
"source": "12",
"target": "22",
"value": "0",
"triads": ["T1"]
},
{
"source": "51",
"value": "1",
"target": "8",
"triads": ["T3"]
},
{
"source": "4",
"value": "1",
"target": "47",
"triads": ["T2"]
},
{
"source": "58",
"value": "0",
"target": "38",
"triads": ["T0",
"T1"]
},
{
"source": "34",
"value": "1",
"target": "45",
"triads": ["T3",
"T1"]
},
{
"source": "47",
"value": "1",
"target": "58",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "33",
"value": "1",
"target": "45",
"triads": ["T3",
"T1"]
},
{
"source": "1",
"value": "1",
"target": "11",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "37",
"value": "1",
"target": "1",
"triads": ["T3",
"T1"]
},
{
"source": "7",
"value": "1",
"target": "28",
"triads": ["T2"]
},
{
"source": "47",
"value": "1",
"target": "53",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "0",
"value": "0",
"target": "25",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "55",
"value": "1",
"target": "54",
"triads": ["T3",
"T1"]
},
{
"source": "25",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "51",
"value": "1",
"target": "50",
"triads": ["T3"]
},
{
"source": "21",
"value": "1",
"target": "37",
"triads": ["T3",
"T1"]
},
{
"source": "41",
"value": "1",
"target": "11",
"triads": ["T3",
"T1"]
},
{
"source": "1",
"value": "1",
"target": "40",
"triads": ["T3",
"T1"]
},
{
"source": "52",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "0",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "50",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "28",
"value": "1",
"target": "2",
"triads": ["T2",
"T3"]
},
{
"source": "24",
"value": "1",
"target": "8",
"triads": ["T3"]
},
{
"source": "33",
"value": "1",
"target": "18",
"triads": ["T1"]
},
{
"source": "11",
"value": "0",
"target": "46",
"triads": ["T1"]
},
{
"source": "38",
"value": "0",
"target": "1",
"triads": ["T0",
"T1"]
},
{
"source": "33",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "21",
"value": "1",
"target": "22",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "58",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "29",
"value": "1",
"target": "28",
"triads": ["T3"]
},
{
"source": "58",
"value": "1",
"target": "28",
"triads": ["T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "43",
"triads": ["T0",
"T1"]
},
{
"source": "5",
"value": "0",
"target": "21",
"triads": ["T1"]
},
{
"source": "28",
"value": "0",
"target": "32",
"triads": ["T1"]
},
{
"source": "53",
"value": "1",
"target": "1",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "41",
"value": "0",
"target": "13",
"triads": ["T1"]
},
{
"source": "18",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "32",
"value": "1",
"target": "34",
"triads": ["T3"]
},
{
"source": "39",
"value": "0",
"target": "7",
"triads": ["T2",
"T1"]
},
{
"source": "34",
"value": "1",
"target": "25",
"triads": ["T3",
"T1"]
},
{
"source": "27",
"value": "1",
"target": "28",
"triads": ["T3",
"T1"]
},
{
"source": "42",
"value": "1",
"target": "11",
"triads": ["T2",
"T1"]
},
{
"source": "63",
"value": "0",
"target": "39",
"triads": ["T2",
"T1"]
},
{
"source": "8",
"value": "1",
"target": "21",
"triads": ["T3"]
},
{
"source": "54",
"value": "0",
"target": "38",
"triads": ["T0",
"T1"]
},
{
"source": "63",
"value": "1",
"target": "58",
"triads": ["T2",
"T3"]
},
{
"source": "39",
"value": "1",
"target": "58",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "40",
"triads": ["T3",
"T1"]
},
{
"source": "52",
"value": "1",
"target": "51",
"triads": ["T3",
"T1"]
},
{
"source": "51",
"value": "1",
"target": "11",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "1",
"target": "16",
"triads": ["T2",
"T3"]
},
{
"source": "3",
"value": "1",
"target": "16",
"triads": ["T3"]
},
{
"source": "45",
"value": "0",
"target": "40",
"triads": ["T1"]
},
{
"source": "16",
"value": "1",
"target": "28",
"triads": ["T3"]
},
{
"source": "58",
"value": "1",
"target": "2",
"triads": ["T2",
"T3"]
},
{
"source": "11",
"value": "1",
"target": "58",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "58",
"value": "0",
"target": "25",
"triads": ["T1"]
},
{
"source": "45",
"value": "0",
"target": "37",
"triads": ["T1"]
},
{
"source": "53",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "1",
"target": "58",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "47",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "3",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "54",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "11",
"value": "1",
"target": "53",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "58",
"value": "1",
"target": "54",
"triads": ["T3",
"T1"]
},
{
"source": "38",
"value": "0",
"target": "11",
"triads": ["T1"]
},
{
"source": "64",
"value": "1",
"target": "39",
"triads": ["T3"]
},
{
"source": "21",
"value": "1",
"target": "29",
"triads": ["T3"]
},
{
"source": "15",
"value": "0",
"target": "1",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "32",
"value": "1",
"target": "20",
"triads": ["T3",
"T1"]
},
{
"source": "58",
"value": "0",
"target": "33",
"triads": ["T1"]
},
{
"source": "56",
"value": "1",
"target": "21",
"triads": ["T3",
"T1"]
},
{
"source": "49",
"value": "1",
"target": "15",
"triads": ["T2",
"T1"]
},
{
"source": "4",
"value": "1",
"target": "25",
"triads": ["T2",
"T3"]
},
{
"source": "33",
"value": "0",
"target": "59",
"triads": ["T1"]
},
{
"source": "1",
"value": "0",
"target": "45",
"triads": ["T0",
"T1"]
},
{
"source": "59",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "19",
"value": "1",
"target": "45",
"triads": ["T3"]
},
{
"source": "57",
"value": "1",
"target": "51",
"triads": ["T3"]
},
{
"source": "37",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "50",
"value": "1",
"target": "55",
"triads": ["T3"]
},
{
"source": "51",
"value": "1",
"target": "54",
"triads": ["T3",
"T1"]
},
{
"source": "28",
"value": "1",
"target": "26",
"triads": ["T3"]
},
{
"source": "1",
"value": "1",
"target": "54",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "25",
"value": "0",
"target": "48",
"triads": ["T1"]
},
{
"source": "39",
"value": "0",
"target": "14",
"triads": ["T1"]
},
{
"source": "11",
"value": "0",
"target": "25",
"triads": ["T1"]
},
{
"source": "9",
"value": "1",
"target": "3",
"triads": ["T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "24",
"triads": ["T3"]
},
{
"source": "29",
"value": "1",
"target": "39",
"triads": ["T3"]
},
{
"source": "21",
"value": "0",
"target": "45",
"triads": ["T0",
"T1"]
},
{
"source": "58",
"value": "1",
"target": "22",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "36",
"value": "1",
"target": "39",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "45",
"value": "1",
"target": "38",
"triads": ["T3",
"T1"]
},
{
"source": "1",
"value": "1",
"target": "21",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "31",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "58",
"value": "1",
"target": "53",
"triads": ["T3",
"T1"]
},
{
"source": "31",
"value": "1",
"target": "11",
"triads": ["T3",
"T1"]
},
{
"source": "11",
"value": "0",
"target": "13",
"triads": ["T1"]
},
{
"source": "56",
"value": "1",
"target": "1",
"triads": ["T3",
"T1"]
},
{
"source": "53",
"value": "0",
"target": "15",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "25",
"value": "0",
"target": "59",
"triads": ["T1"]
},
{
"source": "47",
"value": "0",
"target": "1",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "8",
"value": "1",
"target": "28",
"triads": ["T3"]
},
{
"source": "47",
"value": "1",
"target": "15",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "53",
"value": "1",
"target": "54",
"triads": ["T3",
"T1"]
},
{
"source": "43",
"value": "1",
"target": "44",
"triads": ["T2",
"T1"]
},
{
"source": "49",
"value": "1",
"target": "18",
"triads": ["T1"]
},
{
"source": "41",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "31",
"value": "1",
"target": "53",
"triads": ["T3",
"T1"]
},
{
"source": "13",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "11",
"value": "1",
"target": "47",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "1",
"value": "1",
"target": "36",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "27",
"value": "1",
"target": "26",
"triads": ["T3"]
},
{
"source": "20",
"value": "0",
"target": "21",
"triads": ["T1"]
},
{
"source": "36",
"value": "1",
"target": "15",
"triads": ["T2",
"T3"]
},
{
"source": "19",
"value": "1",
"target": "4",
"triads": ["T3"]
},
{
"source": "21",
"value": "1",
"target": "36",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "28",
"value": "1",
"target": "21",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "22",
"value": "1",
"target": "64",
"triads": ["T3"]
},
{
"source": "13",
"value": "1",
"target": "12",
"triads": ["T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "28",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "10",
"value": "1",
"target": "11",
"triads": ["T3"]
},
{
"source": "37",
"value": "0",
"target": "7",
"triads": ["T1"]
},
{
"source": "49",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "21",
"value": "0",
"target": "60",
"triads": ["T2",
"T1"]
},
{
"source": "21",
"value": "1",
"target": "51",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "0",
"target": "49",
"triads": ["T1"]
},
{
"source": "50",
"value": "1",
"target": "21",
"triads": ["T3"]
},
{
"source": "39",
"value": "1",
"target": "52",
"triads": ["T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "56",
"triads": ["T1"]
},
{
"source": "33",
"value": "1",
"target": "4",
"triads": ["T3"]
},
{
"source": "57",
"value": "1",
"target": "50",
"triads": ["T2",
"T3"]
},
{
"source": "22",
"value": "1",
"target": "11",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "35",
"value": "1",
"target": "22",
"triads": ["T3"]
},
{
"source": "53",
"value": "0",
"target": "38",
"triads": ["T0",
"T1"]
},
{
"source": "58",
"value": "1",
"target": "64",
"triads": ["T3"]
},
{
"source": "51",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "38",
"value": "1",
"target": "4",
"triads": ["T3"]
},
{
"source": "38",
"value": "0",
"target": "21",
"triads": ["T0",
"T1"]
},
{
"source": "60",
"value": "1",
"target": "22",
"triads": ["T2"]
},
{
"source": "58",
"value": "1",
"target": "1",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "39",
"value": "0",
"target": "32",
"triads": ["T1"]
},
{
"source": "56",
"value": "0",
"target": "33",
"triads": ["T1"]
},
{
"source": "1",
"value": "1",
"target": "55",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "7",
"value": "1",
"target": "45",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "5",
"value": "1",
"target": "49",
"triads": ["T1"]
},
{
"source": "11",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "19",
"value": "1",
"target": "20",
"triads": ["T3"]
},
{
"source": "59",
"value": "1",
"target": "10",
"triads": ["T3"]
},
{
"source": "45",
"value": "0",
"target": "48",
"triads": ["T1"]
},
{
"source": "33",
"value": "0",
"target": "50",
"triads": ["T1"]
},
{
"source": "56",
"value": "1",
"target": "37",
"triads": ["T3",
"T1"]
},
{
"source": "16",
"value": "1",
"target": "58",
"triads": ["T3"]
},
{
"source": "39",
"value": "0",
"target": "12",
"triads": ["T1"]
},
{
"source": "53",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "54",
"value": "1",
"target": "11",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "11",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "0",
"target": "63",
"triads": ["T2",
"T1"]
},
{
"source": "15",
"value": "0",
"target": "21",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "45",
"value": "1",
"target": "25",
"triads": ["T3",
"T1"]
},
{
"source": "54",
"value": "1",
"target": "21",
"triads": ["T3",
"T1"]
},
{
"source": "3",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "58",
"value": "0",
"target": "20",
"triads": ["T1"]
},
{
"source": "55",
"value": "1",
"target": "47",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "52",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "58",
"value": "1",
"target": "10",
"triads": ["T3"]
},
{
"source": "31",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "56",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "1",
"value": "0",
"target": "33",
"triads": ["T1"]
},
{
"source": "50",
"value": "1",
"target": "1",
"triads": ["T3",
"T1"]
},
{
"source": "25",
"value": "1",
"target": "33",
"triads": ["T3",
"T1"]
},
{
"source": "29",
"value": "1",
"target": "16",
"triads": ["T3"]
},
{
"source": "21",
"value": "1",
"target": "24",
"triads": ["T3"]
},
{
"source": "11",
"value": "1",
"target": "15",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "40",
"value": "0",
"target": "38",
"triads": ["T0",
"T1"]
},
{
"source": "47",
"value": "1",
"target": "21",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "22",
"triads": ["T1"]
},
{
"source": "22",
"value": "1",
"target": "63",
"triads": ["T2",
"T3"]
},
{
"source": "58",
"value": "1",
"target": "29",
"triads": ["T3"]
},
{
"source": "36",
"value": "1",
"target": "22",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "53",
"value": "1",
"target": "52",
"triads": ["T3",
"T1"]
},
{
"source": "22",
"value": "1",
"target": "47",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "51",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "44",
"triads": ["T1"]
},
{
"source": "54",
"value": "1",
"target": "52",
"triads": ["T3",
"T1"]
},
{
"source": "55",
"value": "1",
"target": "57",
"triads": ["T3"]
},
{
"source": "0",
"value": "1",
"target": "4",
"triads": ["T2"]
},
{
"source": "5",
"value": "1",
"target": "20",
"triads": ["T3",
"T1"]
},
{
"source": "14",
"value": "1",
"target": "13",
"triads": ["T3",
"T1"]
},
{
"source": "11",
"value": "1",
"target": "39",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "33",
"value": "1",
"target": "34",
"triads": ["T3",
"T1"]
},
{
"source": "50",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "40",
"value": "1",
"target": "31",
"triads": ["T3",
"T1"]
},
{
"source": "51",
"value": "1",
"target": "53",
"triads": ["T3",
"T1"]
},
{
"source": "7",
"value": "0",
"target": "36",
"triads": ["T1"]
},
{
"source": "47",
"value": "0",
"target": "7",
"triads": ["T1"]
},
{
"source": "41",
"value": "1",
"target": "47",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "31",
"triads": ["T1"]
},
{
"source": "49",
"value": "0",
"target": "11",
"triads": ["T2",
"T1"]
},
{
"source": "16",
"value": "1",
"target": "39",
"triads": ["T3"]
},
{
"source": "15",
"value": "0",
"target": "54",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "50",
"triads": ["T3",
"T1"]
},
{
"source": "54",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "50",
"value": "0",
"target": "18",
"triads": ["T2",
"T1"]
},
{
"source": "40",
"value": "1",
"target": "11",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "55",
"value": "1",
"target": "8",
"triads": ["T3"]
},
{
"source": "39",
"value": "1",
"target": "1",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "8",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "32",
"value": "1",
"target": "33",
"triads": ["T3",
"T1"]
},
{
"source": "37",
"value": "1",
"target": "8",
"triads": ["T3"]
},
{
"source": "45",
"value": "0",
"target": "11",
"triads": ["T1"]
},
{
"source": "22",
"value": "1",
"target": "39",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "22",
"value": "1",
"target": "28",
"triads": ["T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "21",
"triads": ["T3",
"T1"]
},
{
"source": "9",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "37",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "52",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "58",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "60",
"value": "0",
"target": "39",
"triads": ["T2",
"T1"]
},
{
"source": "20",
"value": "1",
"target": "45",
"triads": ["T3",
"T1"]
},
{
"source": "1",
"value": "1",
"target": "48",
"triads": ["T3",
"T1"]
},
{
"source": "52",
"value": "1",
"target": "50",
"triads": ["T3"]
},
{
"source": "39",
"value": "1",
"target": "10",
"triads": ["T3"]
},
{
"source": "11",
"value": "1",
"target": "21",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "25",
"value": "0",
"target": "1",
"triads": ["T0",
"T1"]
},
{
"source": "24",
"value": "1",
"target": "9",
"triads": ["T3"]
},
{
"source": "45",
"value": "0",
"target": "27",
"triads": ["T1"]
},
{
"source": "21",
"value": "0",
"target": "7",
"triads": ["T2",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "36",
"triads": ["T1"]
},
{
"source": "48",
"value": "1",
"target": "31",
"triads": ["T3",
"T1"]
},
{
"source": "15",
"value": "0",
"target": "58",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "39",
"value": "0",
"target": "46",
"triads": ["T1"]
},
{
"source": "55",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "52",
"value": "1",
"target": "57",
"triads": ["T3"]
},
{
"source": "21",
"value": "1",
"target": "10",
"triads": ["T3"]
},
{
"source": "41",
"value": "1",
"target": "40",
"triads": ["T3",
"T1"]
},
{
"source": "55",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "12",
"value": "1",
"target": "14",
"triads": ["T3",
"T1"]
},
{
"source": "56",
"value": "1",
"target": "57",
"triads": ["T3"]
},
{
"source": "58",
"value": "1",
"target": "57",
"triads": ["T3"]
},
{
"source": "1",
"value": "1",
"target": "31",
"triads": ["T3",
"T1"]
},
{
"source": "37",
"value": "1",
"target": "50",
"triads": ["T3"]
},
{
"source": "5",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "16",
"value": "1",
"target": "2",
"triads": ["T2",
"T3"]
},
{
"source": "15",
"value": "0",
"target": "38",
"triads": ["T0",
"T1"]
},
{
"source": "57",
"value": "1",
"target": "11",
"triads": ["T2",
"T3"]
},
{
"source": "41",
"value": "1",
"target": "1",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "58",
"value": "0",
"target": "32",
"triads": ["T1"]
},
{
"source": "3",
"value": "1",
"target": "28",
"triads": ["T3",
"T1"]
},
{
"source": "59",
"value": "1",
"target": "21",
"triads": ["T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "39",
"triads": ["T0",
"T1"]
},
{
"source": "53",
"value": "1",
"target": "50",
"triads": ["T3"]
},
{
"source": "18",
"value": "1",
"target": "57",
"triads": ["T2"]
},
{
"source": "21",
"value": "1",
"target": "52",
"triads": ["T3",
"T1"]
},
{
"source": "9",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "11",
"value": "1",
"target": "37",
"triads": ["T3",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "42",
"triads": ["T0",
"T1"]
},
{
"source": "53",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "51",
"value": "1",
"target": "58",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "1",
"target": "3",
"triads": ["T3",
"T1"]
},
{
"source": "36",
"value": "1",
"target": "58",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "57",
"value": "1",
"target": "53",
"triads": ["T3"]
},
{
"source": "5",
"value": "1",
"target": "32",
"triads": ["T3",
"T1"]
},
{
"source": "31",
"value": "1",
"target": "54",
"triads": ["T3",
"T1"]
},
{
"source": "14",
"value": "0",
"target": "11",
"triads": ["T1"]
},
{
"source": "64",
"value": "1",
"target": "21",
"triads": ["T3"]
},
{
"source": "50",
"value": "1",
"target": "54",
"triads": ["T3"]
},
{
"source": "34",
"value": "0",
"target": "1",
"triads": ["T1"]
},
{
"source": "36",
"value": "1",
"target": "11",
"triads": ["T3",
"T1"]
},
{
"source": "51",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "7",
"value": "1",
"target": "38",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "0",
"target": "32",
"triads": ["T1"]
},
{
"source": "38",
"value": "0",
"target": "39",
"triads": ["T0",
"T1"]
},
{
"source": "40",
"value": "0",
"target": "15",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "36",
"value": "1",
"target": "31",
"triads": ["T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "31",
"triads": ["T3",
"T1"]
},
{
"source": "51",
"value": "0",
"target": "45",
"triads": ["T1"]
},
{
"source": "5",
"value": "0",
"target": "58",
"triads": ["T1"]
},
{
"source": "59",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "25",
"value": "0",
"target": "56",
"triads": ["T1"]
},
{
"source": "31",
"value": "0",
"target": "38",
"triads": ["T1"]
},
{
"source": "21",
"value": "1",
"target": "55",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "1",
"target": "53",
"triads": ["T3",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "54",
"value": "1",
"target": "47",
"triads": ["T2",
"T3",
"T1"]
},
{
"source": "38",
"value": "0",
"target": "55",
"triads": ["T1"]
},
{
"source": "47",
"value": "0",
"target": "45",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "45",
"value": "0",
"target": "52",
"triads": ["T1"]
},
{
"source": "16",
"value": "1",
"target": "55",
"triads": ["T3"]
},
{
"source": "39",
"value": "0",
"target": "15",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "57",
"value": "1",
"target": "54",
"triads": ["T3"]
},
{
"source": "22",
"value": "0",
"target": "15",
"triads": ["T2",
"T1"]
},
{
"source": "8",
"value": "1",
"target": "56",
"triads": ["T3",
"T1"]
},
{
"source": "58",
"value": "0",
"target": "60",
"triads": ["T2",
"T1"]
},
{
"source": "3",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "41",
"value": "0",
"target": "38",
"triads": ["T1"]
},
{
"source": "18",
"value": "0",
"target": "11",
"triads": ["T2",
"T1"]
},
{
"source": "39",
"value": "1",
"target": "41",
"triads": ["T3",
"T1"]
},
{
"source": "35",
"value": "1",
"target": "11",
"triads": ["T3"]
},
{
"source": "4",
"value": "1",
"target": "45",
"triads": ["T2",
"T3"]
},
{
"source": "20",
"value": "0",
"target": "39",
"triads": ["T1"]
},
{
"source": "0",
"value": "0",
"target": "1",
"triads": ["T0"]
},
{
"source": "45",
"value": "0",
"target": "28",
"triads": ["T2",
"T1"]
},
{
"source": "42",
"value": "0",
"target": "39",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "59",
"value": "0",
"target": "32",
"triads": ["T1"]
},
{
"source": "25",
"value": "0",
"target": "8",
"triads": ["T1"]
},
{
"source": "11",
"value": "1",
"target": "52",
"triads": ["T3",
"T1"]
},
{
"source": "54",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "21",
"value": "0",
"target": "42",
"triads": ["T2",
"T0",
"T1"]
},
{
"source": "49",
"value": "0",
"target": "36",
"triads": ["T2",
"T1"]
},
{
"source": "2",
"value": "0",
"target": "21",
"triads": ["T2"]
},
{
"source": "8",
"value": "1",
"target": "39",
"triads": ["T3",
"T1"]
},
{
"source": "50",
"value": "1",
"target": "11",
"triads": ["T3",
"T1"]
},
{
"source": "6",
"value": "1",
"target": "57",
"triads": []
},
{
"source": "4",
"value": "1",
"target": "5",
"triads": []
},
{
"source": "13",
"value": "1",
"target": "13",
"triads": []
},
{
"source": "45",
"value": "0",
"target": "23",
"triads": []
},
{
"source": "35",
"value": "1",
"target": "8",
"triads": []
},
{
"source": "4",
"value": "1",
"target": "6",
"triads": []
},
{
"source": "39",
"value": "1",
"target": "61",
"triads": []
},
{
"source": "23",
"value": "1",
"target": "35",
"triads": []
},
{
"source": "6",
"value": "0",
"target": "7",
"triads": []
},
{
"source": "6",
"value": "1",
"target": "23",
"triads": []
},
{
"source": "24",
"value": "1",
"target": "23",
"triads": []
},
{
"source": "29",
"value": "1",
"target": "30",
"triads": []
},
{
"source": "17",
"value": "1",
"target": "11",
"triads": []
},
{
"source": "39",
"value": "1",
"target": "62",
"triads": []
},
{
"source": "12",
"value": "1",
"target": "12",
"triads": []
},
{
"source": "43",
"value": "0",
"target": "43",
"triads": []
}]
}
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.link {
stroke: #ccc;
}
.node text {
pointer-events: none;
font: 10px sans-serif;
}
</style>
<body>
<script src="https://d3js.org/d3.v3.min.js"></script><script>
//Constants for the SVG
var width = 900,
height = 900;
//Set up the colour scale
var color = d3.scale.category10();
//Set up the force layout
var force = d3.layout.force()
.charge(-620)
.linkDistance(200)
.size([width, height]);
//Append a SVG to the body of the html page. Assign this SVG as an object to svg
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
//Read the data from the mis element
d3.json("hp.json", function(error, graph) {
if (error) throw error;
//Creates the graph data structure out of the json data
force.nodes(graph.nodes)
.links(graph.links)
.start();
//Create all the line svgs but without locations yet
var link = svg.selectAll(".link")
.data(graph.links)
.enter().append("line")
.attr("class", "link")
.style("stroke-width", function(d) {
return Math.sqrt(d.value);
});
//Do the same with the circles for the nodes - no
//Changed
var node = svg.selectAll(".node")
.data(graph.nodes)
.enter().append("g")
.attr("class", "node")
.call(force.drag);
node.append("circle")
.attr("r", 8)
.style("fill", function(d) {
return color(d.group);
})
node.append("text")
.attr("dx", 10)
.attr("dy", ".35em")
.text(function(d) {
return d.name
});
//End changed
//Now we are giving the SVGs co-ordinates - the force layout is generating the co-ordinates which this code is using to update the attributes of the SVG elements
force.on("tick", function() {
link.attr("x1", function(d) {
return d.source.x;
})
.attr("y1", function(d) {
return d.source.y;
})
.attr("x2", function(d) {
return d.target.x;
})
.attr("y2", function(d) {
return d.target.y;
});
//Changed
d3.selectAll("circle").attr("cx", function(d) {
return d.x;
})
.attr("cy", function(d) {
return d.y;
});
d3.selectAll("text").attr("x", function(d) {
return d.x;
})
.attr("y", function(d) {
return d.y;
});
//End Changed
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment