GithubHelp home page GithubHelp logo

gerhobbelt / d3-selection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from d3/d3-selection

0.0 1.0 0.0 693 KB

Transform the DOM by selecting elements and joining to data.

License: Other

JavaScript 100.00%

d3-selection's Introduction

d3-selection

This module implements the core concept of D3: manipulating the DOM by selecting elements and joining to data. This code is currently EXPERIMENTAL and represents the in-development D3 4.0 API. The 4.0 API is largely backwards-compatible, but differs from 3.x in several ways:

  • The implementation is now organized into ES6 modules, rather than the ad hoc concatentation used previously. A UMD build is provided using Esperanto, but feel free to roll your own.

  • The Selection class now extends Object, rather than Array. This obviates the need for prototype injection and direct property injection. Selections are now hierarchical, rather than having fixed two-level nesting. Accessor functions such as those accepted by selection.attr and selection.style can now refer to parent data and indexes if desired.

  • The selection.data method (when called with arguments) now modifies the current selection to be the update selection, rather than returning a new selection. The enter and exit selections are now empty prior to a data-join, rather than non-existant. The selection.data method (when called without arguments) now returns an array of data for all selected elements, not just the first group.

  • Enter selections no longer have a special subclass, and thus support all selection methods.

  • A new selection.nodes method returns an array of all selected elements.

  • The selection.append method now takes an optional before selector and replaces selection.insert. The selection.insert method is now deprecated. The selection.append method now inserts entering elements in data order by default when joining by key. (This assumes that new data is in the same order as old data; if not, use selection.order.) The selection.append method now moves, rather than copies, entering elements to the update selection.

  • The selection.classed method has been renamed selection.class. The old name is deprecated but preserved for backwards-compatibility.

  • The selection.on method has been renamed selection.event. The old name is deprecated but preserved for backwards-compatibility.

  • A new selection.dispatch method dispatches a custom event of the specified type to all selected elements. Think of it like jQuery’s trigger.

  • Multi-value map variants of selection.attr, selection.style, selection.property, selection.class and selection.on are now implemented as distinct methods in the d3-selection-multi plugin, rather than overloading the arguments. See #2109.

  • The d3.ns.prefix namespace map has been renamed to d3.namespaces and is now a Map rather than an object.

  • The d3.ns.qualify method has been renamed to d3.namespace.

  • Sizzle is no longer supported. It’s time.

d3-selection's People

Contributors

mbostock avatar

Watchers

 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.