Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8494507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:19:03+00:00 2026-06-10T23:19:03+00:00

What exactly does extra select() on enter() selection do and why does it not

  • 0

What exactly does extra select() on enter() selection do and why does it not have selectAll()?

Now here I am probably supposed to post more text to “meet your quality standards”, but I am quite sure the question is precise enough and hopefully not too stupid. I spent few days reading through various d3 tutorials and docs, and this part still escaped from me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:19:04+00:00Added an answer on June 10, 2026 at 11:19 pm

    Calling select on the enter selection is rare; it is much more common to use append or insert instead. Yet the end result of all three of these methods is the same: it specifies how to instantiate elements in the enter selection.

    When you perform a data-join, three new selections are returned:

    • the update selection: selected elements that correspond to the data
    • the exit selection: any leftover elements (no corresponding data)
    • the enter selection: any leftover data (no corresponding elements)

    Since the enter selection is leftover data, there are by definition no corresponding elements. The enter selection thus initially contains placeholder nodes which you must instantiate into proper elements. You almost never see these nodes because you immediately tell D3 how to create the missing elements, typically by calling append or insert. These methods create new elements and insert them into the DOM. (The parent node is determined by the previous select, as described in the nested selections tutorial.)

    In rare cases, you might want to do something beyond the standard append or insert for instantiating entering nodes. For example, the standard append method always creates elements of the same name (such as “div” or “rect”). If you wanted to specify the name dynamically, you could use select instead and pass in a function to create the new elements (as discussed in this thread in the d3-js mailing list):

    enterSelection.select(function(d) {
      return this.appendChild(document.createElement(d.name));
    });
    

    In fact, if you look at how append is implemented, you’ll see that it’s just a wrapper on top of select. A slightly simplified implementation is:

    d3.selection.prototype.append = function(name) {
      return this.select(function() {
        return this.appendChild(document.createElement(name));
      });
    };
    

    These example implementations are simplified because they don’t deal with namespaced SVG elements. For this reason it’s easier to use the built-in methods, and these examples are solely to explain how D3 works internally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a function void myFun(int*) In C++ what exactly does the following
I have a form in which the Submit button does not sit within the
How exactly does adding a random number to the end of an AJAX server
What exactly does SignedCookieJar do? And what is the difference from that and using
What exactly does putting extern C into C++ code do? For example: extern C
What exactly does a mobile need to be able to run JavaFX? Can it
What exactly does a finally block in exception handling perform?
What exactly does the Objective-C garbage collector collect? For example, if I'm writing a
What exactly does execve() do? I've tried looking at the documentation (http://linux.die.net/man/2/execve) but given
I was wondering how exactly does TCP implement in-order delivery. lets say this is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.