("Path.country"). attr ("Class", "Country")//color the map block, the z-parameter of the function, which is the data object of the corresponding element (assigned by the data () function that was previously called). Style ("Fill ", function (z) {if (C.mapdisplaymode = =" Countries ") {//or for a specific length of time, data structure in data.min.jsvar y = MAPTIMEDATA[C.MAPSCOPE][C.MAPD Isplaymode][z.id].t;var x = d (y); Judging the color level return x} else {return c.mapoptions[c.mapdisplay
the SVG range of issues * * So, in the tutorial, all use this method */function Buildtip (data) {var t = "#tooltip"; Chinag.selectall ("path"). Data (data, function (d) {return d.id; }). On ("MouseOver", function (d) {d3.select (T). Style ("left", d3.e Vent.x + "px"). Style ("Top", D3.
technology.D3.js is an excellent data visualization library that allows us to quickly and easily transform data into graphics. However, before starting a follow-up tutorial, first of all, I hope you don't misunderstand d3.js:
D3.
D3 is currently a popular data visualization tool, through this article can have a preliminary understanding of D3. 1. What is D3? The full name of D3 is (Data-driven documents), as the name implies, is a data-driven document. Listen to the name a bit abstract, say simple, is actually a JavaScript function library, us
This demand is actually quite clear, but the online search out of the tutorial is a mess, feel really need to summarize their own.D3.js is now widely used in data visualization, and with the continued development of big data, the framework is expected to become more prevalent in the future (it is said that its author Mike Bostock began full-time development, previously in charge of the New York Times data v
)
.. attr(' height ', function(d) {
return - yscale(yaccessor(d));
})
You can put a constant or function in every attr, this time you use the scale, you give your scale a y-axis value of the parameter, he returned to you a corresponding length.The same x and y coordinates can be calculated as well.
. attr(' x ',function (d) {
return XScale(xaccessor(d));
})
. attr(' y ', function (d) {
return yscale(yaccessor(d));
})
If y
",function(d,i) {D3.select ( This). attr ("Fill", "Yellow"); }). On ("Mouseout",function(d,i) {D3.select ( This). Transition (). Duration (500). attr ("Fill", "Steelblue"); });...But this will cause an error, and it will show that on is not a functionthen I knew I should put the on event before transition () , but why did you do that now? ...//adding rectangles and text elements varrectpadding = 4; varRe
displayed. Intuitively, the function of the layout is to transform some data into another data, and the transformed data is beneficial to the visualization. Therefore, the tutorial on this site is called the layout "Data transformation."Of course, you can also follow the original word "layout" to understand, but also can be understood as "calculation", as long as you know the meaning.Thank you for reading.Document Information
Copyright Notic
The advanced series of tutorials has been completed and is hereby summarized.At the beginning of the month, I said the end of the advanced tutorial, today is the last day, can be done. O (∩_∩) o~As a result, the tutorials for the "Getting Started"-"advanced"-"premium" three series are complete. The purpose of this tutorial is to provide a network of free learning series, I hope you can enjoy.In the process
I. Methods of UseSince Textures.js is based on d3.js, d3.js files must be introduced and textures.min.js files introduced.Second, HTML structureThe HTML structure of the SVG pattern background is very simple, using an empty div element.Third, JavaScriptThe attr property selects the element to make the pattern backgroun
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.