D3.js chart embedding
This is a simple post to see if it’s possible to embed d3.js chart easily with Hugo.
Mitchell’s best-candidate algorithm generates a new random sample by creating k candidate samples and picking the best of k. Here the “best” sample is defined as the sample that is farthest away from previous samples. The algorithm approximates Poisson-disc sampling, producing a much more natural appearance (better blue noise spectral characteristics) than uniform random sampling.
Sourcecode hereTo embed this script I had to create a shortcodes in the themes/academic/layouts/shortcodes/ folder. The generated svg was wider than the article container so I had to change it in the code.
At the moment I still have to experiment with Hugo shortcodes in order to automate d3.js charts embedding in posts, and how to change post width.
sudo shutdown -h now