Skip to content

Variable: sceneAttributes ​

ts
const sceneAttributes: ObjectNode<{
  annotations: ItemsNode<object & TemplatedItemChildren>;
  aspectmode: Attr<"auto" | "data" | "cube" | "manual", {
     description: "`cube`: the axes form a cube whatever their ranges. `data`: axis lengths follow their data spans (per axis type). `manual`: `aspectratio`. `auto` (default; `manual` when `aspectratio` is given): `data` unless one axis would be more than 4 times longer than another, then `cube`.";
     dflt: "auto";
     editType: "plot";
     values: readonly ["auto", "cube", "data", "manual"];
  }>;
  aspectratio: ObjectNode<{
     x: Attr<number, {
        description: "Relative length of the x axis.";
        editType: "plot";
        min: 0;
     }>;
     y: Attr<number, {
        description: "Relative length of the y axis.";
        editType: "plot";
        min: 0;
     }>;
     z: Attr<number, {
        description: "Relative length of the z axis.";
        editType: "plot";
        min: 0;
     }>;
  }>;
  autorotate: ObjectNode<{
     axis: Attr<"x" | "y" | "z", {
        description: "The axis the scene turns about, through the camera's `center`.";
        dflt: "z";
        editType: "camera";
        values: readonly ["x", "y", "z"];
     }>;
     speed: Attr<number, {
        description: "Degrees per second the scene turns, counterclockwise seen from the positive end of `axis` (negative: clockwise). Default 15 when `autorotate` is given, else 0 (off).";
        editType: "camera";
     }>;
     time: Attr<number, {
        description: "Freeze the rotation at this many seconds after the start (the layout camera turned by `speed × time`): a fixed frame for exports and tests.";
        editType: "camera";
     }>;
  }>;
  bgcolor: Attr<string, {
     description: "Background color of the scene (transparent: the paper shows through).";
     dflt: "rgba(0,0,0,0)";
     editType: "plot";
  }>;
  camera: ObjectNode<{
     center: ObjectNode<{
        x: Attr<number, {
           description: "x component.";
           dflt: number;
           editType: "camera";
        }>;
        y: Attr<number, {
           description: "y component.";
           dflt: number;
           editType: "camera";
        }>;
        z: Attr<number, {
           description: "z component.";
           dflt: number;
           editType: "camera";
        }>;
     }>;
     eye: ObjectNode<{
        x: Attr<number, {
           description: "x component.";
           dflt: number;
           editType: "camera";
        }>;
        y: Attr<number, {
           description: "y component.";
           dflt: number;
           editType: "camera";
        }>;
        z: Attr<number, {
           description: "z component.";
           dflt: number;
           editType: "camera";
        }>;
     }>;
     projection: ObjectNode<{
        type: Attr<"perspective" | "orthographic", {
           description: "Perspective (45° vertical field of view) or orthographic projection (the view spans 2 scene units vertically; zooming scales `aspectratio`).";
           dflt: "perspective";
           editType: "camera";
           values: readonly ["perspective", "orthographic"];
        }>;
     }>;
     up: ObjectNode<{
        x: Attr<number, {
           description: "x component.";
           dflt: number;
           editType: "camera";
        }>;
        y: Attr<number, {
           description: "y component.";
           dflt: number;
           editType: "camera";
        }>;
        z: Attr<number, {
           description: "z component.";
           dflt: number;
           editType: "camera";
        }>;
     }>;
  }>;
  domain: ObjectNode<{
     column: Attr<number, {
        description: "Column of the `layout.grid` cell this trace is placed in (0 = leftmost). Only used with a grid.";
        dflt: 0;
        editType: "plot";
        min: 0;
     }>;
     row: Attr<number, {
        description: "Row of the `layout.grid` cell this trace is placed in (0 = first row in `roworder`). Only used with a grid.";
        dflt: 0;
        editType: "plot";
        min: 0;
     }>;
     x: AttrSpec<[number, number], [number, number]>;
     y: AttrSpec<[number, number], [number, number]>;
  }>;
  dragmode: Attr<false | "zoom" | "pan" | "orbit" | "turntable", {
     description: "What dragging does: `orbit` rotates freely, `turntable` rotates about the z axis (keeping it up), `zoom` moves the camera closer, `pan` moves it sideways; `false` turns dragging off. Defaults to `layout.dragmode` when the figure has only 3D subplots and that is one of these, else `turntable` (or `orbit` when `camera.up` isn't the z axis).";
     editType: "modebar";
     values: readonly ["orbit", "turntable", "zoom", "pan", false];
  }>;
  hovermode: Attr<false | "closest", {
     description: "Hover labels on the scene (`closest`) or none (`false`).";
     dflt: "closest";
     editType: "modebar";
     values: readonly ["closest", false];
  }>;
  lighting: ObjectNode<{
     ambient: ObjectNode<{
        color: Attr<string, {
           description: "Ambient color.";
           dflt: "#fff";
           editType: "plot";
        }>;
        intensity: Attr<number, {
           description: string;
           dflt: number;
           editType: "plot";
           min: 0;
        }>;
     }>;
     directional: ItemsNode<object & TemplatedItemChildren>;
     environment: Attr<string, {
        description: "Image-based lighting and reflections for the `standard`, `physical`, `phong` and `basic` material types: `'studio'`, `'city'` (built-in rooms) or the URL of an equirectangular image.";
        editType: "plot";
     }>;
     environmentintensity: Attr<number, {
        description: string;
        dflt: number;
        editType: "plot";
        min: 0;
     }>;
     hemisphere: ObjectNode<{
        groundcolor: Attr<string, {
           description: "Color from below.";
           dflt: "#4d4d4d";
           editType: "plot";
        }>;
        intensity: Attr<number, {
           description: string;
           dflt: number;
           editType: "plot";
           min: 0;
        }>;
        skycolor: Attr<string, {
           description: "Color from above.";
           dflt: "#fff";
           editType: "plot";
        }>;
     }>;
     shadows: ObjectNode<{
        extent: Attr<number, {
           description: "Half-size of the shadowed region, scene units. Default: large enough for the axis box.";
           editType: "plot";
           min: 0;
        }>;
        ground: Attr<boolean, {
           description: "A ground plane catching shadows, below the scene's axis box.";
           dflt: false;
           editType: "plot";
        }>;
        mapsize: Attr<number, {
           description: "Shadow map size, px.";
           dflt: 1024;
           editType: "plot";
           max: 8192;
           min: 64;
        }>;
        opacity: Attr<number, {
           description: "Darkness of the ground plane's shadows.";
           dflt: 0.3;
           editType: "plot";
           max: 1;
           min: 0;
        }>;
     }>;
  }>;
  uirevision: AttrSpec<unknown, unknown>;
  xaxis: ObjectNode<{
     backgroundcolor: Attr<string, {
        description: "Color of this axis' wall.";
        dflt: "rgba(204, 204, 204, 0.5)";
        editType: "plot";
     }>;
     hoverformat: Attr<string, {
        description: "Format of this axis’ values in hover labels (same syntax as `tickformat`). Empty uses the tick format with extra precision.";
        dflt: "";
        editType: "none";
     }>;
     showaxeslabels: Attr<boolean, {
        description: "Draw the axis title.";
        dflt: true;
        editType: "plot";
     }>;
     showbackground: Attr<boolean, {
        description: "Fill this axis' wall (the back plane perpendicular to it) with `backgroundcolor`.";
        dflt: false;
        editType: "plot";
     }>;
     showspikes: Attr<boolean, {
        description: "On hover, draw spikes from the hovered point to this axis' walls (3D hover, plan E14.1d).";
        dflt: true;
        editType: "plot";
     }>;
     spikecolor: Attr<string, {
        description: "Color of the spikes. Defaults to the axis `color`.";
        editType: "plot";
     }>;
     spikesides: Attr<boolean, {
        description: "Extend the spikes from the walls to the edges of the axis box.";
        dflt: true;
        editType: "plot";
     }>;
     spikethickness: Attr<number, {
        description: "Thickness of the spikes, px.";
        dflt: 2;
        editType: "plot";
        min: 0;
     }>;
     title: ObjectNode<{
        font: ObjectNode<{
           color: Attr<string, {
              description: "Text color.";
           }>;
           family: Attr<string, {
              description: "CSS font-family list. The renderer uses the first family it can load and falls back through the list.";
              noBlank: true;
              strict: true;
           }>;
           lineposition: Attr<
              | "none"
              | "under"
              | "over"
              | "through"
              | `under+${(...)}`
              | `over+${(...)}`
              | `through+${(...)}`, {
              description: "Text decoration: `under`, `over` and/or `through` joined with `+` (e.g. `under+over`), or `none`.";
              extras: readonly [...];
              flags: readonly [..., ..., ...];
           }>;
           shadow: Attr<string, {
              description: "CSS `text-shadow` behind the text (`2px 2px 3px black`; only the first shadow is drawn), `none`, or `auto` for a thin halo in the contrast color of the text.";
           }>;
           size: Attr<number, {
              description: "Font size in CSS pixels.";
              min: 1;
           }>;
           style: Attr<"normal" | "italic", {
              description: "Font style.";
              values: readonly [..., ...];
           }>;
           textcase: Attr<"normal" | "word caps" | "upper" | "lower", {
              description: "Letter case transform: `upper`, `lower`, `word caps` (first letter of each word), or `normal`.";
              values: readonly [..., ..., ..., ...];
           }>;
           variant: Attr<
              | "normal"
              | "small-caps"
              | "all-small-caps"
              | "all-petite-caps"
              | "petite-caps"
              | "unicase", {
              description: "Capitals variant (CSS `font-variant-caps`). The SDF text renderer approximates small and petite caps with uppercase letters at a reduced size.";
              values: readonly [..., ..., ..., ..., ..., ...];
           }>;
           weight: Attr<number | "normal" | "bold", {
              description: "Font weight: a CSS numeric weight (1–1000), `normal` or `bold`.";
              extras: readonly [..., ...];
              max: 1000;
              min: 1;
           }>;
        }>;
        text: Attr<string, {
           description: "Axis title, drawn beside the axis. Defaults to the axis letter (`'x'`).";
           editType: "plot";
        }>;
     }>;
     type: Attr<"linear" | "-" | "log" | "date" | "category", {
        description: "Axis type. `'-'` detects it from this axis' data (`x`, `y` or `z`) of the first trace on the scene.";
        dflt: "-";
        editType: "calc";
        values: readonly ["-", "linear", "log", "date", "category"];
     }>;
  }>;
  yaxis: ObjectNode<{
     backgroundcolor: Attr<string, {
        description: "Color of this axis' wall.";
        dflt: "rgba(204, 204, 204, 0.5)";
        editType: "plot";
     }>;
     hoverformat: Attr<string, {
        description: "Format of this axis’ values in hover labels (same syntax as `tickformat`). Empty uses the tick format with extra precision.";
        dflt: "";
        editType: "none";
     }>;
     showaxeslabels: Attr<boolean, {
        description: "Draw the axis title.";
        dflt: true;
        editType: "plot";
     }>;
     showbackground: Attr<boolean, {
        description: "Fill this axis' wall (the back plane perpendicular to it) with `backgroundcolor`.";
        dflt: false;
        editType: "plot";
     }>;
     showspikes: Attr<boolean, {
        description: "On hover, draw spikes from the hovered point to this axis' walls (3D hover, plan E14.1d).";
        dflt: true;
        editType: "plot";
     }>;
     spikecolor: Attr<string, {
        description: "Color of the spikes. Defaults to the axis `color`.";
        editType: "plot";
     }>;
     spikesides: Attr<boolean, {
        description: "Extend the spikes from the walls to the edges of the axis box.";
        dflt: true;
        editType: "plot";
     }>;
     spikethickness: Attr<number, {
        description: "Thickness of the spikes, px.";
        dflt: 2;
        editType: "plot";
        min: 0;
     }>;
     title: ObjectNode<{
        font: ObjectNode<{
           color: Attr<string, {
              description: "Text color.";
           }>;
           family: Attr<string, {
              description: "CSS font-family list. The renderer uses the first family it can load and falls back through the list.";
              noBlank: true;
              strict: true;
           }>;
           lineposition: Attr<
              | "none"
              | "under"
              | "over"
              | "through"
              | `under+${(...)}`
              | `over+${(...)}`
              | `through+${(...)}`, {
              description: "Text decoration: `under`, `over` and/or `through` joined with `+` (e.g. `under+over`), or `none`.";
              extras: readonly [...];
              flags: readonly [..., ..., ...];
           }>;
           shadow: Attr<string, {
              description: "CSS `text-shadow` behind the text (`2px 2px 3px black`; only the first shadow is drawn), `none`, or `auto` for a thin halo in the contrast color of the text.";
           }>;
           size: Attr<number, {
              description: "Font size in CSS pixels.";
              min: 1;
           }>;
           style: Attr<"normal" | "italic", {
              description: "Font style.";
              values: readonly [..., ...];
           }>;
           textcase: Attr<"normal" | "word caps" | "upper" | "lower", {
              description: "Letter case transform: `upper`, `lower`, `word caps` (first letter of each word), or `normal`.";
              values: readonly [..., ..., ..., ...];
           }>;
           variant: Attr<
              | "normal"
              | "small-caps"
              | "all-small-caps"
              | "all-petite-caps"
              | "petite-caps"
              | "unicase", {
              description: "Capitals variant (CSS `font-variant-caps`). The SDF text renderer approximates small and petite caps with uppercase letters at a reduced size.";
              values: readonly [..., ..., ..., ..., ..., ...];
           }>;
           weight: Attr<number | "normal" | "bold", {
              description: "Font weight: a CSS numeric weight (1–1000), `normal` or `bold`.";
              extras: readonly [..., ...];
              max: 1000;
              min: 1;
           }>;
        }>;
        text: Attr<string, {
           description: "Axis title, drawn beside the axis. Defaults to the axis letter (`'x'`).";
           editType: "plot";
        }>;
     }>;
     type: Attr<"linear" | "-" | "log" | "date" | "category", {
        description: "Axis type. `'-'` detects it from this axis' data (`x`, `y` or `z`) of the first trace on the scene.";
        dflt: "-";
        editType: "calc";
        values: readonly ["-", "linear", "log", "date", "category"];
     }>;
  }>;
  zaxis: ObjectNode<{
     backgroundcolor: Attr<string, {
        description: "Color of this axis' wall.";
        dflt: "rgba(204, 204, 204, 0.5)";
        editType: "plot";
     }>;
     hoverformat: Attr<string, {
        description: "Format of this axis’ values in hover labels (same syntax as `tickformat`). Empty uses the tick format with extra precision.";
        dflt: "";
        editType: "none";
     }>;
     showaxeslabels: Attr<boolean, {
        description: "Draw the axis title.";
        dflt: true;
        editType: "plot";
     }>;
     showbackground: Attr<boolean, {
        description: "Fill this axis' wall (the back plane perpendicular to it) with `backgroundcolor`.";
        dflt: false;
        editType: "plot";
     }>;
     showspikes: Attr<boolean, {
        description: "On hover, draw spikes from the hovered point to this axis' walls (3D hover, plan E14.1d).";
        dflt: true;
        editType: "plot";
     }>;
     spikecolor: Attr<string, {
        description: "Color of the spikes. Defaults to the axis `color`.";
        editType: "plot";
     }>;
     spikesides: Attr<boolean, {
        description: "Extend the spikes from the walls to the edges of the axis box.";
        dflt: true;
        editType: "plot";
     }>;
     spikethickness: Attr<number, {
        description: "Thickness of the spikes, px.";
        dflt: 2;
        editType: "plot";
        min: 0;
     }>;
     title: ObjectNode<{
        font: ObjectNode<{
           color: Attr<string, {
              description: "Text color.";
           }>;
           family: Attr<string, {
              description: "CSS font-family list. The renderer uses the first family it can load and falls back through the list.";
              noBlank: true;
              strict: true;
           }>;
           lineposition: Attr<
              | "none"
              | "under"
              | "over"
              | "through"
              | `under+${(...)}`
              | `over+${(...)}`
              | `through+${(...)}`, {
              description: "Text decoration: `under`, `over` and/or `through` joined with `+` (e.g. `under+over`), or `none`.";
              extras: readonly [...];
              flags: readonly [..., ..., ...];
           }>;
           shadow: Attr<string, {
              description: "CSS `text-shadow` behind the text (`2px 2px 3px black`; only the first shadow is drawn), `none`, or `auto` for a thin halo in the contrast color of the text.";
           }>;
           size: Attr<number, {
              description: "Font size in CSS pixels.";
              min: 1;
           }>;
           style: Attr<"normal" | "italic", {
              description: "Font style.";
              values: readonly [..., ...];
           }>;
           textcase: Attr<"normal" | "word caps" | "upper" | "lower", {
              description: "Letter case transform: `upper`, `lower`, `word caps` (first letter of each word), or `normal`.";
              values: readonly [..., ..., ..., ...];
           }>;
           variant: Attr<
              | "normal"
              | "small-caps"
              | "all-small-caps"
              | "all-petite-caps"
              | "petite-caps"
              | "unicase", {
              description: "Capitals variant (CSS `font-variant-caps`). The SDF text renderer approximates small and petite caps with uppercase letters at a reduced size.";
              values: readonly [..., ..., ..., ..., ..., ...];
           }>;
           weight: Attr<number | "normal" | "bold", {
              description: "Font weight: a CSS numeric weight (1–1000), `normal` or `bold`.";
              extras: readonly [..., ...];
              max: 1000;
              min: 1;
           }>;
        }>;
        text: Attr<string, {
           description: "Axis title, drawn beside the axis. Defaults to the axis letter (`'x'`).";
           editType: "plot";
        }>;
     }>;
     type: Attr<"linear" | "-" | "log" | "date" | "category", {
        description: "Axis type. `'-'` detects it from this axis' data (`x`, `y` or `z`) of the first trace on the scene.";
        dflt: "-";
        editType: "calc";
        values: readonly ["-", "linear", "log", "date", "category"];
     }>;
  }>;
}>;

Experimental

The scene subplot container family (scene, scene2, …).

Released under the MIT License.