is "essay" D3 difficult?

Source: Internet
Author: User

A lot of friends say learning D3 is very difficult. Why is it? Want to write an article analysis and analysis.


1. Background of the emergence of D3

D3.js is an open source project on Github for data visualization. The author is Mike Bostock, the New York Times engineer. Now the New York Times, all kinds of data News visualization chart, are based on D3 production.

Data news, is a very popular industry in recent years, in the Internet news, add vivid data analysis, in the form of graphic display, easy to understand.

Data news is emerging as the trend of the big data age. Companies and organizations are getting more data, such as Google's Petabyte search data, and Wal-Mart has global retail data. Such a large amount of data, in the past to deal with is unimaginable, most of the data has not been preserved, or saved is not valued, because the data too much processing.

However, now that the ability of computers has been greatly improved, the hardware base is no longer a problem, the use of big data to analyze problems naturally becomes a trend, so is now known as the Big Data age. For what big data is, see the article I summarized:

"The need for change in the big Data Age"

For the processing of large amounts of data, there are data acquisition, data analysis, data simplification and so on, as well as data visualization. Data visualization is the way that data is presented to the user. Excuse me, are you looking at the image comfortably, or are you looking at a bunch of numbers?

The D3 was born under this trend. Of course, there are a lot of visual libraries that are born with them, such as Processing.js, Echarts, and so on. However, D3 is definitely the leader in this field, and the analysis of the popularity of various JavaScript libraries can be read:

"A survey of the prevalence of JavaScript graphics libraries"


2. Advantages of D3

There are many libraries of visualizations, and there are many libraries based on JavaScript, what are the advantages of D3?

(1) data can be bound together with the DOM

D3 is able to bind data to the DOM, making the data and graphics a whole, i.e. there is data in the graph and there are graphs in the data. You can easily manipulate the data as you build or change the shape, and you can easily change the shape after the data has changed.

(2) data conversion and rendering is independent

Turning data into a chart requires a number of mathematical algorithms. A lot of visual libraries are done:

Provide a function drawpie (), enter the data, and draw the pie chart directly.

But the D3 approach is:

Provides a function computepie () that converts data into pie charts, and developers can use their favorite way to draw pie charts.

Although it seems that D3 makes the problem difficult, but when the chart requirements are more complex, the directly drawn pie chart often does not reach the requirements, the subtle parts can not be changed. D3, by separating the two, greatly increases the degree of freedom so that developers can even use other graphics libraries to display D3-computed data.

(3) Simple code

JQuery is a very popular library in web development, where chained syntax is used and is loved by many people. D3 also uses this syntax, which allows a function to set a function that makes the code very concise.

(4) large number of layouts

Pie, tree, package, matrix, and so on, D3 a large number of complex algorithms into a single "layout" for transforming data. Can be applied to the production of various charts.

(5) SVG-based, scaling without loss of precision

SVG, which is a scalable vector graphic. D3 is mostly drawn on SVG and provides a number of graphical generators that make it easy to generate graphics on SVG.

In addition, because SVG is a vector graph, zooming in and out will not have a loss of precision.


3. Is D3 difficult to learn?

D3 have so many advantages, so, D3 difficult to learn?

I have learned that many friends think D3 is difficult to learn.

I concluded that there are three reasons why D3 is difficult to learn:

(1) The official documents are not well written.

There are a number of examples of API information available on the website. However, each example of how to do is only code, no text description. Although the API has a description, but there are not too many examples of the use of functions. This is the beginning of the use of people feel big head.

(2) not easy to adapt to data conversion and draw separate patterns

A function, Drawpie (), input data, output drawing graphics, the General People's thinking mode is like this. However, D3 to separate the two, after the separation can bring great freedom, but also make it become a little difficult to learn.

(3) foreign language is not good

For most people, reading English documents is still a headache. Since I have mastered Japanese more skillfully, I have just started reading Japanese materials, so it is easier to get started. Chinese material should be said to be relatively scarce, but there has been some improvement recently. After all, it is relatively new things, slowly the data will be more up.

D3 at first glance, some difficult to learn, but once mastered, you can adapt to the production of a variety of charts, freedom is great, very strong function. Some people say that D3 is like Photoshop, the other library is like the United States 美图秀秀, the former needs a certain amount of time to learn, after learning in the image processing invincible, the latter does not need to study time, will and will not have too much value. This analogy may be a little exaggerated, and I have a better metaphor (inspired by Mr. Gu Hongming's article).

D3 is like writing brush words, other visual libraries are like writing pen words. Pen words easy to get started, writing simple, fast, write something called the article . Brush words need long-term training, the use of more difficult, but once mastered, can be flowing, the heart with thought, can go back, only in the nib, writing out of the things called art .

Thank you for reading.

Document Information
    • Copyright Notice: Attribution (by)-Non-commercial (NC)-No deduction (ND)
    • Published: April 28, 2015
    • More content: our D3. JS-Data Visualization special station and CSDN personal blog
    • Remark: This article is published in our D3. JS, reproduced please indicate the source, thank you

is "essay" D3 difficult?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.