Open mkalus opened 3 years ago
I have the same issue with 9.1.0 only if shape === 'image'
These notes indicate the issue only occurs with shape 'image', but I appear to be able to reproduce this issue with the standard examples in GitHub Pages. https://visjs.github.io/vis-network/examples/network/data/dotLanguage/dotEdgeStyles.html
Any news about that issue? It's pretty bad and visible on first sight, why is this threat dead since august?
In the current documentation, there are two methods that can be used for drawing nodes. It's stated there that for covering edges you have to use the one called drawExternalLabel
, not drawNode
:
Note that for ctxRenderer
method to work the shape needs to be defined as custom
And an example of usage would be:
export const drawExternalLabel = (
{ ctx, x, y, style, label, state: { selected } }: CtxRenderMethodProps,
theme: Theme,
) => {
const LabelOffset = 0;
const width = 200;
ctx.lineWidth = 4;
ctx.strokeStyle = '#F7F8FB';
ctx.fillStyle = '#EBEBEB';
// box for label
ctx.beginPath();
ctx.roundRect(x - width / 2, y + style.size + LabelOffset, width, style.size, 5);
ctx.fill();
ctx.closePath();
// node label
ctx.font = '14px Raleway';
ctx.fillStyle = '#000';
ctx.fillText("Some text", x, y + style.size + LabelOffset, width);
};
And this is how it rendered (don't mind the number inside node, for this I used drawNode
):
I am relaying this issue to vis-network project: https://github.com/mkalus/segrada/issues/76
Possible duplicate of #883, #932, and #1037.
vis-netqwork version used is 9.1.0
It appears only if custom shapes (images) are used in the graph.
https://github.com/visjs/vis-network/pull/932#issuecomment-670961647 mentions a ctxRenderer function. Is this a possible solution and if yes, how can I use it? Looked into the documentation and did not find anything on it. Is customRenderer implemented already?