Skip to content

Instantly share code, notes, and snippets.

@wenzelmkay
Last active January 11, 2018 01:52
Show Gist options
  • Save wenzelmkay/4fe6e51899489ef15326af9cf796df9c to your computer and use it in GitHub Desktop.
Save wenzelmkay/4fe6e51899489ef15326af9cf796df9c to your computer and use it in GitHub Desktop.
BIO140/150: Collapsible Tree
license: gpl-3.0
[
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Noctuidae",
"taxon_genus_name": "Achatia",
"taxon_species_name": "Achatia distincta",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Culicidae",
"taxon_genus_name": "Aedes",
"taxon_species_name": "Aedes albopictus",
"size": "6"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Culicidae",
"taxon_genus_name": "Aedes",
"taxon_species_name": "Aedes japonicus",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Agaricaceae",
"taxon_genus_name": "Agaricus",
"taxon_species_name": "Agaricus xanthodermus",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Noctuidae",
"taxon_genus_name": "Agrochola",
"taxon_species_name": "Agrochola bicolorago",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Brassicales",
"taxon_family_name": "Brassicaceae",
"taxon_genus_name": "Alliaria",
"taxon_species_name": "Alliaria petiolata",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Erebidae",
"taxon_genus_name": "Allotria",
"taxon_species_name": "Allotria elonympha",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Amanitaceae",
"taxon_genus_name": "Amanita",
"taxon_species_name": "Amanita brunnescens",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Noctuidae",
"taxon_genus_name": "Anicla",
"taxon_species_name": "Anicla infecta",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Anyphaenidae",
"taxon_genus_name": "Anyphaena",
"taxon_species_name": "Anyphaena pectorosa",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Apidae",
"taxon_genus_name": "Apis",
"taxon_species_name": "Apis mellifera",
"size": "2"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Brassicales",
"taxon_family_name": "Brassicaceae",
"taxon_genus_name": "Arabidopsis",
"taxon_species_name": "Arabidopsis thaliana",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Reduviidae",
"taxon_genus_name": "Arilus",
"taxon_species_name": "Arilus cristatus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Malacostraca",
"taxon_order_name": "Isopoda",
"taxon_family_name": "Armadillidiidae",
"taxon_genus_name": "Armadillidium",
"taxon_species_name": "Armadillidium vulgare",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Physalacriaceae",
"taxon_genus_name": "Armillaria",
"taxon_species_name": "Armillaria gallica",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Physalacriaceae",
"taxon_genus_name": "Armillaria",
"taxon_species_name": "Armillaria mellea",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Rhopalidae",
"taxon_genus_name": "Boisea",
"taxon_species_name": "Boisea trivittata",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Calliphoridae",
"taxon_genus_name": "Calliphora",
"taxon_species_name": "Calliphora vicina",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Camponotus",
"taxon_species_name": "Camponotus americanus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Camponotus",
"taxon_species_name": "Camponotus castaneus",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Camponotus",
"taxon_species_name": "Camponotus chromaiodes",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Camponotus",
"taxon_species_name": "Camponotus nearcticus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Camponotus",
"taxon_species_name": "Camponotus pennsylvanicus",
"size": "2"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Rosales",
"taxon_family_name": "Cannabaceae",
"taxon_genus_name": "Celtis",
"taxon_species_name": "Celtis occidentalis",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Orthoptera",
"taxon_family_name": "Rhaphidophoridae",
"taxon_genus_name": "Ceuthophilus",
"taxon_species_name": "Ceuthophilus guttulosus",
"size": "4"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Orthoptera",
"taxon_family_name": "Rhaphidophoridae",
"taxon_genus_name": "Ceuthophilus",
"taxon_species_name": "Ceuthophilus maculatus",
"size": "2"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Ericales",
"taxon_family_name": "Ericaceae",
"taxon_genus_name": "Chimaphila",
"taxon_species_name": "Chimaphila maculata",
"size": "6"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Agaricaceae",
"taxon_genus_name": "Chlorophyllum",
"taxon_species_name": "Chlorophyllum rhacodes",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Coleoptera",
"taxon_family_name": "Coccinellidae",
"taxon_genus_name": "Coccinella",
"taxon_species_name": "Coccinella septempunctata",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Psathyrellaceae",
"taxon_genus_name": "Coprinopsis",
"taxon_species_name": "Coprinopsis lagopus",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Marasmiaceae",
"taxon_genus_name": "Crinipellis",
"taxon_species_name": "Crinipellis setipes",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Diplopoda",
"taxon_order_name": "Julida",
"taxon_family_name": "Julidae",
"taxon_genus_name": "Cylindroiulus",
"taxon_species_name": "Cylindroiulus caeruleocinctus",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Lycopodiophyta",
"taxon_class_name": "Lycopodiopsida",
"taxon_order_name": "Lycopodiales",
"taxon_family_name": "Lycopodiaceae",
"taxon_genus_name": "Diphasiastrum",
"taxon_species_name": "Diphasiastrum digitatum",
"size": "3"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Brassicales",
"taxon_family_name": "Brassicaceae",
"taxon_genus_name": "Diplotaxis",
"taxon_species_name": "Diplotaxis tenuifolia",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Drosophilidae",
"taxon_genus_name": "Drosophila",
"taxon_species_name": "Drosophila melanogaster",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Coleoptera",
"taxon_family_name": "Lampyridae",
"taxon_genus_name": "Ellychnia",
"taxon_species_name": "Ellychnia corrusca",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Pentatomidae",
"taxon_genus_name": "Euschistus",
"taxon_species_name": "Euschistus tristigmus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Flatidae",
"taxon_genus_name": "Flatormenis",
"taxon_species_name": "Flatormenis proxima",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Fomitopsidaceae",
"taxon_genus_name": "Fomitopsis",
"taxon_species_name": "Fomitopsis spraguei",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Formica",
"taxon_species_name": "Formica glacialis",
"size": "2"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Asparagales",
"taxon_family_name": "Orchidaceae",
"taxon_genus_name": "Goodyera",
"taxon_species_name": "Goodyera pubescens",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Asterales",
"taxon_family_name": "Asteraceae",
"taxon_genus_name": "Grindelia",
"taxon_species_name": "Grindelia squarrosa",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Omphalotaceae",
"taxon_genus_name": "Gymnopus",
"taxon_species_name": "Gymnopus kauffmanii",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Pentatomidae",
"taxon_genus_name": "Halyomorpha",
"taxon_species_name": "Halyomorpha halys",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Erebidae",
"taxon_genus_name": "Halysidota",
"taxon_species_name": "Halysidota tessellaris",
"size": "4"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Asparagales",
"taxon_family_name": "Asphodelaceae",
"taxon_genus_name": "Hemerocallis",
"taxon_species_name": "Hemerocallis fulva",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Russulales",
"taxon_family_name": "Hericiaceae",
"taxon_genus_name": "Hericium",
"taxon_species_name": "Hericium erinaceus",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Boletales",
"taxon_family_name": "Hygrophoropsidaceae",
"taxon_genus_name": "Hygrophoropsis",
"taxon_species_name": "Hygrophoropsis aurantiaca",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Geometridae",
"taxon_genus_name": "Hypagyrtis",
"taxon_species_name": "Hypagyrtis unipunctata",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Erebidae",
"taxon_genus_name": "Hypena",
"taxon_species_name": "Hypena scabra",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Aquifoliales",
"taxon_family_name": "Aquifoliaceae",
"taxon_genus_name": "Ilex",
"taxon_species_name": "Ilex aquifolium",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Aquifoliales",
"taxon_family_name": "Aquifoliaceae",
"taxon_genus_name": "Ilex",
"taxon_species_name": "Ilex cornuta",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Opiliones",
"taxon_family_name": "Sclerosomatidae",
"taxon_genus_name": "Leiobunum",
"taxon_species_name": "Leiobunum vittatum",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Tricholomataceae",
"taxon_genus_name": "Lepista",
"taxon_species_name": "Lepista nuda",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Tricholomataceae",
"taxon_genus_name": "Lepista",
"taxon_species_name": "Lepista subconnexa",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Lamiales",
"taxon_family_name": "Oleaceae",
"taxon_genus_name": "Ligustrum",
"taxon_species_name": "Ligustrum vulgare",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Dipsacales",
"taxon_family_name": "Caprifoliaceae",
"taxon_genus_name": "Lonicera",
"taxon_species_name": "Lonicera japonica",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Dipsacales",
"taxon_family_name": "Caprifoliaceae",
"taxon_genus_name": "Lonicera",
"taxon_species_name": "Lonicera maackii",
"size": "2"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Dipsacales",
"taxon_family_name": "Caprifoliaceae",
"taxon_genus_name": "Lonicera",
"taxon_species_name": "Lonicera xylosteum",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Meruliaceae",
"taxon_genus_name": "Loweomyces",
"taxon_species_name": "Loweomyces fractipes",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Annelida",
"taxon_class_name": "Clitellata",
"taxon_order_name": "Haplotaxida",
"taxon_family_name": "Lumbricidae",
"taxon_genus_name": "Lumbricus",
"taxon_species_name": "Lumbricus rubellus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Annelida",
"taxon_class_name": "Clitellata",
"taxon_order_name": "Haplotaxida",
"taxon_family_name": "Lumbricidae",
"taxon_genus_name": "Lumbricus",
"taxon_species_name": "Lumbricus terrestris",
"size": "3"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Lycoperdaceae",
"taxon_genus_name": "Lycoperdon",
"taxon_species_name": "Lycoperdon pyriforme",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Depressariidae",
"taxon_genus_name": "Machimia",
"taxon_species_name": "Machimia tentoriferella",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Magnoliales",
"taxon_family_name": "Magnoliaceae",
"taxon_genus_name": "Magnolia",
"taxon_species_name": "Magnolia grandiflora",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Marasmiaceae",
"taxon_genus_name": "Marasmius",
"taxon_species_name": "Marasmius scorodonius",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Meruliaceae",
"taxon_genus_name": "Merulius",
"taxon_species_name": "Merulius incarnatus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Araneidae",
"taxon_genus_name": "Micrathena",
"taxon_species_name": "Micrathena gracilis",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Mycenaceae",
"taxon_genus_name": "Mycena",
"taxon_species_name": "Mycena haematopus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Notodontidae",
"taxon_genus_name": "Nadata",
"taxon_species_name": "Nadata gibbosa",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Araneidae",
"taxon_genus_name": "Neoscona",
"taxon_species_name": "Neoscona crucifera",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Noctuidae",
"taxon_genus_name": "Noctua",
"taxon_species_name": "Noctua pronuba",
"size": "3"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Omphalotaceae",
"taxon_genus_name": "Omphalotus",
"taxon_species_name": "Omphalotus illudens",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Orussidae",
"taxon_genus_name": "Orussus",
"taxon_species_name": "Orussus minutus",
"size": "2"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Bolbitiaceae",
"taxon_genus_name": "Panaeolina",
"taxon_species_name": "Panaeolina foenisecii",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Theridiidae",
"taxon_genus_name": "Parasteatoda",
"taxon_species_name": "Parasteatoda tepidariorum",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Blattodea",
"taxon_family_name": "Ectobiidae",
"taxon_genus_name": "Parcoblatta",
"taxon_species_name": "Parcoblatta virginica",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Philodromidae",
"taxon_genus_name": "Philodromus",
"taxon_species_name": "Philodromus keyserlingi",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Malacostraca",
"taxon_order_name": "Isopoda",
"taxon_family_name": "Philosciidae",
"taxon_genus_name": "Philoscia",
"taxon_species_name": "Philoscia muscorum",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Linyphiidae",
"taxon_genus_name": "Pityohyphantes",
"taxon_species_name": "Pityohyphantes costatus",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Lamiales",
"taxon_family_name": "Plantaginaceae",
"taxon_genus_name": "Plantago",
"taxon_species_name": "Plantago major",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Membracidae",
"taxon_genus_name": "Platycotis",
"taxon_species_name": "Platycotis vittata",
"size": "3"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Pluteaceae",
"taxon_genus_name": "Pluteus",
"taxon_species_name": "Pluteus cervinus",
"size": "2"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Pluteaceae",
"taxon_genus_name": "Pluteus",
"taxon_species_name": "Pluteus hongoi",
"size": "5"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Bryophyta",
"taxon_class_name": "Bryopsida",
"taxon_order_name": "Polytrichales",
"taxon_family_name": "Polytrichaceae",
"taxon_genus_name": "Polytrichum",
"taxon_species_name": "Polytrichum commune",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Coleoptera",
"taxon_family_name": "Scarabaeidae",
"taxon_genus_name": "Popillia",
"taxon_species_name": "Popillia japonica",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Muscidae",
"taxon_genus_name": "Potamia",
"taxon_species_name": "Potamia littoralis",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Zygaenidae",
"taxon_genus_name": "Pyromorpha",
"taxon_species_name": "Pyromorpha dimidiata",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Erebidae",
"taxon_genus_name": "Renia",
"taxon_species_name": "Renia discoloralis",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Coleoptera",
"taxon_family_name": "Ripiphoridae",
"taxon_genus_name": "Ripiphorus",
"taxon_species_name": "Ripiphorus fasciatus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Erebidae",
"taxon_genus_name": "Scolecocampa",
"taxon_species_name": "Scolecocampa liburna",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Chilopoda",
"taxon_order_name": "Scutigeromorpha",
"taxon_family_name": "Scutigeridae",
"taxon_genus_name": "Scutigera",
"taxon_species_name": "Scutigera coleoptrata",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Liliales",
"taxon_family_name": "Smilacaceae",
"taxon_genus_name": "Smilax",
"taxon_species_name": "Smilax rotundifolia",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Theridiidae",
"taxon_genus_name": "Steatoda",
"taxon_species_name": "Steatoda triangulosa",
"size": "3"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Russulales",
"taxon_family_name": "Stereaceae",
"taxon_genus_name": "Stereum",
"taxon_species_name": "Stereum complicatum",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Russulales",
"taxon_family_name": "Stereaceae",
"taxon_genus_name": "Stereum",
"taxon_species_name": "Stereum ostrea",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Strophariaceae",
"taxon_genus_name": "Stropharia",
"taxon_species_name": "Stropharia rugosoannulata",
"size": "3"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Tapinoma",
"taxon_species_name": "Tapinoma sessile",
"size": "2"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Polyporaceae",
"taxon_genus_name": "Trametes",
"taxon_species_name": "Trametes gibbosa",
"size": "2"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Polyporaceae",
"taxon_genus_name": "Trichaptum",
"taxon_species_name": "Trichaptum abietinum",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Polyporaceae",
"taxon_genus_name": "Trichaptum",
"taxon_species_name": "Trichaptum biforme",
"size": "7"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Fabales",
"taxon_family_name": "Fabaceae",
"taxon_genus_name": "Trifolium",
"taxon_species_name": "Trifolium repens",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Orthoptera",
"taxon_family_name": "Gryllidae",
"taxon_genus_name": "Velarifictorus",
"taxon_species_name": "Velarifictorus micado",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Araneidae",
"taxon_genus_name": "Verrucosa",
"taxon_species_name": "Verrucosa arenata",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Vespidae",
"taxon_genus_name": "Vespula",
"taxon_species_name": "Vespula maculifrons",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Physalacriaceae",
"taxon_genus_name": "Xerula",
"taxon_species_name": "Xerula furfuracea",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Reduviidae",
"taxon_genus_name": "Zelus",
"taxon_species_name": "Zelus luridus",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Annelida",
"taxon_class_name": "Clitellata",
"taxon_order_name": "Haplotaxida",
"taxon_family_name": "Megascolecidae",
"taxon_genus_name": "Amynthas",
"taxon_species_name": "sp",
"size": "2"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Physalacriaceae",
"taxon_genus_name": "Armillaria",
"taxon_species_name": "sp",
"size": "4"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Rhopalidae",
"taxon_genus_name": "Boisea",
"taxon_species_name": "sp",
"size": "3"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Agaricaceae",
"taxon_genus_name": "Chlorophyllum",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Braconidae",
"taxon_genus_name": "Chrysopophthorus",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Noctuidae",
"taxon_genus_name": "Condica",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Drosophilidae",
"taxon_genus_name": "Drosophila",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hymenoptera",
"taxon_family_name": "Formicidae",
"taxon_genus_name": "Formica",
"taxon_species_name": "sp",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Coleoptera",
"taxon_family_name": "Coccinellidae",
"taxon_genus_name": "Harmonia",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Magnoliopsida",
"taxon_order_name": "Lamiales",
"taxon_family_name": "Oleaceae",
"taxon_genus_name": "Jasminum",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Annelida",
"taxon_class_name": "Clitellata",
"taxon_order_name": "Haplotaxida",
"taxon_family_name": "Lumbricidae",
"taxon_genus_name": "Lumbricus",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Marasmiaceae",
"taxon_genus_name": "Marasmius",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Marasmiaceae",
"taxon_genus_name": "Megacollybia",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Pluteaceae",
"taxon_genus_name": "Pluteus",
"taxon_species_name": "sp",
"size": "3"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Russulales",
"taxon_family_name": "Russulaceae",
"taxon_genus_name": "Russula",
"taxon_species_name": "sp",
"size": "2"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Liliales",
"taxon_family_name": "Smilacaceae",
"taxon_genus_name": "Smilax",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Russulales",
"taxon_family_name": "Stereaceae",
"taxon_genus_name": "Stereum",
"taxon_species_name": "sp",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Entognatha",
"taxon_order_name": "Entomobryomorpha",
"taxon_family_name": "Tomoceridae",
"taxon_genus_name": "Tomocerus",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Polyporales",
"taxon_family_name": "Polyporaceae",
"taxon_genus_name": "Trametes",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Asparagales",
"taxon_family_name": "Asparagaceae",
"taxon_genus_name": "Yucca",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Hemiptera",
"taxon_family_name": "Reduviidae",
"taxon_genus_name": "Zelus",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Alismatales",
"taxon_family_name": "Araceae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Plantae",
"taxon_phylum_name": "Magnoliophyta",
"taxon_class_name": "Liliopsida",
"taxon_order_name": "Asparagales",
"taxon_family_name": "Asparagaceae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Russulales",
"taxon_family_name": "Russulaceae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Arachnida",
"taxon_order_name": "Araneae",
"taxon_family_name": "Araneidae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "2"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Phasmida",
"taxon_family_name": "Diapheromeridae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Diplopoda",
"taxon_order_name": "Julida",
"taxon_family_name": "Julidae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "5"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Mantodea",
"taxon_family_name": "Mantidae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "3"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Lepidoptera",
"taxon_family_name": "Geometridae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Fungi",
"taxon_phylum_name": "Basidiomycota",
"taxon_class_name": "Agaricomycetes",
"taxon_order_name": "Agaricales",
"taxon_family_name": "Tricholomataceae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Diptera",
"taxon_family_name": "Psychodidae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Orthoptera",
"taxon_family_name": "Rhaphidophoridae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
},
{
"taxon_kingdom_name": "Animalia",
"taxon_phylum_name": "Arthropoda",
"taxon_class_name": "Insecta",
"taxon_order_name": "Coleoptera",
"taxon_family_name": "Scarabaeidae",
"taxon_genus_name": "unknown",
"taxon_species_name": "sp",
"size": "1"
}
]
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
cursor: pointer;
}
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 1.5px;
}
.node text {
font: 10px sans-serif;
}
.link {
fill: none;
stroke: #ccc;
stroke-width: 1.5px;
}
</style>
<header>
<button onclick="expandAll()">Expand All</button>
<button onclick="collapseAll()">Collapse All</button>
</header>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>
var margin = {top: 20, right: 120, bottom: 20, left: 120},
width = 1500,
height = 2000;
function expand(d){
var children = (d.children)?d.children:d._children;
if (d._children) {
d.children = d._children;
d._children = null;
}
if(children)
children.forEach(expand);
}
function expandAll(){
tree.size([height, width])
expand(root);
update(root);
}
function collapseAll(){
tree.size([height/4, width])
root.children.forEach(collapse);
collapse(root);
update(root);
}
function collapse(d) {
if (d.children) {
d._children = d.children;
d._children.forEach(collapse);
d.children = null;
}
}
var i = 0,
duration = 750,
root;
var tree = d3.layout.tree()
.size([height/4, width]);
var diagonal = d3.svg.diagonal()
.projection(function(d) { return [d.y, d.x]; });
var svg = d3.select("body").append("svg")
.attr("width", width + margin.right + margin.left)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
/*var partition = d3.layout.partition()
.value(function(d) { return d.size; });*/
var formatNumber = d3.format(",d");
function count_leaves(node){
};
d3.json("data.json", function(error, flare) {
data=flare
var newData = { name :"Total Species", children : [] },
levels = ["taxon_kingdom_name","taxon_phylum_name","taxon_class_name","taxon_order_name","taxon_family_name","taxon_genus_name","taxon_species_name"];
// For each data row, loop through the expected levels traversing the output tree
data.forEach(function(d){
// Keep this as a reference to the current level
var depthCursor = newData.children;
// Go down one level at a time
levels.forEach(function( property, depth ){
// Look to see if a branch has already been created
var index;
depthCursor.forEach(function(child,i){
if ( d[property] == child.name ) index = i;
});
// Add a branch if it isn't there
if ( isNaN(index) ) {
depthCursor.push({ name : d[property], children : []});
index = depthCursor.length - 1;
}
// Now reference the new child array as we go deeper into the tree
depthCursor = depthCursor[index].children;
// This is a leaf, so add the last element to the specified branch
if ( depth === levels.length - 2 ) depthCursor.push({ name : d.taxon_species_name, size : d.size });
});
});
console.log(newData);
if (error) throw error;
root = newData;
root.x0 = height / 2;
root.y0 = 0;
root.children.forEach(collapse);
update(root);
});
d3.select(self.frameElement).style("height", "800px");
function update(source) {
// Compute the new tree layout.
var nodes = tree.nodes(root).reverse(),
links = tree.links(nodes);
// Normalize for fixed-depth.
nodes.forEach(function(d) { d.y = d.depth * 180; });
// Update the nodes…
var node = svg.selectAll("g.node")
.data(nodes, function(d) { return d.id || (d.id = ++i); });
// Enter any new nodes at the parent's previous position.
var nodeEnter = node.enter().append("g")
.attr("class", "node")
.attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; })
.on("click", click);
nodeEnter.append("circle")
.attr("r", 1e-6)
.style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; });
nodeEnter.append("text")
.attr("x", function(d) { return d.children || d._children ? -10 : 10; })
.attr("dy", ".35em")
.attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; })
.text(function(d) { return d.name; })
.style("fill-opacity", 1e-6);
// Transition nodes to their new position.
var nodeUpdate = node.transition()
.duration(duration)
.attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; });
nodeUpdate.select("circle")
.attr("r", 7)
.style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; });
nodeUpdate.select("text")
.style("fill-opacity", 1);
// Transition exiting nodes to the parent's new position.
var nodeExit = node.exit().transition()
.duration(duration)
.attr("transform", function(d) { return "translate(" + source.y + "," + source.x + ")"; })
.remove();
nodeExit.select("circle")
.attr("r", 1e-6);
nodeExit.select("text")
.style("fill-opacity", 1e-6);
// Update the links…
var link = svg.selectAll("path.link")
.data(links, function(d) { return d.target.id; });
// Enter any new links at the parent's previous position.
link.enter().insert("path", "g")
.attr("class", "link")
.attr("d", function(d) {
var o = {x: source.x0, y: source.y0};
return diagonal({source: o, target: o});
});
// Transition links to their new position.
link.transition()
.duration(duration)
.attr("d", diagonal);
// Transition exiting nodes to the parent's new position.
link.exit().transition()
.duration(duration)
.attr("d", function(d) {
var o = {x: source.x, y: source.y};
return diagonal({source: o, target: o});
})
.remove();
// Stash the old positions for transition.
nodes.forEach(function(d) {
d.x0 = d.x;
d.y0 = d.y;
});
}
// Toggle children on click.
function click(d) {
if (d.children) {
d._children = d.children;
d.children = null;
} else {
d.children = d._children;
d._children = null;
}
update(d);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment