Skip to content

ExtrusionLazy ​

Experimental

Interfaces ​

InterfaceDescription
HeatmapColumnsHeatmap columns: rect corners (data space), heights (px) and colors of every cell.
ShapeStyleEverything a shape needs besides its outline.
SlabGeometryA fill's slab in world px (see the module comment).

Variables ​

VariableDescription
EXTRUSION_LIGHTINGLights of extruded 2D shapes: ambient light and one light fixed to the chart, from the upper left in front. With Plotly's lighting defaults (ambient 0.8, diffuse 0.8) a face toward the viewer shows its color exactly, tops ~87 %, left sides ~80 %, right sides and bottoms ~64 %.
EXTRUSION_THREE_LIGHTINGThe same lights for three.js material types, which take their intensities as physical light (brighter than Plotly's model at the same numbers): less ambient light, so faces keep their shading and toon bands show.
HEATMAP_BEVEL_MAXLargest heatmap (cells) whose columns take bevel: larger grids get sharp edges.
HEATMAP_COLUMNS_MAXLargest heatmap (cells) drawn as columns: larger grids stay flat, with a warning.
UNCLIPPEDObject flag: the 2.5D view does not clip this object to the flat plot area (view3d.ts).
VIEW3D_MAX_ANGLELimit of tilt and rotation (degrees).
VIEW3D_MAX_FOVField of view (degrees) at perspective: 1.

Functions ​

FunctionDescription
arcShapesPie slices (arc data, world px) as sector shapes. items: one entry per group of arcs (a slice and its outline rims, drawn by the trace as extra arcs, which are skipped), the item its depth is read at; default one group per arc.
buildPrismsWrite the prisms of shapes (world px) into out; item k is shape k.
clampBevelThe bevel an outline of this size and depth takes: at most half its size and its depth; none below a thousandth of a px.
createExtrusionPrimitiveCreate an ExtrusionPrimitive drawn with the loaded mesh module (loadMeshModule).
createView3DProjectorCreate a View3DProjector.
domainActiveWhether a trace is drawn in 2.5D: a tilt, or a depth that isn't 0.
domainCaptureIntercept a primitive the view of a trace in 2.5D just added (see syncDomain).
domainDepthA shape's depth (px) from the trace's depth: a number, a percentage of size ('20%'), or one number per item (item indexes it). At least FLAT.
domainHoverA domain trace's hoverPoints in 2.5D: the pointer (query.cx, query.cy) mapped onto the flat trace, the points' anchors onto the tilted one. Undefined when the trace is flat.
domainKeyboardA domain trace's keyboardPoints in 2.5D (anchors where drawn); undefined when flat.
domainPointerA domain trace's pointer event mapped onto the flat trace; undefined when it is flat.
extrudeOutlineExtrude outline from z0 to z1 into out (see the module comment): walls, a bevel of radius bevel in segments rings (clamp it with clampBevel first), and both caps.
extrusionDepthsdepth per shape in px: a number (px), a percentage string of the shape's width ('60%'), or an array of numbers (px). widths(i): shape i's width in px.
extrusionMaterialSpecThe mesh material spec of a defaulted material attribute (core litMaterialAttributes): null for Plotly's model; CSS colors become sRGB tuples, a matcap URL a texture (onTextureLoad is called once it has loaded).
heatmapColumnsThe columns of a heatmap top px tall at zmax (see the module comment), their cells inset by the gaps (gapX / gapY: half the gap in data units). Cells without a value have NaN corners.
overcolor (straight alpha) times opacity over under (opaque): the color the flat trace shows. Prisms are drawn opaque, so they keep writing depth (translucent ones would need sorting that nested and adjacent prisms defeat); what is under a shape in the flat trace is the paper or, for a nested tile, its parent.
paperColorThe paper color (paper_bgcolor, alpha dropped; white when unset or transparent).
polygonOutlineA simple polygon (flat [x0, y0, x1, y1, …], either orientation) with sharp corners; cap: its triangulation (indices of the polygon's points, e.g. from earcut), default a fan (convex).
raycastSlabWhere a ray (in the slab's own world frame) first meets the slab from z0 to z1: its front face (or its plane within NEAR px of it, where the lines along the edge are drawn) or a wall facing the ray, inside the world box clip (x0, y0, x1, y1). The hit point on a wall is moved a hair inside the fill.
rectOutlineA rectangle from (x0, y0) to (x1, y1) (any order) with corners rounded by radius in segments steps (sharp corners for radius 0).
rectPrismVertexCountVertices of one rect prism with a bevel of segments (> 0) or none (0).
rectShapesTiles (rect data, world px) as rect shapes, inset by half their outline width (the outlines become gaps); a tile inside an earlier one stands on its top. d.items: the item of each rect.
sectorOutlineAn annular sector around (cx, cy) from inner to outer radius and angle a0 to a1 (radians, counter-clockwise, a1 > a0), the arcs in arcSegments steps; inner = 0 is a pie slice. Sharp corners; the cap is a strip between the arcs.
slabGeometryThe slab geometry of a fill triangulation for a data → world transform. Vertices at the same point count as one, so an edge two triangles share is found however they number it.
syncDomainThe lazily loaded side of extrudeDomain (see the module comment): capture added (the primitives the trace view added), set the trace's camera and draw. Returns the extrusion primitive, if the trace is in 2.5D. items: per slice, the item its depth is read at.
syncExtrudedFillsDraw a scatter trace's fill as a slab when the trace has depth (see the module comment; the lazily loaded side of extrudeFills): creates, updates or removes the extrusion primitive and returns it; hides the flat fill while extruded and lifts the trace's other primitives in added (those still drawn) onto the slab's front. depth is px, or a percentage of the plot area's width. fill must have loaded (fill.fill).
syncExtrudedRectsDraw a trace's rects extruded when it has depth (plan E9.10; see extrudeRects in extrusion-loader.ts, which calls this once the chunk has loaded): creates, updates or (for a flat trace) removes the extrusion primitive and returns it. The flat rects are hidden while extruded; lift (labels, error bars) moves to the front faces and out of the 2.5D view's clipping. rects' data gives the shapes and colors (fill, opacity); the trace gives depth (widths along the position axis, orientation), bevel and material.
syncHeatmapColumnsDraw a heatmap's cells as columns when its trace has depth (see the module comment; the lazily loaded side of extrudeHeatmap): creates, updates or removes the extrusion primitive and returns it. depth is the height at zmax in px, or a percentage of the mean cell width.
view3dCameraThe 2.5D camera of a viewport whose rect (container px, top-left origin) is drawn into area (see the module comment).
view3dProjectWhere the world point (x, y, z) of a viewport (rect-local px, bottom-left origin) appears, in container px (top-left origin).
view3dRayThe pointer ray through a container point (sx, sy): its world origin (on the near plane) and direction (toward the scene, unnormalized).
view3dUnprojectThe world point of the plot plane (z = 0) under a container point (sx, sy); NaN when the ray runs parallel to the plane.
writeSlabWrite a slab from z0 to z1: the front triangles and the walls (no back face).

References ​

DomainCamera ​

Re-exports DomainCamera


DomainHost ​

Re-exports DomainHost


DomainShape ​

Re-exports DomainShape


DomainView ​

Re-exports DomainView


ExtrusionData ​

Re-exports ExtrusionData


ExtrusionHit ​

Re-exports ExtrusionHit


ExtrusionHost ​

Re-exports ExtrusionHost


ExtrusionPrimitive ​

Re-exports ExtrusionPrimitive


LiftedPrimitive ​

Re-exports LiftedPrimitive


Outline ​

Re-exports Outline


PrismBuffers ​

Re-exports PrismBuffers


View3DAngles ​

Re-exports View3DAngles


View3DCamera ​

Re-exports View3DCamera


View3DProjector ​

Re-exports View3DProjector

Released under the MIT License.