ReadonlydataOptional ReadonlyisOptional ReadonlytimeOptional, for drawings anchored to the viewport (space: 'viewport'):
the time axis, which turns a data anchor's time into a place on the plot
and back when a drawing is pinned or unpinned.
OptionalpaneIndex: numberOptionalcoordinateOptionalcoordinateOptionalgetOptional: the host's data context, whose interval decides which
drawings with an interval range are shown (Drawing.intervals). Read
when the controller is built and on every data:context, whose payload
is the context itself; a host without it that emits data:context is
followed through the payload alone. With no interval every drawing shows.
The instrument is declared too, as the chart's context carries it, so one
host object also satisfies DrawingLinkChart.
OptionalindicatorsThe event bus, with the names and payloads of ChartEventMap. The
controller listens for click, crosshair:move, drag, drag:end,
drag:cancel, dblclick and hover ({ id }, the hit id under the pointer
whenever it changes), which is what drives the hover state: the chart has
already hit-tested the move, so the controller reads its answer rather than
testing a second time. A host that never emits hover has drawings that
select and drag but do not light up. It also follows data:context,
drawings:restore, pick:start, pick:end, paneRemoved, paneMoved,
objects:change and indicatorRemoved; a host that moves or removes panes
without paneRemoved and paneMoved leaves drawings on the old slots. It
emits the draw:* and drawing:* names this tier adds to ChartEventMap.
OptionalpanesOptional. It keeps a paste from a chart with more panes than this one
landing on a pane the user cannot see: adding a primitive creates the pane
it names, so without this a drawing copied out of an indicator pane would
conjure an empty pane in a single-pane chart. An entry with priceToY and
yToPrice, as a chart pane has, also lets an alert read a drawing on a
pane the chart maps no price for, one collapsed to its header strip.
OptionalplotOptional, for drawings anchored to the viewport: a pane's plot in
container px, as Chart.plotRect reports it, which is what a viewport
anchor is a fraction of. A host without it still paints them, since the
layer reads the plot size from its render context, but cannot place,
move or convert them.
OptionalpriceOptional, and used only to move a drawing by a fixed screen distance (a paste offset, an arrow-key nudge, a multi-drag across panes). Going through pixels rather than adding a price delta keeps the offset the same visible nudge on a log scale as on a linear one, and the same on an RSI pane as on the price pane. A host without them still gets the time half.
OptionalpaneIndex: numberOptionalprimaryOptional, all three, for the magnet: the price series' bars, the studies
and a series' style. The chart reports no bar while a drawing is in hand,
so a handle or a shape snaps against primaryBars; a study pane snaps
to the values of the studies plotted on it, skipping a hidden plot. A
host without them snaps placements on the price pane only.
OptionalprimaryOptionalseriesOptional, both: a pane's series band, back to front, and the call that
paints a layer directly above one of its entries. Without them no drawing
can be placed in the series band, and one saved there paints by its
zIndex.
OptionalseriesOptionalsetOptionalsetOptionaltime
The slice of the chart this controller needs.
Declared structurally rather than as
Charton purpose. Each tier ships its own bundled.d.ts, so naming the class here made the draw tier re-declareChart, and becauseCharthas private members, TypeScript treats the two declarations as different types. A TS consumer passing the chart fromcreateChart()got "separate declarations of a private property", which made the tier unusable from TypeScript at all. An interface with no private members is structural, so the realChartsatisfies it with nothing to cast.