flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
34
VISUALIZACION/node_modules/d3-selection/src/selection/dispatch.js
generated
vendored
Executable file
34
VISUALIZACION/node_modules/d3-selection/src/selection/dispatch.js
generated
vendored
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
import defaultView from "../window.js";
|
||||
|
||||
function dispatchEvent(node, type, params) {
|
||||
var window = defaultView(node),
|
||||
event = window.CustomEvent;
|
||||
|
||||
if (typeof event === "function") {
|
||||
event = new event(type, params);
|
||||
} else {
|
||||
event = window.document.createEvent("Event");
|
||||
if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
|
||||
else event.initEvent(type, false, false);
|
||||
}
|
||||
|
||||
node.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function dispatchConstant(type, params) {
|
||||
return function() {
|
||||
return dispatchEvent(this, type, params);
|
||||
};
|
||||
}
|
||||
|
||||
function dispatchFunction(type, params) {
|
||||
return function() {
|
||||
return dispatchEvent(this, type, params.apply(this, arguments));
|
||||
};
|
||||
}
|
||||
|
||||
export default function(type, params) {
|
||||
return this.each((typeof params === "function"
|
||||
? dispatchFunction
|
||||
: dispatchConstant)(type, params));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue