Skip to content

Type Alias: BaseLayout ​

ts
type BaseLayout = object;

Figure layout.

Indexable ​

ts
[key: `xaxis${number}`]: unknown

Further xaxis containers (xaxis10, …): the same attributes as xaxis, not type-checked.

ts
[key: `yaxis${number}`]: unknown

Further yaxis containers (yaxis10, …): the same attributes as yaxis, not type-checked.

Properties ​

autosize? ​

ts
optional autosize?: boolean;

Size the figure to its container on first render (and on resize with config.responsive).

Default Value ​

false


colorway? ​

ts
optional colorway?: readonly string[] | string;

Default trace colors, cycled by trace index. A registered colorway's name works too, e.g. 'Safe' (colorblind-safe, always available; Holochart only).

Default Value ​

["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]


datarevision? ​

ts
optional datarevision?: unknown;

Change this to force data arrays to be re-read when they are mutated in place.


dragmode? ​

ts
optional dragmode?:
  | "zoom"
  | "pan"
  | "select"
  | "lasso"
  | "drawclosedpath"
  | "drawopenpath"
  | "drawline"
  | "drawrect"
  | "drawcircle"
  | "orbit"
  | "turntable"
  | false;

What dragging on the plot area does: zoom, pan, box or lasso select, or draw a new shape (draw*, styled by newshape).

Default Value ​

"zoom"


font? ​

ts
optional font?: LayoutFont;

Global font. Every text element inherits unset font fields from here.


grid? ​

ts
optional grid?: LayoutGrid;

A grid of subplots (Plotly layout.grid). Cartesian axes placed in the grid get their domain, anchor, side and position defaults from their cell; domain traces (pie, …) are placed with domain.row / domain.column. Values given on an axis or a trace always win.


height? ​

ts
optional height?: number;

Figure height in CSS pixels. Ignored when autosize fills the container.

Minimum: 10

Default Value ​

450


hovermode? ​

ts
optional hovermode?: "x" | "y" | "closest" | false | "x unified" | "y unified";

How hover picks points: nearest point, all points at the same x/y, or unified labels.

Default Value ​

"closest"


margin? ​

ts
optional margin?: LayoutMargin;

Space around the plot area.


meta? ​

ts
optional meta?: unknown;

Arbitrary user data, available in text templates as %{meta}.


paper_bgcolor? ​

ts
optional paper_bgcolor?: string;

Background color of the whole figure.

Default Value ​

"#fff"


plot_bgcolor? ​

ts
optional plot_bgcolor?: string;

Background color of the plot area between the axes.

Default Value ​

"#fff"


selections? ​

ts
optional selections?: readonly LayoutSelection[];

Selections as layout objects (plan E5.12): each box or lasso drag in select / lasso mode adds one (shift keeps the others), and every selection on a subplot selects the points inside it (selectedpoints follows). Set them to restore a selection; drag one to move or resize it; a double-click clears them.


separators? ​

ts
optional separators?: string;

Decimal then thousands separator of numbers, e.g. ', ' for 1 234,5. Default: the locale's (config.locale), '.,' in English.


showlegend? ​

ts
optional showlegend?: boolean;

Show the legend. Defaults to true when more than one trace has a legend entry.


template? ​

ts
optional template?: unknown;

Template: a registered name ('dark'), a +-composition ('dark+presentation') or an object { layout, data }. null disables the default template.


title? ​

ts
optional title?: BaseLayoutTitle;

Figure title.


transition? ​

ts
optional transition?: LayoutTransition;

Default transition for animated updates (E7.3).


uirevision? ​

ts
optional uirevision?: unknown;

While unchanged across updates, user interaction state (zoom, legend toggles, selections) is preserved.


uniformtext? ​

ts
optional uniformtext?: LayoutUniformtext;

Uniform text sizing for bar and pie labels (E4.6).


width? ​

ts
optional width?: number;

Figure width in CSS pixels. Ignored when autosize fills the container.

Minimum: 10

Default Value ​

700


xaxis? ​

ts
optional xaxis?: LayoutXaxis;

A x axis. xaxis2, xaxis3, … declare further x axes, referenced from traces as 'x2', 'x3', ….


xaxis2? ​

ts
optional xaxis2?: LayoutXaxis;

Subplot x2: the same attributes as xaxis.


xaxis3? ​

ts
optional xaxis3?: LayoutXaxis;

Subplot x3: the same attributes as xaxis.


xaxis4? ​

ts
optional xaxis4?: LayoutXaxis;

Subplot x4: the same attributes as xaxis.


xaxis5? ​

ts
optional xaxis5?: LayoutXaxis;

Subplot x5: the same attributes as xaxis.


xaxis6? ​

ts
optional xaxis6?: LayoutXaxis;

Subplot x6: the same attributes as xaxis.


xaxis7? ​

ts
optional xaxis7?: LayoutXaxis;

Subplot x7: the same attributes as xaxis.


xaxis8? ​

ts
optional xaxis8?: LayoutXaxis;

Subplot x8: the same attributes as xaxis.


xaxis9? ​

ts
optional xaxis9?: LayoutXaxis;

Subplot x9: the same attributes as xaxis.


yaxis? ​

ts
optional yaxis?: LayoutYaxis;

A y axis. yaxis2, yaxis3, … declare further y axes, referenced from traces as 'y2', 'y3', ….


yaxis2? ​

ts
optional yaxis2?: LayoutYaxis;

Subplot y2: the same attributes as yaxis.


yaxis3? ​

ts
optional yaxis3?: LayoutYaxis;

Subplot y3: the same attributes as yaxis.


yaxis4? ​

ts
optional yaxis4?: LayoutYaxis;

Subplot y4: the same attributes as yaxis.


yaxis5? ​

ts
optional yaxis5?: LayoutYaxis;

Subplot y5: the same attributes as yaxis.


yaxis6? ​

ts
optional yaxis6?: LayoutYaxis;

Subplot y6: the same attributes as yaxis.


yaxis7? ​

ts
optional yaxis7?: LayoutYaxis;

Subplot y7: the same attributes as yaxis.


yaxis8? ​

ts
optional yaxis8?: LayoutYaxis;

Subplot y8: the same attributes as yaxis.


yaxis9? ​

ts
optional yaxis9?: LayoutYaxis;

Subplot y9: the same attributes as yaxis.

Released under the MIT License.