Skip to content

Interface: ComponentView ​

Experimental

Properties ​

PropertyModifierTypeDescription
clickThrough?readonlybooleanExperimental For a view that takes every press in an area to drag it (GEO2: a map pans): a press released without moving, whose click the view does not handle, is then a click on the points under it, with the chart's click event and click-to-select, as on a cartesian subplot.

Methods ​

animateCamera()? ​

ts
optional animateCamera(camera, run): Promise<void> | undefined;

Experimental

Camera animation (E7.5, chart.animateCamera): move the camera of the view's subplot run.subplot (default: its first) to camera with run's duration and easing, resolving when it arrives. Return undefined when the view has no such subplot (the chart asks the next view).

Parameters ​

ParameterType
cameraCameraTarget
runCameraAnimationRun

Returns ​

Promise<void> | undefined


dispose()? ​

ts
optional dispose(): void;

Experimental

Returns ​

void


drawShape()? ​

ts
optional drawShape(gesture): boolean | void;

Experimental

Shape drawing hook (E5.5, see DrawGesture). Return true when the view handles the gesture: later views are then not asked for this call.

Parameters ​

ParameterType
gestureDrawGesture

Returns ​

boolean | void


handlePointer()? ​

ts
optional handlePointer(event): boolean | void;

Experimental

Pointer hook (M1 wave 2): the runtime offers every pointer event to component views first — topmost (last drawn) first — and only runs its own hover / zoom / pan / selection when none returns true. Return true for events over your own hit regions (e.g. legend items): a handled down also routes the rest of that gesture (move, up, click) to this view only, and a handled move hides hover labels. DOM components (modebar) get their own DOM events and don't need this.

Parameters ​

ParameterType
eventComponentPointerEvent

Returns ​

boolean | void


layoutTweens()? ​

ts
optional layoutTweens(from, to): readonly LayoutTween[];

Experimental

Layout transitions (E7.3, E7.5): attributes the view animates with its own interpolation (a 3D camera orbits rather than moving in a straight line), from what it shows now to the defaulted layout to. The transition writes each tween's value at path on every frame.

Parameters ​

ParameterType
fromFullLayout
toFullLayout

Returns ​

readonly LayoutTween[]


selectArea()? ​

ts
optional selectArea(x, y): SelectArea | undefined;

Experimental

Box / lasso selection on a non-cartesian subplot the view draws (E6.3, polar): the subplot under container (x, y) when a select / lasso drag may start there. The runtime then runs the selection over the rect (the drag is clamped to it) with the visible traces whose subplot attribute is the area's id; their selectPoints get container px queries. Plotly keeps no layout.selections for these subplots.

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

SelectArea | undefined


update() ​

ts
update(ctx, plan): void;

Experimental

Parameters ​

ParameterType
ctxComponentDrawContext
planComponentUpdatePlan

Returns ​

void

Released under the MIT License.