Free facet dimensions get the globally resolved breaks, so most panels show one tick

Fechada
#516 2 comentários 1 reação 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 10 dias

@thomasp85 já está trabalhando nisso.

Desde 29/9/2026.

  • #567 de @thomasp85 — aberto

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
rust

Direção de pesquisa

Comece pela reprodução de facets e inspecione como ggsql resolve escalas e breaks para dimensões livres. Leia o tratamento de resolve.scale e axis.values no writer de Vega-Lite e compare-o com scales::free_position_scale, free_binned_scale e Scale::expand_range de hephaestus. Considera-se concluído quando core fornecer domínios e breaks por painel, para que os writers não apliquem mais breaks globais nem calculem extensões livres por conta própria.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

plot building writer
Summary

ggsql resolves exactly one scale — and one break set — per aesthetic, including for a facet dimension declared free. The Vega-Lite writer therefore pins the global break set as axis.values even where it has delegated the domain to Vega, so each free panel shows only whichever global breaks happen to fall inside it — frequently one, or none.

While this issue is about the breaks specifically, it also points to a deficiency in our ggsql <-> writer contract. Specifically for faceted plots with free scales we are currently letting the writer calculate range, breaks etc for the free scales. This really belongs in ggsql which should resolve the scale to an array somehow (VegaLite might not be able to consume that but Hephaestus can)

Reproduction
VISUALISE Date AS x, Temp AS y FROM ggsql:airquality
DRAW line
FACET Month SETTING free => 'x'
resolve: {'scale': {'x': 'independent'}}     # domain correctly delegated to Vega
scale:   {'zero': False}                     # no domain, as intended
values:  ['1973-04-23', '1973-05-21', '1973-06-18', '1973-07-16', '1973-08-13', '1973-09-10']

Those six breaks span the whole year, but each panel covers one month — so a panel gets at most one of them.

Why it belongs in core

Both writers currently work around the missing per-panel resolution, in different places and with different results:

  • Vega-Lite delegates the domain to Vega (resolve.scale: independent) but still pins global break values on top of it.
  • hephaestus computes the per-panel extent itself in scales::free_position_scale / free_binned_scale, applying ggsql's own Scale::expand_range factors — this is the one remaining piece of writer-side domain computation, and it exists solely because core resolves nothing per panel.

Resolving per-panel domains and breaks for a free facet dimension in core fixes the Vega-Lite tick problem and removes the hephaestus writer's architectural exception in one go.

Linguagem predominante
Rust
Estrelas
572
Forks
31
Merge médio
9d 4h
PRs com merge (30d)
12

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de posit-dev/ggsql

Todas as issues de posit-dev/ggsql

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.