Giter Site home page Giter Site logo

Comments (1)

mbostock avatar mbostock commented on August 29, 2024

If you want to use this module, you just need to add this to your index.js:

import "d3-selection-multi";

However, you must make sure that the version of d3-selection-multi you’re using is compatible with the version of d3-selection you’re using. The latest d3-selection version is 0.7, and assuming you want that, you’ll need d3-selection-multi 0.2.10, which I just released. (If they’re not compatible, then d3-selection-multi uses its own internal version of d3-selection, and you’ll get duplicate code.)

Back to the issue at hand, I think returning maps is probably a bad idea because they would be expensive to compute. It might be reasonable for attributes, which are defined explicitly for each node, but it would be a very large set of values for styles or properties. For example, on d3js.org getComputedStyle(document.body).length returns 262. Similarly, size = 0; for (var property in document.body) ++size is 222, though if you ignore properties defined on the prototype chain, it is zero. I suppose if you restricted it to only directly-assigned styles and directly-assigned properties it might be more reasonable, but then the problem is it wouldn’t be consistent with the getter mode of selection.style (which is returns the computed style) and selection.property (which includes inherited properties).

from d3-selection-multi.

Related Issues (16)

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.