The app draws the whole file, always. The first question two NAV series invite is about a
stretch of it — what did these two do in 2022 — and today the only way to ask is to leave
the app and refilter the parquet.
Everything needed is already in place. columns.date_column knows whether there is a date
axis or row numbers; aligned sorts by period; plot and stats both consume the same
aligned frame. What is missing is one input.
Shape. A range control in the middle column, under the rebase switch: mo.ui.date_range
when date_column(frame) is not None, mo.ui.range_slider over the row index when it is.
Filter once in the cell that already derives pair and chart, and let both the chart and
the two summary tables come off the filtered frame.
Why a range control and not an Altair brush. alt.selection_interval(bind="scales")
would be fewer lines, and it would break the repo's own invariant: zooming the axis moves
the picture and leaves the tables describing the full sample, which is the exact failure mode
of #75 reintroduced deliberately. A range input filters the data, so the tables follow and
"the numbers beside the chart always describe the lines in it" keeps holding. Getting a
brush to filter instead of zoom needs mo.ui.altair_chart for the round trip, which also
means line_chart stops being the plain Altair chart that plot.py's docstring promises —
worth knowing before reaching for it.
Two things fall out for free once the window exists:
Sequencing: after #75. Building a window on a caption that already misreports its sample
means writing the fix twice.
The app draws the whole file, always. The first question two NAV series invite is about a
stretch of it — what did these two do in 2022 — and today the only way to ask is to leave
the app and refilter the parquet.
Everything needed is already in place.
columns.date_columnknows whether there is a dateaxis or row numbers;
alignedsorts by period;plotandstatsboth consume the samealigned frame. What is missing is one input.
Shape. A range control in the middle column, under the rebase switch:
mo.ui.date_rangewhen
date_column(frame)is not None,mo.ui.range_sliderover the row index when it is.Filter once in the cell that already derives
pairandchart, and let both the chart andthe two summary tables come off the filtered frame.
Why a range control and not an Altair brush.
alt.selection_interval(bind="scales")would be fewer lines, and it would break the repo's own invariant: zooming the axis moves
the picture and leaves the tables describing the full sample, which is the exact failure mode
of #75 reintroduced deliberately. A range input filters the data, so the tables follow and
"the numbers beside the chart always describe the lines in it" keeps holding. Getting a
brush to filter instead of zoom needs
mo.ui.altair_chartfor the round trip, which alsomeans
line_chartstops being the plain Altair chart thatplot.py's docstring promises —worth knowing before reaching for it.
Two things fall out for free once the window exists:
2022" is what the switch means — which is the comparison the feature is for.
same sentence.
Sequencing: after #75. Building a window on a caption that already misreports its sample
means writing the fix twice.