class: center, middle, title-slide .contextLL[d3-Unconf | 2017 | David Richards] # Hierarchical Datasets ### When? What? How? --- .context[hierarchies] # Our Goal? .right-column[
] By the end of this session,
you should have
a solid understanding,
and a comfort with,
hierarchical datasets
and d3.stratify.
* _When_ should I use them? * _What_ does the code look like? * _How_ do we work with them? --- name: d3-examples .context[hierarchies] # Illustrating Hierarchies .right-column[
] .left-column[
] ??? Radial tree is a little pathetic... --- .context[hierarchies] # Defined [TODO: include top snipped of definition png and make this look like a definition] A hierarchical dataset is: 1. Pyramid-like organization of ideas, people, items... 2. With a _single_, top-level item that we call the "__root__". 3. Every level has _one higher_ and _zero or more lower_ neighbors. 4. Higher levels have greater inclusion, influence, or breadth. [TODO: engineering picture] ??? Briefly explain the hierarchical dataset. Emphasize importance of root. --- .context[hierarchies] # Hello World Example >Continent ⇢ Country ⇢ State ⇢ City ⇢ Street ⇢ House might look like this in json: ``` json { "name": "North America", "children": [ { "name": "Canada" }, { "name": "Mexico" }, { "name": "United States", "children": [ { "name": "California" }, { "name": "Indiana", "children": [ { "name": "Fishers" }, { "name": "Carmel" }, { "name": "Indianapolis" } ] } ] } ] } ``` ??? * Note our simple example. * "You can often go higher, but we'll start with just simply picking a beginning spot." * Note simplified "name" and "children" keys. --- .context[when] # Natural hierarchies Some data is naturally hierarchical: * Location: Continent ⇢ Country ⇢ State ⇢ City ⇢ Street ⇢ House * Company: CEO ⇢ EVP ⇢ SVP ⇢ VP ⇢ DIR ⇢ MGR * Filesystem: Folder ⇢ Subfolder ⇢ File * Book: Dictionary ⇢ Letter ⇢ Word ⇢ Part-of-speech ⇢ Definitions ⇢ Examples * Family Tree: Granparents ⇢ Parents ⇢ Kids (this one kinda' falls apart...) Some fields use hiararchies to make decisions * MECE: mutually exclusive and collectively exhaustive (_consulting_) * Decision Tree illustration (_data science_) [TODO: illustrations of MECE and/or Decision Tree] ??? * Not everything that seems hierarchical is: family tree * MECE is actually a good way to divide up complex problems and a litmus test for true hierarchy. --- class: center, middle ## Our Hierarchical Dataset in Action --- .context[when] # Let's Create an Example Together .exercise[What are examples of naturally occurring hierarchies?] .exercise[PostIt Notes & Pencil: Draw a picture of a dataset that you want to work with that is hierarchical.] [TODO: Add a short description of what's expected] ??? 1. Explain the exercise 2. Give time to complete 3. Provide Ideas: * Bucket List items, divided by completed/not completed, terrifying/not terrifying * Places you've visited, divided by contintent or companions * Things you want to learn, divided by technology/not * Upcoming projects: work/personal * Cars you've owned, divided by how the relationship ended 4. Show my example --- --- .contextLL[slides created with remark.js] # Thanks!