The options your application has to accept so it can interact with the CanvasSandbox.

interface CanvasSandboxExpectedOptions {
    darkMode: boolean;
    seed: number;
    viewport: { h: number; w: number; x: number; y: number };
}

Properties

darkMode: boolean

Should your application run in dark mode? You can ignore this setting and produce any colored output you want, but the setting will be toggeled by the sandbox according to the user's browser/OS preference.

seed: number

The seed for the PRNG.

viewport: { h: number; w: number; x: number; y: number }

The part of the canvas that the targetted render kernel will handle. This is ignored, unless you use multi-process rendering.

Type declaration

  • h: number

    Height of the viewport in fractional world-space.

  • w: number

    Width of the viewport in fractional world-space.

  • x: number

    Start of the viewport in fractional world-space.

  • y: number

    Start of the viewport in fractional world-space.