@urban-toolkit/autk-plot / PlotBaseInteractive
Abstract Class: PlotBaseInteractive
Defined in: plot-base-interactive.ts:29
Interactive plot base class.
Extends PlotBaseData with selection state, click/brush wiring, and mark highlighting behavior shared by interactive plots.
Extends
Constructors
Constructor
new PlotBaseInteractive(
config):PlotBaseInteractive
Defined in: plot-base-interactive.ts:66
Initializes interactive plot state on top of the shared data lifecycle.
Parameters
config
Plot configuration including optional interaction events.
Returns
PlotBaseInteractive
Throws
If configured bindings are missing or invalid (delegated to PlotBaseData).
Overrides
Properties
_axisLabels
protected_axisLabels:string[]
Defined in: plot-base-data.ts:61
User-facing axis labels.
Inherited from
_categoricalColorMapInterpolator
protected_categoricalColorMapInterpolator:ColorMapInterpolator=ColorMapInterpolator.CAT_OBSERVABLE10
Defined in: plot-base-data.ts:91
Color interpolator used when the color attribute contains categorical (string) values.
Inherited from
PlotBaseData._categoricalColorMapInterpolator
_colorMapInterpolator
protected_colorMapInterpolator:ColorMapInterpolator=ColorMapInterpolator.SEQ_REDS
Defined in: plot-base-data.ts:89
Color interpolator used for continuous (numeric) color encoding.
Inherited from
PlotBaseData._colorMapInterpolator
_colorProperty
protected_colorProperty:"fill"|"stroke"='fill'
Defined in: plot-base-interactive.ts:33
CSS property used when applying colors to marks.
_data
protected_data:object&object[]
Defined in: plot-base-data.ts:54
Normalized render rows bound to marks.
Inherited from
_div
protected_div:HTMLElement
Defined in: plot-base-data.ts:49
Host element where the plot is rendered.
Inherited from
_domainSpec
protected_domainSpec:ColorMapDomainSpec|undefined=undefined
Defined in: plot-base-data.ts:87
Domain specification for color encoding (from config).
Inherited from
_enabledEvents
protected_enabledEvents:PlotEvent[] =[]
Defined in: plot-base-interactive.ts:31
Interaction events explicitly enabled for the plot instance.
_height
protected_height:number=500
Defined in: plot-base-data.ts:76
Outer plot height in pixels.
Inherited from
_margins
protected_margins:PlotMargins
Defined in: plot-base-data.ts:78
Plot margins in pixels.
Inherited from
_MODE
protected_MODE:"and"|"or"='and'
Defined in: plot-base-interactive.ts:58
Brush combine mode for multi-brush interactions.
and requires all active brushes to contain a mark; or allows any brush to include it.
_resolvedDomain
protected_resolvedDomain:ResolvedDomain|undefined=undefined
Defined in: plot-base-data.ts:81
Resolved color domain, computed from data after each transform.
Inherited from
_sourceFeatures
protected_sourceFeatures:Feature<Geometry,GeoJsonProperties>[]
Defined in: plot-base-data.ts:52
Original source features from the input collection, indexed by source feature id.
Inherited from
_tickFormats
protected_tickFormats:string[]
Defined in: plot-base-data.ts:71
D3 tick-format specifiers used by axis renderers.
Inherited from
_title
protected_title:string
Defined in: plot-base-data.ts:69
Plot title text.
Inherited from
_transformAttributes
protected_transformAttributes:string[] |undefined=undefined
Defined in: plot-base-data.ts:59
Dot-path attributes used to read values from transformed rows, when applicable.
Inherited from
PlotBaseData._transformAttributes
_transformColorAttribute
protected_transformColorAttribute:string|null|undefined=undefined
Defined in: plot-base-data.ts:66
Dot-path attribute used for color encoding on transformed rows, when applicable.
Inherited from
PlotBaseData._transformColorAttribute
_transformConfig?
protectedoptional_transformConfig?:PlotTransformConfig
Defined in: plot-base-data.ts:84
Optional transform config shared by plot implementations that support transformed views.
Inherited from
_width
protected_width:number=800
Defined in: plot-base-data.ts:74
Outer plot width in pixels.
Inherited from
Accessors
events
Get Signature
get events():
EventEmitter<PlotEventRecord>
Defined in: plot-base-interactive.ts:83
Returns the typed event emitter used by this plot instance.
Returns
EventEmitter<PlotEventRecord>
renderAxisAttributes
Get Signature
get
protectedrenderAxisAttributes():string[]
Defined in: plot-base-data.ts:293
Returns the active axis bindings for rendered rows.
Returns
string[]
Inherited from
PlotBaseData.renderAxisAttributes
renderColorAttribute
Get Signature
get
protectedrenderColorAttribute():string|undefined
Defined in: plot-base-data.ts:300
Returns the active color binding for rendered rows.
Returns
string | undefined
Inherited from
PlotBaseData.renderColorAttribute
selection
Get Signature
get selection():
number[]
Defined in: plot-base-interactive.ts:76
Returns the active selection as source feature ids.
Returns
number[]
Methods
afterDataRefresh()
protectedafterDataRefresh():void
Defined in: plot-base-interactive.ts:124
Rehydrates local aggregated mark selection after _data is rebuilt.
Returns
void
Overrides
applyMarkStyles()
protectedapplyMarkStyles(svgs):void
Defined in: plot-base-interactive.ts:406
Applies interaction-aware styling to rendered marks.
Parameters
svgs
Selection<BaseType, unknown, HTMLElement, unknown>
Selection containing rendered mark nodes.
Returns
void
brushEvent()
protectedbrushEvent():void
Defined in: plot-base-interactive.ts:263
Enables 2D rectangular brushing interactions.
Returns
void
brushXEvent()
protectedbrushXEvent():void
Defined in: plot-base-interactive.ts:297
Enables horizontal brushing interactions.
Returns
void
brushYEvent()
protectedbrushYEvent():void
Defined in: plot-base-interactive.ts:339
Enables vertical brushing interactions.
Returns
void
clickEvent()
protectedclickEvent():void
Defined in: plot-base-interactive.ts:231
Enables click-based selection for .autkMark nodes and clear overlays.
Returns
void
computeColorDomain()
protectedcomputeColorDomain():void
Defined in: plot-base-data.ts:324
Computes and caches the active color domain from rendered rows.
Returns
void
Inherited from
PlotBaseData.computeColorDomain
configureSignalListeners()
configureSignalListeners():
void
Defined in: plot-base-interactive.ts:133
Attaches interaction handlers requested by the plot configuration.
Returns
void
Throws
Never throws.
draw()
draw():
void
Defined in: plot-base-data.ts:152
Rebuilds source rows, applies transforms, validates bindings, and delegates rendering.
Returns
void
Throws
If active render bindings do not resolve on the rendered data.
Inherited from
getMarkColor()
protectedgetMarkColor(d):string
Defined in: plot-base-interactive.ts:155
Resolves the color for a rendered mark datum.
Selection highlight takes precedence over data-driven color encoding.
Parameters
d
unknown
Bound datum for the mark.
Returns
string
CSS color string for the mark.
isMarkHighlighted()
protectedisMarkHighlighted(d):boolean
Defined in: plot-base-interactive.ts:204
Returns whether a rendered mark should be highlighted.
Parameters
d
unknown
Bound datum for the mark.
Returns
boolean
true when the mark belongs to the active selection.
markIntersectsRect()
protectedmarkIntersectsRect(node,x0,y0,x1,y1):boolean
Defined in: plot-base-interactive.ts:456
Tests whether a rendered mark intersects the supplied brush rectangle.
Parameters
node
SVGGeometryElement
SVG geometry node representing the mark.
x0
number
First rectangle x coordinate.
y0
number
First rectangle y coordinate.
x1
number
Second rectangle x coordinate.
y1
number
Second rectangle y coordinate.
Returns
boolean
true when the mark intersects the rectangle.
nodeIntersectsRect()
protectednodeIntersectsRect(node,x0,y0,x1,y1):boolean
Defined in: plot-base-interactive.ts:474
Tests a generic SVG geometry node against a brush rectangle.
Parameters
node
SVGGeometryElement
SVG geometry node representing the mark.
x0
number
First rectangle x coordinate.
y0
number
First rectangle y coordinate.
x1
number
Second rectangle x coordinate.
y1
number
Second rectangle y coordinate.
Returns
boolean
true when the node intersects the rectangle.
onSelectionUpdated()
protectedonSelectionUpdated():void
Defined in: plot-base-interactive.ts:413
Hook invoked after mark selection styles have been refreshed.
Returns
void
render()
abstractrender():void
Defined in: plot-base-data.ts:267
Renders plot DOM, SVG, or HTML nodes for the current internal state.
Returns
void
Inherited from
renderSelection()
protectedrenderSelection():void
Defined in: plot-base-interactive.ts:395
Refreshes rendered marks to reflect the current selection state.
Returns
void
resolveSelectionFromRects()
protectedresolveSelectionFromRects(activeBrushes):number[]
Defined in: plot-base-interactive.ts:421
Resolves selected source ids by testing rendered marks against brush rectangles.
Parameters
activeBrushes
Map<string, [number, number, number, number]>
Active brush rectangles keyed by brush host id.
Returns
number[]
Selected source feature ids.
resolveTransformResult()
protectedresolveTransformResult(result):ResolvedPlotTransform
Defined in: plot-base-data.ts:276
Maps a preset-specific executed transform into the rendered row schema expected by plot implementations.
Parameters
result
Executed transform payload returned by the shared dispatcher.
Returns
Normalized rendered rows plus any transformed binding metadata.
Inherited from
PlotBaseData.resolveTransformResult
setRenderColorAttribute()
protectedsetRenderColorAttribute(attribute):void
Defined in: plot-base-data.ts:312
Updates the active render-time color binding.
Parameters
attribute
string | undefined
Dot-path attribute to use for color, or undefined to clear it.
Returns
void
Inherited from
PlotBaseData.setRenderColorAttribute
setSelection()
setSelection(
selection):void
Defined in: plot-base-interactive.ts:110
Applies an externally authored selection to the plot.
Parameters
selection
number[]
Source feature ids to highlight.
Returns
void
Throws
Never throws.
updateCollection()
updateCollection(
collection):void
Defined in: plot-base-interactive.ts:93
Replaces the source collection, clears interaction state, and redraws.
Parameters
collection
FeatureCollection<Geometry, GeoJsonProperties>
New GeoJSON collection to render.
Returns
void
Throws
Never throws.