I'm just concerned about speed. Diffing works ok for forms but charts with 1000s of elements... let's see.
As someone who has worked with D3 and React a lot, D4 makes a lot of sense.
And the name is great!
- vs -
Declaring 'how' this structure is created
selection.enter().append("div").attr("class", "bar") .style("height", function(d){ return d + "px"; }) .style(“margin-top”, function(d){ return (100 — d) + "px"; });
enter is not imperative, but what you write just afterwards is.
It's an active verb and seems to imply an imperative style. Except it's actually declarative. The problem with d3 is that it takes a declarative system and gives it an imperative-looking API.
If I write "node.enter()" it definitely looks like I'm making the node is being made to enter if you aren't well-versed in d3.
The problem with "enter" is that nothing will happen if you simply use enter by itself. Yet it's an active verb which seems to imply that something will be made to enter.
But you still "SELECT" something to look at. A SELECT statement is, by itself, sufficient to get something to happen (for results to be fetched).
On the other hand, a D3 enter() does absolutely nothing by itself. You must do further calls for it to have any impact.
This is very off topic and ridiculous.
SELECT * FROM stuff WHERE thing=2
Of course you can't. Because every declarative process has two main steps: declare and execute. SELECT and enter() both only declare; they must then be executed against data in an engine to produce a result.