Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between D3.js vs D3.min.js

What is the difference between D3.js and D3.min.js files? It seems enough to include only D3.min.js. What is D3.js for then?

Even http://d3js.org/ page suggests to get d3.min.js from internet and include into the body

<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>

When I extract downloaded zip from http://d3js.org/ i get both d3.js and d3.min.js

like image 607
Benas Avatar asked Jun 08 '15 13:06

Benas


People also ask

What is difference between .js and Min js files?

Normal “. js” is usually a file containing code with additional comments which explains what are specific method doing, what variable contains etc. “Min JS” (from “Minified”) is the same code but minified (“squashed”) to keep entire functionality taking minimum amount of space.

What is d3js used for?

js (also known as D3, short for Data-Driven Documents) is a JavaScript library for producing dynamic, interactive data visualizations in web browsers. It makes use of Scalable Vector Graphics (SVG), HTML5, and Cascading Style Sheets (CSS) standards. It is the successor to the earlier Protovis framework.

Is d3js still relevant?

The JavaScript ecosystem has completely changed during this time, in terms of libraries, best practices and even language features. Nevertheless, D3 is still here. And it's more popular than ever.

What is D3 v3 min js?

D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS.


2 Answers

The D3.min.js file is the compressed version of the code. Which means it's smaller and suitable for production - faster loading.

The uncompressed version of the file D3.js is the version you would use in development stage of your app. You can browse the code easier & most of the IDEs have the "go to the function definition" functionality which is almost impossible if you use the compressed version of the file.

Both files have the same functionality.

This applies to other javascript libraries out there in the Internet.

like image 95
Ivanka Todorova Avatar answered Sep 28 '22 17:09

Ivanka Todorova


  • D3.js -> Human readable (for dev environment)
  • D3.min.js -> Smaller size, faster loading (for production environment)
like image 26
2ehr Avatar answered Sep 28 '22 17:09

2ehr