Skip to content

Type Alias: ModebarIcon ​

ts
type ModebarIcon =
  | {
      paths: readonly string[];
      viewBox?: string;
    }
  | {
      height?: number;
      path: string;
      transform?: string;
      width?: number;
    }
  | {
      svg: string;
    };

An icon for a modebar button, in one of three forms:

  • { paths, viewBox? } — filled SVG paths (the built-in form, viewBox default 0 0 24 24);
  • { path, width?, height?, transform? } — Plotly's custom-icon form (viewBox 0 0 width height, default 1000 × 1000, optional transform on the path);
  • { svg } — a complete SVG string. It is inserted as markup, so it must be trusted (developer-provided config, like the button's click function itself).

Released under the MIT License.