I've got an mxGraph that has very small vertices, in terms of their label, because it starts with 1, 2, 3. The default size of those less-than-10 vertices is too small for a tooltip rollover. How can I set the minimum size of vertices so I get some extra width on the smallest ones and tooltips will be fired on rollovers?
Asked
Active
Viewed 575 times
0
-
I don't want to replace the user class of the mxCell itself, since it is representing a specific Node class that I use in my pan-genomic graph applications. Node.toString() gives its ID. – Sam Hokin Jan 02 '20 at 13:55
-
And I have a zoom feature so one CAN zoom in and see the tooltip; but I'd really like the rollovers to work at the default size, which is a pretty nice size overall and tooltips work fine on nodes>9. – Sam Hokin Jan 02 '20 at 13:57
1 Answers
1
2 options.
You can set the size of a mxCell with the "geometry", or you look at Style.
You can register as many custom styles as you need. Refer to this example : https://jgraph.github.io/mxgraph/javascript/examples/stylesheet.html
for a vertex, pseudo code would look like this :
var defaultVertexStyle = this.getDefaultVertexStyle(); // "this" is mxStyleSheet
var myCustomStyle = defaultVertexStyle.clone();
myCustomStyle["width"] = 100px;
this.putCellStyle("myStyle", myCustomStyle);
and then you can add "myStyle" to any cell you want. You can customize shape, color, everything.

Colin Claverie
- 789
- 9
- 11