g3-toolkit API Reference
    Preparing search index...

    Function FloatingLegend

    • Parameters

      • __namedParameters: {
            collapsible?: boolean;
            corner?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
            defaultCollapsed?: boolean;
            elements?: readonly LegendElement[];
            labelFor?: (value: string, channel: LegendChannel) => string;
            onResetOverrides?: () => void;
            overrides?: readonly { scope: { nodeId: string } | { type: string } }[];
            sectionTitle?: (channel: LegendChannel, driver: string) => string;
            spec: EncodingSpec;
            testId?: string;
            title?: string;
            ugm?: UGM;
        }
        • Optionalcollapsible?: boolean

          Forwarded to SpecLegend. Default true, which is what this component hard-coded before 2026-08-27.

        • Optionalcorner?: "top-left" | "top-right" | "bottom-left" | "bottom-right"
        • OptionaldefaultCollapsed?: boolean

          Forwarded to SpecLegend. A floating legend sits OVER the canvas at up to 240px wide, so a dense scene often wants it to arrive collapsed and open on demand. Previously unreachable: the prop was dropped here, and the only workaround was to abandon FloatingLegend and position a SpecLegend by hand.

        • Optionalelements?: readonly LegendElement[]
        • OptionallabelFor?: (value: string, channel: LegendChannel) => string

          Forwarded to SpecLegend (issue #38): the channel argument lets one function label node types and relation types differently.

        • OptionalonResetOverrides?: () => void
        • Optionaloverrides?: readonly { scope: { nodeId: string } | { type: string } }[]

          R-13: forwarded to the legend for override disclosure.

        • OptionalsectionTitle?: (channel: LegendChannel, driver: string) => string

          Forwarded to SpecLegend (issue #38): heading wording per section, for legends whose audience should read "Relation", not edge color: relation.

        • spec: EncodingSpec
        • OptionaltestId?: string
        • Optionaltitle?: string
        • Optionalugm?: UGM

          R-17 (register, 2026-08-06): optional, matching SpecLegend. A floating legend over a structural scene passes elements instead; the two components stay in step.

      Returns Element