weasel API - v0.8.0
    Preparing search index...

    Interface SceneSlotConfig<TNode, TPose>

    Scene slot config — describes how to draw one object with its effective pose.

    interface SceneSlotConfig<TNode extends { id: string }, TPose> {
        alphaFor?: (id: string) => number;
        drawOne: (obj: TNode, pose: TPose, view: View) => DrawCommand[];
        ghostAlpha?: number;
        objects?: TNode[];
        postProcess?: (
            cmds: DrawCommand[],
            view: View,
            dims: Dims,
        ) => DrawCommand[];
        toPose?: (obj: TNode) => TPose;
    }

    Type Parameters

    • TNode extends { id: string }
    • TPose
    Index

    Properties

    alphaFor?: (id: string) => number

    Optional per-id alpha multiplier. When supplied, each node's emitted DrawCommand[] is wrapped in a { kind: 'group', alpha } when the returned value is not 1. The scoping-dim integration supplies this to dim non-active nodes during a mode transition.

    Defaults to () => 1 (no effect).

    drawOne: (obj: TNode, pose: TPose, view: View) => DrawCommand[]

    Draw a single object as a DrawCommand tree.

    ghostAlpha?: number

    Default ghost alpha for the move-overlay slot. Default 0.85.

    objects?: TNode[]

    Override adapter.getNodes() for the object iteration.

    postProcess?: (cmds: DrawCommand[], view: View, dims: Dims) => DrawCommand[]

    Optional post-processor for the scene slot's emitted commands. Called with the final world-space DrawCommand[] each time a scene canvas layer draws (after per-node rotation wrapping and alphaFor); the return value replaces the array handed to the renderer. When the scene slot is split into per-scene-layer canvas layers (scene:<layerId>), it runs once per layer. Identity by default.

    Commands are world-space — drawLayers applies the view transform afterward, so e.g. a clip path in a wrapping group is authored in world coordinates. Note clip nesting is capped at 7 levels; a wrapping group with clip consumes one.

    The move-overlay ghost (drag preview) is not post-processed.

    toPose?: (obj: TNode) => TPose

    Project an object to its committed pose. Defaults to adapter.getPose(obj.id).