MCPcopy Create free account
hub / github.com/breck7/scroll / tweenFunction

Function tweenFunction

external/.d3.js:4372–4395  ·  view source on GitHub ↗
(id, name, value)

Source from the content-addressed store, hash-verified

4370}
4371
4372function tweenFunction(id, name, value) {
4373 var tween0, tween1;
4374 if (typeof value !== "function") throw new Error;
4375 return function() {
4376 var schedule = set(this, id),
4377 tween = schedule.tween;
4378
4379 // If this node shared tween with the previous node,
4380 // just assign the updated shared tween and we’re done!
4381 // Otherwise, copy-on-write.
4382 if (tween !== tween0) {
4383 tween1 = (tween0 = tween).slice();
4384 for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {
4385 if (tween1[i].name === name) {
4386 tween1[i] = t;
4387 break;
4388 }
4389 }
4390 if (i === n) tween1.push(t);
4391 }
4392
4393 schedule.tween = tween1;
4394 };
4395}
4396
4397function transition_tween(name, value) {
4398 var id = this._id;

Callers

nothing calls this directly

Calls 2

setFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected