Hmm... I figured out that the solution does not fit the requirements I have.
I tried adding rectangles to the canvas as a replacement for a div. The code is as follows:
var canvas: HTMLCanvasElement = document.getElementById('diagram') as HTMLCanvasElement;
var ctx: CanvasRenderingContext2D = canvas.getContext('2d');
ctx.fillStyle = "#FF0000"
ctx.fillRect(0, 0, canvas.width * 0.2, canvas.height);
But the rectangle is not shown. Is it even possible to manipúlate the canvas element without using mindfusion specific methods?
Edit: I just use ShapeNodes instead of drawing rectangles by my own. It works, but not as expected. The rectangles are ways too big.
When summing up the widths of the rectangles, then it should be the same width as the canvas' width. And the canvas' width is the same than the wrapping div's width.
var firstRect= new MindFusion.Drawing.Rect(0, 0, canvas.width * 0.2, canvas.height);
Im creating the bounds as given above. The width of the first rectangle should be 1/5 of the canvas width, but in real it's like 1/3. Changing the measurement unit has an effect, but none choice gives me the expected result.
Seems like I'm doing something or do I miss a conversion?