G-code Preview — API Reference
    Preparing search index...

    @chestnutlabs/gcode-preview-element — the framework-free <gcode-preview> Web Component adapter (DD-009 D5), a thin shell over @chestnutlabs/gcode-preview-core. Registration is a function (defineGcodePreview) so the . entry stays side-effect-free; import @chestnutlabs/gcode-preview-element/define to auto-register.

    Hierarchy

    • HTMLElement
      • GcodePreviewElement
    Index
    • get cameraFov(): number | null

      DD-032: perspective lens in degrees, [10, 120] (default 50; STUDIO_CAMERA_FOV = 32). Reflects the camera-fov attribute; null removes it and keeps the current lens. Setting the property out of range throws RangeError (never clamped) and leaves the attribute unchanged. A markup/setAttribute value that is not a number in range is ignored: the element keeps the last valid lens. Reads return the effective lens: a valid attribute, else the last valid lens, else null (none set yet).

      Returns number | null

    • set cameraFov(v: number | null): void

      Parameters

      • v: number | null

      Returns void

    • get pixelRatio(): PixelRatioOption | null

      Resting pixel ratio of the canvas: a number in (0, 4], or 'device' (the display's devicePixelRatio capped at 2, followed live; the exact lowercase string). Reflects the pixel-ratio attribute; null removes it and keeps the current ratio. Setting the property to anything else throws RangeError (never clamped) and leaves the attribute unchanged. A markup/setAttribute value that is not valid is ignored: the element keeps the last valid ratio. Reads return the effective ratio: a valid attribute, else the last valid ratio, else null (none set: the renderer's own, 1). A ratio of 2 shades 4x the fragments of 1. The default capture() size does not change. 3D only.

      Returns PixelRatioOption | null

    • set pixelRatio(v: PixelRatioOption | null): void
    • get renderer(): string | null

      DD-014 D5 renderer selection (DD-031 E1): reflected property accessor over the renderer attribute. Construction-time like every adapter — read once at connect; changing it after the element is connected has no effect (mode switching post-mount is out of scope), it just keeps the attribute and property in sync so the value is readable/consistent.

      Returns string | null

    • set renderer(v: string | null): void

      Parameters

      • v: string | null

      Returns void