[HN Gopher] A Tiny Grammar of Graphics
       ___________________________________________________________________
        
       A Tiny Grammar of Graphics
        
       Author : pavpanchekha
       Score  : 114 points
       Date   : 2022-06-14 00:24 UTC (22 hours ago)
        
 (HTM) web link (observablehq.com)
 (TXT) w3m dump (observablehq.com)
        
       | woevdbz wrote:
       | I'm really curious how Observable will fare in the VC bear
       | market. They seem to be a fantastic team of conceptual thinkers
       | but I'm not sure what the cash flow looks like for this kind of
       | tooling
        
       | thedudeabides5 wrote:
       | Relevant, the OG Bertin's Matrix Theory of Graphics
       | 
       | http://www.geo-informatie.nl/courses/grs60312/visualisation/...
        
         | lo5 wrote:
         | His masterpiece Semiology of Graphics is a treasure trove of
         | novel visualizations.
        
       | dhucerbin wrote:
       | I've been building data visualizations for web for almost ten
       | years. Most of the time it was some kind of dashboard with custom
       | charts, interactivity and of course brand look.
       | 
       | Grammar of graphics always was this North Star for me. It is very
       | helpful to go through papers and books and search for inspiration
       | how to organize your system. But direct implementations are
       | finicky to work with. And in my hubris I attempted to write yet
       | another one implementation of grammar of graphics and it resulted
       | in exactly the same problems! With complex marks it is ambiguous
       | what is a data point and what is a series. Tuning looks require
       | this configuration objects scattered around chart definition and
       | composition sometimes require to inject something in two
       | different parts of definition.
       | 
       | Now I treat grammar of graphics as this collection of patterns
       | and good practices. But surrender to pragmatic solutions when
       | necessary.
       | 
       | Anyway I think I owe big part of my career to works of Wickham
       | and Wilkinson.
        
         | lo5 wrote:
         | > With complex marks it is ambiguous what is a data point and
         | what is a series.
         | 
         | I sort of agree with you. I've implemented the Grammar of
         | Graphics from the ground up four times professionally (!),
         | twice in collaboration with Leland, all in different products.
         | 
         | The main reason why it might be finicky to work with directly
         | is that the point vs. series vs. series-of-series distinction
         | can run arbitrarily deep, so there's some mental gymnastics
         | involved on the part of the library's user how to refactor the
         | data and present it correctly so that the library can do its
         | thing.
         | 
         | Tableau, which is also a GoG system, sort of deals with this by
         | having slots for "Dimensions", "Pages", "Color", etc. as
         | proxies for multi-level aggregation ("group/slice/dice" in BI
         | terms). So even though it's not immediately apparent to new
         | users how to present data correctly to the rendering system to
         | get the kind of vis they want, at least it's pretty low-
         | friction UX to shuffle variables between those slots till
         | satisfied.
         | 
         | With programmatic use, that shuffling-around gets cumbersome
         | because now you have write code to munge data into submission.
         | 
         | Tableau introduced the "Show Me" feature precisely for this
         | reason - most new users would rather get stuff done quickly
         | than figure out how the GoG can best solve their vis problem.
        
       | vavooom wrote:
       | A larger, more detailed introduction to this topic is best
       | discussed by Hadley Wickham in his seminal paper "A Layered
       | Grammar of Graphics".
       | 
       | https://byrneslab.net/classes/biol607/readings/wickham_layer...
       | 
       | Wickham is the Chief Scientist at RStudio and created R packages
       | such as ggplot2 and the tidyverse.
        
         | ngmc wrote:
         | Love that paper. Wickham also made his ggplot2 book freely
         | available:
         | 
         | https://ggplot2-book.org/
        
         | lo5 wrote:
         | Even more detailed is the original book by Leland Wilkinson, on
         | which ggplot2 is based:
         | https://link.springer.com/book/10.1007/0-387-28695-0.
         | 
         | The original implementations go back to SYSTAT and SPSS GPL
         | (Graphics Production Language).
         | 
         | GPL especially, with its statement-based approach, has arguably
         | better ergonomics for interactively and iteratively producing
         | plots compared to function-based approaches.
        
           | madcaptenor wrote:
           | I use ggplot2 regularly and have read Wilkinson but honestly
           | I have a bit of trouble seeing how ggplot2 is an
           | implementation of Wilkinson's book.
           | 
           | (It's been a few years, maybe I should take another look at
           | the book.)
        
             | lo5 wrote:
             | The overview links to the book. See:
             | https://ggplot2.tidyverse.org/
             | 
             | > ggplot2 is a system for declaratively creating graphics,
             | based on The Grammar of Graphics.
        
               | madcaptenor wrote:
               | I have the book! I just should figure out where it is on
               | my shelves.
        
       | lo5 wrote:
       | H2O Wave has a similar (probably tinier) Grammar of Graphics API:
       | https://wave.h2o.ai/docs/plotting
       | 
       | Leland Wilkinson (GoG inventor) and I designed it together a
       | couple of years back.
       | 
       | The function for creating marks (a layer) tries to be as "flat"
       | as possible, in the sense that it should be possible to render
       | most common kinds of plots without having to pass
       | nested/hierarchical options: https://wave.h2o.ai/docs/api/ui#mark
        
       | jackallis wrote:
       | Boy, as newbie tyring to learn DV is really confusing these days
       | when it comes to picking a platform - R, Pythong DJ3,
       | Obervablehq.
        
         | kasperset wrote:
         | Start with the platform one is already using for data
         | munging/transformation. I think R with its ggplot2 library is
         | very good. Python's Matplotlib is also not bad. ObservableHq is
         | also good when the data is closer to visual representation.
         | Overall, I find the data transformation technique does the 80%
         | of the work when it comes to data visualization.
        
         | skybrian wrote:
         | Once you've decided which programming language you're using,
         | it's easier to choose a plotting library.
        
       | skybrian wrote:
       | I've been having fun using Observable Plot to graph various
       | things related to digital signal processing. Here are my notes.
       | Feedback welcome!
       | 
       | https://observablehq.com/collection/@skybrian/digital-signal...
        
       ___________________________________________________________________
       (page generated 2022-06-14 23:00 UTC)