- Analytic Engine
- May 18, 2009
-
not the analytical engine
|
The future of webpages:
<html>
<head>
<script getD3 />
</head>
<body>
<script buildSinglePageAppWithD3 />
</body>
</html>
|
#
?
Nov 28, 2017 11:26
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
?
Apr 28, 2024 22:26
|
|
- du -hast
- Mar 12, 2003
-
BEHEAD THOSE WHO INSULT GENTOO
|
why did you make this thread.
|
#
?
Nov 28, 2017 16:46
|
|
- akadajet
- Sep 14, 2003
-
|
who the gently caress uses d3 as a spa framework?
gas
|
#
?
Nov 28, 2017 17:18
|
|
- Analytic Engine
- May 18, 2009
-
not the analytical engine
|
why did you make this thread.
who the gently caress uses d3 as a spa framework?
gas
I’m just spreading the good word about the General Update Pattern of Saint Bostock. Enter, Update, Exit, my brothers.
code:var tDuration = 500;
var tEase = d3.easeCubicInOut;
var body = d3.select('body');
var elemClass1Data = [{...}, {...}, ...];
var elemClass1s = body.selectAll('elem.class1')
.data(elemClass1Data);
elemClass1s = elemClass1s.enter().append('elem')
.classed('class1', true)
.attr('attr1', function(d) { return ...; }) // initial attr 1
.style('style1', function(d) { return ...; }) // initial style 1
.on('event1', function(d) { return ...; }) // event handler 1
.merge(elemClass1s);
elemClass1s
.transition().duration(tDuration).ease(tEase)
.attr('attr1', function(d) { return ...; }) // updated attr 1
.style('style1', function(d) { return ...; }); // updated style 1
elemClass1s.exit()
.transition().duration(tDuration).ease(tEase)
.style('opacity', 0)
.remove();
React.js is cool too, he can render the boring non-SVG non-Canvas stuff.
|
#
?
Nov 29, 2017 06:03
|
|