Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

勘误表 #1

Open
tianxuzhang opened this issue Apr 23, 2016 · 3 comments
Open

勘误表 #1

tianxuzhang opened this issue Apr 23, 2016 · 3 comments

Comments

@tianxuzhang
Copy link
Owner

tianxuzhang commented Apr 23, 2016

  • 1.4.1
    • 错误:“例如,使用期望值是0,标准差是1的正态分布..."
    • 更正:例如,使用期望值是**0.5,标准差是0.1**的正态分布...
    • 说明:文字表述与代码和图统一
@tianxuzhang
Copy link
Owner Author

tianxuzhang commented Jul 10, 2016

  • 6.1.4

    • 错误:
      图6.2对应的代码有误。
    • 更正:实现方式改成Canvas的写法
    d3.json("china.json", function(error, china) {
        context.beginPath();
        path(china);
        context.stroke();
        context.fillStyle = 'steelblue';
        context.fill();
        context.closePath();
    
    });
    • 美化:给地图上色
    var color = d3.scale.category20();
    d3.json("china.json", function(error, china) {
        for (var i = china.features.length - 1; i >= 0; i--) {
            context.beginPath();
            path(china.features[i]);
            context.fillStyle = color(i);
            context.fill();
            context.closePath();
        };
    
    });
    • 说明:
      代码d3-api-demo/geo/path/path.context.html中路径函数path已经指定渲染方式是Canvas了,所以使用path(feature)方式就可以渲染成Canvas。

@tianxuzhang
Copy link
Owner Author

  • 1.1.2
    • 错误:$("body")[0][0]
    • 更正:$("body")[0]
    • 说明:d3.select(node)这个方法的入参是个DOM对象。所以与第三方库例如JQuery整合的时候,可以把JQuery包装的对象还原的DOM对象作为这个方法的入参。

感谢网友盾钮指正。

@tianxuzhang
Copy link
Owner Author

在2.6.3 节

quantileScale.invertExtent('c'); // 返回[4, 5.5] 
quantileScale.invertExtent('d'); // 返回[5.5, 12]

正确的应该是

quantileScale.invertExtent('c'); // 返回[4, 8] 
quantileScale.invertExtent('d'); // 返回[8, 12]

感谢网友龚友诚指正。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant