Tooltip issue with node

hi,
i am facing one issue with tooltip in gojs node while the text is empty then also tooltip is getting displayed. i just want to show tooltip when the text is present

code using :

{
toolTip: // define a tooltip for each node that displays the color as text
$(go.Adornment, “Auto”,
$(go.Shape, { fill: “#444” }),
$(go.TextBlock, { margin: 4 },
new go.Binding(“text”, “”, diagramNodeInfo))
)
}

function diagramNodeInfo(model) {
if (model.Error != null) {
return model.Error;
} else {
if (model.PluginName == null) {
model.PluginName = model.ActionType;
}
return model.text;
}
}

Add a Binding of “visible” on the Adornment.

hey walter i didn’t get any solution for this please let me know how would i solve my issue

when there is nothing in my node it looks like this

i just want to remove this tool-tip when the data is not present in node this tool-tip should be hidden

There are several possibilities, depending on exactly what you want.

You could have the value of Node.visible be controlled by whether the TextBlock.text is the empty string or not:

      $(go.Node, . . .,
        {
          toolTip:
            $("ToolTip",
              new go.Binding("visible", "text", function(t) { return !!t; }).ofObject("TB"),
              $(go.TextBlock,
                { name: "TB", margin: 6 },
                new go.Binding("text"))
            )
        },
        . . .

Or you could use some other criteria that you can implement in a conversion function, depending directly on the data.

      $(go.Node, . . .,
        {
          toolTip:
            $("ToolTip",
              new go.Binding("visible", "", function(d) { return d.Error || d.PluginName; }),
              $(go.TextBlock,
                { name: "TB", margin: 6 },
                new go.Binding("text"))
            )
        },
        . . .

By the way, you should not be performing side-effects in your binding conversion function!