Drawing Tools Remember Their Settings in Vela 0.8.4

Vela 0.8.4 is a drawing release. Each tool now starts its next drawing from the last one you styled, and those settings are saved with the workspace or widget so they survive a reload. Every drawing gets a full settings panel, named styles and a timeframe filter. Trend lines can extend, the Fib retracement gains level sets, and three price action tools are new. Two fixes matter if you feed your own bars or render per-bar candle colors from an indicator. If you embed Vela and let users draw, this release is for you.
Tool settings that persist
A tool's colors, widths, text styling and its own settings, such as a Fib's levels or a position's account size, carry over to its next drawing. Styling several drawings at once counts too. A workspace or widget saves these settings in its state document, along with the magnet and stay-in-drawing-mode, and shares them across every chart in the grid.
If you manage state yourself, read and restore the set through chart.drawings, follow changes on the drawing:defaults event, and send a tool back to its factory look with resetToolDefaults().
// Read the current per-tool settings
const defaults = chart.drawings.toolDefaults();
// Restore them later, for example after loading your own saved state
chart.drawings.setToolDefaults(defaults);
// Changes are announced on the 'drawing:defaults' event
// Return a tool to its factory look
chart.drawings.resetToolDefaults();One settings panel, named styles and timeframe visibility
The gear on a drawing's toolbar, or a double-click on the drawing, opens one panel with all of the tool's settings: its look, its own options, its label, the price and time of each point, and the timeframes it shows on. Options appear only when they apply, sections fold to a one-line summary, and Cancel puts the drawing back as it was. The chart stays usable behind the panel. The toolbar's separate Levels, Position size and Settings buttons are now a single Settings button that opens this panel for every tool.
A drawing's look can be saved as a named style and applied to any drawing of that tool in one click, with a live preview on hover. Line and area tools come with ready-made styles. Styles are kept with the other tool settings and have their own read and restore pair.
Drawings can also be limited to chosen timeframes: intraday only, 1H and up, or any set of timeframes. Other charts hide the drawing. The limit is saved with the drawing as showOn.
// Named styles travel with the tool settings
const templates = chart.drawings.toolTemplates();
chart.drawings.setToolTemplates(templates);
// A drawing's timeframe limit is stored on the drawing as showOnTrend lines, Fib level sets and price action tools
A trend line can now run past either point to the edge of the chart, and its label can sit at the start, middle or end of the line, above or below it.
The Fib retracement offers Classic, Extension and OTE level sets. Classic shows the standard pullback ratios. Extension measures from the swing's start and projects targets past its end. OTE marks the 0.62–0.79 entry zone with equilibrium at 0.5 and targets beyond the swing. Every set keeps the whole ladder of levels, with the unused ones switched off. Retracement and extension levels can run on to the chart's edge, show their ratio, their price, both or neither, on the left or the right, and drop the tinted background between them.
Fibs, Gann tools and Mach figures now list every level in a two-column grid of on/off, ratio and color. A new retracement or extension carries a longer ladder of levels, with the familiar ones on. Level labels set before still show, but are no longer edited in the panel.
A new Price Action section in the Fibonacci flyout holds three tools, each placed with one click on a candle: Fair Value Gap, Order Block and Liquidity. Each finds its zone or level on the candles and runs right until the event you choose (tested, half-filled, filled, broken or swept), then marks it. A filled gap can flip once price closes through it, and a broken order block can carry on as a breaker.
Smaller changes: drawing labels carry a thin outline in the chart's background color, so a line running through them no longer hides the words. Arrow Mark Up text now sits centered below the arrow and Arrow Mark Down text centered above it. The trend angle's degree readout sits on the side of the baseline the line leaves empty, with a halo over candles.
Fixes: indicator candle colors and your own data
Per-bar colors set by a plotcandle() or plotbar() series were applied only when the indicator was added. Later recalculations, such as each live tick, replaced the candles but kept the old colors, so color changes never showed, colors could land on the wrong candles, and new candles kept the default up/down colors. Every recalculation now repaints the candles with the colors it sets, and one that sets none clears the old ones.
A chart given its bars through data with live: true used to nudge the last candle by up to 0.15% every second and append made-up candles. Bars passed as data are now shown exactly as given.
// data + live: true no longer alters or appends candles.
// Bars passed as data render exactly as given.
// To stream real updates onto your own bars,
// register a data provider that implements subscribe.Get it
npm i @luxalgo/velaDocs: velacharts.dev. Full release notes: CHANGELOG for 0.8.4. Source: github.com/LuxAlgo/Vela.
Read next