{"id":444,"date":"2015-04-01T01:03:51","date_gmt":"2015-04-01T07:03:51","guid":{"rendered":"http:\/\/harrysurden.com\/wordpress\/?p=444"},"modified":"2015-04-01T04:33:56","modified_gmt":"2015-04-01T10:33:56","slug":"visualizing-the-us-code-part-1-law-explorer","status":"publish","type":"post","link":"https:\/\/www.harrysurden.com\/wordpress\/archives\/444","title":{"rendered":"Visualizing the US Code -Part 1: Law Explorer"},"content":{"rendered":"<div id=\"attachment_416\" style=\"width: 568px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/harrysurden.com\/projects\/visual\/USCode_D3\/US_Code_Tree_d3_1g.html\" target=\"_blank\"><img aria-describedby=\"caption-attachment-416\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-416\" src=\"http:\/\/harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/03\/US-Code-Explorer-Screen-shot.png\" alt=\"\" width=\"558\" height=\"309\" srcset=\"https:\/\/www.harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/03\/US-Code-Explorer-Screen-shot.png 1016w, https:\/\/www.harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/03\/US-Code-Explorer-Screen-shot-300x166.png 300w, https:\/\/www.harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/03\/US-Code-Explorer-Screen-shot-620x344.png 620w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n<p id=\"caption-attachment-416\" class=\"wp-caption-text\">US Code Explorer: Title 35 (Click to Use)<\/p>\n<\/div>\n<h2>Visualizing the US Code: Law Explorer<\/h2><p>I have created a new demonstration application for visualizing and browsing the US Code &#8211; <a href=\"http:\/\/harrysurden.com\/projects\/visual\/USCode_D3\/US_Code_Tree_d3_1g.html\">the US Code Explorer<\/a>\u00a0(beta)\u00a0(pictured above). \u00a0Click on the link or photo to see it in action.<\/p><p>The app is meant as an experiment in visualizing and interacting with the US Code\u00a0<a href=\"http:\/\/uscode.house.gov\/download\/download.shtml\">since\u00a0it has been marked-up\u00a0in xml by the federal government.<\/a><\/p><p>I selected Title 35 (Patent Law) as my example.<\/p><p><a href=\"http:\/\/harrysurden.com\/projects\/visual\/USCode_D3\/US_Code_Tree_d3_Multiple.html\">There is also a second version with three Titles of the US code: Title 35 (Patents), Title 17\u00a0( Copyright), and Title 20 (Education). <\/a>\u00a0Due to the size, the second version takes a bit longer to load.<\/p>\n<div id=\"attachment_461\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/harrysurden.com\/projects\/visual\/USCode_D3\/US_Code_Tree_d3_Multiple.html\" target=\"_blank\"><img aria-describedby=\"caption-attachment-461\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-461 size-medium\" src=\"http:\/\/harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-01-at-9.22.04-PM-300x167.png\" alt=\"Screen Shot 2015-04-01 at 9.22.04 PM\" width=\"300\" height=\"167\" srcset=\"https:\/\/www.harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-01-at-9.22.04-PM-300x167.png 300w, https:\/\/www.harrysurden.com\/wordpress\/wp-content\/uploads\/2015\/04\/Screen-Shot-2015-04-01-at-9.22.04-PM.png 475w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p id=\"caption-attachment-461\" class=\"wp-caption-text\">Version with Multiple Titles: Title 35, Title 17, Title 20<\/p>\n<\/div><p>The look and presentation of the visualization parallels the visual style that\u00a0that I use when I\u00a0present\u00a0the law to my students when I teach <a href=\"http:\/\/lawweb.colorado.edu\/courses\/courseSection.jsp?id=LAWS7311&term=20147#section_001\">Patent Law<\/a> and <a href=\"http:\/\/lawweb.colorado.edu\/courses\/courseSection.jsp?id=LAWS6301&term=20147#section_001\">Introduction to Intellectual Property.<\/a>\u00a0 During class, the visualizations are static Powerpoint slides. \u00a0This is a more interactive version.<\/p><p>Please note &#8211; this is merely a beta version of this visualization. \u00a0Neither the computer code, nor the US code, have been thoroughly tested. \u00a0Please do not rely on this app for the law\u00a0as there may be errors or omissions.<\/p><p>I will have a follow up post explaining in more depth what I did, but in short, I wrote a parser in python to read through the US Code xml files and extract\u00a0the law\u00a0hierarchy from\u00a0the titles. \u00a0I then exported the structure in .json format.<\/p><p>And finally, I used the amazing\u00a0<a href=\"http:\/\/d3js.org\/\"><strong>d3 data visualization<\/strong><\/a>\u00a0framework to create the visualization. \u00a0Here, I borrowed heavily and employed\u00a0a modified version of <a href=\"http:\/\/bl.ocks.org\/mbostock\/4339083\">Mike Bostock&#8217;s d3 collapseable\u00a0hierarchical tree.<\/a><\/p><p>This is the first is a series of data visualization experiments of the US Code that I will employ using the d3 framework. \u00a0The <a href=\"http:\/\/harrysurden.com\/wordpress\/projects\">projects will be found in here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visualizing the US Code: Law ExplorerI have created a new demonstration application for visualizing and browsing the US Code &#8211; the US Code Explorer\u00a0(beta)\u00a0(pictured above). \u00a0Click on the link or photo to see it in action.The app is meant as an experiment in visualizing and interacting with the US Code\u00a0since\u00a0it has been marked-up\u00a0in xml by [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/posts\/444"}],"collection":[{"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/comments?post=444"}],"version-history":[{"count":10,"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":462,"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/posts\/444\/revisions\/462"}],"wp:attachment":[{"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/categories?post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.harrysurden.com\/wordpress\/wp-json\/wp\/v2\/tags?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}