Kevin Hoyt · Notes

Dispatches from development and design.

Handling the click event is common in web development. Tablets and phones, do not technically have click but will respond to the event at the end of a touch. Capturing touchstart can lead to improved perceived performance on these devices. Here is how to handle both.

When creating charts you will often find it useful to convert a value from the data to a pixel value. Take a value in one range, and convert it to a value in another range. This is called a linear map function. Useful for microcontroller projects as well (esp. analog sensors).

We have historically built user interfaces with point and click in mind. This was necessary as it was the only way to expose complex processes to the customer. With AI, chat is the UI - especially when enriched with supporting forms, charts, etc. No more learning a new UI.

Given that you often want to label an SVG chart, you can set alignment-baseline and text-anchor on a text element to get fine-grained control. Setting both to middle will make the anchor the center of the element. Useful to adjust on charts with spokes such as radar.