Programming fads are cyclical. If you have been around long enough, you will have seen this repeatedly. AI reminds me of the emergence of the web/browser. Just like with dot-com, there will be disruption, a bubble, and consolidation. AI however is not going away.
One of the interesting effects that chat normalized is a streaming flow of text as a response. This is done to alter perceived performance of the otherwise slow LLM inference process. Here is a Netlify function in JavaScript to invoke the OpenAI API and stream the results.
Many developers are experiencing stages of grief around AI. I think this is in part due to the realization that we are blue collar workers, not professionals. No board exam is needed to be a developer. We are not doctors or lawyers, even if our work environment may look similar.
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.