flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
78
BACK_BACK/node_modules/d3-transition/src/transition/attr.js
generated
vendored
Executable file
78
BACK_BACK/node_modules/d3-transition/src/transition/attr.js
generated
vendored
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
import {interpolateTransformSvg as interpolateTransform} from "d3-interpolate";
|
||||
import {namespace} from "d3-selection";
|
||||
import {tweenValue} from "./tween.js";
|
||||
import interpolate from "./interpolate.js";
|
||||
|
||||
function attrRemove(name) {
|
||||
return function() {
|
||||
this.removeAttribute(name);
|
||||
};
|
||||
}
|
||||
|
||||
function attrRemoveNS(fullname) {
|
||||
return function() {
|
||||
this.removeAttributeNS(fullname.space, fullname.local);
|
||||
};
|
||||
}
|
||||
|
||||
function attrConstant(name, interpolate, value1) {
|
||||
var string00,
|
||||
string1 = value1 + "",
|
||||
interpolate0;
|
||||
return function() {
|
||||
var string0 = this.getAttribute(name);
|
||||
return string0 === string1 ? null
|
||||
: string0 === string00 ? interpolate0
|
||||
: interpolate0 = interpolate(string00 = string0, value1);
|
||||
};
|
||||
}
|
||||
|
||||
function attrConstantNS(fullname, interpolate, value1) {
|
||||
var string00,
|
||||
string1 = value1 + "",
|
||||
interpolate0;
|
||||
return function() {
|
||||
var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
||||
return string0 === string1 ? null
|
||||
: string0 === string00 ? interpolate0
|
||||
: interpolate0 = interpolate(string00 = string0, value1);
|
||||
};
|
||||
}
|
||||
|
||||
function attrFunction(name, interpolate, value) {
|
||||
var string00,
|
||||
string10,
|
||||
interpolate0;
|
||||
return function() {
|
||||
var string0, value1 = value(this), string1;
|
||||
if (value1 == null) return void this.removeAttribute(name);
|
||||
string0 = this.getAttribute(name);
|
||||
string1 = value1 + "";
|
||||
return string0 === string1 ? null
|
||||
: string0 === string00 && string1 === string10 ? interpolate0
|
||||
: (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
||||
};
|
||||
}
|
||||
|
||||
function attrFunctionNS(fullname, interpolate, value) {
|
||||
var string00,
|
||||
string10,
|
||||
interpolate0;
|
||||
return function() {
|
||||
var string0, value1 = value(this), string1;
|
||||
if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
|
||||
string0 = this.getAttributeNS(fullname.space, fullname.local);
|
||||
string1 = value1 + "";
|
||||
return string0 === string1 ? null
|
||||
: string0 === string00 && string1 === string10 ? interpolate0
|
||||
: (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
||||
};
|
||||
}
|
||||
|
||||
export default function(name, value) {
|
||||
var fullname = namespace(name), i = fullname === "transform" ? interpolateTransform : interpolate;
|
||||
return this.attrTween(name, typeof value === "function"
|
||||
? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value))
|
||||
: value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)
|
||||
: (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue