Implemented 2D visualization for notes using Vue Flow
This commit is contained in:
44
node_modules/d3-transition/src/transition/attrTween.js
generated
vendored
Normal file
44
node_modules/d3-transition/src/transition/attrTween.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import {namespace} from "d3-selection";
|
||||
|
||||
function attrInterpolate(name, i) {
|
||||
return function(t) {
|
||||
this.setAttribute(name, i.call(this, t));
|
||||
};
|
||||
}
|
||||
|
||||
function attrInterpolateNS(fullname, i) {
|
||||
return function(t) {
|
||||
this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
||||
};
|
||||
}
|
||||
|
||||
function attrTweenNS(fullname, value) {
|
||||
var t0, i0;
|
||||
function tween() {
|
||||
var i = value.apply(this, arguments);
|
||||
if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
|
||||
return t0;
|
||||
}
|
||||
tween._value = value;
|
||||
return tween;
|
||||
}
|
||||
|
||||
function attrTween(name, value) {
|
||||
var t0, i0;
|
||||
function tween() {
|
||||
var i = value.apply(this, arguments);
|
||||
if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
|
||||
return t0;
|
||||
}
|
||||
tween._value = value;
|
||||
return tween;
|
||||
}
|
||||
|
||||
export default function(name, value) {
|
||||
var key = "attr." + name;
|
||||
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
||||
if (value == null) return this.tween(key, null);
|
||||
if (typeof value !== "function") throw new Error;
|
||||
var fullname = namespace(name);
|
||||
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
||||
}
|
||||
Reference in New Issue
Block a user