I needed to use a string as a template in the vein of template literals, which turned out to be harder than expected. Here’s the solution…
Category Archives: Uncategorized
Vite : Build a lib & erase comments
I’m writing a JavaScript lib with TypeScript, using the excellent Vite for on-the-fly transpiling and packaging. This post is about the config I use and specifically covers removal of comments because I Googled for a solution but it wasn’t obvious so I’m writing about it here.
Konva – Flip an image in-place
Someone asked on the Discord channel about how to flip an image – the case related to artwork on a tee-shirt designer app. The Konva docs suggest setting scale to -1 but that comes with some complications. Here’s my workaround for that…
Konva – no automatic scrollbars – what?
After getting a few shapes onto the canvas, folks start wondering about how to make the canvas play nice with their UI and the subject of scrollbars emerges. Here are some thoughts on that…
Konva – Stage.draw is dead, you did know, right?
If you know about Stage.draw() and that you don’t need to worry about it any more, don’t read this – put your feet up and have some cake. If you are at all fuzzy on the subject, read on…
Konva – what I learned building rtx – a rich text editor for HTML5 canvas
So I spent some time building a rich text editor as a side project. Here’s some of what I learned which I’m sharing so you can avoid the bear traps and subsequent pain! Lets take a look…
Konva – rubber band selection
Using a click-drag-rect to select objects visually is a staple of graphics UX – this is one way to do it with Konva. Lets take a look…
Konva – Stage, Layer & Node snapshot and download
Getting snapshot images of the stage, layer and nodes is straightforward once you know a couple of tricks – here they are…
Konva – Group is not draggable from a click on its empty space – what gives?
So there you are with a shiny new group – with a couple of shapes added to it. Click-dragging either shape will move the Group, but click-dragging the empty space doesn’t – what gives ? So – by design, the Group does not have a hitFunc. What? Ok – so when the Konva engine isContinue reading “Konva – Group is not draggable from a click on its empty space – what gives?”
JavaScript – working with Emoji’s or the café problem
Working with non-English languages or emoji’s and finding that strings get garbled or just don’t add up? Let me try to explain why…