{"id":87,"date":"2016-02-08T19:26:14","date_gmt":"2016-02-08T19:26:14","guid":{"rendered":"http:\/\/www.stratadata.co.uk\/blog\/?p=87"},"modified":"2017-11-03T09:25:35","modified_gmt":"2017-11-03T09:25:35","slug":"generalrelativity","status":"publish","type":"post","link":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/2016\/02\/08\/generalrelativity\/","title":{"rendered":"General Relativity (&#8216;Relative Inner&#8217; vs &#8216;Relative Outer&#8217; )"},"content":{"rendered":"<p>Expect the blog to feature many, many posts about the biostratigraphy panels. There are so many combinations of panel options that I shouldn&#8217;t think anybody is au fait with all of them &#8211; probably not even me! I want to start with something relatively (excuse the pun) simple. I&#8217;m also choosing this because it&#8217;s something that wasn&#8217;t possible before the new charts module was released.<\/p>\n<p>My examples use data from our demo dataset. My template starts out as a simple &#8216;group by category&#8217; palynology\u00a0panel &#8211; that is, I&#8217;ve kept all the basic options except changing &#8220;group data by&#8221; to &#8220;category&#8221;. In the real world this would be better as groups, for which you will also need to restrict the outer panel to a group set.<\/p>\n<p>Everybody should be familiar with the &#8220;relative (inner)&#8221; calculation\u00a0style &#8211; it&#8217;s been in StrataBugs since the year dot. It would transform a simple absolute-abundance style plot like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-88 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-1.jpg\" alt=\"relativity-1\" width=\"496\" height=\"323\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-1.jpg 496w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-1-300x195.jpg 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/p>\n<p>Into a relative-abundance plot like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-2.jpg\" alt=\"relativity-2\" width=\"358\" height=\"322\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-2.jpg 358w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-2-300x270.jpg 300w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><\/p>\n<p>Each column shows its count relative to the total count for the analysis\u00a0across the whole panel. Each row adds up to 100%. Well, OK, nearly 100% &#8211; since you asked, we&#8217;re rounding up to integer values except where we have less than 1%.<!--more--><\/p>\n<p>Now, what if instead of the category totals, you want to show individual species, but as a percentage of the total fossil count?\u00a0If you switch the &#8220;group data by&#8221; option back to &#8220;species&#8221;, this is exactly what you&#8217;ll get, except that you will lose the neat category grouping.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-98 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-8.jpg\" alt=\"relativity-8\" width=\"540\" height=\"317\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-8.jpg 540w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-8-300x176.jpg 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/p>\n<p>If I show just the SP instead, the values only reflect percentages of the SP total. For example, in the first analysis, Pollen bisaccate is 23% of the total paly count (above), but 69% of the SP total (below).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-91 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-3.jpg\" alt=\"relativity-3\" width=\"373\" height=\"473\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-3.jpg 373w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-3-237x300.jpg 237w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/p>\n<p>Here&#8217;s the bit where we need to use the new concept of inner vs outer panels. If this is a new concept, bear with me. All you really need to know is that the biostratigraphy panel behaves a bit like a mini block &#8211; it has panels within itself, which we call &#8220;inner panels&#8221;. There are a set of properties which affect all inner panels, and then each inner panel has properties of its own.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-99 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-9.jpg\" alt=\"relativity-9\" width=\"269\" height=\"416\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-9.jpg 269w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-9-194x300.jpg 194w\" sizes=\"auto, (max-width: 269px) 100vw, 269px\" \/><\/p>\n<p>Crucially, you can restrict the the data of both the inner and outer panels separately, such that the data for any inner panel is a subset of the outer panel. In the previous panel, I applied the restriction &#8220;SP&#8221; to the inner panel only.<\/p>\n<p>Now,\u00a0changing the calculation style of this SP inner panel to &#8220;relative (outer)&#8221; changes the calculation to use the total of whatever data would be included in the outer panel. In this case, because I haven&#8217;t changed it, it will be &#8220;all paly&#8221;.\u00a0Now I&#8217;ve got just the SP, but relative to all of the paly data:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-92 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-4.jpg\" alt=\"relativity-4\" width=\"279\" height=\"529\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-4.jpg 279w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-4-158x300.jpg 158w\" sizes=\"auto, (max-width: 279px) 100vw, 279px\" \/><\/p>\n<p>I could include inner panels for the other important categories too:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-94 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-6.jpg\" alt=\"relativity-6\" width=\"540\" height=\"320\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-6.jpg 540w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-6-300x178.jpg 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/p>\n<p>Note that the inner panels have exactly the same properties as each other, except for &#8220;restrict data by&#8221;. This means you can leave them with linked properties:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-95 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-5.jpg\" alt=\"relativity-5\" width=\"264\" height=\"148\" \/><\/p>\n<p>Or,\u00a0for extra points, this is a great time to make use of the &#8216;one panel per category&#8217; option when you restrict the data. This means that whatever data\u00a0are present, you will get one inner panel for every relevant category.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-96 aligncenter\" src=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-7.jpg\" alt=\"relativity-7\" width=\"435\" height=\"316\" srcset=\"https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-7.jpg 435w, https:\/\/www.stratadata.co.uk\/blog\/wp-content\/uploads\/2016\/02\/relativity-7-300x218.jpg 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Expect the blog to feature many, many posts about the biostratigraphy panels. There are so many combinations of panel options that I shouldn&#8217;t think anybody is au fait with all of them &#8211; probably not even me! I want to start with something relatively (excuse the pun) simple. I&#8217;m also choosing this because it&#8217;s something [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[10,11],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-charts","tag-panels","tag-taxon-panel"],"_links":{"self":[{"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":15,"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/87\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stratadata.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}