interface UpdateMenu {
    active?: number;
    bgcolor?: Color;
    bordercolor?: Color;
    borderwidth: number;
    buttons: Partial<UpdateMenuButton>[];
    direction:
        | "left"
        | "right"
        | "up"
        | "down";
    font: Partial<Font>;
    name: string;
    pad: Partial<Padding>;
    showactive: boolean;
    templateitemname: string;
    type: "buttons" | "dropdown";
    visible: boolean;
    x: number;
    xanchor:
        | "auto"
        | "left"
        | "center"
        | "right";
    y: number;
    yanchor:
        | "auto"
        | "top"
        | "middle"
        | "bottom";
}

Properties

active?: number

Determines which button (by index starting from 0) is considered active.

bgcolor?: Color

Sets the background color of the update menu buttons.

bordercolor?: Color

Sets the color of the border enclosing the update menu.

borderwidth: number

Sets the width (in px) of the border enclosing the update menu.

array of object where each object has one or more of the keys listed below.

direction:
    | "left"
    | "right"
    | "up"
    | "down"

Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For left and up, the buttons will still appear in left-to-right or top-to-bottom order respectively.

font: Partial<Font>

Sets the font of the update menu button text.

name: string

When used in a template, named items are created in the output figure in addition to any items the figure already has in this array. You can modify these items in the output figure by making your own item with templateitemname matching this name alongside your modifications (including visible: false or enabled: false to hide it). Has no effect outside of a template.

Sets the padding around the buttons or dropdown menu.

showactive: boolean

Highlights active dropdown item or active button if true.

templateitemname: string

Used to refer to a named item in this array in the template. Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with templateitemname matching its name, alongside your modifications (including visible: false or enabled: false to hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it with visible: true.

type: "buttons" | "dropdown"

Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically

visible: boolean

Determines whether or not the update menu is visible.

x: number

Sets the x position (in normalized coordinates) of the update menu.

xanchor:
    | "auto"
    | "left"
    | "center"
    | "right"

Sets the update menu's horizontal position anchor. This anchor binds the x position to the "left", "center" or "right" of the range selector.

y: number

Sets the y position (in normalized coordinates) of the update menu.

yanchor:
    | "auto"
    | "top"
    | "middle"
    | "bottom"

Sets the update menu's vertical position anchor This anchor binds the y position to the "top", "middle" or "bottom" of the range selector.