How to update the UI surface on Dashboard when a new message arrived

I am in the process of creating my first node to display a speedometer on the dashboard.
I have the problem that the written HTML code for the dashboard is not updated when a new message arrives.
My code is structured according to the following scheme:

module.exports = function(RED) {
  function html(config) {
    var code = String.raw`
    return code;

  function node(config) {
    var ui = RED.require("node-red-dashboard")(RED);
    RED.nodes.createNode(this, config);
    var done = ui.addWidget({
      format: html(config);
      //definition of more properties

Is there a function that regenerates the HTML code or is there another way to define the HTML code so that it is regenerated with each new message?

Thank you for your replies.