Skip to content

Instantly share code, notes, and snippets.

@joe776
Created October 7, 2011 09:34
Show Gist options
  • Save joe776/1269897 to your computer and use it in GitHub Desktop.
Save joe776/1269897 to your computer and use it in GitHub Desktop.
Force-direct graph with rectangular nodes and labels
{"links":[{"source":22,"target":0},{"source":2,"target":70},{"source":2,"target":71},{"source":2,"target":72},{"source":17,"target":170},{"source":5,"target":0},{"source":18,"target":144},{"source":1,"target":121},{"source":1,"target":120},{"source":18,"target":142},{"source":1,"target":123},{"source":18,"target":141},{"source":1,"target":122},{"source":1,"target":117},{"source":1,"target":116},{"source":1,"target":119},{"source":1,"target":118},{"source":1,"target":115},{"source":21,"target":0},{"source":16,"target":143},{"source":16,"target":144},{"source":6,"target":0},{"source":18,"target":63},{"source":18,"target":64},{"source":18,"target":62},{"source":20,"target":0},{"source":16,"target":142},{"source":16,"target":141},{"source":3,"target":0},{"source":19,"target":0},{"source":15,"target":135},{"source":15,"target":134},{"source":4,"target":0},{"source":15,"target":136},{"source":15,"target":133},{"source":15,"target":132},{"source":23,"target":89},{"source":7,"target":43},{"source":23,"target":88},{"source":7,"target":42},{"source":23,"target":87},{"source":7,"target":45},{"source":23,"target":86},{"source":7,"target":44},{"source":7,"target":39},{"source":26,"target":0},{"source":6,"target":69},{"source":7,"target":38},{"source":23,"target":92},{"source":7,"target":41},{"source":23,"target":91},{"source":7,"target":40},{"source":23,"target":90},{"source":22,"target":128},{"source":7,"target":46},{"source":22,"target":131},{"source":22,"target":130},{"source":22,"target":129},{"source":31,"target":126},{"source":31,"target":127},{"source":9,"target":0},{"source":25,"target":0},{"source":8,"target":61},{"source":10,"target":0},{"source":8,"target":59},{"source":23,"target":73},{"source":8,"target":60},{"source":23,"target":74},{"source":23,"target":75},{"source":8,"target":58},{"source":23,"target":76},{"source":23,"target":77},{"source":23,"target":78},{"source":23,"target":79},{"source":23,"target":80},{"source":23,"target":81},{"source":23,"target":82},{"source":23,"target":83},{"source":23,"target":84},{"source":23,"target":85},{"source":3,"target":100},{"source":19,"target":161},{"source":19,"target":160},{"source":19,"target":159},{"source":21,"target":96},{"source":19,"target":158},{"source":21,"target":95},{"source":19,"target":157},{"source":21,"target":94},{"source":19,"target":156},{"source":18,"target":186},{"source":21,"target":93},{"source":24,"target":0},{"source":19,"target":155},{"source":19,"target":154},{"source":19,"target":162},{"source":19,"target":163},{"source":7,"target":0},{"source":4,"target":102},{"source":4,"target":106},{"source":17,"target":176},{"source":4,"target":105},{"source":4,"target":104},{"source":4,"target":103},{"source":23,"target":0},{"source":6,"target":63},{"source":6,"target":64},{"source":6,"target":62},{"source":8,"target":0},{"source":6,"target":67},{"source":7,"target":36},{"source":20,"target":107},{"source":6,"target":68},{"source":7,"target":37},{"source":20,"target":108},{"source":6,"target":65},{"source":20,"target":109},{"source":6,"target":66},{"source":7,"target":35},{"source":26,"target":146},{"source":26,"target":145},{"source":26,"target":148},{"source":26,"target":147},{"source":26,"target":150},{"source":26,"target":149},{"source":26,"target":152},{"source":26,"target":151},{"source":13,"target":0},{"source":11,"target":50},{"source":11,"target":48},{"source":11,"target":49},{"source":30,"target":0},{"source":11,"target":47},{"source":13,"target":33},{"source":13,"target":32},{"source":13,"target":34},{"source":14,"target":0},{"source":28,"target":34},{"source":29,"target":0},{"source":5,"target":180},{"source":11,"target":0},{"source":5,"target":174},{"source":5,"target":175},{"source":5,"target":172},{"source":5,"target":173},{"source":5,"target":178},{"source":5,"target":179},{"source":25,"target":97},{"source":5,"target":176},{"source":25,"target":98},{"source":5,"target":177},{"source":28,"target":0},{"source":5,"target":170},{"source":5,"target":171},{"source":9,"target":99},{"source":24,"target":114},{"source":24,"target":113},{"source":24,"target":112},{"source":24,"target":111},{"source":24,"target":110},{"source":12,"target":0},{"source":27,"target":0},{"source":17,"target":0},{"source":31,"target":124},{"source":31,"target":125},{"source":29,"target":165},{"source":29,"target":164},{"source":29,"target":167},{"source":29,"target":166},{"source":29,"target":169},{"source":29,"target":168},{"source":16,"target":64},{"source":28,"target":181},{"source":14,"target":137},{"source":14,"target":138},{"source":14,"target":139},{"source":14,"target":140},{"source":14,"target":116},{"source":14,"target":122},{"source":18,"target":0},{"source":14,"target":118},{"source":14,"target":117},{"source":15,"target":0},{"source":2,"target":0},{"source":27,"target":182},{"source":12,"target":101},{"source":27,"target":183},{"source":0,"target":31},{"source":1,"target":0},{"source":10,"target":185},{"source":30,"target":51},{"source":0,"target":25},{"source":30,"target":52},{"source":0,"target":26},{"source":16,"target":0},{"source":0,"target":23},{"source":0,"target":24},{"source":0,"target":29},{"source":0,"target":30},{"source":0,"target":27},{"source":0,"target":28},{"source":0,"target":17},{"source":27,"target":153},{"source":0,"target":18},{"source":30,"target":57},{"source":0,"target":15},{"source":0,"target":16},{"source":30,"target":55},{"source":0,"target":21},{"source":30,"target":56},{"source":0,"target":22},{"source":30,"target":53},{"source":0,"target":19},{"source":27,"target":147},{"source":30,"target":54},{"source":0,"target":20},{"source":0,"target":10},{"source":0,"target":9},{"source":0,"target":8},{"source":0,"target":7},{"source":0,"target":14},{"source":0,"target":13},{"source":31,"target":0},{"source":0,"target":12},{"source":0,"target":11},{"source":26,"target":153},{"source":0,"target":2},{"source":0,"target":1},{"source":0,"target":6},{"source":0,"target":5},{"source":10,"target":184},{"source":0,"target":4},{"source":0,"target":3}],"nodes":[{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x7.5km_relay_Women2002","label":"4x7.5km Relay Women 2002"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#alpine_combined_Women1936","label":"Alpine Combined Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#long_jump_Men1936","label":"Long Jump Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#marathon_Men1936","label":"Marathon Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Women1984","label":"Singles Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#200m_freestyle_Men1984","label":"200m Freestyle Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team,_horizontal_bar_Men1896","label":"Team, Horizontal Bar Men 1896"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Mixed1976","label":"Individual Mixed 1976"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#INGRID_KRMER-ENGEL-GULBIN","label":"Ingrid Krmer-engel-gulbin"},{"group":0,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#Germany","label":"Germany"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#high_jump_Women1972","label":"High Jump Women 1972"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1956","label":"Team Mixed 1956"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#18km_Men1936","label":"18km Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#400m_freestyle_Women1936","label":"400m Freestyle Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Women1988","label":"Singles Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#20km_Men1992","label":"20km Men 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#10m_platform_Women1960","label":"10m Platform Women 1960"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3x7.5km_relay_Women1992","label":"3x7.5km Relay Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-4_500m_(kayak_four)_Women2000","label":"K-4 500m (kayak Four) Women 2000"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#10m_platform_Women1964","label":"10m Platform Women 1964"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#500m_Men1936","label":"500m Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-4_500m_(kayak_four)_Women2004","label":"K-4 500m (kayak Four) Women 2004"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#sabre_individual_Men1936","label":"Sabre Individual Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K120_team_(90m)_Men1994","label":"K120 Team (90m) Men 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#four-man_Men1998","label":"Four-man Men 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#CARL_SCHUMANN","label":"Carl Schumann"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#rings_Men1936","label":"Rings Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Mixed1972","label":"Individual Mixed 1972"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-2_500m_(kayak_double)_Women2000","label":"K-2 500m (kayak Double) Women 2000"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-4_500m_(kayak_four)_Women1988","label":"K-4 500m (kayak Four) Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#HELMUT_RECKNAGEL","label":"Helmut Recknagel"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#BIRGIT_FISCHER","label":"Birgit Fischer"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#two-man_Men2002","label":"Two-man Men 2002"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#200m_butterfly_Men1988","label":"200m Butterfly Men 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Mixed1968","label":"Individual Mixed 1968"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#super-G_Women1992","label":"Super-g Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#high_jump_Women1984","label":"High Jump Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_medley_relay_Women2004","label":"4x100m Medley Relay Women 2004"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#STEFFI_WALTER","label":"Steffi Walter"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#MARK_KIRCHNER","label":"Mark Kirchner"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x7.5km_relay_Women1994","label":"4x7.5km Relay Women 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#Half-pipe_Women1998","label":"Half-pipe Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#MICHAEL_GROSS","label":"Michael Gross"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x7.5km_relay_Women1998","label":"4x7.5km Relay Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K120_individual_(90m)_Men1994","label":"K120 Individual (90m) Men 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x200m_freestyle_relay_Men1988","label":"4x200m Freestyle Relay Men 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Men2002","label":"Singles Men 2002"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#ULRIKE_MEYFARTH","label":"Ulrike Meyfarth"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Men1936","label":"5000m Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-2_500m_(kayak_double)_Women1988","label":"K-2 500m (kayak Double) Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#giant_slalom_Women1976","label":"Giant Slalom Women 1976"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x200m_freestyle_relay_Men1984","label":"4x200m Freestyle Relay Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#Berlin1936","label":"Berlin 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#floor_exercises_Men1936","label":"Floor Exercises Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#7.5km_Women2002","label":"7.5km Women 2002"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K90_individual_(70m)_Men1960","label":"K90 Individual (70m) Men 1960"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Mixed1956","label":"Individual Mixed 1956"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#LISELOTT_LINSENHOFF","label":"Liselott Linsenhoff"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1500m_Women1984","label":"1500m Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#500m_Women1992","label":"500m Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1500m_Women1988","label":"1500m Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#vault_Men1896","label":"Vault Men 1896"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#GERD_WESSIG","label":"Gerd Wessig"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#FRANZISKA_VAN_ALMSICK","label":"Franziska Van Almsick"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-2_500m_(kayak_double)_Women1996","label":"K-2 500m (kayak Double) Women 1996"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#high_jump_Men1980","label":"High Jump Men 1980"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#REINER_KLIMKE","label":"Reiner Klimke"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#ANDREA_EHRIG","label":"Andrea Ehrig"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1500m_Women1992","label":"1500m Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3m_springboard_Women1964","label":"3m Springboard Women 1964"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1500m_Women1994","label":"1500m Women 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-2_500m_(kayak_double)_Women2004","label":"K-2 500m (kayak Double) Women 2004"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Women1992","label":"Singles Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#200m_freestyle_Women1996","label":"200m Freestyle Women 1996"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_medley_relay_Women1992","label":"4x100m Medley Relay Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-4_500m_(kayak_four)_Women1992","label":"K-4 500m (kayak Four) Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#KATARINA_WITT","label":"Katarina Witt"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3m_springboard_Women1960","label":"3m Springboard Women 1960"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1500m_Women1998","label":"1500m Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#slalom_Women1976","label":"Slalom Women 1976"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#200m_freestyle_Women1992","label":"200m Freestyle Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#sabre_team_Men1936","label":"Sabre Team Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#500m_Women1988","label":"500m Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#500m_Women1984","label":"500m Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#100m_freestyle_Women1936","label":"100m Freestyle Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#12,5km_mass_start_Women2006","label":"12,5km Mass Start Women 2006"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-4_500m_(kayak_four)_Women1996","label":"K-4 500m (kayak Four) Women 1996"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K90_individual_(70m)_Men1984","label":"K90 Individual (70m) Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#sprint_Women1988","label":"Sprint Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#USCHI_DISL","label":"Uschi Disl"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Women1936","label":"Individual Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women1984","label":"3000m Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_freestyle_relay_Women1992","label":"4x100m Freestyle Relay Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#open_event_Men1896","label":"Open Event Men 1896"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#STEFFI_GRAF","label":"Steffi Graf"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K90_individual_(70m)_Men1936","label":"K90 Individual (70m) Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#downhill_Women1976","label":"Downhill Women 1976"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_freestyle_relay_Women1996","label":"4x100m Freestyle Relay Women 1996"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x200m_freestyle_relay_Women2000","label":"4x200m Freestyle Relay Women 2000"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1984","label":"Team Mixed 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#CLAUDIA_PECHSTEIN","label":"Claudia Pechstein"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#8m_Mixed1936","label":"8m Mixed 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#foil_individual_Men1936","label":"Foil Individual Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#15km_Women1998","label":"15km Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1500m_Men1936","label":"1500m Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x200m_freestyle_relay_Women2004","label":"4x200m Freestyle Relay Women 2004"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#10000m_Men1936","label":"10000m Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#ANTJE_HARVEY","label":"Antje Harvey"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1988","label":"Team Mixed 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Women1998","label":"5000m Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#foil_team_Men1936","label":"Foil Team Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#doubles_Women1988","label":"Doubles Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team,_parallel_bars_Men1896","label":"Team, Parallel Bars Men 1896"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#FRANK-PETER_ROETSCH","label":"Frank-peter Roetsch"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Women1992","label":"5000m Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Women1994","label":"5000m Women 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#Garmisch-Partenkirchen1936","label":"Garmisch-partenkirchen 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women1976","label":"3000m Women 1976"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#15km_Women1994","label":"15km Women 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#15km_Women1992","label":"15km Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#200m_butterfly_Men1984","label":"200m Butterfly Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#7.5km_Women1998","label":"7.5km Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#200m_Men1936","label":"200m Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#100m_backstroke_Women1936","label":"100m Backstroke Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#7.5km_Women1992","label":"7.5km Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#alpine_combined_Women1998","label":"Alpine Combined Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#NICOLA_THOST","label":"Nicola Thost"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_relay_Women1936","label":"4x100m Relay Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#100m_Men1936","label":"100m Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Women1988","label":"5000m Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#pairs_Mixed1936","label":"Pairs Mixed 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#foil_individual_Women1936","label":"Foil Individual Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_relay_Men1936","label":"4x100m Relay Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-1_500m_(kayak_single)_Women1988","label":"K-1 500m (kayak Single) Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x100m_freestyle_relay_Women1936","label":"4x100m Freestyle Relay Women 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#JENS_WEISSFLOG","label":"Jens Weissflog"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#GUNDA_NIEMANN-STIRNEMANN","label":"Gunda Niemann-stirnemann"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x10km_relay_Men1936","label":"4x10km Relay Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#10km_Men1992","label":"10km Men 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-1_500m_(kayak_single)_Women1980","label":"K-1 500m (kayak Single) Women 1980"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x200m_freestyle_relay_Women1996","label":"4x200m Freestyle Relay Women 1996"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#KATJA_SEIZINGER","label":"Katja Seizinger"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#GEORG_HACKL","label":"Georg Hackl"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#100m_freestyle_Women1992","label":"100m Freestyle Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#downhill_Women1998","label":"Downhill Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#downhill_Women1994","label":"Downhill Women 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1964","label":"Team Mixed 1964"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#ROSI_MITTERMAIER","label":"Rosi Mittermaier"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1960","label":"Team Mixed 1960"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#two-man_Men1992","label":"Two-man Men 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#double_sculls_(2x)_Men1936","label":"Double Sculls (2x) Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women2002","label":"3000m Women 2002"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1000m_Women1988","label":"1000m Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Men1988","label":"Singles Men 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1968","label":"Team Mixed 1968"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K120_individual_(90m)_Men1984","label":"K120 Individual (90m) Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#1000m_Women1984","label":"1000m Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Women2002","label":"5000m Women 2002"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#CHRISTOPH_LANGEN","label":"Christoph Langen"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Mixed1984","label":"Individual Mixed 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Men1936","label":"Individual Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#20km_Men1984","label":"20km Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#5000m_Women2006","label":"5000m Women 2006"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Men1994","label":"Singles Men 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Men1992","label":"Singles Men 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#20km_Men1988","label":"20km Men 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#ERNST_BAIER","label":"Ernst Baier"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#100m_butterfly_Men1984","label":"100m Butterfly Men 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women1994","label":"3000m Women 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x7.5km_relay_Men1992","label":"4x7.5km Relay Men 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women1992","label":"3000m Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#K-1_500m_(kayak_single)_Women1992","label":"K-1 500m (kayak Single) Women 1992"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women1998","label":"3000m Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#Team_pursuit_Women2006","label":"Team Pursuit Women 2006"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#two-man_Men1998","label":"Two-man Men 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Women1988","label":"Individual Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#3000m_Women1988","label":"3000m Women 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1976","label":"Team Mixed 1976"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#giant_slalom_Women1998","label":"Giant Slalom Women 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#individual_Women1984","label":"Individual Women 1984"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#CHRISTA_LUDING","label":"Christa Luding"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_Mixed1972","label":"Team Mixed 1972"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#4x7.5km_relay_Men1994","label":"4x7.5km Relay Men 1994"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#singles_Men1998","label":"Singles Men 1998"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#10km_Men1988","label":"10km Men 1988"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#team_competition_Men1936","label":"Team Competition Men 1936"},{"group":1,"iri":"http://swat.cse.lehigh.edu/resources/onto/olympics.owl#HANS_GNTER_WINKLER","label":"Hans Gnter Winkler"}]}
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script>
<style type="text/css">
.node {
stroke: black;
stroke-width: 1.5px;
}
line.link {
stroke: #999;
stroke-opacity: .6;
}
</style>
<script type="text/javascript">
var w, h, fill, vis;
function initVisualization() {
w = d3.select("#graph")[0][0].offsetWidth;
h = d3.select("#graph")[0][0].offsetHeight;
fill = d3.scale.category10();
vis = d3.select("#graph")
.append("svg:svg")
.attr("width", "100%")
.attr("height", "100%")
.attr("pointer-events", "all")
.append("svg:g")
.call(d3.behavior.zoom().on("zoom", redraw))
.append("svg:g");
vis.style("opacity", 1e-6)
.transition()
.duration(1000)
.style("opacity", 1);
}
function redraw() {
vis.attr("transform",
"translate(" + d3.event.translate + ")"
+ "scale(" + d3.event.scale + ")");
}
function collide(node) {
var nx1 = node.x,
nx2 = node.x + node.width,
ny1 = node.y,
ny2 = node.y + node.height;
return function(quad, x1, y1, x2, y2) {
if (quad.point && (quad.point !== node)) {
if (node.x <= quad.point.x) {
var dist = quad.point.x - node.x;
if (dist < node.width) {
node.px -= 5;
}
} else {
var dist = node.x -quad.point.x;
if (dist < quad.point.width) {
node.px += 5;
}
}
if (node.y <= quad.point.y) {
var dist = quad.point.y - node.y;
if (dist < node.height) {
node.py -= 5;
}
} else {
var dist = node.y -quad.point.y;
if (dist < quad.point.height) {
node.py += 5;
}
}
}
return x1 > nx2
|| x2 < nx1
|| y1 > ny2
|| y2 < ny1;
};
};
var data;
function startVisualization(json) {
data = json;
vis.selectAll("line.link").remove();
vis.selectAll("rect.node").remove();
var force = d3.layout.force()
.gravity(1)
.charge(-1000)
.linkDistance(500)
.nodes(json.nodes)
.links(json.links)
.size([w, h])
.start();
var link = vis.selectAll("line.link")
.data(json.links)
.enter().append("svg:line")
.attr("class", "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; });
var node = vis.selectAll("rect.node")
.data(json.nodes)
.enter().append("svg:rect")
.attr("class", "node")
.attr("x", function(d) { return d.x; })
.attr("y", function(d) { return d.y; })
.attr("id", function(d) { return d.index; })
.attr("width", 50)
.attr("height", 14)
.style("fill", function(d) { return fill(d.group); })
.call(force.drag);
node.append("svg:title")
.text(function(d) { return d.iri; });
vis.selectAll("text")
.data(json.nodes)
.enter().append("svg:text")
.attr("dx", 2)
.attr("dy", 12)
.attr("id", function(d) { return d.index + "_text"; })
.text(function(d) { return d.label; });
node = vis.selectAll("rect.node, text");
vis.selectAll("rect.node").each(function(node) {
var text = document.getElementById(this.id + "_text");
var bBox = text.getBBox();
this.setAttributeNS(null, "width", bBox.width + 4);
this.setAttributeNS(null, "height", bBox.height);
data.nodes[this.id].width = bBox.width + 4;
data.nodes[this.id].height = bBox.height;
});
var graph = d3.select("#graph")[0][0];
force.on("tick", function() {
var w = graph.offsetWidth;
var h = graph.offsetHeight;
force.size([w, h]);
var q = d3.geom.quadtree(data["nodes"]),
i = 0,
n = data["nodes"].length;
while (++i < n) {
q.visit(collide(data["nodes"][i]));
}
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; });
node.attr("x", function(d) { return d.x = Math.max(50, Math.min(w - 50,d.x)); })
.attr("y", function(d) { return d.y = Math.max(10, Math.min(h - 10,d.y)); });
});
}
function run() {
initVisualization();
d3.json("data.json", startVisualization);
}
</script>
<body onload="run()">
<div id="graph"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment