A simple visual element generation example with D3.js

D3.js is a wonderful JavaScript visualization library. In this simple example, however, we are generating some color-filled bars of random widths by using the following methods from D3,

Basically, we are showing how D3 methods can be used to generate DOM elements (on the fly) to visually encode information.

Click on the button below to generate some random color filled bars!