bubbles.Bubble class
The abstract pop-up bubble class. This creates a UI that looks like a speech bubble, where it has a "tail" that points to the block, and a "head" that displays arbitrary svg elements.
Signature:
export declare abstract class Bubble implements IBubble, ISelectable, IFocusableNode, IBoundedElement
Implements: IBubble, ISelectable, IFocusableNode, IBoundedElement
Constructors
Constructor | Modifiers | Description |
|---|---|---|
(constructor)(workspace, anchor, ownerRect, overriddenFocusableElement, owner) | Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| (not declared) | Distance between arrow point and anchor point. | |
| |||
| (not declared) | The width of the border around the bubble. | |
| SVGGElement | The SVG group containing the contents of the bubble. | |
boolean | True if the bubble has been disposed, false otherwise. | ||
| number | Double the width of the border around the bubble. | |
string | |||
| number | The minimum size the bubble can have. | |
| (IHasBubble & IFocusableNode) | undefined | (Optional) | |
| Rect | undefined | (Optional) | |
| SVGGElement | The SVG group containing all parts of the bubble. | |
| (not declared) | The number of degrees that the tail bends counter-clockwise. | |
| (not declared) | The sharpness of the tail's bend. Higher numbers result in smoother tails. | |
| (not declared) | The thickness of the base of the tail in relation to the size of the bubble. Higher numbers result in thinner tails. | |
|
Methods
Method | Modifiers | Description |
|---|---|---|
See IFocusableNode.canBeFocused. | ||
Dispose of this bubble. | ||
Drags the bubble to the given location. | ||
Ends the drag on the bubble. | ||
Returns the ARIA label to use for this bubble based on the provider set via setAriaLabelProvider. This will return null if the provider is absent or returns null. | ||
Returns the bounds of this bubble. | ||
| Returns the colour of the background and tail of this bubble. | |
See IFocusableNode.getFocusableElement. | ||
See IFocusableNode.getFocusableTree. | ||
Returns the object that owns/hosts this bubble, if any. | ||
| ||
Returns whether this bubble is movable or not. | ||
Moves the bubble by the given amounts in the x and y directions. | ||
| Handles key events when this bubble is focused. By default, closes the bubble on Escape. | |
See IFocusableNode.onNodeBlur. | ||
See IFocusableNode.onNodeFocus. | ||
| Positions the bubble "optimally" so that the most of it is visible and it does not overlap the rect (if provided). | |
| Positions the bubble relative to its anchor. Does not render its tail. | |
| Recomputes the ARIA label and role for this bubble. This is automatically called during initialization, but implementations may find it useful to call this if the bubble's label should be changed. Bubbles use a default non-specific label unless they're customized otherwise which is the responsibility of the bubble's owner rather than bubble implementations. Customization can be done via setAriaLabelProvider. | |
Moves the bubble back to where it was at the start of a drag. | ||
Set the location the tail of this bubble points to. | ||
Sets a custom ARIA label provider for this bubble, or null if it should be reset to use the default method. Bubbles do not compute ARIA labels specifically to their implementation since they can be rather general-purpose. Instead, owners of the specific bubble instance (such as an icon) are responsible for defining custom label providers for their bubbles. Note that calling this isn't sufficient for it to actually be used. recomputeAriaContext will likely also need to be called to actually apply the custom label to the bubble's focusable element. | ||
Sets the colour of the background and tail of this bubble. | ||
Sets the position of this bubble relative to its anchor. | ||
| Sets the size of this bubble, including the border. | |
Starts a drag on the bubble. | ||