Files
blowfish/node_modules/d3-transition/src/transition/text.js
Nuno Coração 5fb4bd8083 config redirect
2023-01-29 22:30:24 +00:00

21 lines
476 B
JavaScript

import {tweenValue} from "./tween.js";
function textConstant(value) {
return function() {
this.textContent = value;
};
}
function textFunction(value) {
return function() {
var value1 = value(this);
this.textContent = value1 == null ? "" : value1;
};
}
export default function(value) {
return this.tween("text", typeof value === "function"
? textFunction(tweenValue(this, "text", value))
: textConstant(value == null ? "" : value + ""));
}