Comments (7)
I’ll investigate, but a word of caution: as the README says, this module is currently an experimental API and is likely to change before 4.0 is released. This module and d3-transition are likely to be the last of the 4.0 modules to be released (since, in some sense, they are the most important to get the API right). So I wouldn’t recommend using this module in production yet.
I am working on implementing the other modules first, so I can’t be as responsive fixing issues in the unreleased modules such as this one.
That said, it is a bug if the code is trying to set the length
of a NodeList, clearly. It should have arrayify’d the arrays first before mutating them.
from d3-selection.
Also, it looks like you’re trying to call selection.text on the enter selection before appending. That shouldn’t fail, but it also won’t have any effect because you’re setting the textContent
property of a placeholder node. You’ll want to say something like this instead:
selectAll('p')
.data(data)
.enter().append('p')
.text(d => d)
from d3-selection.
Sure thing, this isn't a production app, so no damage there. The new stuff is too tempting to leave alone though :)
Also, the example was thrown together, that's not app code, the failure is coming in data
, before it even hits the enter
section but I'll fix the example.
As far as I can tell, the enter
and exit
calls are arryifying the selection around emptyNode, but the update
call is simply this._root
, which is a NodeList.
I'm really looking forward to using this stuff in production, happy to help bugbash if that's in the cards.
from d3-selection.
Cool, just making sure. Another gotcha in your test case (probably unrelated to the bug) is that you didn’t select a node to append to, so your entering paragraph elements will get added to the document element rather than the body. The fix:
select('body').selectAll('p')
.data(data)
.enter().append('p')
.text(d => d);
from d3-selection.
Ah. Yeah in the app its a normal selection on a group of bar charts (similar to the crossfilter example). Works right if I leave d3.selectAll in there.
from d3-selection.
The bug is only exhibited when calling selection.data on a top-level (flat) selection, rather than one nested under a parent element. That typically never happens because you instead specify a parent to append to. But it shouldn’t fail. Fix incoming.
from d3-selection.
from d3-selection.
Related Issues (20)
- How to add passive listener into zoom event? HOT 1
- Proposal: add sample code for transitions into README docs HOT 1
- How to report type issues HOT 1
- d3.style('padding') or d3.style('margin') returned empty string only in firefox HOT 2
- Adopt InternMap for selection.data
- Stash the key used by the previous data-join HOT 2
- Raise an error when passing a `selection.data()` key that does not evaluate to a string. HOT 1
- Selection.one HOT 11
- Please provide your artifact as transpiled (CJS) code. HOT 3
- Enable the use of d3.join() without implicit d3.order() call HOT 3
- selection.appendAll HOT 3
- Is anyone working on D3.ts ? HOT 1
- chaining multiple transform styles to an element do not all get applied to the element HOT 1
- Proposal: Memoization Utility HOT 3
- Error: path attribute d expected number, on value with scientific notation HOT 2
- Chaining select has a side-effect on data HOT 1
- `pointer.js` function is not available for import through `d3-selection` HOT 8
- .attr on null selection should not error HOT 3
- Missing null check HOT 1
- Cannot import {pointer} function as it is not available to import HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-selection.