Skip to main content

Home > @jsplumb/core > Component

Component class#

Base class for Endpoint and Connection.

Signature:

export declare abstract class Component extends EventGenerator 

Extends: EventGenerator

Constructors#

ConstructorModifiersDescription
(constructor)(instance, params)Constructs a new instance of the Component class

Properties#

PropertyModifiersTypeDescription
_defaultTypeComponentTypeDescriptor
_hoverboolean
_typeCache{}
_typesSet<string>
beforeDetachBeforeDetachInterceptor
beforeDropBeforeDropInterceptor
clone() => Component
cssClassstring
dataRecord<string, any>
defaultLabelLocationnumber | [number, number]
deletedboolean
eventsany
hnumber
hoverClassstring
hoverPaintStylePaintStyle
idstring
instanceJsPlumbInstance
lastPaintedAtstring
overlayPlacementsRecord<string, Extents>
overlayPositionsRecord<string, PointXY>
overlaysRecord<string, Overlay>
paintStylePaintStyle
paintStyleInUsePaintStyle
parametersComponentParameters
paramsRecord<string, any>
segmentnumber
typeIdstring
visibleboolean
wnumber
xnumber
ynumber

Methods#

MethodModifiersDescription
addClass(clazz, cascade)Adds a css class to the component
getClass()Returns a space-separated list of the current classes assigned to this component.
getData()Gets any backing data stored against the given component.
getDefaultOverlayKey()
getIdPrefix()
getLabel()Return this component's label, if one is set.
getOverlay(id)Get the Overlay with the given ID. You can optionally provide a type parameter for this method in order to get a typed return value (such as LabelOverlay, ArrowOverlay, etc), since some overlays have methods that others do not.
getOverlays()Gets all the overlays registered on this component.
getTypeDescriptor()
getXY()
hideOverlay(id)Hide the overlay with the given id.
hideOverlays(ids)Hide all overlays, or a specific set of overlays.
mergeData(d)Merges the given backing data into any current backing data.
removeAllOverlays()Remove all overlays from this component.
removeClass(clazz, cascade)Removes a css class from the component
removeOverlays(overlays)Remove the given set of overlays, specified by their ids.
setData(d)Sets backing data stored against the given component, overwriting any current value.
setLabel(l)Set this component's label.
showOverlay(id)Show a specific overlay (set it to be visible)
showOverlays(ids)Show all overlays, or a specific set of overlays.