blockly > blockRendering > Renderer
blockRendering.Renderer class
The base class for a block renderer.
Signature:
export declare class Renderer implements IRegistrable
Implements: IRegistrable
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(name) | Constructs a new instance of the Renderer class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
constants_ | protected |
ConstantProvider | The renderer's constant provider. |
name | protected |
string | |
overrides | protected |
object | null | Rendering constant overrides, passed in through options. |
Methods
Method | Modifiers | Description |
---|---|---|
dispose() | Dispose of this renderer. Delete all DOM elements that this renderer and its constants created. | |
getClassName() | Gets the class name that identifies this renderer. | |
getConnectionPreviewMethod(closest, local, topBlock) | Chooses a connection preview method based on the available connection, the current dragged connection, and the block being dragged. | |
getConstants() | Get the current renderer's constant provider. We assume that when this is called, the renderer has already been initialized. | |
init(theme, opt_rendererOverrides) | Initialize the renderer. | |
makeConstants_() | protected |
Create a new instance of the renderer's constant provider. |
makeDrawer_(block, info) | protected |
Create a new instance of the renderer's drawer. |
makeMarkerDrawer(workspace, marker) | Create a new instance of the renderer's marker drawer. | |
makePathObject(root, style) | Create a new instance of a renderer path object. | |
makeRenderInfo_(block) | protected |
Create a new instance of the renderer's render info object. |
orphanCanConnectAtEnd(topBlock, orphanBlock, localType) | protected |
Checks if an orphaned block can connect to the "end" of the topBlock's block-clump. If the clump is a row the end is the last input. If the clump is a stack, the end is the last next connection. If the clump is neither, then this returns false. |
refreshDom(svg, theme) | Refresh the renderer after a theme change. | |
shouldHighlightConnection(_conn) | Determine whether or not to highlight a connection. |