Vela, our next-generation charting platform, is live at vela.luxalgo.com.
LuxAlgo

Overview

Reference for all state persisted by Vela Pro, default browser storage keys, and options for moving storage to a server.

View as Markdown

User state in Vela Pro falls into two categories: a single workspace state document per workspace, and independent stores for data that is not scoped to a single layout. By default, independent stores write to localStorage, and the workspace state document writes to localStorage once persist is enabled. You can replace each store with a custom adapter or port to persist state per user on your backend.

State inventory

Workspace state document

These entries are scoped to a layout. Configuring persist and storage on VelaWorkspace saves and restores all of them together.

StateDocument field
Grid layout, splitter sizes, active chart, sync links, and time zonelayout, trackSizes, activeCellId, sync, timezone
Per-chart symbol, timeframe, chart type, session, bar depth, status line, watermark, and legend togglescharts[i]
Chart settings (colors, scales, grid, margins) and chart-type settings (Footprint, TPO)charts[i].rendererConfig
Drawings on each chart for its active symbolcharts[i].drawings
Built-in indicators and manifest scripts, including modified inputs and visibility statecharts[i].indicators
Scripts added from the indicator menu, including their source codecharts[i].ext['velapro.indicators']
Favorite drawing toolsfavorites
Favorite timeframestimeframeFavorites
Drawing tool defaults, saved styles, magnet mode, and stay-in-drawing-modedrawingTools
Side panels (active panel, resized widths, and pinned panels)panels
Bottom dock open state, active panel, and heightext['velapro.bottomDock']
Order book settings (DOM columns, depth mode, combined book)ext['velapro.orderbook']
Trading settings (modified display settings, safety settings, presets, order size)ext['velapro.trading']
Calendar settings (active tab and impact filter)ext['velapro.calendar']

Independent stores

StateDefault localStorage keyScopeConfiguration option or port
Per-symbol drawings across every symbol opened on a chartvela-pro.drawings:<chart>:<symbol>, one entry per chart and symbolChart key and symbolsymbolDrawings: { storage }
Indicator templatesvelapro.indicatorTemplatesUserindicatorTemplates: { storage }
Favorite indicators and scripts starred in the code editorvela-pro-indicator-favoritesUserindicatorLibrary: { favorites }
Code editor draftvela-pro-editorUsercodeEditor: { storage, persist }
Watchlists, plus column, sparkline, and detail-panel togglesvelapro.watchlistsUserwatchlist: { storage } (WatchlistStorage port)
Alerts and alert firing logvela-pro.alertsUseralerts: { backend } (AlertsBackend port)
Journal accounts, fills, annotations, and notesvela-pro.journalUserjournal({ store }) (JournalStore port)
Paper trading accountsvela-pro.paper, vela-pro.paper:accounts, and vela-pro.paper:<account> per added accountBrowsertrading({ paper: { persist } }) renames the key or keeps accounts in memory. Live accounts reside at your broker (Broker port)
Replay bar position and docked or floating statevela-pro.replay.bar-position, vela-pro.replay.dockedBrowserBrowser-only (not configurable)
Indicator menu view mode (cards or list)velapro.indicators.layoutBrowserBrowser-only (not configurable)

User-scoped stores are isolated per signed-in user only after you connect them to your backend. With the default localStorage adapters, everyone using the same browser profile shares the stored data.

Workspace state document

workspace.getState() returns the workspace state document, and workspace.applyState() restores it as a single JSON object covering the layout and every chart in the workspace. When persist is enabled, the workspace writes the document through a storage adapter (defaulting to localStorage under the vela-workspace key) and restores it during construction.

Vela Pro features and modules with layout-level preferences store their settings inside the document's ext maps (one at the document root and one per chart). Enabling persist: true therefore preserves settings such as order book columns and trading presets automatically. See Layouts and chart state for the document schema and Plugin state to register custom state handlers.

Independent stores

State that spans multiple layouts is stored outside the workspace state document:

  • Per-symbol drawings persist across symbol changes. While the state document holds one drawing set per chart for its active symbol, the per-symbol store keeps a separate set for every symbol opened on that chart and restores it when the user switches back. See Drawing persistence.
  • Indicator templates and favorites apply across layouts so a template saved in one layout is available in every other layout.
  • Module data represents user records rather than layout preferences. Watchlists, alerts, and journal entries remain consistent regardless of which layout is active and can render inside standalone widgets on pages without a workspace.

Each independent store accepts a small storage adapter for built-in features or a typed port interface for domain modules, defaulting to localStorage.

Transient state

Transient stateBehavior on reload
Visible range (scroll position and zoom)Never persisted. The visibleRange option frames the initial load of a newly created chart only.
Historical barsThe state document records each chart's symbol, provider, and timeframe, while OHLCV bars are fetched from your data provider on every load.
Theme and localeNot stored in the state document. Each chart's rendererConfig preserves plot colors, while the surrounding interface follows the theme and locale options passed at construction. Persist the user's preference in your application and pass it when creating the workspace.
Maximized chart or panelResets to the full multi-chart layout after reload.
Drawing groups in the object treeKept in memory for the lifetime of the chart instance.
Scripts executed from the code editorThe editor text is saved as a draft, but indicators added directly by running code in the editor are excluded from the state document. See Indicator persistence for details.

Moving storage to a backend

Configure a workspace storage adapter

Pass persist and a storage object implementing get and set to new VelaWorkspace(...). This routes the workspace state document and all layout-level ext settings to your backend.

Configure feature stores and module ports

Pass custom storage adapters and module ports to enableVelaPro() for symbolDrawings, indicatorTemplates, indicatorLibrary, codeEditor, and the watchlist, alerts, and journal modules.

See Server-side storage for a complete implementation covering both steps.

On this page