[D3.js entry series, d3.js entry series

Source: Internet
Author: User

[D3.js entry series, d3.js entry series

My personal blog is: www.ourd3js.com

The csdn blog is blog.csdn.net/lzhlzz.

Please indicate the source for reprinting. Thank you.

Pack is used to contain the relationship with the object to be included. It also indicates the weight of each object. A circle is usually used to represent the former, and the circle is used to represent the latter.

First read the data used in this section: city2.json

This is the relationship data of cities. Now we need to use layout of D3 to convert data and make it easy to visualize.

var pack = d3.layout.pack()    .size([ width, height ])    .radius(20);
The pack function is defined above. size () is the size of the converted data, that is, the (x, y) of the converted vertex will be within this size range. Radius is used to set the radius of the smallest circle after conversion. Next, read the json file and provide the file content to the pack function for data conversion.
d3.json("city2.json", function(error, root) {var nodes = pack.nodes(root);var links = pack.links(nodes);console.log(nodes);console.log(links);}
The above pack is used to convert the data into vertex nodes and link links. The console. log in the next two sentences is used to output the converted data. Let's see what the data is converted.

The above figure shows the content of vertex nodes. After the data is converted, the depth information (depth), radius (r), and coordinate position (x, y) are added). I didn't post a links image, because we didn't draw lines in this section. No matter what layout is used to convert data, we must first check what the converted data is and then draw the data. Otherwise, errors may occur. The content we want to draw includes circles and texts, all of which are drawn in SVG. The Code is as follows:
svg.selectAll("circle").data(nodes).enter().append("circle").attr("fill","rgb(31, 119, 180)").attr("fill-opacity","0.4").attr("cx",function(d){return d.x;}).attr("cy",function(d){return d.y;}).attr("r",function(d){return d.r;}).on("mouseover",function(d,i){d3.select(this).attr("fill","yellow");}).on("mouseout",function(d,i){d3.select(this).attr("fill","rgb(31, 119, 180)");});
This is the code for drawing circles. I have read the previous sections and I am very familiar with them.
The result is as follows:
Mouse operation content, please click the following link to try: http://www.ourd3js.com/demo/pack.html complete code, right-click the browser to view.


What is the difference between the initial series and the getting-started series of the battle King hurricane soul?

There are only two models in the entry series, and the attack rings are rubber. They can be used normally, but the effect is poor. Very cheap 10 ~ RMB 30
There are four initial series, RFID chip in the Ares cover, and the attack ring is made of zinc alloy. The effect is good and the attack is strong. Moderate price 50 ~ 80 RMB.
If you want to discuss the tornado storm, continue to ask me or talk to me.

OllyDBG entry series (III)-who has the function reference attachment? To

Now go to the third article. This article focuses on how to use the function reference (Name Reference) function in OllyDBG. Still select a crackme named CrackHead in the crackmes.cjb.net image package. Old Rules: run this program first to see:

Oh, I couldn't find the place to enter the registration code! Click the "Shit" menu on the program. Select "Try It" from the drop-down menu and the following interface will be displayed:

Let's click the "Check It" button and try It. Oh, no response! I try again "78787878", but I still don't respond. Try again and enter letters or other characters. This determines that the registration code should be a number. Only the correct registration code can be entered. PEiD is used to check whether the result is MASM32/TASM32. No wonder the program is small. Information collection is almost done. Now we turn off this program. We load it with OllyDBG, press the F9 key to run it directly, and click the menu shown above in sequence, display the program to the second figure above. The "Check It" button is retained. Now we don't have any strings for reference. We just need to break down the API function to interrupt the debugging program where we want it to be. In the Disassembly window of OllyDBG, right-click and choose search> name (TAG) in the current module in the pop-up menu ), or we can achieve the same effect by pressing the CTR + N key combination (note that the OllyDBG must ensure that it is in the airspace of the currently debugged program, I have introduced the concept of airspace in the first article. For example, when I debug this program, the title bar of OllyDBG displays "[CPU-main thread, module-CrackHea]". this indicates that we are currently in the airspace of the program being debugged ). After the preceding operations, a dialog box is displayed,

For a program that enters the registration code in such an editing box, we need to set the preferred API function for the breakpoint to GetDlgItemText and GetWindowText. Each function has two versions. One is the ASCII version, and the other is the UNICODE version. For example, GetDlgItemTextW. Programs compiled into the UNCODE version may not run under Win98, because Win98 is not a system that fully supports UNICODE. The NT system supports UNICODE from the underlying layer. It can convert strings in the operating system and support calling functions of ASCII and UNICODE versions. Generally, the programs we open are called ASCII functions, ending with ". I ran the question again. Now let's go back to the program we are debugging. Now we are looking for information about whether the program we are debugging has called the GetDlgItemTextA or GetWindowTextA function. Fortunately, find a GetWindowTextA. Right-click the function and select "Set breakpoint on each reference" in the pop-up menu. We will see "2 breakpoints have been set" in the bottom status bar of the OllyDBG window ". Another method is to right-click the GetWindowTextA function and select "Search for input function reference" (or press Enter) in the pop-up menu. The following dialog box is displayed:

You can set both of them to a breakpoint. This program only needs to set a breakpoint in the first command. Okay. Now, the first method we mentioned above is to set a breakpoint for each reference. In this way, the two Commands will set a breakpoint. After the breakpoint is set, we go to the program we are debugging. Now we click the "Check It" button on the program we are debugging and It is broken by OllyDBG:

00401323 |. E8 4C010000 CALL ...... remaining full text>

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.