Changelog¶
This page mirrors the project changelog. The canonical source lives at docs/CHANGELOG.md in the repository.
Changelog¶
All notable changes to this project are documented here.
1.2.3 — 2026-05-21¶
Fixed¶
- Multi-line area fills now layer correctly when one series is bigger in some regions and smaller in others. The previous version sorted whole series by their global peak, so a series that had one tall spike would sit on top of (or under) every other series across the entire chart. Areas are now split into per-segment trapezoids and sorted by their local height, so layering can flip from segment to segment and a small bar in one region no longer "phases through" a taller neighbour.
- HTML page card charts no longer print a duplicated title in the SVG. Passing
title: ''to any renderer now suppresses the default title fallback (the cards already show the symbol/name in their own header). renderBarChartandrenderCandlestickChartinsets the first and last bar by half their width so they sit fully inside the plot rectangle instead of overflowing into the axis area.parseInterval/parseIntervalSpecnow reject zero-length intervals like"0d"or"0mo"(previously accepted, would have produced bars sharing the same timestamp).
1.2.2 — 2026-05-19¶
Added¶
- Multi-line chart
area: trueoption. Each series gets a translucent gradient fill from the line down to the chart bottom. Areas are painted from largest peak to smallest so smaller series stay visible on top of taller ones. - Sub-cent price support. Internal floor moved from
0.01to0.0001, and prices below$1keep 4 decimal places (below$0.01keeps 6). Customprices/ohlcarrays accept any positive number down to0.0001. - Axis labels auto-format with extra decimals when prices are small, so a chart of $0.0008 tokens shows readable values instead of rounding to zero.
1.2.1 — 2026-05-19¶
Changed¶
- Multi-line chart legend now sits in the top-left of the plot area instead of top-right
- Chart titles move to the top-right so they don't overlap the legend
- Default chart size is now 1000×500 (was 800×400)
- Default
xTicksis now 8 (was 5) so timelines have more date labels out of the box
1.2.0 — 2026-05-18¶
Added¶
renderMultiLineChart(stocks, options)— render multiple companies on a single chart with a built-in legend. Series are plotted against actual timestamps, so stocks with differentstartDatevalues land at the right horizontal position (a 2020 series sits on the left, a 2022 series on the right). Supportsmode: 'price'(raw prices) ormode: 'normalized'(rebased to 100, the default).kind: 'stock' | 'crypto'option ongenerateStock. Crypto uses log-distributed start prices (sub-$1 coins to $50k+), wider drift and much higher volatility. Defaults to'stock'.- Stock objects now carry a
kindfield, preserved throughtoJSON/fromJSON. - Per-stock
colorfield is honored by the multi-line renderer; otherwise a built-in palette assigns colors automatically. xTicksandyTickschart options to control the number of date / price labels (defaults to 5 each).fromJSONnow accepts arrays of stocks, so a market saved withtoJSON(market)round-trips back into an array you can pass straight torenderMultiLineChart.
Notes¶
- The chart
titleoption (already in the API) is the image title — completely separate from a stock'ssymbolandname. Pass any string and it appears at the top of the SVG:renderLineChart(stock, { title: 'Q1 Review' }).
1.1.2 — 2026-05-18¶
Fixed¶
- Edge axis labels no longer get cropped: the first X-axis label is left-anchored at the plot edge and the last is right-anchored, so long dates like
2023-12-31stay fully inside the chart - Slightly bigger default padding (
top: 28, right: 24, bottom: 44, left: 64) so longer price labels and date strings have breathing room
1.1.1 — 2026-05-18¶
Fixed¶
1moand1yintervals are now calendar-aware. Bars step to the same day of the next month/year instead of advancing by 30 or 365 fixed days, sostartDate: '1999-08-01'with1moproduces1999-08-01, 1999-09-01, 1999-10-01, …and1yproduces1999-08-01, 2000-08-01, 2001-08-01, …- Y-axis padding is clipped at zero so charts of low-priced series never show negative tick labels
- X-axis labels switch to full
YYYY-MM-DDwhen the chart spans more than one calendar year (instead of ambiguousMM/DD)
Added¶
parseIntervalSpecandstepTimehelpers insrc/interval.jsfor calendar-aware time stepping
1.1.0 — 2026-05-18¶
Added¶
pricesoption ongenerateStock— pass your own close prices, the package fills in open/high/low/volume around themohlcoption ongenerateStock— pass full OHLC bars verbatimtoJSON(stockOrMarket)— convenience wrapper aroundJSON.stringifyfromJSON(text|object)— parse and validate previously saved data, ready to render again- Validation for the new inputs: rejects negative prices, malformed bars, and the prices/ohlc conflict
- README rewritten with a glossary, a step-by-step tutorial, and a recipes section
Changed¶
examples/market-page.jsnow uses the defaultlinechart instead ofarearenderHtmlPagenow produces clickable cards: clicking one opens a detail view with a larger chart, key stats, and a recent-bars table; press Escape or click outside to close- Larger fonts and bigger card charts on the generated HTML page so labels are readable
- SVG axis and title fonts bumped from 11/13 px to 13/15 px
1.0.0 — 2026-05-18¶
Initial release. A modern rewrite of the old fake-stock-market-generator.
Added¶
generateStock(options)— single ticker with OHLCV barsgenerateMarket({ count, stocks, ...options })— whole markets, with optional per-company overrides- Geometric Brownian Motion price model (prices stay positive, configurable drift and volatility)
- User-driven metadata:
symboldefaults to a random ticker,nameandsectorare yours to set - Configurable:
symbol,name,sector,startPrice,drift,volatility,bars,interval,startDate,seed - Interval shorthands:
"1m","1h","1d","1w","1mo","1y", plus raw milliseconds - Seeded PRNG (Mulberry32 + Box-Muller) for reproducible output
renderLineChart,renderAreaChart,renderBarChart,renderCandlestickChart— SVG renderersrenderChart(stock, type, options)— single entry pointrenderHtmlPage(marketOrStock, options)— self-contained HTML page builder- Light and dark themes, with per-color overrides
- Dual ESM + CJS publish, zero runtime dependencies
- Node 14+ support
- Input validation: rejects negative
startPrice, non-stringname/sector/symbol, negativevolatility, non-finitedrift, invalidstartDate, and non-positivebars