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

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

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

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.

Description

bug writer

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.

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.