I've encountered an issue using code written inside livecoding_io outside the livecoding_io environment.
I made my own modification of the "D3:particles" example, using rectangles rather than circles, which can be found here:
But when I copied the exact code into JSFiddle, I got just the SVG body, and no rectangles:
Since JSFiddle doesn't give me a console log to see what's going on, I next put the code into a testing server on my laptop, then used Google Chrome's console log.
It showed this error: Uncaught ReferenceError: $ is not defined
on the line of code:
var w = $('svg').width(), ]
How would I need to modify the code to make it work outside the
livecoding.io environment, and why?