
NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
The ObjTextMermaid object is a utility for rendering diagrams and charts from text using the Mermaid.js library. It generates the necessary HTML and JavaScript to display a Mermaid diagram on a web page.
Process(Param1: str, ...)This method takes a string of Mermaid diagram syntax and generates the HTML and JavaScript to render it.
Parameters:
Param1 (str): A string containing the Mermaid diagram syntax. For convenience, semicolons (;) in the string will be automatically replaced with newlines, allowing for more compact diagram definitions.Returns:
Example Usage:
mermaid = ObjProcessText()
diagram_code = "graph TD; A-->B; B-->C; C-->A;"
diagram_html = mermaid.Process(param1=diagram_code)
print(diagram_html)
This would output the necessary code to render a simple flowchart:
The wrapper lives in ObjTextMermaid.yaml under templates:, the
initialiser under js:.
The diagram source is concatenated into the wrapper, never passed
through .format(). That is not a stylistic choice here: Mermaid's
own syntax uses braces for node shapes — A{Decision},
B{{Hexagon}} — so a template formatted over caller content would
raise KeyError on the first rhombus anyone drew. The JS carries an
%%ID%% placeholder for the same reason a .format() field would be
awkward: the body is mostly braces, and doubling every one to survive
formatting makes it unreadable. Same convention as ObjTextTilt.
startOnLoad is false and mermaid.init is called by hand because
the diagram usually arrives after page load — via a report embed or
an RPC refresh — by which time Mermaid's own auto-run has been and
gone.