Skip to content

Instantly share code, notes, and snippets.

@nitaku
Last active October 19, 2015 13:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nitaku/a8aa67de3cd9f2e0554e to your computer and use it in GitHub Desktop.
Save nitaku/a8aa67de3cd9f2e0554e to your computer and use it in GitHub Desktop.
Tree colors (sunburst, DBpedia)

A partial implementation of the tree color scheme proposed in Tennekes, Jonge 2014, applied to a sunburst representation of the canonically sorted DBpedia hierarchical ontology.

Hue is used to differentiate subtrees, while luminance (and chroma) to encode depth.

This implementation misses the five-element permutation feature described in the paper above. The effect on the visualization is that similar pairs of different colors are repeated one after each other.

As in the original work, the effect of hue is mainly limited to the first levels. The case of DBpedia is especially bad, because of the high number of nodes at the first level.

{
"name": "http://www.w3.org/2002/07/owl#Thing",
"leaf_count": 533,
"children": [
{
"name": "http://dbpedia.org/ontology/Place",
"leaf_count": 9175,
"children": [
{
"name": "http://dbpedia.org/ontology/PopulatedPlace",
"leaf_count": 6,
"children": [
{
"name": "http://dbpedia.org/ontology/Region",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/AdministrativeRegion",
"leaf_count": 18599,
"children": [
{
"name": "http://dbpedia.org/ontology/ClericalAdministrativeRegion",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/Diocese",
"leaf_count": 3049
}
]
},
{
"name": "http://dbpedia.org/ontology/GovernmentalAdministrativeRegion",
"leaf_count": 6,
"children": [
{
"name": "http://dbpedia.org/ontology/Department",
"leaf_count": 1
},
{
"name": "http://dbpedia.org/ontology/District",
"leaf_count": 1
},
{
"name": "http://dbpedia.org/ontology/Municipality",
"leaf_count": 1
},
{
"name": "http://dbpedia.org/ontology/Province",
"leaf_count": 1
}
]
}
]
}
]
},
{
"name": "http://dbpedia.org/ontology/Settlement",
"leaf_count": 225439,
"children": [
{
"name": "http://dbpedia.org/ontology/Village",
"leaf_count": 160111
},
{
"name": "http://dbpedia.org/ontology/Town",
"leaf_count": 43038
},
{
"name": "http://dbpedia.org/ontology/City",
"leaf_count": 20895
}
]
},
{
"name": "http://dbpedia.org/ontology/Island",
"leaf_count": 4100
},
{
"name": "http://dbpedia.org/ontology/Country",
"leaf_count": 3109
},
{
"name": "http://dbpedia.org/ontology/Continent",
"leaf_count": 17
},
{
"name": "http://dbpedia.org/ontology/Territory",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/NaturalPlace",
"leaf_count": 4,
"children": [
{
"name": "http://dbpedia.org/ontology/BodyOfWater",
"leaf_count": 599,
"children": [
{
"name": "http://dbpedia.org/ontology/Stream",
"leaf_count": 39,
"children": [
{
"name": "http://dbpedia.org/ontology/River",
"leaf_count": 26295
},
{
"name": "http://dbpedia.org/ontology/Canal",
"leaf_count": 287
}
]
},
{
"name": "http://dbpedia.org/ontology/Lake",
"leaf_count": 10669
}
]
},
{
"name": "http://dbpedia.org/ontology/Mountain",
"leaf_count": 13772
},
{
"name": "http://dbpedia.org/ontology/MountainRange",
"leaf_count": 2220
},
{
"name": "http://dbpedia.org/ontology/Crater",
"leaf_count": 2130
},
{
"name": "http://dbpedia.org/ontology/MountainPass",
"leaf_count": 976
},
{
"name": "http://dbpedia.org/ontology/Volcano",
"leaf_count": 786
},
{
"name": "http://dbpedia.org/ontology/Glacier",
"leaf_count": 642
},
{
"name": "http://dbpedia.org/ontology/Cave",
"leaf_count": 402
},
{
"name": "http://dbpedia.org/ontology/Valley",
"leaf_count": 123
}
]
},
{
"name": "http://dbpedia.org/ontology/ArchitecturalStructure",
"leaf_count": 371,
"children": [
{
"name": "http://dbpedia.org/ontology/Infrastructure",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/RouteOfTransportation",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Road",
"leaf_count": 18765
},
{
"name": "http://dbpedia.org/ontology/Bridge",
"leaf_count": 3543
},
{
"name": "http://dbpedia.org/ontology/RailwayLine",
"leaf_count": 2791
},
{
"name": "http://dbpedia.org/ontology/RoadTunnel",
"leaf_count": 191
},
{
"name": "http://dbpedia.org/ontology/RoadJunction",
"leaf_count": 134
},
{
"name": "http://dbpedia.org/ontology/RailwayTunnel",
"leaf_count": 132
},
{
"name": "http://dbpedia.org/ontology/WaterwayTunnel",
"leaf_count": 19
}
]
},
{
"name": "http://dbpedia.org/ontology/Station",
"leaf_count": 21435,
"children": [
{
"name": "http://dbpedia.org/ontology/RailwayStation",
"leaf_count": 6816
}
]
},
{
"name": "http://dbpedia.org/ontology/Airport",
"leaf_count": 13649
},
{
"name": "http://dbpedia.org/ontology/Dam",
"leaf_count": 2769
},
{
"name": "http://dbpedia.org/ontology/PowerStation",
"leaf_count": 2436
},
{
"name": "http://dbpedia.org/ontology/LaunchPad",
"leaf_count": 83
}
]
},
{
"name": "http://dbpedia.org/ontology/Building",
"leaf_count": 45119,
"children": [
{
"name": "http://dbpedia.org/ontology/HistoricBuilding",
"leaf_count": 6250
},
{
"name": "http://dbpedia.org/ontology/Museum",
"leaf_count": 4195
},
{
"name": "http://dbpedia.org/ontology/ReligiousBuilding",
"leaf_count": 3468
},
{
"name": "http://dbpedia.org/ontology/Hospital",
"leaf_count": 2618
},
{
"name": "http://dbpedia.org/ontology/ShoppingMall",
"leaf_count": 2444
},
{
"name": "http://dbpedia.org/ontology/Castle",
"leaf_count": 1282
},
{
"name": "http://dbpedia.org/ontology/Restaurant",
"leaf_count": 1213
},
{
"name": "http://dbpedia.org/ontology/Hotel",
"leaf_count": 1111
},
{
"name": "http://dbpedia.org/ontology/Prison",
"leaf_count": 885
},
{
"name": "http://dbpedia.org/ontology/Skyscraper",
"leaf_count": 3
}
]
},
{
"name": "http://dbpedia.org/ontology/Tower",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/Lighthouse",
"leaf_count": 1535
}
]
},
{
"name": "http://dbpedia.org/ontology/Venue",
"leaf_count": 818,
"children": [
{
"name": "http://dbpedia.org/ontology/Theatre",
"leaf_count": 1333
}
]
},
{
"name": "http://dbpedia.org/ontology/AmusementParkAttraction",
"leaf_count": 500,
"children": [
{
"name": "http://dbpedia.org/ontology/RollerCoaster",
"leaf_count": 692
},
{
"name": "http://dbpedia.org/ontology/WaterRide",
"leaf_count": 73
}
]
},
{
"name": "http://dbpedia.org/ontology/MilitaryStructure",
"leaf_count": 3537
},
{
"name": "http://dbpedia.org/ontology/Tunnel",
"leaf_count": 59
},
{
"name": "http://dbpedia.org/ontology/Mill",
"leaf_count": 4
}
]
},
{
"name": "http://dbpedia.org/ontology/SportFacility",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/RaceTrack",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Racecourse",
"leaf_count": 215
}
]
},
{
"name": "http://dbpedia.org/ontology/Stadium",
"leaf_count": 8623
},
{
"name": "http://dbpedia.org/ontology/GolfCourse",
"leaf_count": 366
},
{
"name": "http://dbpedia.org/ontology/CricketGround",
"leaf_count": 265
}
]
},
{
"name": "http://dbpedia.org/ontology/HistoricPlace",
"leaf_count": 14012
},
{
"name": "http://dbpedia.org/ontology/ProtectedArea",
"leaf_count": 8305
},
{
"name": "http://dbpedia.org/ontology/Park",
"leaf_count": 2844
},
{
"name": "http://dbpedia.org/ontology/WorldHeritageSite",
"leaf_count": 1025
},
{
"name": "http://dbpedia.org/ontology/SiteOfSpecialScientificInterest",
"leaf_count": 1008
},
{
"name": "http://dbpedia.org/ontology/SkiArea",
"leaf_count": 605
},
{
"name": "http://dbpedia.org/ontology/Garden",
"leaf_count": 379
},
{
"name": "http://dbpedia.org/ontology/Monument",
"leaf_count": 362
},
{
"name": "http://dbpedia.org/ontology/WineRegion",
"leaf_count": 345
},
{
"name": "http://dbpedia.org/ontology/Mine",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/Agent",
"leaf_count": 1876,
"children": [
{
"name": "http://dbpedia.org/ontology/Person",
"leaf_count": 587317,
"children": [
{
"name": "http://dbpedia.org/ontology/Athlete",
"leaf_count": 25166,
"children": [
{
"name": "http://dbpedia.org/ontology/MotorsportRacer",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/RacingDriver",
"leaf_count": 2021,
"children": [
{
"name": "http://dbpedia.org/ontology/NascarDriver",
"leaf_count": 920
},
{
"name": "http://dbpedia.org/ontology/FormulaOneRacer",
"leaf_count": 852
}
]
},
{
"name": "http://dbpedia.org/ontology/MotorcycleRider",
"leaf_count": 1035,
"children": [
{
"name": "http://dbpedia.org/ontology/SpeedwayRider",
"leaf_count": 654
}
]
}
]
},
{
"name": "http://dbpedia.org/ontology/GridironFootballPlayer",
"leaf_count": 6843,
"children": [
{
"name": "http://dbpedia.org/ontology/AmericanFootballPlayer",
"leaf_count": 13909
}
]
},
{
"name": "http://dbpedia.org/ontology/Wrestler",
"leaf_count": 3371,
"children": [
{
"name": "http://dbpedia.org/ontology/SumoWrestler",
"leaf_count": 457
}
]
},
{
"name": "http://dbpedia.org/ontology/Boxer",
"leaf_count": 3350,
"children": [
{
"name": "http://dbpedia.org/ontology/AmateurBoxer",
"leaf_count": 407
}
]
},
{
"name": "http://dbpedia.org/ontology/VolleyballPlayer",
"leaf_count": 1211,
"children": [
{
"name": "http://dbpedia.org/ontology/BeachVolleyballPlayer",
"leaf_count": 128
}
]
},
{
"name": "http://dbpedia.org/ontology/SnookerPlayer",
"leaf_count": 281,
"children": [
{
"name": "http://dbpedia.org/ontology/SnookerChamp",
"leaf_count": 24
}
]
},
{
"name": "http://dbpedia.org/ontology/SoccerPlayer",
"leaf_count": 96693
},
{
"name": "http://dbpedia.org/ontology/BaseballPlayer",
"leaf_count": 20686
},
{
"name": "http://dbpedia.org/ontology/IceHockeyPlayer",
"leaf_count": 13866
},
{
"name": "http://dbpedia.org/ontology/Cricketer",
"leaf_count": 13504
},
{
"name": "http://dbpedia.org/ontology/RugbyPlayer",
"leaf_count": 12500
},
{
"name": "http://dbpedia.org/ontology/BasketballPlayer",
"leaf_count": 8152
},
{
"name": "http://dbpedia.org/ontology/AustralianRulesFootballPlayer",
"leaf_count": 6837
},
{
"name": "http://dbpedia.org/ontology/Cyclist",
"leaf_count": 4779
},
{
"name": "http://dbpedia.org/ontology/TennisPlayer",
"leaf_count": 4025
},
{
"name": "http://dbpedia.org/ontology/Swimmer",
"leaf_count": 3638
},
{
"name": "http://dbpedia.org/ontology/GaelicGamesPlayer",
"leaf_count": 3179
},
{
"name": "http://dbpedia.org/ontology/FigureSkater",
"leaf_count": 2770
},
{
"name": "http://dbpedia.org/ontology/MartialArtist",
"leaf_count": 2768
},
{
"name": "http://dbpedia.org/ontology/GolfPlayer",
"leaf_count": 2704
},
{
"name": "http://dbpedia.org/ontology/Skier",
"leaf_count": 2141
},
{
"name": "http://dbpedia.org/ontology/HandballPlayer",
"leaf_count": 1226
},
{
"name": "http://dbpedia.org/ontology/ChessPlayer",
"leaf_count": 1220
},
{
"name": "http://dbpedia.org/ontology/Gymnast",
"leaf_count": 1180
},
{
"name": "http://dbpedia.org/ontology/PokerPlayer",
"leaf_count": 636
},
{
"name": "http://dbpedia.org/ontology/BadmintonPlayer",
"leaf_count": 595
},
{
"name": "http://dbpedia.org/ontology/Curler",
"leaf_count": 591
},
{
"name": "http://dbpedia.org/ontology/Canoeist",
"leaf_count": 523
},
{
"name": "http://dbpedia.org/ontology/Jockey",
"leaf_count": 475
},
{
"name": "http://dbpedia.org/ontology/DartsPlayer",
"leaf_count": 469
},
{
"name": "http://dbpedia.org/ontology/TableTennisPlayer",
"leaf_count": 469
},
{
"name": "http://dbpedia.org/ontology/HorseRider",
"leaf_count": 436
},
{
"name": "http://dbpedia.org/ontology/SquashPlayer",
"leaf_count": 372
},
{
"name": "http://dbpedia.org/ontology/LacrossePlayer",
"leaf_count": 350
},
{
"name": "http://dbpedia.org/ontology/Skater",
"leaf_count": 316
},
{
"name": "http://dbpedia.org/ontology/NationalCollegiateAthleticAssociationAthlete",
"leaf_count": 308
},
{
"name": "http://dbpedia.org/ontology/Rower",
"leaf_count": 280
},
{
"name": "http://dbpedia.org/ontology/NetballPlayer",
"leaf_count": 248
},
{
"name": "http://dbpedia.org/ontology/Bodybuilder",
"leaf_count": 217
}
]
},
{
"name": "http://dbpedia.org/ontology/Artist",
"leaf_count": 11006,
"children": [
{
"name": "http://dbpedia.org/ontology/MusicalArtist",
"leaf_count": 44611,
"children": [
{
"name": "http://dbpedia.org/ontology/Instrumentalist",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Guitarist",
"leaf_count": 149
}
]
},
{
"name": "http://dbpedia.org/ontology/ClassicalMusicArtist",
"leaf_count": 332
}
]
},
{
"name": "http://dbpedia.org/ontology/Actor",
"leaf_count": 4433,
"children": [
{
"name": "http://dbpedia.org/ontology/AdultActor",
"leaf_count": 1497
},
{
"name": "http://dbpedia.org/ontology/VoiceActor",
"leaf_count": 571
}
]
},
{
"name": "http://dbpedia.org/ontology/Writer",
"leaf_count": 24993,
"children": [
{
"name": "http://dbpedia.org/ontology/ScreenWriter",
"leaf_count": 683
},
{
"name": "http://dbpedia.org/ontology/Poet",
"leaf_count": 322
}
]
},
{
"name": "http://dbpedia.org/ontology/Painter",
"leaf_count": 2885
},
{
"name": "http://dbpedia.org/ontology/ComicsCreator",
"leaf_count": 2542
},
{
"name": "http://dbpedia.org/ontology/Comedian",
"leaf_count": 1158
},
{
"name": "http://dbpedia.org/ontology/FashionDesigner",
"leaf_count": 656
},
{
"name": "http://dbpedia.org/ontology/Photographer",
"leaf_count": 453
}
]
},
{
"name": "http://dbpedia.org/ontology/Royalty",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/BritishRoyalty",
"leaf_count": 8089,
"children": [
{
"name": "http://dbpedia.org/ontology/Baronet",
"leaf_count": 582
}
]
}
]
},
{
"name": "http://dbpedia.org/ontology/FictionalCharacter",
"leaf_count": 3935,
"children": [
{
"name": "http://dbpedia.org/ontology/ComicsCharacter",
"leaf_count": 4246,
"children": [
{
"name": "http://dbpedia.org/ontology/AnimangaCharacter",
"leaf_count": 232
}
]
},
{
"name": "http://dbpedia.org/ontology/SoapCharacter",
"leaf_count": 2524
}
]
},
{
"name": "http://dbpedia.org/ontology/OrganisationMember",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/SportsTeamMember",
"leaf_count": 279134
}
]
},
{
"name": "http://dbpedia.org/ontology/SportsManager",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/SoccerManager",
"leaf_count": 14578
}
]
},
{
"name": "http://dbpedia.org/ontology/Politician",
"leaf_count": 18840,
"children": [
{
"name": "http://dbpedia.org/ontology/MemberOfParliament",
"leaf_count": 9139
},
{
"name": "http://dbpedia.org/ontology/Congressman",
"leaf_count": 3296
},
{
"name": "http://dbpedia.org/ontology/Governor",
"leaf_count": 2558
},
{
"name": "http://dbpedia.org/ontology/President",
"leaf_count": 2206
},
{
"name": "http://dbpedia.org/ontology/Mayor",
"leaf_count": 1789
},
{
"name": "http://dbpedia.org/ontology/PrimeMinister",
"leaf_count": 1505
},
{
"name": "http://dbpedia.org/ontology/Senator",
"leaf_count": 928
},
{
"name": "http://dbpedia.org/ontology/Chancellor",
"leaf_count": 86
}
]
},
{
"name": "http://dbpedia.org/ontology/Coach",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/CollegeCoach",
"leaf_count": 6166
},
{
"name": "http://dbpedia.org/ontology/AmericanFootballCoach",
"leaf_count": 329
},
{
"name": "http://dbpedia.org/ontology/VolleyballCoach",
"leaf_count": 29
}
]
},
{
"name": "http://dbpedia.org/ontology/Cleric",
"leaf_count": 2144,
"children": [
{
"name": "http://dbpedia.org/ontology/ChristianBishop",
"leaf_count": 5818
},
{
"name": "http://dbpedia.org/ontology/Saint",
"leaf_count": 3302
},
{
"name": "http://dbpedia.org/ontology/Cardinal",
"leaf_count": 927
},
{
"name": "http://dbpedia.org/ontology/Pope",
"leaf_count": 394
}
]
},
{
"name": "http://dbpedia.org/ontology/Scientist",
"leaf_count": 17558,
"children": [
{
"name": "http://dbpedia.org/ontology/Entomologist",
"leaf_count": 375
},
{
"name": "http://dbpedia.org/ontology/Medician",
"leaf_count": 301
}
]
},
{
"name": "http://dbpedia.org/ontology/Presenter",
"leaf_count": 101,
"children": [
{
"name": "http://dbpedia.org/ontology/RadioHost",
"leaf_count": 318
},
{
"name": "http://dbpedia.org/ontology/TelevisionHost",
"leaf_count": 43
}
]
},
{
"name": "http://dbpedia.org/ontology/Criminal",
"leaf_count": 2199,
"children": [
{
"name": "http://dbpedia.org/ontology/Murderer",
"leaf_count": 92
}
]
},
{
"name": "http://dbpedia.org/ontology/OfficeHolder",
"leaf_count": 47550
},
{
"name": "http://dbpedia.org/ontology/MilitaryPerson",
"leaf_count": 25621
},
{
"name": "http://dbpedia.org/ontology/Noble",
"leaf_count": 4811
},
{
"name": "http://dbpedia.org/ontology/Monarch",
"leaf_count": 2726
},
{
"name": "http://dbpedia.org/ontology/Judge",
"leaf_count": 2274
},
{
"name": "http://dbpedia.org/ontology/Architect",
"leaf_count": 2269
},
{
"name": "http://dbpedia.org/ontology/BeautyQueen",
"leaf_count": 2073
},
{
"name": "http://dbpedia.org/ontology/Journalist",
"leaf_count": 1848
},
{
"name": "http://dbpedia.org/ontology/Philosopher",
"leaf_count": 1515
},
{
"name": "http://dbpedia.org/ontology/Model",
"leaf_count": 1484
},
{
"name": "http://dbpedia.org/ontology/BusinessPerson",
"leaf_count": 954
},
{
"name": "http://dbpedia.org/ontology/Economist",
"leaf_count": 798
},
{
"name": "http://dbpedia.org/ontology/MythologicalFigure",
"leaf_count": 791
},
{
"name": "http://dbpedia.org/ontology/Engineer",
"leaf_count": 758
},
{
"name": "http://dbpedia.org/ontology/Religious",
"leaf_count": 751
},
{
"name": "http://dbpedia.org/ontology/Historian",
"leaf_count": 680
},
{
"name": "http://dbpedia.org/ontology/Astronaut",
"leaf_count": 637
},
{
"name": "http://dbpedia.org/ontology/Ambassador",
"leaf_count": 470
},
{
"name": "http://dbpedia.org/ontology/Chef",
"leaf_count": 462
},
{
"name": "http://dbpedia.org/ontology/PlayboyPlaymate",
"leaf_count": 295
},
{
"name": "http://dbpedia.org/ontology/HorseTrainer",
"leaf_count": 230
},
{
"name": "http://dbpedia.org/ontology/TelevisionPersonality",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/Organisation",
"leaf_count": 10819,
"children": [
{
"name": "http://dbpedia.org/ontology/Group",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Band",
"leaf_count": 30572
},
{
"name": "http://dbpedia.org/ontology/ComedyGroup",
"leaf_count": 56
}
]
},
{
"name": "http://dbpedia.org/ontology/EducationalInstitution",
"leaf_count": 590,
"children": [
{
"name": "http://dbpedia.org/ontology/School",
"leaf_count": 30141
},
{
"name": "http://dbpedia.org/ontology/University",
"leaf_count": 17538
},
{
"name": "http://dbpedia.org/ontology/College",
"leaf_count": 88
}
]
},
{
"name": "http://dbpedia.org/ontology/SportsTeam",
"leaf_count": 1794,
"children": [
{
"name": "http://dbpedia.org/ontology/SoccerClub",
"leaf_count": 19013
},
{
"name": "http://dbpedia.org/ontology/RugbyClub",
"leaf_count": 2080
},
{
"name": "http://dbpedia.org/ontology/HockeyTeam",
"leaf_count": 2016
},
{
"name": "http://dbpedia.org/ontology/BasketballTeam",
"leaf_count": 1214
},
{
"name": "http://dbpedia.org/ontology/CricketTeam",
"leaf_count": 544
},
{
"name": "http://dbpedia.org/ontology/BaseballTeam",
"leaf_count": 443
},
{
"name": "http://dbpedia.org/ontology/AustralianFootballTeam",
"leaf_count": 379
},
{
"name": "http://dbpedia.org/ontology/HandballTeam",
"leaf_count": 372
},
{
"name": "http://dbpedia.org/ontology/CyclingTeam",
"leaf_count": 255
},
{
"name": "http://dbpedia.org/ontology/FormulaOneTeam",
"leaf_count": 115
},
{
"name": "http://dbpedia.org/ontology/SpeedwayTeam",
"leaf_count": 76
},
{
"name": "http://dbpedia.org/ontology/AmericanFootballTeam",
"leaf_count": 32
},
{
"name": "http://dbpedia.org/ontology/CanadianFootballTeam",
"leaf_count": 25
}
]
},
{
"name": "http://dbpedia.org/ontology/Broadcaster",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/RadioStation",
"leaf_count": 18520
},
{
"name": "http://dbpedia.org/ontology/TelevisionStation",
"leaf_count": 7473
},
{
"name": "http://dbpedia.org/ontology/BroadcastNetwork",
"leaf_count": 1231
}
]
},
{
"name": "http://dbpedia.org/ontology/Company",
"leaf_count": 48379,
"children": [
{
"name": "http://dbpedia.org/ontology/Airline",
"leaf_count": 3387
},
{
"name": "http://dbpedia.org/ontology/RecordLabel",
"leaf_count": 3014
},
{
"name": "http://dbpedia.org/ontology/BusCompany",
"leaf_count": 1328
},
{
"name": "http://dbpedia.org/ontology/Publisher",
"leaf_count": 1141
},
{
"name": "http://dbpedia.org/ontology/LawFirm",
"leaf_count": 479
},
{
"name": "http://dbpedia.org/ontology/Brewery",
"leaf_count": 364
},
{
"name": "http://dbpedia.org/ontology/Winery",
"leaf_count": 309
}
]
},
{
"name": "http://dbpedia.org/ontology/SportsLeague",
"leaf_count": 286,
"children": [
{
"name": "http://dbpedia.org/ontology/SoccerLeague",
"leaf_count": 1443
},
{
"name": "http://dbpedia.org/ontology/RugbyLeague",
"leaf_count": 450
},
{
"name": "http://dbpedia.org/ontology/BasketballLeague",
"leaf_count": 407
},
{
"name": "http://dbpedia.org/ontology/IceHockeyLeague",
"leaf_count": 274
},
{
"name": "http://dbpedia.org/ontology/BaseballLeague",
"leaf_count": 211
},
{
"name": "http://dbpedia.org/ontology/AmericanFootballLeague",
"leaf_count": 86
},
{
"name": "http://dbpedia.org/ontology/VolleyballLeague",
"leaf_count": 82
},
{
"name": "http://dbpedia.org/ontology/LacrosseLeague",
"leaf_count": 32
},
{
"name": "http://dbpedia.org/ontology/HandballLeague",
"leaf_count": 26
},
{
"name": "http://dbpedia.org/ontology/FieldHockeyLeague",
"leaf_count": 24
},
{
"name": "http://dbpedia.org/ontology/InlineHockeyLeague",
"leaf_count": 24
},
{
"name": "http://dbpedia.org/ontology/MotorcycleRacingLeague",
"leaf_count": 21
},
{
"name": "http://dbpedia.org/ontology/SoftballLeague",
"leaf_count": 20
},
{
"name": "http://dbpedia.org/ontology/PoloLeague",
"leaf_count": 18
},
{
"name": "http://dbpedia.org/ontology/SpeedwayLeague",
"leaf_count": 16
},
{
"name": "http://dbpedia.org/ontology/GolfLeague",
"leaf_count": 14
},
{
"name": "http://dbpedia.org/ontology/TennisLeague",
"leaf_count": 11
},
{
"name": "http://dbpedia.org/ontology/CricketLeague",
"leaf_count": 9
},
{
"name": "http://dbpedia.org/ontology/AutoRacingLeague",
"leaf_count": 7
},
{
"name": "http://dbpedia.org/ontology/CanadianFootballLeague",
"leaf_count": 7
},
{
"name": "http://dbpedia.org/ontology/VideogamesLeague",
"leaf_count": 7
},
{
"name": "http://dbpedia.org/ontology/AustralianFootballLeague",
"leaf_count": 4
},
{
"name": "http://dbpedia.org/ontology/CurlingLeague",
"leaf_count": 3
},
{
"name": "http://dbpedia.org/ontology/BowlingLeague",
"leaf_count": 1
},
{
"name": "http://dbpedia.org/ontology/MixedMartialArtsLeague",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/MilitaryUnit",
"leaf_count": 15091
},
{
"name": "http://dbpedia.org/ontology/PoliticalParty",
"leaf_count": 5290
},
{
"name": "http://dbpedia.org/ontology/GovernmentAgency",
"leaf_count": 4175
},
{
"name": "http://dbpedia.org/ontology/Non-ProfitOrganisation",
"leaf_count": 4120
},
{
"name": "http://dbpedia.org/ontology/TradeUnion",
"leaf_count": 1564
},
{
"name": "http://dbpedia.org/ontology/PublicTransitSystem",
"leaf_count": 1524
},
{
"name": "http://dbpedia.org/ontology/Legislature",
"leaf_count": 1449
},
{
"name": "http://dbpedia.org/ontology/ReligiousOrganisation",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/Family",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/Event",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/SocietalEvent",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/SportsEvent",
"leaf_count": 975,
"children": [
{
"name": "http://dbpedia.org/ontology/Tournament",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/SoccerTournament",
"leaf_count": 4911
},
{
"name": "http://dbpedia.org/ontology/TennisTournament",
"leaf_count": 4354
},
{
"name": "http://dbpedia.org/ontology/GolfTournament",
"leaf_count": 1716
},
{
"name": "http://dbpedia.org/ontology/WomensTennisAssociationTournament",
"leaf_count": 61
}
]
},
{
"name": "http://dbpedia.org/ontology/Olympics",
"leaf_count": 58,
"children": [
{
"name": "http://dbpedia.org/ontology/OlympicEvent",
"leaf_count": 3614
}
]
},
{
"name": "http://dbpedia.org/ontology/Race",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/HorseRace",
"leaf_count": 1975
},
{
"name": "http://dbpedia.org/ontology/CyclingRace",
"leaf_count": 590
}
]
},
{
"name": "http://dbpedia.org/ontology/FootballMatch",
"leaf_count": 2403
},
{
"name": "http://dbpedia.org/ontology/GrandPrix",
"leaf_count": 1234
},
{
"name": "http://dbpedia.org/ontology/WrestlingEvent",
"leaf_count": 963
},
{
"name": "http://dbpedia.org/ontology/MixedMartialArtsEvent",
"leaf_count": 805
},
{
"name": "http://dbpedia.org/ontology/NationalFootballLeagueEvent",
"leaf_count": 9
}
]
},
{
"name": "http://dbpedia.org/ontology/MilitaryConflict",
"leaf_count": 12289
},
{
"name": "http://dbpedia.org/ontology/Election",
"leaf_count": 6935
},
{
"name": "http://dbpedia.org/ontology/Convention",
"leaf_count": 908
},
{
"name": "http://dbpedia.org/ontology/FilmFestival",
"leaf_count": 734
},
{
"name": "http://dbpedia.org/ontology/MusicFestival",
"leaf_count": 462
},
{
"name": "http://dbpedia.org/ontology/SpaceMission",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/NaturalEvent",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/SolarEclipse",
"leaf_count": 382
}
]
},
{
"name": "http://dbpedia.org/ontology/LifeCycleEvent",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/PersonalEvent",
"leaf_count": 4
}
]
}
]
},
{
"name": "http://dbpedia.org/ontology/Species",
"leaf_count": 4194,
"children": [
{
"name": "http://dbpedia.org/ontology/Eukaryote",
"leaf_count": 952,
"children": [
{
"name": "http://dbpedia.org/ontology/Animal",
"leaf_count": 5415,
"children": [
{
"name": "http://dbpedia.org/ontology/Mammal",
"leaf_count": 8846,
"children": [
{
"name": "http://dbpedia.org/ontology/RaceHorse",
"leaf_count": 3349
}
]
},
{
"name": "http://dbpedia.org/ontology/Insect",
"leaf_count": 93578
},
{
"name": "http://dbpedia.org/ontology/Mollusca",
"leaf_count": 27691
},
{
"name": "http://dbpedia.org/ontology/Fish",
"leaf_count": 17420
},
{
"name": "http://dbpedia.org/ontology/Bird",
"leaf_count": 12740
},
{
"name": "http://dbpedia.org/ontology/Amphibian",
"leaf_count": 5893
},
{
"name": "http://dbpedia.org/ontology/Reptile",
"leaf_count": 5273
},
{
"name": "http://dbpedia.org/ontology/Arachnid",
"leaf_count": 3967
},
{
"name": "http://dbpedia.org/ontology/Crustacean",
"leaf_count": 2545
}
]
},
{
"name": "http://dbpedia.org/ontology/Plant",
"leaf_count": 45176,
"children": [
{
"name": "http://dbpedia.org/ontology/FloweringPlant",
"leaf_count": 642,
"children": [
{
"name": "http://dbpedia.org/ontology/Grape",
"leaf_count": 370
}
]
},
{
"name": "http://dbpedia.org/ontology/CultivatedVariety",
"leaf_count": 1541
},
{
"name": "http://dbpedia.org/ontology/Fern",
"leaf_count": 884
},
{
"name": "http://dbpedia.org/ontology/Conifer",
"leaf_count": 722
},
{
"name": "http://dbpedia.org/ontology/Moss",
"leaf_count": 412
},
{
"name": "http://dbpedia.org/ontology/GreenAlga",
"leaf_count": 355
},
{
"name": "http://dbpedia.org/ontology/Cycad",
"leaf_count": 183
},
{
"name": "http://dbpedia.org/ontology/ClubMoss",
"leaf_count": 96
},
{
"name": "http://dbpedia.org/ontology/Gnetophytes",
"leaf_count": 30
},
{
"name": "http://dbpedia.org/ontology/Ginkgo",
"leaf_count": 7
}
]
},
{
"name": "http://dbpedia.org/ontology/Fungus",
"leaf_count": 9122
}
]
},
{
"name": "http://dbpedia.org/ontology/Bacteria",
"leaf_count": 538
},
{
"name": "http://dbpedia.org/ontology/Archaea",
"leaf_count": 226
}
]
},
{
"name": "http://dbpedia.org/ontology/Work",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/WrittenWork",
"leaf_count": 1310,
"children": [
{
"name": "http://dbpedia.org/ontology/PeriodicalLiterature",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/Newspaper",
"leaf_count": 5956
},
{
"name": "http://dbpedia.org/ontology/AcademicJournal",
"leaf_count": 5678
},
{
"name": "http://dbpedia.org/ontology/Magazine",
"leaf_count": 4274
}
]
},
{
"name": "http://dbpedia.org/ontology/Book",
"leaf_count": 30358,
"children": [
{
"name": "http://dbpedia.org/ontology/Novel",
"leaf_count": 672
}
]
},
{
"name": "http://dbpedia.org/ontology/Comics",
"leaf_count": 5844
},
{
"name": "http://dbpedia.org/ontology/Play",
"leaf_count": 1755
},
{
"name": "http://dbpedia.org/ontology/Poem",
"leaf_count": 376
},
{
"name": "http://dbpedia.org/ontology/Annotation",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/MusicalWork",
"leaf_count": 278,
"children": [
{
"name": "http://dbpedia.org/ontology/Song",
"leaf_count": 6011,
"children": [
{
"name": "http://dbpedia.org/ontology/EurovisionSongContestEntry",
"leaf_count": 1121
}
]
},
{
"name": "http://dbpedia.org/ontology/Album",
"leaf_count": 123374
},
{
"name": "http://dbpedia.org/ontology/Single",
"leaf_count": 45433
},
{
"name": "http://dbpedia.org/ontology/ArtistDiscography",
"leaf_count": 3494
},
{
"name": "http://dbpedia.org/ontology/ClassicalMusicComposition",
"leaf_count": 599
}
]
},
{
"name": "http://dbpedia.org/ontology/Software",
"leaf_count": 10964,
"children": [
{
"name": "http://dbpedia.org/ontology/VideoGame",
"leaf_count": 19301
},
{
"name": "http://dbpedia.org/ontology/ProgrammingLanguage",
"leaf_count": 1136
}
]
},
{
"name": "http://dbpedia.org/ontology/Cartoon",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Anime",
"leaf_count": 4188
},
{
"name": "http://dbpedia.org/ontology/HollywoodCartoon",
"leaf_count": 1586
}
]
},
{
"name": "http://dbpedia.org/ontology/Database",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/BiologicalDatabase",
"leaf_count": 333
}
]
},
{
"name": "http://dbpedia.org/ontology/Document",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/Image",
"leaf_count": 2
}
]
},
{
"name": "http://dbpedia.org/ontology/Film",
"leaf_count": 87282
},
{
"name": "http://dbpedia.org/ontology/TelevisionShow",
"leaf_count": 29466
},
{
"name": "http://dbpedia.org/ontology/TelevisionEpisode",
"leaf_count": 7991
},
{
"name": "http://dbpedia.org/ontology/Artwork",
"leaf_count": 3755
},
{
"name": "http://dbpedia.org/ontology/Website",
"leaf_count": 3639
},
{
"name": "http://dbpedia.org/ontology/TelevisionSeason",
"leaf_count": 2883
},
{
"name": "http://dbpedia.org/ontology/Musical",
"leaf_count": 1265
},
{
"name": "http://dbpedia.org/ontology/RadioProgram",
"leaf_count": 988
},
{
"name": "http://dbpedia.org/ontology/CollectionOfValuables",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/SportsSeason",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/SportsTeamSeason",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/FootballLeagueSeason",
"leaf_count": 6195,
"children": [
{
"name": "http://dbpedia.org/ontology/NationalFootballLeagueSeason",
"leaf_count": 3108
}
]
},
{
"name": "http://dbpedia.org/ontology/NCAATeamSeason",
"leaf_count": 7925
},
{
"name": "http://dbpedia.org/ontology/SoccerClubSeason",
"leaf_count": 7100
},
{
"name": "http://dbpedia.org/ontology/BaseballSeason",
"leaf_count": 293
}
]
},
{
"name": "http://dbpedia.org/ontology/MotorsportSeason",
"leaf_count": 2390
}
]
},
{
"name": "http://dbpedia.org/ontology/UnitOfWork",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Case",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/LegalCase",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/SupremeCourtOfTheUnitedStatesCase",
"leaf_count": 2564
}
]
}
]
},
{
"name": "http://dbpedia.org/ontology/Project",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/ResearchProject",
"leaf_count": 25
}
]
}
]
},
{
"name": "http://dbpedia.org/ontology/TopicalConcept",
"leaf_count": 9,
"children": [
{
"name": "http://dbpedia.org/ontology/Genre",
"leaf_count": 3,
"children": [
{
"name": "http://dbpedia.org/ontology/MusicGenre",
"leaf_count": 1142
}
]
},
{
"name": "http://dbpedia.org/ontology/Fashion",
"leaf_count": 483
},
{
"name": "http://dbpedia.org/ontology/Type",
"leaf_count": 2
},
{
"name": "http://dbpedia.org/ontology/TheologicalConcept",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/Biomolecule",
"leaf_count": 2,
"children": [
{
"name": "http://dbpedia.org/ontology/Gene",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/HumanGene",
"leaf_count": 15
},
{
"name": "http://dbpedia.org/ontology/MouseGene",
"leaf_count": 10
}
]
},
{
"name": "http://dbpedia.org/ontology/Protein",
"leaf_count": 13359
},
{
"name": "http://dbpedia.org/ontology/Enzyme",
"leaf_count": 4992
}
]
},
{
"name": "http://dbpedia.org/ontology/Activity",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Sport",
"leaf_count": 209,
"children": [
{
"name": "http://dbpedia.org/ontology/Boxing",
"leaf_count": 2
}
]
},
{
"name": "http://dbpedia.org/ontology/Game",
"leaf_count": 1356
}
]
},
{
"name": "http://dbpedia.org/ontology/Food",
"leaf_count": 5209,
"children": [
{
"name": "http://dbpedia.org/ontology/Beverage",
"leaf_count": 808,
"children": [
{
"name": "http://dbpedia.org/ontology/Wine",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/Cheese",
"leaf_count": 322
}
]
},
{
"name": "http://dbpedia.org/ontology/MeanOfTransportation",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Ship",
"leaf_count": 27131
},
{
"name": "http://dbpedia.org/ontology/Aircraft",
"leaf_count": 9678
},
{
"name": "http://dbpedia.org/ontology/Automobile",
"leaf_count": 8485
},
{
"name": "http://dbpedia.org/ontology/Locomotive",
"leaf_count": 3093
},
{
"name": "http://dbpedia.org/ontology/Train",
"leaf_count": 1214
},
{
"name": "http://dbpedia.org/ontology/Motorcycle",
"leaf_count": 926
},
{
"name": "http://dbpedia.org/ontology/Rocket",
"leaf_count": 249
},
{
"name": "http://dbpedia.org/ontology/Spacecraft",
"leaf_count": 159
},
{
"name": "http://dbpedia.org/ontology/SpaceStation",
"leaf_count": 31
},
{
"name": "http://dbpedia.org/ontology/SpaceShuttle",
"leaf_count": 18
}
]
},
{
"name": "http://dbpedia.org/ontology/Device",
"leaf_count": 985,
"children": [
{
"name": "http://dbpedia.org/ontology/AutomobileEngine",
"leaf_count": 22907
},
{
"name": "http://dbpedia.org/ontology/Weapon",
"leaf_count": 5409
},
{
"name": "http://dbpedia.org/ontology/InformationAppliance",
"leaf_count": 1035
},
{
"name": "http://dbpedia.org/ontology/Instrument",
"leaf_count": 2
},
{
"name": "http://dbpedia.org/ontology/Camera",
"leaf_count": 1
}
]
},
{
"name": "http://dbpedia.org/ontology/CelestialBody",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/Asteroid",
"leaf_count": 17086
},
{
"name": "http://dbpedia.org/ontology/Planet",
"leaf_count": 11894
},
{
"name": "http://dbpedia.org/ontology/Star",
"leaf_count": 3250
},
{
"name": "http://dbpedia.org/ontology/Galaxy",
"leaf_count": 635
}
]
},
{
"name": "http://dbpedia.org/ontology/ChemicalSubstance",
"leaf_count": 1,
"children": [
{
"name": "http://dbpedia.org/ontology/ChemicalCompound",
"leaf_count": 9427
},
{
"name": "http://dbpedia.org/ontology/Mineral",
"leaf_count": 1198
}
]
},
{
"name": "http://dbpedia.org/ontology/Medicine",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/Disease",
"leaf_count": 6078
}
]
},
{
"name": "http://dbpedia.org/ontology/Name",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/GivenName",
"leaf_count": 3345
},
{
"name": "http://dbpedia.org/ontology/Surname",
"leaf_count": 1084
}
]
},
{
"name": "http://dbpedia.org/ontology/TimePeriod",
"leaf_count": 83910,
"children": [
{
"name": "http://dbpedia.org/ontology/Year",
"leaf_count": 2037
},
{
"name": "http://dbpedia.org/ontology/YearInSpaceflight",
"leaf_count": 60
}
]
},
{
"name": "http://dbpedia.org/ontology/Satellite",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/ArtificialSatellite",
"leaf_count": 1909
}
]
},
{
"name": "http://dbpedia.org/ontology/SportCompetitionResult",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/OlympicResult",
"leaf_count": 765
}
]
},
{
"name": "http://dbpedia.org/ontology/AnatomicalStructure",
"leaf_count": 1780,
"children": [
{
"name": "http://dbpedia.org/ontology/Brain",
"leaf_count": 550
},
{
"name": "http://dbpedia.org/ontology/Bone",
"leaf_count": 415
},
{
"name": "http://dbpedia.org/ontology/Artery",
"leaf_count": 368
},
{
"name": "http://dbpedia.org/ontology/Nerve",
"leaf_count": 336
},
{
"name": "http://dbpedia.org/ontology/Muscle",
"leaf_count": 280
},
{
"name": "http://dbpedia.org/ontology/Vein",
"leaf_count": 234
},
{
"name": "http://dbpedia.org/ontology/Ligament",
"leaf_count": 194
},
{
"name": "http://dbpedia.org/ontology/Embryology",
"leaf_count": 188
},
{
"name": "http://dbpedia.org/ontology/Lymph",
"leaf_count": 81
}
]
},
{
"name": "http://dbpedia.org/ontology/GeneLocation",
"leaf_count": 0,
"children": [
{
"name": "http://dbpedia.org/ontology/HumanGeneLocation",
"leaf_count": 9
},
{
"name": "http://dbpedia.org/ontology/MouseGeneLocation",
"leaf_count": 8
}
]
},
{
"name": "http://dbpedia.org/ontology/CareerStation",
"leaf_count": 643162
},
{
"name": "http://dbpedia.org/ontology/PersonFunction",
"leaf_count": 126796
},
{
"name": "http://www.opengis.net/gml/_Feature",
"leaf_count": 14001
},
{
"name": "http://dbpedia.org/ontology/Language",
"leaf_count": 7928
},
{
"name": "http://dbpedia.org/ontology/Sales",
"leaf_count": 6626
},
{
"name": "http://dbpedia.org/ontology/Drug",
"leaf_count": 5590
},
{
"name": "http://dbpedia.org/ontology/EthnicGroup",
"leaf_count": 4595
},
{
"name": "http://dbpedia.org/ontology/Award",
"leaf_count": 3803
},
{
"name": "http://dbpedia.org/ontology/Colour",
"leaf_count": 1019
},
{
"name": "http://dbpedia.org/ontology/Holiday",
"leaf_count": 938
},
{
"name": "http://dbpedia.org/ontology/Currency",
"leaf_count": 355
},
{
"name": "http://dbpedia.org/ontology/SnookerWorldRanking",
"leaf_count": 34
},
{
"name": "http://dbpedia.org/ontology/Swarm",
"leaf_count": 2
},
{
"name": "http://dbpedia.org/ontology/Competition",
"leaf_count": 1
},
{
"name": "http://dbpedia.org/ontology/List",
"leaf_count": 1
}
]
}
treehue = (node, hue_range, fraction, rev) ->
# 0 <= hue_range[0] <= hue_range[1]
r = hue_range[1]-hue_range[0]
node.hue = hue_range[0]+r/2
if node.children?
n = node.children.length
ri = r/n
child_hue_ranges = []
half_n = Math.floor(n/2)
for i in [0...half_n]
child_hue_ranges.push [
hue_range[0] + ri*i + ri*(1-fraction)/2,
hue_range[0] + ri*(i+1) - ri*(1-fraction)/2
]
child_hue_ranges.push [
hue_range[0] + ri*(i+half_n) + ri*(1-fraction)/2,
hue_range[0] + ri*(i+1+half_n) - ri*(1-fraction)/2
]
# if n is odd we need to push the middle item
if n%2 is 1
child_hue_ranges.push [
hue_range[0] + ri*(half_n) + ri*(1-fraction)/2,
hue_range[0] + ri*(1+half_n) - ri*(1-fraction)/2
]
child_hue_ranges.reverse() if rev
for child, i in node.children
treehue(child, child_hue_ranges[i], fraction, i % 2 is 0)
treelum = d3.scale.linear()
.range([80,10])
treechroma = d3.scale.sqrt()
.range([0,90])
# layout, behaviors and scales
RADIUS = 250
partition = d3.layout.partition()
.sort(null)
.size([2 * Math.PI, RADIUS * RADIUS])
.value((node) -> node.leaf_count)
arc = d3.svg.arc()
.startAngle((d) -> d.x )
.endAngle((d) -> d.x + d.dx )
.innerRadius((d) -> Math.sqrt(d.y) )
.outerRadius((d) -> Math.sqrt(d.y + d.dy) )
svg = d3.select('svg')
width = svg.node().getBoundingClientRect().width
height = svg.node().getBoundingClientRect().height
# translate the viewBox to have (0,0) at the center of the vis
svg
.attr
viewBox: "#{-width/2} #{-height/2} #{width} #{height}"
# append a group for zoomable content
zoomable_layer = svg.append('g')
# define a zoom behavior
zoom = d3.behavior.zoom()
.scaleExtent([1,10]) # min-max zoom
.on 'zoom', () ->
# GEOMETRIC ZOOM
zoomable_layer
.attr
transform: "translate(#{zoom.translate()})scale(#{zoom.scale()})"
# bind the zoom behavior to the main SVG
svg.call(zoom)
# group the visualization
vis = zoomable_layer.append('g')
d3.json 'dbpedia_canonical.json', (tree) ->
treehue(tree, [0,360], 0.7)
treelum
.domain([0, 5])
treechroma
.domain([0, 5])
vis.datum(tree)
nodes = vis.selectAll('.node')
.data((t) -> partition.nodes(t))
enter_nodes = nodes.enter().insert('path','path')
.attr
class: 'node'
d: arc
fill: (n) -> d3.hcl(n.hue, treechroma(n.depth), treelum(n.depth))
enter_nodes.append('title')
.text((node) -> node.name.split('/').reverse()[0])
vis.append('text')
.text((tree) -> tree.name.split('/').reverse()[0])
.attr
class: 'label'
dy: '0.35em'
svg {
background: white;
}
.node {
vector-effect: non-scaling-stroke;
stroke: white;
stroke-width: 1;
}
.node:hover {
fill: #FC3;
}
.label {
pointer-events: none;
fill: #444;
text-anchor: middle;
font-family: sans-serif;
font-size: 28px;
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tree colors (sunburst, DBpedia)</title>
<link type="text/css" href="index.css" rel="stylesheet"/>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="//wafi.iit.cnr.it/webvis/libs/jigmaps/zip.js"></script>
<script src="//wafi.iit.cnr.it/webvis/libs/jigmaps/tree_utils.js"></script>
</head>
<body>
<svg height="500" width="960"></svg>
<script src="index.js"></script>
</body>
</html>
// Generated by CoffeeScript 1.4.0
(function() {
var RADIUS, arc, height, partition, svg, treechroma, treehue, treelum, vis, width, zoom, zoomable_layer;
treehue = function(node, hue_range, fraction, rev) {
var child, child_hue_ranges, half_n, i, n, r, ri, _i, _j, _len, _ref, _results;
r = hue_range[1] - hue_range[0];
node.hue = hue_range[0] + r / 2;
if (node.children != null) {
n = node.children.length;
ri = r / n;
child_hue_ranges = [];
half_n = Math.floor(n / 2);
for (i = _i = 0; 0 <= half_n ? _i < half_n : _i > half_n; i = 0 <= half_n ? ++_i : --_i) {
child_hue_ranges.push([hue_range[0] + ri * i + ri * (1 - fraction) / 2, hue_range[0] + ri * (i + 1) - ri * (1 - fraction) / 2]);
child_hue_ranges.push([hue_range[0] + ri * (i + half_n) + ri * (1 - fraction) / 2, hue_range[0] + ri * (i + 1 + half_n) - ri * (1 - fraction) / 2]);
}
if (n % 2 === 1) {
child_hue_ranges.push([hue_range[0] + ri * half_n + ri * (1 - fraction) / 2, hue_range[0] + ri * (1 + half_n) - ri * (1 - fraction) / 2]);
}
if (rev) {
child_hue_ranges.reverse();
}
_ref = node.children;
_results = [];
for (i = _j = 0, _len = _ref.length; _j < _len; i = ++_j) {
child = _ref[i];
_results.push(treehue(child, child_hue_ranges[i], fraction, i % 2 === 0));
}
return _results;
}
};
treelum = d3.scale.linear().range([80, 10]);
treechroma = d3.scale.sqrt().range([0, 90]);
RADIUS = 250;
partition = d3.layout.partition().sort(null).size([2 * Math.PI, RADIUS * RADIUS]).value(function(node) {
return node.leaf_count;
});
arc = d3.svg.arc().startAngle(function(d) {
return d.x;
}).endAngle(function(d) {
return d.x + d.dx;
}).innerRadius(function(d) {
return Math.sqrt(d.y);
}).outerRadius(function(d) {
return Math.sqrt(d.y + d.dy);
});
svg = d3.select('svg');
width = svg.node().getBoundingClientRect().width;
height = svg.node().getBoundingClientRect().height;
svg.attr({
viewBox: "" + (-width / 2) + " " + (-height / 2) + " " + width + " " + height
});
zoomable_layer = svg.append('g');
zoom = d3.behavior.zoom().scaleExtent([1, 10]).on('zoom', function() {
return zoomable_layer.attr({
transform: "translate(" + (zoom.translate()) + ")scale(" + (zoom.scale()) + ")"
});
});
svg.call(zoom);
vis = zoomable_layer.append('g');
d3.json('dbpedia_canonical.json', function(tree) {
var enter_nodes, nodes;
treehue(tree, [0, 360], 0.7);
treelum.domain([0, 5]);
treechroma.domain([0, 5]);
vis.datum(tree);
nodes = vis.selectAll('.node').data(function(t) {
return partition.nodes(t);
});
enter_nodes = nodes.enter().insert('path', 'path').attr({
"class": 'node',
d: arc,
fill: function(n) {
return d3.hcl(n.hue, treechroma(n.depth), treelum(n.depth));
}
});
enter_nodes.append('title').text(function(node) {
return node.name.split('/').reverse()[0];
});
return vis.append('text').text(function(tree) {
return tree.name.split('/').reverse()[0];
}).attr({
"class": 'label',
dy: '0.35em'
});
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment