Chartsv26.10.18
Pro edition

Drawing dashboard

The Pro drawing surfaces over the live streaming chart - the tool rail with search and favorites, the floating figure style panel with fifteen fill patterns, style templates and the figure context menu.

The Pro edition ships a full drawing dashboard over the same engine: a palette rail on the left, a floating style panel next to the selected figure and a context menu on right click. Everything is driven through the public drawing API, so the host stays the owner of the store and the journal while the dashboard stays a set of controlled components.

How charting works

Charting on the desk is three steps, and the live demo below marks the step you are on:

  1. Pick a tool on the rail - search it with / or open a family; the rail remembers favorites and the five most recent tools.
  2. Drag on the chart - one tool places one figure; the desk returns to the selection mode right after the figure lands, so a stray click never starts a second shape.
  3. Style the zone - click any figure to open its look: line, fill with a pattern, text; the strip below the chart repeats the fill patterns, Escape closes the panel.
  1. 1 Pick a tool on the rail
  2. 2 Drag on the chart to place the figure
  3. 3 Click the figure to style it
Step 1: pick a tool on the rail; the desk then waits for a drag.Live · 14400 bars · 3 figures

The desk above is that flow live on the real library chart: the same streaming scene as the desk pages carries the crosshair, the tooltip and pan and zoom while no tool is armed, and the step strip highlights what to do next. Dragging paints the zone with the picked tool and clicking a zone opens its style panel - the panel never opens by itself, so the chart stays readable right after a figure lands. Change the pattern in the panel or on the strip and press "To all of type" to spread the look to the other zones. Every figure is anchored to bar and price points, so it stays glued to its bars through the stream and a pan. The rail tray and the search popover close on a pick and on any click outside the rail. The rail keeps its state as plain JSON, so a workspace snapshot restores the active tool, the favorites and the five most recent tools without any host code.

The tool rail

DrawingToolbar renders all 95 catalogue tools grouped by seven families with two-level subgroups. The rail carries:

  • search on / across the tool title, the tool id and the catalogue code;
  • favorites and the five most recent tools, kept in the serialisable DrawingPaletteState of the core;
  • the lock and the "hide markup" toggle - hiding never deletes anything, the drawings stay in the store and the host only skips their painting;
  • unique hotkeys for every tool that never collide with the platform keymap or the navigation keys;
  • full keyboard access: every control is a button with an accessible name, Escape leaves the tool mode.

The rail renders nothing in mini and readOnly surfaces, so the same bundle serves widgets and terminals.

The figure style panel

DrawingStylePanel is the floating dashboard of the selected figure: line colour, style and width, fill colour and opacity, the pattern grid, then the text group. Three actions sit below the fields: "To all of type" applies the current look to every figure of the same tool in one journal step, "Template" saves the look as a style template, and delete follows the host policy.

Fill patterns

The core registry FILL_PATTERNS carries fifteen samples; the four canonical ones are always present: empty (a transparent fill), a 45 degree hatch, dots and a grid.

  • every sample is painted by pure functions over the canvas contract - no createPattern, no offscreen canvas, no DOM;
  • the geometry is memoised by pattern and integer bounds, so one frame builds one tile set per pattern and colour;
  • a context without clipping support (or without arc for the dots) degrades to the flat alpha fill instead of failing;
  • the field DrawingStyle.fillPattern is additive: an unknown id falls back to solid, and older snapshots load without migration.

The panel previews every sample as a small SVG built from the same tile geometry, so previews need no chart and render on the server.

Style templates

A style template is the saved look of one figure - line, fill with its pattern, and text. Save the current look from the panel and the next figure of the same type starts with it. Templates live in the core DrawingStyleLibrary, persist through the host storage as a versioned JSON envelope, and a starter set of four canonical looks (trend, zone, Fibonacci, position) loads idempotently.

The figure context menu

Right click opens DrawingContextMenu: show or hide, lock, raise or lower, clone, save as template, switch the pattern, delete. The menu opens offset from the click so it never covers the figure anchors, stays inside the canvas bounds, and follows the host deletion policy - the Pro desk asks its own confirmation dialog before the journal call.

Hosting notes

  • The rail, the panel and the menu are controlled components: they emit the next state or a style patch and never mutate the store themselves.
  • Hiding markup and locking are flags: the drawings stay intact, and the host decides how they paint.
  • The fill painter is a core helper: a host that renders the drawing layer through buildLayerOps passes the rect, ellipse, polygon and fill operations to paintFillPattern with the colours of the active theme.
  • No eval, no network calls: patterns, templates and the palette are plain data.

On this page