{"id":9417,"date":"2022-11-28T15:55:47","date_gmt":"2022-11-28T15:55:47","guid":{"rendered":"https:\/\/max-drake.cc\/?p=9417"},"modified":"2022-11-29T08:33:16","modified_gmt":"2022-11-29T08:33:16","slug":"tree-diagram-collapsable-for-plant-generations-in-html","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=9417","title":{"rendered":"Tree Diagram, collapsible, for plant generations in HTML"},"content":{"rendered":"\n<p>The <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/pir2.tk\/\/web\/data\/1TreeDiagram\/MarigoldVS1_TreeDiagram.html\" target=\"_blank\">web page<\/a> <\/strong>for the Tree Diagram<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"813\" height=\"1024\" data-src=\"http:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-813x1024.jpg\" alt=\"\" class=\"wp-image-9424 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-813x1024.jpg 813w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-238x300.jpg 238w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-768x968.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-50x63.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-40x50.jpg 40w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-100x126.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-79x100.jpg 79w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-508x640.jpg 508w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-640x806.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-610x768.jpg 610w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-857x1080.jpg 857w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18.jpg 981w\" data-sizes=\"(max-width: 813px) 100vw, 813px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 813px; --smush-placeholder-aspect-ratio: 813\/1024;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Background story <\/h3>\n\n\n\n<p>My daughter is a grower and she had information on the different generations of plants she is growing. She has a spreadsheet that she uses to show different strains of plants, grown initially from seed and then cloning the plants to get the best strains.<\/p>\n\n\n\n<p>To find out information to track the plants you need to use spreadsheet filters to ascertain the children of the previous generation plants and which generation the plants are at a particular instance. So you could search which the parent plant was by using filters to find all the children of that particular parent.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tag_Batch_mum-numbers-Max-2022-11-26-Copy.xlsx-Excel2022-11-29-09_29.jpg\" alt=\"\" class=\"wp-image-9421 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1494px; --smush-placeholder-aspect-ratio: 1494\/1185;\" \/><\/figure>\n\n\n\n<p>As a designer I found the spreadsheet hard to understand, although it was very easy to search using the filters, but I wanted the information in a more visual manner so you could see the successful and unsuccessful strains and scan it easily with the eye, so I rearranged the information in the following manner,where you can clearly see each plant, who the parent plant was and what particular plant was cloned to make children , so at each new batch you can <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-batch-numbers.xlsx-Excel2022-11-29-09_12-1.jpg\" alt=\"\" class=\"wp-image-9419 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1661px; --smush-placeholder-aspect-ratio: 1661\/1183;\" \/><\/figure>\n\n\n\n<p>The above image shows a tree-like structure. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Dendograms in D3.JS <\/h3>\n\n\n\n<p>My initial thought was to use D3.JS, as I&#8217;d experimented with that before , in this <a rel=\"noreferrer noopener\" href=\"https:\/\/pir2.tk\/web\/data\/1Dendrogram\/dendoCollapse1.html\" target=\"_blank\">Expandable Building Parameter Tree<\/a>. I found that the text would be an issue of possibly writing over lines and the steps could get a bit messy. <\/p>\n\n\n\n<p>Also I wanted to be able to link to possible URL&#8217;s inside the tree as well, either to a file or to some other data that may be useful.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">HTML web page for Tree Diagram <\/h3>\n\n\n\n<p>On looking around further,  had one of those serendipitous events where my RSS feed had an article on tree diagrams <strong><a href=\"https:\/\/iamkate.com\/code\/tree-views\/\">Tree views in CSS<\/a>.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"631\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-1024x631.jpg\" alt=\"\" class=\"wp-image-9427 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-1024x631.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-300x185.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-768x474.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-50x31.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-81x50.jpg 81w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-100x62.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-162x100.jpg 162w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-1038x640.jpg 1038w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04-640x395.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Tree-views-in-CSS-\u2014-Mozilla-Firefox2022-11-29-16_04.jpg 1072w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/631;\" \/><\/figure>\n\n\n\n<p>It does some fancy stuff with CSS to beutify the icons, but the underlying code is in HTML. <\/p>\n\n\n\n<p>After looking at that code I started to explore further and found another bit of code doing the same thing on w<strong>3schools.com<\/strong> website,<strong>  <a rel=\"noreferrer noopener\" href=\"https:\/\/www.w3schools.com\/howto\/howto_js_treeview.asp\" target=\"_blank\">How To Create a Tree View<\/a><\/strong>. <\/p>\n\n\n\n<p>I decided to use that code as it went down 2 levels, unlike the first article that only went one level. It was easier to use as a proof of concept, which is what I was after. <\/p>\n\n\n\n<p>The other nice thing with the <strong>3schools.com<\/strong> website is you can try it out and modify it slightly and test, and it seemed to do what I wanted, so I used that method to build the flower Tree Diagram. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Designing for others <\/h4>\n\n\n\n<p>The people doing the gardening are all proficient in Excel but not good at coding, so if they were going to utilise the Tree in what they were doing then I would need to make it easy for them to be able to update and add further generations on later. <\/p>\n\n\n\n<p>So I decided to use the Excel Sheet I had created (see 2 images above) and create the HTML code around the data. As the HTML code was mainly to do with &lt;UL> unordered lists it as easy to add these items to the current Excel worksheet, just adding extra rows\/columns as needed to allow to put the html code around the items. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-batch-numbers.xlsx-Excel2022-11-29-16_26.jpg\" alt=\"\" class=\"wp-image-9428 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2421px; --smush-placeholder-aspect-ratio: 2421\/1336;\" \/><\/figure>\n\n\n\n<p>As HTML code does not indent unless you specifically make it do so, so it doesn&#8217;t matter if the code spans across several columns. <\/p>\n\n\n\n<p>I&#8217;d used this HTML scripting method when doing my Covid map <a href=\"https:\/\/www.drax.gq\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Transmission Type<\/strong><\/a>. That ended up being quite a complex excel worksheet as it included the whole webpage of the map and all the latest covid data from an API. <\/p>\n\n\n\n<p>The spreadsheet with this code is available on the web-page, you&#8217;ll see the purple text in the top image. So click on link at the top. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">End Comment <\/h3>\n\n\n\n<p>It was a fun exercise to carry out, but my daughter was not interested in developing it further. <\/p>\n\n\n\n<p>It could be enhanced with some more CSS to make the page more appealing, and also to colourise some of the items. <\/p>\n\n\n\n<p>The javascript is pretty limited and I&#8217;d maybe add a button so you could open the whole tree with one click. <\/p>\n\n\n\n<p>I&#8217;d also put links into the fields themselves, maybe for the plants or the plant batches. <\/p>\n\n\n\n<p>As there were other flower types I would have explored either having a menu to select which flower type to explore or separate tabs on the main page to be able to navigate between each. <\/p>\n\n\n\n<p>The actual development of the tree and code writing didn&#8217;t take too long, it was rather looking at the options available. <\/p>\n\n\n\n<p>As I&#8217;ve the resource now I may think about using it somewhere else in future. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The web page for the Tree Diagram Background story My daughter is a grower and she had information on the different generations of plants she is growing. She has a spreadsheet that she uses to show different strains of plants, grown initially from seed and then cloning the plants to get the best strains. To [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9424,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[204,40,32,42,12,29],"tags":[],"class_list":["post-9417","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automation","category-data-analysis","category-power-bi","category-productivity","category-visualisation","category-web"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-600x400.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2022\/11\/Marigold-VS1-\u2014-Mozilla-Firefox2022-11-29-09_18-600x600.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9417"}],"version-history":[{"count":6,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9417\/revisions"}],"predecessor-version":[{"id":9431,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9417\/revisions\/9431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/9424"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}