G-code Preview — API Reference
    Preparing search index...
    interface PreviewController {
        controls: GcodePreviewControls;
        raw: {
            renderer: () => null | ToolpathRenderer;
            session: GcodeParseSession;
        };
        bindCanvas(canvas: null | HTMLCanvasElement): void;
        cancel(): void;
        clearProgress(): void;
        dispose(): void;
        getState(): GcodePreviewState;
        observeProgress(obs: ProgressObservation): null | MappedProgress;
        onEvent(cb: (e: PreviewEvent) => void): () => void;
        onStateChange(cb: (state: GcodePreviewState) => void): () => void;
        parse(
            input: ArrayBuffer | Uint8Array<ArrayBufferLike> | File,
            opts?: WireParseOptions,
        ): Promise<ParseOutcome>;
        tickProgress(nowMs: number): null | MappedProgress;
    }
    Index

    Properties

    raw: { renderer: () => null | ToolpathRenderer; session: GcodeParseSession }

    Escape hatches — the neutral objects themselves (advanced use).

    Methods

    • Bind/rebind the renderer to a canvas (null unbinds). Rebinding disposes safely.

      Parameters

      • canvas: null | HTMLCanvasElement

      Returns void