Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

JavaScript code for an animated chart diagram

I am trying to understand a JavaScript code.
Please find the whole code on this codepen website.
I cannot determine where the variable d3 is defined.

This variable is used in many places in the code, for example in let svg = d3.select('.chart-wrapper').append('svg').

Could someone please tell me where this variable comes from?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The global object of the D3.js library is d3.

D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.

  1. Click the "Settings" icon to see the JavaScript settings in CodePen.

enter image description here

  1. Check the "Add External Scripts/Pens" field to see the CDN references added to the project.

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading