VijsJS: Make "Node Dimensions" match node shape in ctxRenderer?

34 Views Asked by At

Having trouble finding info on this.

I'm using a custom shape for my VisJS Vis-Network nodes using the "custom" shape property and ctxRenderer Function similar to as specified here https://visjs.github.io/vis-network/docs/network/nodes.html

My custom shape is just a rectangle rotated about its center, made by ctx.rotate... and then ctx.fillRect(....).

The problem is that the "nodeDimensions" (nodeDimensions: { width, height }), which is the hit-box that detects clicks on the node, specified in the ctxRenderer function only seems to allow for rectangles using width and height- is there a way to define nodeDimensions so that i can match the actual shape specified above (a rotated rectangle)? diagram of nodeDimensions and it not matching the nodeShape

Or hell, is there a way i can just rotate a node without drawing a special shape lol. thanks! Also no, i don't want the node click box to be a giant unrotated rectangle that fits the rotated rectangle

can't find any info/documentation on nodeDimensions.

0

There are 0 best solutions below