posit-dev / posit-dev/ggsql

Vega-Lite writer: DateTime / Time binned facet strips never match, so the labels never apply

Open
#518 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug writer
Dominant language
Rust
Stars
554
Forks
30
Avg merge
17h 27m
Merged PRs (30d)
8

Description

build_binned_facet_label_expr builds its strip labels as a Vega expression comparing datum.value against a midpoint string produced by calculate_midpoint_string (src/writer/vegalite/mod.rs:879). For the temporal arms — Date, DateTime, Time — that midpoint is emitted as a quoted ISO string ('1973-06-25T00:00:00'), which never equals the serialized facet column value at runtime. No condition ever fires, so the strips fall through to datum.value and show raw values instead of the bin range.

The hephaestus writer computes the same labels from typed values (scales::bin_at_centre, joining the column's bin centre back to its bin) and is correct — that is the behaviour to match.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start in src/writer/vegalite/mod.rs at build_binned_facet_label_expr and calculate_midpoint_string, then compare the temporal handling with the hephaestus writer's scales::bin_at_centre logic. Update the Date, DateTime, and Time label comparisons so they match serialized facet values and display bin ranges instead of raw values.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.