Tooltip and Zooming

Hi there.

When zooming the diagram in or out, the tooltips (in the Adornment) stays the same size.

This causes the issue that when afterwards the user moves the mouse over the nodes, and the tooltips appear, they don’t scale up with the rest of the diagram and look wierd.

I’ve searched your website and the examples, and found no solution.

Please - any idea?

Tooltips and context menus are automatically scaled such that they maintain the same apparent size, no matter the Diagram.scale.

Could you show screenshots before and after, and could you describe how “they don’t scale up with the rest of the diagram and look weird”?

Hi
Thanks for replying.

That’s the diagram with the default scaling, and the tooltip looks in the size we want it:

If I’ll zoom in or out when the tooltip is shown then you are right.

But if I’m taking my mouse curser out of the node and the tooltip disappers, and then I zoom in/out. Then when I’ll put my mouse curser again in the node and the tooltip will be displayed again, the tooltip won’t scale up with the rest of the diagram. As in the below picture, you can see it is much smaller than the rest of the diagram:

Is there a way it can act as if it was displayed and still scale up with the rest of the diagram?

Thanks!

That is easy to implement by overriding ToolManager.showToolTip:

    var mgr = myDiagram.toolManager;
    mgr.showToolTip = function(tt, obj) {
        go.ToolManager.prototype.showToolTip.call(mgr, tt, obj);
        tt.scale = 1;
    };

Works great!

Thank you very much!