Giter Site home page Giter Site logo

d3demo's Introduction

d3官方文档:https://d3js.org/

一、深入理解Updata、Enter、Exit 地址:http://wiki.jikexueyuan.com/project/d3wiki/enterexit.html 1、有数据,而没有足够图形元素的时候:

svg.selectAll("rect") //选择svg内所有的矩形 .data(dataset) //绑定数组 .enter() //指定选择集的enter部分 .append("rect") //添加足够数量的矩形元素

2、如果数组为 [3, 6, 9, 12, 15],将此数组绑定到三个 p 元素的选择集上。 可以想象,会有两个数据没有元素与之对应,这时候 D3 会建立两个空的元素与数据对应,这 一部分就称为 Enter。而有元素与数据对应的部分称为 Update。如果数组为 [3],则会有两 个元素没有数据绑定,那么没有数据绑定的部分被称为 Exit。示意图如下所示。 image

d3demo's People

Contributors

slh8060 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.