Konva.js Blog

A tech blog giving usable explainers, advice, tools, tricks and techniques for the Konva.js JavaScript canvas library, the HTML5 canvas, and related subjects.

Konva - the Transformer and size conundrum

Konva - the Transformer and size conundrum

VanquishedWombat ― May 14, 2024

So what, you grabbed a transformer handle and stretched the rectangle and now you don't understand what gives with the width and height - they didn't change? You can see the freekin size changed but why are the width & height the same as before? Huh ? Ok, lets talk about it.

Konva Transformer
Konva - Clip Regions with Holes

Konva - Clip Regions with Holes

VanquishedWombat ― May 14, 2024

I needed to make a hole in an image so I took to Google and read up on Canvas and winding. Here's the result...

Konva Tricks ClipFunc
Konva - a class to quickly put random shapes on test layers

Konva - a class to quickly put random shapes on test layers

VanquishedWombat ― May 14, 2024

I was working on a minimap component and needed to generate a couple of layers with relatively random shapes - this is what I did...

Konva Tricks
HTML5 canvas - how to initially control scaling

HTML5 canvas - how to initially control scaling

VanquishedWombat ― May 14, 2024

So there I was, trying to place a new canvas element exactly over a Konva stage, which worked but the scaling was all wrong compared to the Konva output - what gives ?

Canvas Tricks
Konva - Rotating a rectangle to contain another

Konva - Rotating a rectangle to contain another

VanquishedWombat ― May 14, 2024

In this post I'll look at how to rotate and scale a rectangle so that it entirely covers the space it occupied before rotation. This is useful if you ever have to rotate an image without leaving gappy corners.

Konva Tricks
C# - A Require for ClearScript

C# - A Require for ClearScript

VanquishedWombat ― May 14, 2024

ClearScript is the C# scripting engine that can execute JavaScript inside a C# context. It's way smarter than that description suggests. But it does not provide a require (think 'code module loader') capability. So how about we make one...

ClearScript JavaScript
Konva - HTML5 Canvas viewport optimisation

Konva - HTML5 Canvas viewport optimisation

VanquishedWombat ― May 14, 2024

When trying to squeeze every last morsel of optimisation out of a canvas app, we need to be concerned about avoiding drawing anything we don't need to. This means anything that the user cannot possibly see should not be drawn. Lets take a look...

Konva Performance Tricks
Konva - no CSS selectors! What are the alternatives?

Konva - no CSS selectors! What are the alternatives?

VanquishedWombat ― May 14, 2024

If you are used to using CSS selectors to work on the HTML DOM and wondering if there is anything similar in Konva? You might have looked in the docs and not found anything you recognise. Let me take you through what Konva has to offer for selecting...

Konva CSS Selectors Tricks
Page 5 of 12
  • Home
  • About
  • Hire me
KonvaTricksJavaScriptCanvasTextTransformationsVitePerformanceLinePathCSSrichTextClipFuncTypeScriptAnimation
  • Sign up
© 2026 Konva.js Blog
Forma theme by Just Good Themes. Powered by Ghost.