# Changelog

All notable changes to this project will be documented in this file.

## [0.5.0] - 2026-05-19

### Fixed

- **Widen `:decimal` version constraint** — `{:decimal, "~> 2.0 or ~> 3.0", optional: true}`. The previous `~> 2.0` constraint silently downgraded Decimal 3.x to 2.x in apps that pulled in gnuplot_ex alongside Ecto 3.13+, Postgrex 0.22+, or Phoenix LiveView 1.1+ (all on Decimal 3.x). Mirrors the dual constraint used by ecto/postgrex/jason

## [0.4.0] - 2026-04-19

### Added

- **Candlestick (OHLC) series** — first-class `GnuplotEx.candlestick/1,2,3` builder for financial charts. Supports bull/bear body coloring via `:up_color`/`:down_color` (conditional `lc rgb variable`) and optional wick caps via `:whiskerbars`
- **MultiPlot composition** — new `%GnuplotEx.MultiPlot{}` struct plus `GnuplotEx.multiplot/0,1`, `add_panel/2`, `layout/2`, `shared_x/2` builders for multi-panel layouts (e.g. price + volume + indicator stacks). Shared x-axis mode aligns time-series panels
- **MultiPlot figure-level styling** — `:background` (canvas color appended to `set terminal`) and `:commands` (figure-level raw gnuplot commands emitted before `set multiplot`) for consistent styling across panels
- **MultiPlot `:row_heights`** — unequal vertical panel heights (e.g. `[0.6, 0.2, 0.2]` for price-dominant financial stacks). Emits bare `set multiplot` with per-panel `set size`/`set origin` instead of forced-equal `set multiplot layout R,C`
- **LiveView accepts MultiPlot** — `<.live_gnuplot plot={@multiplot} />` renders composed layouts through the existing component, cache, and async paths

### Fixed

- **`Series.using` honored for all data sources** — previously dropped for inline `"-"` and datablock `$name` sources, breaking time-axis line/impulses/steps plots that gnuplot requires to declare their using clause
- **Multiplot inline-streaming** — gnuplot 6 refuses `plot '-'` inside `set multiplot`. Panel series data is now hoisted into named datablocks (`$mp_pN_sM << EOD … EOD`) before emission
- **Float-tuple ranges** — `{94.5, 105.5}` now renders as `[94.5:105.5]` instead of `94.5,105.5` (invalid gnuplot syntax). Elixir `Range` doesn't support floats, so float tuples are emitted as gnuplot range literals directly
- **Duplicate SVG ids in LiveView** — multiple `<.live_gnuplot>` components on one page no longer collide on gnuplot's hardcoded ids (`gnuplot_canvas`, `gpPt0`–`gpPt14`, `textbox`, `greybox`, etc.). The component rewrites every `id=`/`xlink:href=#`/`href=#`/`url(#…)` to a per-component prefix, handling both single- and double-quoted forms

### Internal

- Real-gnuplot smoke tests (`@tag :gnuplot`) added for multiplot, candlestick, and the using/range fixes so future regressions fail on render rather than slipping past dry-mode checks

## [0.2.4] - 2024-12-30

### Fixed

- **render/2 now returns actual SVG/PNG output** - Previously returned the gnuplot script string instead of rendered output, breaking LiveView components
- **datablock/3 works with command/2 plots** - Named datablocks are now defined before custom commands, allowing references like `$stats` in custom plot commands
- **Pie/donut charts render correctly** - Fixed inner_radius calculation so pie charts display as full circles, not donuts

### Added

- **Pie/donut slice labels** - Labels are now rendered at the center of each slice using `set label` commands

## [0.2.3] - 2024-12-29

### Added

- Initial public release
- High-level API for common chart types (scatter, line, bar, histogram, pie, donut, spider, parallel coordinates)
- Low-level API for full gnuplot control
- LiveView components for real-time charts
- Explorer DataFrame integration
- Nx tensor support
- ML visualizations (confusion matrix, ROC curves, loss curves, embeddings)
- SVG, PNG, and ASCII output formats
- Async/parallel rendering
- Binary data optimization for large datasets
