innerHTML section of a svg content
Factory of the module
Cache store for the module's icons
Return the svg content (aka icon) normalized to fit the module's box of the builder view (100 x 100 pixels).
Create the SVG element representing the module in the builder panel.
target module
the associated SVG element
Generated using TypeDoc
ModuleRendererBuild
This class is used to generate the view of the module in the builder panel.
ModuleRendererBuild implements a default view generating a kind of 'box' including a user-defined icon and featuring the appropriate number of inputs and outputs. This is what the decorator BuilderView allows at the first place.
Implementing a custom view
The simplest way to create custom view is to use the BuilderView decorator by providing a custom render function. For instance:
You can get inspiration or use the function genericModulePlot.
A usual need when creating a custom view is to be able to interact with the configuration of the module. For such case you can use the Environment.hostCommandRequest$ pipeline (accessible from ModuleFlux.environment) to send UpdateConfigurationCommand commands: