# CHANGELOG
## v0.3.0-beta
- 2026-08-01
- **Changed** — the plot tool was reworked from a doc cheat-sheet into a **questionnaire-driven plot generator**
- Pick one of eight plot types (line, scatter, bar, pie, histogram, box, heatmap, dual-axis), fill in the fields (title, data, colors, …), and preview the generated JSON/TOML live; `--no-preview` disables the live refresh.
- Validation flags missing required fields and malformed numbers inline; `c` copies to the clipboard, `s` saves to `plot-<type>.json`/`.toml`, and `r` restores the built-in example.
- **Changed** — TUI visuals reworked to the "biomorphic organic" paper palette: `Layer` / `density_char` / rounded-panel `Block` helpers, a solid-accent status band, and TrueColor → 256 → 16 → none colour adaptation via `supports-color`, so the paper background never garbles an older terminal.
- **Added** — the plot generator schema: `docs/PLOT-SCHEMA.json` plus a `-zh_CN` translation, the single source of truth for generator fields, targets, and examples. It is embedded at compile time, so the generator works fully offline.
- **Added** — programmatic visual regression tests (`tests/test_tui_visual.rs`, ratatui `TestBackend`) and dedicated `docs-schema-test` / `tui-visual-test` CI jobs.
- **Removed** — the machine-readable USAGE schema (`docs_parser`, the `<!-- usage-schema -->` / `<!-- plot:begin/end -->` markers, `docs/USAGE-SCHEMA.md`, the `--refresh` flag, and the GitHub `raw` endpoint override). All plot data now comes from the schema file, so nothing is parsed out of the manual and there is no second place to maintain.
- **Changed** — schema language selection (`MDBOOK_PLOTLY_LANG` → `[language] doc` → system locale) now picks the localized schema instead of the manual.
- **Fixed** — none (no behavior changes to the preprocessor itself).
## v0.3.0-alpha
- 2026-08-01
- **Added** — the full (TUI) edition as an optional `tui` Cargo feature
- Two binary variants are now shipped: **slim** (default, preprocessor only) and **full** (`-tui`, preprocessor + interactive TUI). Asset names follow `docs/RELEASE.md`; the self-update tool only ever matches assets of its own variant.
- New `mdbook-plotly tui` subcommand hosting a welcome view, a help overlay, and a tool list:
- **Self-update**: checks GitHub Releases for the latest tag, compares against the running version with semver, downloads the matching `-tui` asset, verifies its `.sha256`, and atomically replaces the running binary after explicit confirmation. Supports `--dry-run` and reads `GITHUB_TOKEN` for the API rate limit.
- **book.toml editor**: walks up from the working directory to find `book.toml`, guides edits of the `[preprocessor.plotly]` keys with per-field descriptions and valid ranges, uses `toml_edit` so comments/formatting are preserved, shows a diff before writing, and writes atomically via temp-file + rename.
- The slim edition recognizes the `tui` command and prints install/download instructions instead of an "unknown subcommand" error.
- **Added** — `docs/RELEASE.md` defining the release-asset naming scheme shared by CI and the updater.
- **Changed** — CI now builds and uploads both variants per target (with `cargo build --locked --release`), generates a `.sha256` per asset, and runs `clippy -D warnings` + `cargo test` for both feature combinations on every PR/push.
- **Changed** — code organization: the TUI sources were split into focused modules (logic vs. views vs. configuration), all unit tests now live under `tests/`, and the GitHub endpoint logic was extracted into a configurable module with `thiserror`-based error types.
- **Fixed** — none (no behavior changes to the preprocessor itself).
## v0.2.3
- Improved `book.toml` configuration parsing
- Ignored unknown keys at both the top level and inside nested sections such as `map-eval`, while logging a warning for each unknown key path
- Preserved type-sensitive validation for known fields, but limited failures to the field or nested section that failed to parse
- Kept other configuration fields active when one field falls back to its default value
## v0.2.2
- Improved mdBook preprocessing performance
- Skips Markdown parser/cmark rewriting for chapters that cannot contain `plot` / `plotly` blocks
- Injects the Plotly HTML header only when a chart is successfully generated
- Added complete Markdown chapter coverage for mixed prose, regular code fences, and plot fences
- Refined map parser internals
- Split map lookup, expression evaluation, and color parsing into focused modules while preserving existing public imports
- Implemented `reuse-slab` behavior for expression evaluation modes
- Reduced per-item allocation in `g-number-list` generation
## v0.2.2-beta
- Added TOML chart input support
- Added the [`toml`](Cargo.toml:23) dependency and a new [`PlotlyInputType::TOMLInput`](src/preprocessor/config.rs:82) variant
- Added [`handle_toml_input()`](src/code_handler.rs:35) to convert TOML into [`serde_json::Value`](src/code_handler.rs:8) before reusing the existing plot parser
- Added regression coverage in [`tests/test_code_handler.rs`](tests/test_code_handler.rs:55) for direct TOML handling and config-driven input dispatch
## v0.2.2-alpha
- Refined layout parser release-prep cleanup
- Normalized axis `type` error messages in [`parse_axis_obj()`](src/code_handler/plot_obj_parser/layout_parser.rs:256) to match the field-oriented style already used by [`translate_with_config!()`](src/macros.rs:36) and [`translate_enum_with_config!()`](src/macros.rs:66)
- Kept axis parsing on explicit [`ParseContext`](src/code_handler/parse_context.rs:4) / [`MapEvalConfig`](src/preprocessor/config.rs:61) propagation without reintroducing hidden defaults
- Added an axis regression test in [`tests/test_code_handler.rs`](tests/test_code_handler.rs) covering `map.*`-backed `range`, `tick_prefix`, `tick_suffix`, `title`, `anchor`, `overlaying`, `show_tick_labels`, `auto_margin`, `fixed_range`, and axis `type`
- Updated release documentation
- Clarified that parser migration work favors [`translate_with_config!()`](src/macros.rs:36) and [`translate_enum_with_config!()`](src/macros.rs:66) over legacy [`translate!()`](src/macros.rs:29) in active parsing paths
- Documented `map-eval` / `map-parser-extensions` behavior more explicitly in user-facing docs
- Adjusted configs
- Removed `offline_js_sources`
## v0.2.1
- Refined parser migration toward explicit [`MapEvalConfig`](src/preprocessor/config.rs:61) propagation
- Replaced top-level legacy [`translate!()`](src/macros.rs:29) usage in [`parse_config_obj()`](src/code_handler/plot_obj_parser/layout_parser.rs:8) and [`parse_layout_obj()`](src/code_handler/plot_obj_parser/layout_parser.rs:59) with explicit [`translate_with_config!()`](src/macros.rs:36) entrypoints
- Updated tests to validate the migration path remains stable
- Added a layout/config regression case in [`tests/test_code_handler.rs`](tests/test_code_handler.rs) covering `map.*`-backed title, legend, axis range, and config parsing
## v0.2.1-beta
- Refined parser migration toward explicit [`MapEvalConfig`](src/preprocessor/config.rs:61) propagation
- Migrated trace parsers to consume [`ParseContext`](src/code_handler/parse_context.rs:4) instead of raw `map` where applicable
- Removed [`must_translate()`](src/code_handler/until.rs:29) and migrated remaining translation paths to explicit [`ParseContext`](src/code_handler/parse_context.rs:4) / config-driven helpers
- Threaded active map-eval config through generator parsing paths in [`src/code_handler/until.rs`](src/code_handler/until.rs)
- Reused shared helpers like [`parse_marker()`](src/code_handler/plot_obj_parser/common.rs:7) and [`parse_color_bar()`](src/code_handler/plot_obj_parser/common.rs:59) to reduce duplicated translation logic
- Slimmed trace registry dispatch in [`trace_registry.rs`](src/code_handler/plot_obj_parser/trace_registry.rs:1)
- Removed registry-side `.map(into_trace)` adaptation
- Moved trait-object conversion boundaries down into parser modules via `*_trace()` entrypoints
- Updated tests to validate the migration path remains stable
## v0.2.1-alpha
- Refined plot parser structure
- Refined parser config propagation
- Updated deps
## v0.2.0
- Added **Layout field expansion** — Phase 1 & 2
- **Phase 1 (Basic fields)**:
- Spacing: `bar_gap`, `bar_group_gap`, `box_gap`, `box_group_gap`
- Interaction: `hover_mode`, `drag_mode`, `click_mode`
- Sub-objects: `font` (family/size/color), `coloraxis` (cmin/cmax/cmid/auto/reverse/show)
- **Phase 2 (Axis support)**:
- Default axes: `xaxis`, `yaxis` with full field support
- Named axes: `xaxis2`–`xaxis8`, `yaxis2`–`yaxis8`
- Axis fields: `title`, `show_grid`, `show_line`, `zero_line`, `visible`,
`anchor`, `overlaying`, `range`, `color`, `line_color`, `grid_color`,
`tick_prefix`, `tick_suffix`, `tick_format`, `hover_format`, `category_array`,
`fixed_range`, `scale_anchor`, `auto_margin`, `show_tick_labels`
- Axis enums: `category_order` (16 variants), `type` (linear/log/date/category/multicategory)
- Added helper functions: `parse_axis_obj()`, `parse_named_axes()`
- Added 3 axis tests (xaxis, date type, named axes)
- Updated documentation (USAGE-zh_CN.md, USAGE.md) with new Layout fields and Axis reference
## v0.2.0-beta
- Added 6 new Data trace types
- Added `box` (BoxPlot)
- Added `contour` (Contour)
- Added `heatmap` (HeatMap)
- Added `mesh3d` (Mesh3D)
- Added `scatter3d` (Scatter3D)
- Added `surface` (Surface)
- Updated docs for all new trace types (USAGE-zh_CN.md, USAGE.md)
- Added comprehensive tests for all existing and new trace types
- Re-exported all new trace types in `src/code_handler/plot_obj_parser.rs`
## v0.1.9
- Updated interfaces
- Added Marker in `bar`, `histogra`, `pie`, `scatter`, `scatter_geo`, `scatter_mapbox`, `scatter_polar`
- Updated tests and macros
## v0.1.9-beta
- Updated interfaces
- Updated layout
- Updated config
- Updated legend
- Updated the `Color`
- Fixed docs
## v0.1.9-alpha
- Updated Cargo.toml
- Adjusted deps
- Added `chrono`
- Adjusted features
- Add the `map-parser-extensions` feature
- Updated interfaces
- Updated the map parser
- Updated `time`, `g-random`, `g-choose`
- Fixed docs
## v0.1.8
> [!NOTE]
> Hotfix. Please don't use old versions.
- Fixed `BookData`
## v0.1.8-alpha
- Adjusted `code_handler`
- Updated `map`
- Fixed docs
- Updated tests
## v0.1.7
- Adjusted `code_handler`
- Updated `map`
- Fixed docs
- Updated tests
## v0.1.7-beta.2
- Adjusted `code_handler`
- Updated `map`
- Fixed docs
- Adjusted `Cargo.toml`
- Added the `fasteval` crate
## v0.1.7-beta
- Adjusted `code_handler`
- Adjusted `must_translate`
- Added `translate_enum`
- Made it all to support `DataPack`(Map)
- Updated docs
## v0.1.7-alpha
- Adjusted `Cargo.toml`
- The preview version would now provide the symbols.
## v0.1.6
- Adjusted `Cargo.toml`
- Adjusted `[profile.release]`
- Updated docs
## v0.1.6-beta
- Adjusted interfaces
- Adjusted Config
- Adjusted other Datas
- Added Color enum
- Updated docs
- Updated tests
## v0.1.6-alpha
- Adjusted interfaces
- Added Data-candlestick
- Added Data-sankey
- Added Data-scatter_polar
- Added Data-table
- Added Data-ohlc
- Updated docs
## v0.1.5-alpha
- Adjusted interfaces
- Added Data-density_mapbox
- Added Data-histogram
- Added Data-image
- Added Data-scatter_geo
- Added Data-scatter_mapbox
- Adjusted other Datas
- Updated docs
- Updated some tests
## v0.1.4-alpha
> [!WARNING]
> Although `plotly_svg_handler` is updated, it is not available.
- Updated `plotly_svg_handler`
- Adjusted interfaces
- Add Data-scatter
- Adjust Data-bar
## v0.1.3-beta
- Added interfaces
- Added `Data-bar`
- Used `usize` instead of `u64`
- Adjusted deps
- Added `anyhow`
- Added `env_logger` instead of `chlog`
- Used `anyhow` to optimize
## v0.1.3-alpha
- Added interfaces
- Added to `Config`
- `editable`
- `autosizable`
- `responsive`
- `scroll_zoom`
- `fill_frame`
- `frame_margins`
- `show_axis_drag_handlers`
- `show_axis_range_entry_boxes`
- `show_tips`
- `show_link`
- `send_data`
- Updated `docs/USAGE-zh_CN.md`
- Adjusted deps
- Added `rand`
- Adjusted features
- Added `dep:rand` to `plotly-backed`
## v0.1.2-alpha
- Optimized parsers performance in `code_handler`
- Fixed parser bugs
## v0.1.1-alpha
> [!WARNING]
> The changelog of `0.1.0-alpha` has been incorporated into this release.
- Added `plotly-html-handler`
- Added interfaces
- Added `pie` plot
- Updated docs
- Created workflows