Conversation
✅ Deploy Preview for posit-open-source canceled.
|
|
/deploy-preview |
Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> Co-authored-by: George Stagg <georgestagg@gmail.com> Co-authored-by: Thomas Lin Pedersen <thomasp85@gmail.com>
Preview not availableThis PR is from a fork and cannot deploy a preview automatically. |
|
I've noticed other places that vegalite looks horrible on mobile. Currently investigating whether we can shrink the visualisation below a certain width threshold |
|
/deploy-preview |
|
/deploy-preview |
|
/deploy-preview |
|
@thomasp85 next time you push, you should get a comment checking your post YAML header. We changed a few things recently, so you'll be flagged for (and need to fix): |
|
I'm going to close and re-open this PR to try and debug some CI stuff. Sorry for the noise. |
| ### A (simple) example | ||
| Let's start with some code even though we haven't introduced the syntax yet. I promise we will go through it below. The example is an adaptation of a visualization created by [Jack Davison](https://jack-davison.github.io) for TidyTuesday. | ||
|
|
||
| ```{ggsql} |
There was a problem hiding this comment.
Any chance at all of somehow getting this syntax highlighted in the final rendered post?
Co-authored-by: George Stagg <georgestagg@gmail.com>
Fork PRs get a read-only GITHUB_TOKEN on pull_request events, so the sticky-comment step in validate-blog-posts.yml fails with "Resource not accessible by integration" (e.g. run 24529154129 on PR #170). Move the commenting step into a second workflow triggered by workflow_run, which runs from main with a write-capable token. The validation job now uploads the report (plus the PR number) as an artifact; the new comment-blog-validation.yml downloads it and posts the sticky comment. Untrusted PR code only ever runs with the read-only token; the write-token job never checks out PR code, only the pre-generated markdown artifact.
Fork PRs get a read-only GITHUB_TOKEN on pull_request events, so the sticky-comment step in validate-blog-posts.yml fails with "Resource not accessible by integration" (e.g. run 24529154129 on PR #170). Move the commenting step into a second workflow triggered by workflow_run, which runs from main with a write-capable token. The validation job now uploads the report (plus the PR number) as an artifact; the new comment-blog-validation.yml downloads it and posts the sticky comment. Untrusted PR code only ever runs with the read-only token; the write-token job never checks out PR code, only the pre-generated markdown artifact.
|
/deploy-preview |
teunbrand
left a comment
There was a problem hiding this comment.
A few last nitpicks, the rest reads great!
Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com>
…5/open-source-website into blog/ggsql-announcement
Blog YAML Checks✅ All 1 posts passed. |
hadley
left a comment
There was a problem hiding this comment.
Argh I commented all these on the .md
|
|
||
| Today, we are super excited to formally announce the alpha-release of [ggsql](https://ggsql.org). As the name suggests, ggsql is an implementation of the grammar of graphics based on the SQL syntax, bringing rich, structured visualization support to SQL for the first time. | ||
|
|
||
| In this post we will go over some of the motivations that lead us to develop this tool, as well as give you ample examples of its use; so you can hopefully get as excited about it as we are (if you can't wait to get excited, [jump straight to the examples](#meet-ggsql)). |
There was a problem hiding this comment.
IMO you should include one example here
There was a problem hiding this comment.
Or even flip the order; show the results then discuss the motivation.
| QUALIFY ROW_NUMBER() OVER ( | ||
| PARTITION BY name | ||
| ORDER BY mission_number DESC | ||
| ) = 1 |
There was a problem hiding this comment.
Could we simplify this? It's a bit distracting to hit some complex SQL syntax when the focus should be on the visualisation.
There was a problem hiding this comment.
If the example is moved down don't you think it will be ok. The point was really to show a full pipeline including some meaningful SQL preparation
| It should also be noted that the SQL query part is optional. If your data is already in the right shape for plotting you can skip it and instead name the source directly in the `VISUALIZE` clause: | ||
|
|
||
| ``` ggsql | ||
| VISUALIZE year_of_selection AS x, year_of_mission AS y FROM 'astronauts.parquet' |
There was a problem hiding this comment.
| VISUALIZE year_of_selection AS x, year_of_mission AS y FROM 'astronauts.parquet' | |
| FROM 'astronauts.parquet' | |
| VISUALIZE year_of_selection AS x, year_of_mission AS y |
?
There was a problem hiding this comment.
that won't work - everything above VISUALIZE is ignored
There was a problem hiding this comment.
We probably should add support for the equivalent of duckdb's,
D FROM 'penguins.csv' LIMIT 2;
┌─────────┬───────────┬───┬───────────────────┬─────────────┬─────────┐
│ species │ island │ … │ flipper_length_mm │ body_mass_g │ sex │
│ varchar │ varchar │ │ int64 │ int64 │ varchar │
├─────────┼───────────┼───┼───────────────────┼─────────────┼─────────┤
│ Adelie │ Torgersen │ … │ 181 │ 3750 │ MALE │
│ Adelie │ Torgersen │ … │ 186 │ 3800 │ FEMALE │
├─────────┴───────────┴───┴───────────────────┴─────────────┴─────────┤
│ 2 rows 7 columns (5 shown) │
└─────────────────────────────────────────────────────────────────────┘
if we can. I have had someone else ask for the same thing, with FROM at the front.
There was a problem hiding this comment.
Maybe not for initial release, if the required grammar changes end up being a pain.
| The last clause in our visual query is `LABEL` which allows us to add or modify various text labels like title, subtitle, and axis and legend titles. | ||
|
|
||
| ### Stepping back | ||
| That was a mouthful. But there are two very silvery linings to it all: |
There was a problem hiding this comment.
IMO it would be better to step people up to the complex example.
If you wanted to keep a complex example first, I'd suggest you just show it, then explain the syntax with simple plots, then come back to an explanation of the complex plot.
| SETTING position => 'jitter', distribution => 'density' | ||
| ``` | ||
|
|
||
| As you can see the syntax and composable nature makes visualization iteration very ergonomic, something that is extremely valuable in both explorative analyses and visualization design. |
There was a problem hiding this comment.
I'd add one example of mapping points to colour (or similar) here.
| As you can see the syntax and composable nature makes visualization iteration very ergonomic, something that is extremely valuable in both explorative analyses and visualization design. | ||
|
|
||
| ## Behind the curtains | ||
| With a passing understanding of how to use ggsql, let's discuss what goes on behind the scenes. At its core ggsql is a modular Rust library that is split into a Reader module, a Plot module, and a Writer module. Both the Reader and Writer can be swapped out, leaving the Plot module as the only constant. |
There was a problem hiding this comment.
I'd suggest you drop this entire section and move it to the site somewhere.


No description provided.