Stay organized with collections
Save and categorize content based on your preferences.
blockly > blockRendering > ConstantProvider > createDom
blockRendering.ConstantProvider.createDom() method
Create any DOM elements that this renderer needs (filters, patterns, etc).
Signature:
createDom(svg: SVGElement, tagName: string, selector: string, injectionDivIfIsParent?: HTMLElement): void;
Parameters
Parameter |
Type |
Description |
svg |
SVGElement |
The root of the workspace's SVG. |
tagName |
string |
The name to use for the CSS style tag. |
selector |
string |
The CSS selector to use. |
injectionDivIfIsParent |
HTMLElement |
(Optional) The div containing the parent workspace and all related workspaces and block containers, if this renderer is for the parent workspace. CSS variables representing SVG patterns will be scoped to this container. Child workspaces should not override the CSS variables created by the parent and thus do not need access to the injection div. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-16 UTC."],[[["The `blockRendering.ConstantProvider.createDom()` method generates necessary DOM elements within the workspace's SVG for the renderer, such as filters and patterns."],["It accepts the workspace's SVG root, a style tag name, and a CSS selector as parameters to facilitate DOM element creation."],["This method modifies the SVG structure but does not return any specific value."]]],["The `createDom()` method, part of `blockRendering.ConstantProvider`, generates necessary DOM elements for the renderer, such as filters and patterns. It accepts three parameters: `svg` (the workspace's SVG root), `tagName` (CSS style tag name), and `selector` (CSS selector). This method does not return anything, and its primary function is to set up DOM elements within the workspace's SVG structure.\n"]]