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

  • Home
  • SEARCH
  • 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 7782385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:31:37+00:00 2026-06-01T19:31:37+00:00

Quick question about data joining. Say I have some elements that each contain a

  • 0

Quick question about data joining. Say I have some elements that each contain a . When I initially join the data to the , it is automatically inherited by the elements I append to the enter selection.

When the data is changed and I rebind it to I was expecting that the elements would pick up the new data but this didn’t happen.

To handle this I needed to explicitly rebind the data at the lower level like this:

gElements.selectAll("circle")
    .data(function(d) { return [d]; }
    .enter().append("circle");

This handles both the creation case and the subsequent re-bind. But it seems kind of redundant as returning [d] is essentially what happens automatically with the initial inheritance of data from the parent element.

Is this approach the right way to handle this, or am I getting confused somewhere here?

  • 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-01T19:31:38+00:00Added an answer on June 1, 2026 at 7:31 pm

    When you bind data to elements via selection.data, it updates the data bound to those elements. However, it does not automatically propagate the new data to descendent elements; you must do this yourself.

    When you call selection.select, which is counterpart to selection.append, data from the parent is bound to the selected child for each selected element. When you call selection.selectAll, data is not bound, so you must subsequently call selection.data to bind new data to children.

    It’s difficult to answer your question without seeing more context. If you have updated the data on gElements, and each G element contains one circle, you can propagate the data from parent G to child circle using selection.select:

    gElements.select("circle");
    

    The code snippet you wrote would be used only if you want to create one new circle, if the circle is missing. This is described in Thinking with Joins. The exact code that you would write might depend on whether it is going to be executed on both enter and update, or just on update.

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

Sidebar

Related Questions

Quick question about include/requre_once . I have some code that is common to a
Just a quick question about best practice in MVC development. Let's say that I've
A quick question about saving data in symfony 2. I have this method (just
I have a quick question about how to serve data from a repository in
I have a quick question about fetching results from a weakly typed cursor and
I just have a quick question about how to get the length of a
Quick question about CI. I have a view with a form, several text input
Folks, I had a quick question about Amazon EC2, I have been recently using
Quick question/clarification required here. I have a DB table that will quite possibly have
I have a quick question about a preg_replace problem I have. I am just

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.