Scale contraints for 2D facets

Open
#408 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust, sql

Research direction

Start by running the SQL visualization example in the issue and compare the rendered facet panels with the penguins data relationships. The work is done when Adelie, Chinstrap, and Gentoo appear in the correct panels, zero anchoring is removed, and the requested per-panel or ggplot2-style row/column scale behavior is available as specified.

Written by the indexing model from the issue text.

Description

writer

Consider the following plot where x/y are free.

SELECT bill_len, bill_dep, species, island FROM ggsql:penguins
VISUALISE bill_len AS x, bill_dep AS y
DRAW point
FACET species BY island SETTING free => ['x', 'y']
LABEL
  title => 'Bill Dimensions by Species and Island',
  x => 'Bill Length (mm)',
  y => 'Bill Depth (mm)'
Image

There are a few things wrong with this plot:

  • BUG: The data-to-panel mapping is wrong.
    • Adelie penguins live on all three islands.
    • Chinstrap only on dream
    • Gentoo only on Biscoe.
  • BUG: Position scales are anchored to 0 for no apparent reason.
  • ENHANCEMENT: Position scales are free per-panel. In ggplot2, we have free scales per row/column. We should at least allow for ggplot2's behaviour of fixing x scales within a column and fixing y scales within a row to be an option.
Dominant language
Rust
Stars
575
Forks
33
Avg merge
7d 18h
Merged PRs (30d)
11

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/ggsql

All issues in posit-dev/ggsql

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.