Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ jobs:
- name: Build library (no features) at MSRV
run: cargo +${{ steps.msrv.outputs.version }} build

# Excludes `pdf`: krilla (the pdf feature's backend) needs a newer Rust
# than package.rust-version — verified separately by the pdf-msrv job
# below, at its own higher floor.
# Excludes `pdf`: krilla (the pdf feature's backend) and typst (its
# math typesetter) need a newer Rust than package.rust-version —
# verified separately by the pdf-msrv job below, at its own higher floor.
- name: Build library (CLI + non-PDF backends) at MSRV
run: cargo +${{ steps.msrv.outputs.version }} build --features cli,png,embed_font

Expand All @@ -101,9 +101,11 @@ jobs:

- uses: Swatinem/rust-cache@v2

# `full` = png + pdf + embed_font; this is the combination the release
# workflow's pre-built binaries use (features: cli,full), so verify it
# builds cleanly at the pdf feature's own real MSRV floor rather than
# package.rust-version (which no longer covers it).
- name: Build library (CLI + all backends, including pdf) at pdf's MSRV
# `full` = png + pdf + embed_font + typst; this is the combination the
# release workflow's pre-built binaries use (features: cli,full), so
# verify it builds cleanly at the pdf feature's own real MSRV floor
# rather than package.rust-version (which no longer covers it). Since
# `pdf` also carries the typst math tier, this job covers typst's MSRV
# too (typst 0.14 needs 1.89 < krilla's 1.92).
- name: Build library (CLI + all backends, including pdf + typst math) at pdf's MSRV
run: cargo +${{ steps.pdf_msrv.outputs.version }} build --features cli,full
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- **Typst tier for math in labels** (part of the `pdf` feature) — labels containing `$...$` may now be typeset with the Typst compiler (linked as a library — no external binary) for real 2-D math: stacked fractions, radicals with vinculum, large operators, math italic. The whole label is compiled and embedded as an SVG fragment (SVG backend), pixmap (PNG), or through the PDF pipeline, with math color following the label color. The typesetter rides the `pdf` feature rather than a feature of its own: krilla (the PDF backend) is Typst's own PDF stack, so `pdf` was already the crate's one deliberately heavy, Rust >= 1.92 feature — enabling it now buys typeset math in every vector/raster backend, and `cargo build --features pdf` (or `full`) is the only switch to flip. Builds on the always-on inline-Unicode lookup tier from 0.3.0, which remains the fallback everywhere: the terminal backend, builds without `pdf`, and any label Typst fails to compile (one warning per distinct label). Bundles New Computer Modern Math (~0.75 MB compressed) as the math font. Note: Typst math is not LaTeX (`mc` is one identifier — write `m c`). See *Reference → Math in Labels*.
- **Math in `TextPlot` bodies (typst tier)** — `$...$` inside a markdown body is spliced into the wrapped paragraph as a typeset fragment: kuva's own word-wrap treats each fragment as one unbreakable word (sized by its typeset width), surrounding words stay real selectable text in SVG/PDF, punctuation directly after math stays flush (`$x^2$.`), and a line holding a tall fragment (stacked fraction, radical) grows its leading so neighbouring lines never collide. Terminal output and builds without `pdf` lower body math to inline Unicode exactly as before.
- **`TypstBackend`** (feature `typst`, zero deps) — emit a CETZ-based Typst document for external compilation with `typst compile`; `$...$` regions become native Typst math, typeset with fonts matching the surrounding document. Full primitive coverage: `Path` (arrowheads, chord ribbons, sankey flows, venn outlines) lowers to CETZ `merge-path` calls with arcs converted to cubic Béziers, and clip regions map to Typst's `box(clip: true)` — so quiver/network arrowheads and plot-area clipping survive the round trip.
- **`CoveragePlot` coverage-threshold lines** — `with_coverage_threshold(depth)` / `with_coverage_threshold_labeled(depth, label)` draw a dashed horizontal line at a given depth on every coverage track (e.g. a minimum-coverage cutoff). CLI: `kuva coverage --min-coverage <depth>` (repeatable). Built on new `PlotTrack::with_hline` / `with_reference_line` support in the `TrackStack` primitive, so any `PlotTrack` can carry horizontal reference lines in its own y-scale.
- **`BrickPlot` marker lines** — `with_vline(x)` / `with_vline_labeled(x, label)` draw a dashed vertical line across all rows at a reference coordinate (locus, primer boundary, variant position), and `with_marker_line(ReferenceLine)` takes a fully-styled line. Drawn in the brick's own reference-coordinate system, so they respect `with_x_offset`/`with_x_origin`. (`ReferenceLine`/`Orientation` now derive `Debug`.)
- **Survival clinical figures.** `SurvivalPlot` gains three survminer-style options for publication-quality Kaplan-Meier figures: `.with_risk_table(true)` draws a number-at-risk table below the plot (one row per group, counts at each x-axis tick; space is reserved automatically via a new `Layout::risk_table_rows` / `ComputedLayout::risk_table_extra` bottom-margin mechanism); `.with_median_lines(true)` draws dashed median-survival reference lines; and `.with_logrank_pvalue(true)` computes the log-rank test p-value from the raw data (exact Mantel-Haenszel for two groups, `Σ (O−E)²/E` approximation for 3+) via a new chi-square survival function, annotating it and overriding any `with_pvalue_text`. CLI: `kuva survival --risk-table --median-lines --logrank`.
Expand Down
Loading
Loading