What the controller needs from the chart (the Chart implements this).

interface TradingHost {
    addPrimitive(p: IPrimitive): void;
    emit(event: string, payload: unknown): void;
    removePrimitive(p: IPrimitive): void;
    subscribeClick(cb: (externalId: string) => void): void;
    subscribeDrag(
        onDrag: (externalId: string, price: number) => void,
        onDragEnd?: (externalId: string, price: number) => void,
    ): void;
}

Methods

  • Optional: route trading events onto the chart's unified chart.on(...) bus.

    Parameters

    • event: string
    • payload: unknown

    Returns void

  • Parameters

    • onDrag: (externalId: string, price: number) => void
    • OptionalonDragEnd: (externalId: string, price: number) => void

    Returns void