js/d3.min.js
by Sohaib Nehal
通过Sohaib Nehal
在5分钟内学习D3.js (Learn D3.js in 5 minutes)
创建数据可视表示的简介 (An introduction to creating visual representations of your data)
D3.js is a JavaScript library used to manipulate documents based on data. It uses HTML, CSS, and SVG to create visual representations of data which can be viewed on any modern browser.
D3.js是一个JavaScript库,用于根据数据处理文档。 它使用HTML,CSS和SVG创建可以在任何现代浏览器上查看的数据的可视表示形式。
It also provides some awesome features for interactions and animations.
它还为交互和动画提供了一些很棒的功能。
In this tutorial, we will explore the basic concepts and features of D3.js. We’ll learn how to use it with the help of few examples like rendering a bar chart, rendering HTML and SVG elements, and applying transformations and events to them.
在本教程中,我们将探讨D3.js的基本概念和功能。 我们将在几个示例的帮助下学习如何使用它,例如渲染条形图,渲染HTML和SVG元素以及对其应用转换和事件。
We’ve also created a free 10-part course on D3.js on Scrimba. Check it out here.
我们还在Scrimba上的D3.js上创建了免费的10部分课程。 在这里查看。
D3入门 (Getting started with D3)
As D3.js is a JavaScript library, you can simply include it in your HTML file inside a script tag.
由于D3.js是JavaScript库,因此您只需将其包含在HTML文件中的script标签内即可。
<script src='https://d3js.org/d3.v4.min.js'><;/script>
The full source and tests are also available for download on GitHub.
DOM选择 (DOM Selection)
Using D3.js, we can manipulate the Document Object Model (DOM), meaning we can select elements and apply various transformations on them.