blowfish/node_modules/d3-transition/src/transition/duration.js
2023-01-29 22:30:24 +00:00

23 lines
531 B
JavaScript

import {get, set} from "./schedule.js";
function durationFunction(id, value) {
return function() {
set(this, id).duration = +value.apply(this, arguments);
};
}
function durationConstant(id, value) {
return value = +value, function() {
set(this, id).duration = value;
};
}
export default function(value) {
var id = this._id;
return arguments.length
? this.each((typeof value === "function"
? durationFunction
: durationConstant)(id, value))
: get(this.node(), id).duration;
}