PiDraw API
    Preparing search index...

    Interface IGraphController

    A module that acts on a graph from outside (the animation, a zoom, the slides): the program makes it with the graph (new Animate(graph)) and the module attaches itself with graph.attach. The graph never imports a controller: it only calls this contract.

    interface IGraphController {
        dispose(): void;
        onControlsChanged?(key: "titles"): void;
        onFigureChanged?(name: string): void;
        onFiguresRemoved?(names: string[]): void;
        onLayoutChanged?(config: IGraphConfig): void;
    }

    Implemented by

    Index
    • Called when the graph is taken out of the page (dispose): stop what the controller does, and let go of the listeners and the timers.

      Returns void

    • Called when a theme gave the graph a value, or took it away (Graph.setControl, which Draw calls after reading the code): the name of the entry. A controller reads what it needs in graph.controls.

      Parameters

      • key: "titles"

      Returns void

    • Called when a figure tells the graph that something a controller may care about changed in it (the steps of a presentation, slide): its name. A controller reads what it needs from the figure, graph.figures[name].

      Parameters

      • name: string

      Returns void

    • Called after figures were removed from the graph (remove, with the ones that depended on it, or clear, which dispose calls too), with their names: forget the ones that were read. Not called when no figure was removed.

      Parameters

      • names: string[]

      Returns void

    • Called after the layout of the graph was drawn again (updateLayout, whoever asked for it) with the configuration that is now the one of the graph: the size, the origin and the vector of a unit of each axis. A controller that keeps what it read from the layout reads it again.

      Parameters

      Returns void