Really can't genuinely call this "zero" code. However, it is certainly low-code. You will need v6.3.0 (just published) to try this example because that release now allows not just HTML to be created dynamically but SVG images as well.
Simply use this single inject node to create a very simplistic gauge display. It has some parameters you can change but it is certainly not a feature-complete example.
[{"id":"8116c9abacbaf474","type":"inject","z":"56443195ea782ac2","name":"svg gauge","props":[{"p":"gaugeId","v":"gauge-1","vt":"str"},{"p":"radius","v":"200","vt":"num"},{"p":"topic","vt":"str"},{"p":"payload"},{"p":"_ui","v":"(\t $strokeWidth := radius * 0.2;\t $innerRadius := radius - $strokeWidth / 2;\t $circumference := $innerRadius * 2 * 3.14;\t $arc := $circumference * (270 / 360);\t $dashArray := $arc & \" \" & $circumference;\t $transform := \"rotate(135, \" & radius & \", \" & radius & \")\";\t $percentNormalized := $min([$max([payload, 0]), 100]);\t $offset := $arc - ($percentNormalized / 100) * $arc;\t\t[\t {\t \"method\": \"replace\",\t \"components\": [\t {\t \"type\": \"svg\",\t \"id\": gaugeId,\t \"parent\": \"#more\",\t \"position\": \"last\",\t \"attributes\": {\t \"xmlns\": \"http://www.w3.org/2000/svg\",\t \"xmlns:xlink\": \"http://www.w3.org/1999/xlink\",\t \"height\": radius * 2,\t \"width\": radius * 2\t },\t \"components\": [\t {\t \"type\": \"circle\",\t \"attributes\": {\t \"class\": \"gauge_base\",\t \"cx\": radius,\t \"cy\": radius,\t \"fill\": \"transparent\",\t \"r\": $innerRadius,\t \"stroke\": \"var(--surface5)\",\t \"stroke-width\": $strokeWidth,\t \"stroke-dasharray\": $dashArray,\t \"transform\": $transform,\t \"stroke-linecap\": \"round\"\t }\t },\t {\t \"type\": \"circle\",\t \"attributes\": {\t \"class\": \"gauge_pct\",\t \"cx\": radius,\t \"cy\": radius,\t \"fill\": \"transparent\",\t \"r\": $innerRadius,\t \"stroke\": \"var(--primary-bg)\",\t \"stroke-width\": $strokeWidth,\t \"stroke-dasharray\": $dashArray,\t \"stroke-dashoffset\": $offset,\t \"transform\": $transform,\t \"stroke-linecap\": \"round\",\t \"style\": \"transition: \\\"stroke-dasharray 0.5s;\\\"\"\t }\t }\t ]\t }\t ]\t }\t]\t)","vt":"jsonata"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"svg-gauge","payload":"$random() * 100","payloadType":"jsonata","x":760,"y":920,"wires":[["278d2031ac38b84a"]],"info":"Based on this REACT example:\r\nhttps://www.fullstacklabs.co/blog/creating-an-svg-gauge-component-from-scratch"}]
We made good use of JSONata here so that the gauge really is generated dynamically. The payload is also dynamic. If you use the uib-brand.css
file, the display also adapts to light/dark settings.
Keep track of this thread if you like as I will doubtless expand the example further.
Eventually, this will be incorporated into a zero-code node for ease of use.