MCPcopy Create free account
hub / github.com/idank/explainshell / d3_transitionNode

Function d3_transitionNode

explainshell/web/static/js/d3.v3.js:7355–7405  ·  view source on GitHub ↗
(node, i, id, inherit)

Source from the content-addressed store, hash-verified

7353 return d3_transition(subgroups, id1);
7354 };
7355 function d3_transitionNode(node, i, id, inherit) {
7356 var lock = node.__transition__ || (node.__transition__ = {
7357 active: 0,
7358 count: 0
7359 }), transition = lock[id];
7360 if (!transition) {
7361 var time = inherit.time;
7362 transition = lock[id] = {
7363 tween: new d3_Map(),
7364 event: d3.dispatch("start", "end"),
7365 time: time,
7366 ease: inherit.ease,
7367 delay: inherit.delay,
7368 duration: inherit.duration
7369 };
7370 ++lock.count;
7371 d3.timer(function(elapsed) {
7372 var d = node.__data__, ease = transition.ease, event = transition.event, delay = transition.delay, duration = transition.duration, tweened = [];
7373 return delay <= elapsed ? start(elapsed) : d3.timer(start, delay, time), 1;
7374 function start(elapsed) {
7375 if (lock.active > id) return stop();
7376 lock.active = id;
7377 event.start.call(node, d, i);
7378 transition.tween.forEach(function(key, value) {
7379 if (value = value.call(node, d, i)) {
7380 tweened.push(value);
7381 }
7382 });
7383 if (!tick(elapsed)) d3.timer(tick, 0, time);
7384 return 1;
7385 }
7386 function tick(elapsed) {
7387 if (lock.active !== id) return stop();
7388 var t = (elapsed - delay) / duration, e = ease(t), n = tweened.length;
7389 while (n > 0) {
7390 tweened[--n].call(node, e);
7391 }
7392 if (t >= 1) {
7393 stop();
7394 event.end.call(node, d, i);
7395 return 1;
7396 }
7397 }
7398 function stop() {
7399 if (--lock.count) delete lock[id]; else delete node.__transition__;
7400 return 1;
7401 }
7402 }, 0, time);
7403 return transition;
7404 }
7405 }
7406 d3.svg.axis = function() {
7407 var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, tickMajorSize = 6, tickMinorSize = 6, tickEndSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_, tickSubdivide = 0;
7408 function axis(g) {

Callers 1

d3.v3.jsFile · 0.85

Calls 1

startFunction · 0.85

Tested by

no test coverage detected