{"id":909,"date":"2014-03-31T14:45:28","date_gmt":"2014-03-31T19:45:28","guid":{"rendered":"http:\/\/billdwhite.com\/?p=909"},"modified":"2014-03-31T14:45:28","modified_gmt":"2014-03-31T19:45:28","slug":"d3-multiple-flow-container-demo","status":"publish","type":"post","link":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/","title":{"rendered":"d3 Multiple Flow Container Demo"},"content":{"rendered":"<p>I received a comment on the <a href=\"http:\/\/billdwhite.com\/2013\/10\/11\/d3-flow-tree-layout\/\" title=\"http:\/\/billdwhite.com\/2013\/10\/11\/d3-flow-tree-layout\/\" target=\"_blank\">Flow Tree Layout post<\/a> asking if it was possible to use that same layout multiple times within a single SVG.  The code in that example created an SVG inside of a dom node passed in by the caller, but it is possible to modify that sample to accept any valid SVG container for executing the layout.  I created <a href=\"http:\/\/gist.github.com\/billdwhite\/9875443\" title=\"http:\/\/gist.github.com\/billdwhite\/9875443\" target=\"_blank\">a quick and dirty sample GIST<\/a> showing how it might be done.<\/p>\n<p>I also put together another <a href=\"http:\/\/d3js.org\/\" title=\"http:\/\/d3js.org\/\" target=\"_blank\">d3<\/a> demo showing how the flow layout could be used within multiple containers within the same SVG.  This is a much more component-ized implementation which lets you create any number of containers, each with its own layout (all are flow layout in this case).  You can resize the containers below to see their individual flow layouts operate.  This demo also includes z-ordering and selection logic (drag on the background to do a lasso selection of multiple containers) all implemented using d3.  <a href=\"http:\/\/gist.github.com\/billdwhite\/9900551\" title=\"http:\/\/gist.github.com\/billdwhite\/9900551\" target=\"_blank\">Gist is here<\/a> and <a href=\"http:\/\/bl.ocks.org\/billdwhite\/9900551\" title=\"http:\/\/bl.ocks.org\/billdwhite\/9900551\" target=\"_blank\">bl.ocks version is here<\/a>. Enjoy \ud83d\ude42<\/p>\n<p><strong>Multiple Flow Containers<\/strong><br \/>\n<iframe loading=\"lazy\" src=\"\/wordpress\/wp-content\/js\/multiflow_01.html\" height=\"750\" width=\"650\" scrolling=\"no\"><\/iframe> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I received a comment on the Flow Tree Layout post asking if it was possible to use that same layout multiple times within a single SVG. The code in that example created an SVG inside of a dom node passed in by the caller, but it is possible to modify that sample to accept any\u2026 <span class=\"read-more\"><a href=\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,7,9],"tags":[],"class_list":["post-909","post","type-post","status-publish","format-standard","hentry","category-d3","category-html5","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>d3 Multiple Flow Container Demo - Bill White<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"d3 Multiple Flow Container Demo - Bill White\" \/>\n<meta property=\"og:description\" content=\"I received a comment on the Flow Tree Layout post asking if it was possible to use that same layout multiple times within a single SVG. The code in that example created an SVG inside of a dom node passed in by the caller, but it is possible to modify that sample to accept any\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\" \/>\n<meta property=\"og:site_name\" content=\"Bill White\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-31T19:45:28+00:00\" \/>\n<meta name=\"author\" content=\"Bill White\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bill_d_white\" \/>\n<meta name=\"twitter:site\" content=\"@bill_d_white\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bill White\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\"},\"author\":{\"name\":\"Bill White\",\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314\"},\"headline\":\"d3 Multiple Flow Container Demo\",\"datePublished\":\"2014-03-31T19:45:28+00:00\",\"dateModified\":\"2014-03-31T19:45:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\"},\"wordCount\":180,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314\"},\"articleSection\":[\"d3\",\"HTML5\",\"Javascript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\",\"url\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\",\"name\":\"d3 Multiple Flow Container Demo - Bill White\",\"isPartOf\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#website\"},\"datePublished\":\"2014-03-31T19:45:28+00:00\",\"dateModified\":\"2014-03-31T19:45:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/billdwhite.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"d3 Multiple Flow Container Demo\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#website\",\"url\":\"https:\/\/billdwhite.com\/wordpress\/\",\"name\":\"Bill White's Blog\",\"description\":\"UI Development and Data Visualization:  Angular \/ React \/ D3 \/ Typescript \/ Javascript \/ UI \/ UX \/ Etc\",\"publisher\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/billdwhite.com\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314\",\"name\":\"Bill White\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3c3595ee8305a186eea4ea5286143893?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3c3595ee8305a186eea4ea5286143893?s=96&d=mm&r=g\",\"caption\":\"Bill White\"},\"logo\":{\"@id\":\"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.billdwhite.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"d3 Multiple Flow Container Demo - Bill White","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/","og_locale":"en_US","og_type":"article","og_title":"d3 Multiple Flow Container Demo - Bill White","og_description":"I received a comment on the Flow Tree Layout post asking if it was possible to use that same layout multiple times within a single SVG. The code in that example created an SVG inside of a dom node passed in by the caller, but it is possible to modify that sample to accept any\u2026 Read More &raquo;","og_url":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/","og_site_name":"Bill White","article_published_time":"2014-03-31T19:45:28+00:00","author":"Bill White","twitter_card":"summary_large_image","twitter_creator":"@bill_d_white","twitter_site":"@bill_d_white","twitter_misc":{"Written by":"Bill White","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#article","isPartOf":{"@id":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/"},"author":{"name":"Bill White","@id":"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314"},"headline":"d3 Multiple Flow Container Demo","datePublished":"2014-03-31T19:45:28+00:00","dateModified":"2014-03-31T19:45:28+00:00","mainEntityOfPage":{"@id":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/"},"wordCount":180,"commentCount":0,"publisher":{"@id":"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314"},"articleSection":["d3","HTML5","Javascript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/","url":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/","name":"d3 Multiple Flow Container Demo - Bill White","isPartOf":{"@id":"https:\/\/billdwhite.com\/wordpress\/#website"},"datePublished":"2014-03-31T19:45:28+00:00","dateModified":"2014-03-31T19:45:28+00:00","breadcrumb":{"@id":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/billdwhite.com\/wordpress\/2014\/03\/31\/d3-multiple-flow-container-demo\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/billdwhite.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"d3 Multiple Flow Container Demo"}]},{"@type":"WebSite","@id":"https:\/\/billdwhite.com\/wordpress\/#website","url":"https:\/\/billdwhite.com\/wordpress\/","name":"Bill White's Blog","description":"UI Development and Data Visualization:  Angular \/ React \/ D3 \/ Typescript \/ Javascript \/ UI \/ UX \/ Etc","publisher":{"@id":"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/billdwhite.com\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/ea6b87554d0eed13a0152765dd01d314","name":"Bill White","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3c3595ee8305a186eea4ea5286143893?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3c3595ee8305a186eea4ea5286143893?s=96&d=mm&r=g","caption":"Bill White"},"logo":{"@id":"https:\/\/billdwhite.com\/wordpress\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.billdwhite.com"]}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/posts\/909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/comments?post=909"}],"version-history":[{"count":0,"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/posts\/909\/revisions"}],"wp:attachment":[{"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/media?parent=909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/categories?post=909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/billdwhite.com\/wordpress\/wp-json\/wp\/v2\/tags?post=909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}