Code and Music

Today was spent on a little bit of code and a little bit of music making. I studied more D3 and ported by force directed graph into React. I ran into an issue in React where the D3 select method was not able to grab an HTML element (an SVG) before the component had mounted, as intended. I used a ref to access the element through a useEffect hook so that the SVG would be accessible after the component mounted. I then specified the parameters of the nodes, lines, and text items. Afterwards, I called a method that encapsulated the D3 logic that rendered the visualization. Success! I briefly read that this is not the correct way to do this, but that's for another day. Little victories, right?

I messed around with some synthesizer stuff and created a lil' ditty. Other than that, today was low-key.

attachment (3).jpeg

more blogs

copyright © 2022 Albert Padilla all rights reserved