n8n-editor-ui 1.63.2 → 1.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AnnotationTagsDropdown.ee-BrHzX0gM.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DZsUO41i.js} +2 -3
- package/dist/assets/{AuthView-DBTpAWBR.js → AuthView-CCyCGmwi.js} +3 -6
- package/dist/assets/{AuthView-BnHKMYu_.css → AuthView-Cnr31xHM.css} +6 -5
- package/dist/assets/{CanvasControls-DJjSv7Wo.js → CanvasControls-Bh28om35.js} +1 -31
- package/dist/assets/{ChangePasswordView-4HfufusV.js → ChangePasswordView-CzOXz1B5.js} +2 -32
- package/dist/assets/CollectionParameter--dDx2Uul.js +4 -0
- package/dist/assets/{CredentialsView-ChVc0kqb.js → CredentialsView-Uwkj-6Gn.js} +5 -35
- package/dist/assets/{ErrorView-C3MNpu-h.js → ErrorView-Du8F4roT.js} +1 -31
- package/dist/assets/{ExecutionsFilter-C71cMIbt.js → ExecutionsFilter-X5OsOzg1.js} +2 -5
- package/dist/assets/{ExecutionsView-CyfD2AaP.js → ExecutionsView-Cdl2wX8O.js} +18 -54
- package/dist/assets/{file-saver-Dbfm4l4I.js → FileSaver.min-BZDLz63C.js} +5 -12
- package/dist/assets/{FixedCollectionParameter-DjS7zdm4.js → FixedCollectionParameter-h3uHE3EI.js} +1 -32
- package/dist/assets/{ForgotMyPasswordView-BThu5AzW.js → ForgotMyPasswordView-DKha33bM.js} +2 -32
- package/dist/assets/{MainHeader-BonioYN5.js → MainHeader-Dp0CMpLa.js} +8 -47
- package/dist/assets/{MainSidebar-NOlas3VF.js → MainSidebar-DX7RWqIJ.js} +5 -44
- package/dist/assets/{NodeCreation-ByUlHR8c.js → NodeCreation-CH8QZkmg.js} +4 -7
- package/dist/assets/{NodeCreator-DE9FRbnS.js → NodeCreator-GlBp8VyB.js} +20 -64
- package/dist/assets/{NodeViewSwitcher-BMWd0Gm9.css → NodeViewSwitcher-0LWuIntY.css} +136 -135
- package/dist/assets/{NodeViewSwitcher-D7fdLnF1.js → NodeViewSwitcher-B6pXHQpy.js} +17208 -4340
- package/dist/assets/{ProjectCardBadge-f4baniz3.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-R4VvIcND.js} +1 -12
- package/dist/assets/{ProjectSettings-CeJUMGSQ.js → ProjectSettings-BRbDO1Gw.js} +6 -38
- package/dist/assets/{ProjectTabs-dq7a740r.js → ProjectTabs-DGe3p6nk.js} +1 -3
- package/dist/assets/{PushConnectionTracker-Bs_UzKPJ.js → PushConnectionTracker-CYr4h_PG.js} +1 -4
- package/dist/assets/{ResourcesListLayout-B1XBsMRy.js → ResourcesListLayout-Cp1vFuQD.js} +2 -7
- package/dist/assets/{RunDataAi-DdGO06st.js → RunDataAi-Dr6ypWYk.js} +51 -13
- package/dist/assets/{RunDataJson-DTKvzLZz.js → RunDataJson-BR2zl0xs.js} +11 -34
- package/dist/assets/{jsonpath--XXuA3UN.js → RunDataJsonActions-hnNDgPdr.js} +272 -73
- package/dist/assets/{RunDataSearch-CW0connN.js → RunDataSearch-aEp6SsT6.js} +1 -31
- package/dist/assets/{RunDataTable-C-mEq2dD.js → RunDataTable-CNdHnjmM.js} +43 -70
- package/dist/assets/{SamlOnboarding-BfsNvcA1.js → SamlOnboarding-BGSor93S.js} +2 -32
- package/dist/assets/{SettingsApiView--aIfdlDF.js → SettingsApiView-DnaOHGOU.js} +11 -42
- package/dist/assets/{SettingsCommunityNodesView-DdyT-sgu.js → SettingsCommunityNodesView-DG_uJUfX.js} +3 -35
- package/dist/assets/{SettingsExternalSecrets-DTMX68vp.js → SettingsExternalSecrets-CC-c2C10.js} +2 -32
- package/dist/assets/SettingsFakeDoorView-DJJ9xpvu.js +44 -0
- package/dist/assets/{humanize-duration-DdvB4QXM.js → SettingsLdapView-BTxklMe-.js} +827 -12
- package/dist/assets/{SettingsLogStreamingView-lQvw760T.js → SettingsLogStreamingView-D32eR0j1.js} +1 -31
- package/dist/assets/{SettingsPersonalView-2vlxeSgj.js → SettingsPersonalView-CycnGnFd.js} +1 -31
- package/dist/assets/{SettingsSourceControl-1Z-AF1Yv.js → SettingsSourceControl-CpzwZEYt.js} +4 -35
- package/dist/assets/{SettingsSso-Bp82V4Mw.js → SettingsSso-HjdnsVOf.js} +1 -31
- package/dist/assets/{SettingsUsageAndPlan-CDXY25ax.js → SettingsUsageAndPlan-CYQUE0tK.js} +1 -32
- package/dist/assets/{SettingsUsersView-3sIYeb4A.js → SettingsUsersView-DkzKTkeO.js} +1 -31
- package/dist/assets/{SettingsView-BNNArsIx.js → SettingsView-DVcUKSKE.js} +25 -34
- package/dist/assets/{SetupView-pspJi2at.js → SetupView-RG_ylo8Z.js} +2 -32
- package/dist/assets/{SetupWorkflowCredentialsButton-SC5-MI0D.js → SetupWorkflowCredentialsButton-DrA_a2OJ.js} +1 -31
- package/dist/assets/{SetupWorkflowFromTemplateView-CU3grpvN.js → SetupWorkflowFromTemplateView-DDIIQT4h.js} +3 -33
- package/dist/assets/{SigninView-CZdE2LU3.js → SigninView-SB0OrGE8.js} +2 -32
- package/dist/assets/SignoutView-CydN5z6L.js +27 -0
- package/dist/assets/{SignupView-BPlt_Lbh.js → SignupView-GfwP9_4w.js} +2 -32
- package/dist/assets/{TemplateDetails-CdRKYWL6.js → TemplateDetails-BHYTgWe7.js} +1 -4
- package/dist/assets/{TemplateList-BYq50eQG.js → TemplateList-DqeiM-sc.js} +1 -3
- package/dist/assets/{TemplatesCollectionView-D-N6pD00.js → TemplatesCollectionView-BmNqs_gk.js} +5 -35
- package/dist/assets/{TemplatesSearchView-BYNWZYGm.css → TemplatesSearchView-BiokbeYf.css} +94 -1
- package/dist/assets/{TemplatesSearchView-CaRL_LUd.js → TemplatesSearchView-CNF6-vdG.js} +738 -41
- package/dist/assets/{TemplatesView-C5HnqMFU.js → TemplatesView-2elduxzA.js} +1 -3
- package/dist/assets/{TemplatesWorkflowView-XV_mNcau.js → TemplatesWorkflowView-ZW6hOx7N.js} +5 -35
- package/dist/assets/{VariablesView-CDacoelY.js → VariablesView-BX27mddL.js} +2 -33
- package/dist/assets/{WorkerView-DciBUDzM.js → WorkerView-Cr7HLqrl.js} +159 -43
- package/dist/assets/{WorkflowActivator-GHyUbwAO.js → WorkflowActivator-BdyaV7fz.js} +3 -7
- package/dist/assets/{WorkflowExecutionsInfoAccordion-Dez7kHwM.js → WorkflowExecutionsInfoAccordion-GC5Xu1TI.js} +1 -3
- package/dist/assets/{WorkflowExecutionsLandingPage-j7sS9stL.js → WorkflowExecutionsLandingPage-DUaKxO-Z.js} +2 -32
- package/dist/assets/{WorkflowExecutionsPreview-DLogApYK.js → WorkflowExecutionsPreview-1hB0xaBl.js} +10 -42
- package/dist/assets/{WorkflowExecutionsView-CZ0E-5CZ.js → WorkflowExecutionsView-OE3NlCHo.js} +6 -37
- package/dist/assets/{WorkflowHistory-D6BLJ_QX.js → WorkflowHistory-q9Izoevv.js} +8 -45
- package/dist/assets/{WorkflowOnboardingView-7Z0s7yrd.js → WorkflowOnboardingView-B3UpsBmI.js} +1 -31
- package/dist/assets/{WorkflowPreview-C2zFAYYi.js → WorkflowPreview-MCXIiPMR.js} +1 -3
- package/dist/assets/{WorkflowsView-CLNYtnzv.js → WorkflowsView-BpzSj9Gu.js} +19 -37
- package/dist/assets/cloud-C5pqS4q0.js +37 -0
- package/dist/assets/{dateFormatter-B-oph3V5.js → dateFormatter-BgjGibAI.js} +1 -1
- package/dist/assets/{index-B5Pl_Rdy.css → index-BGyoJ6bM.css} +3941 -8
- package/dist/assets/index-TQ22MZub.js +331746 -0
- package/dist/assets/{pushConnection.store-C38m0a4q.js → pushConnection.store-DBI9rig9.js} +3 -3
- package/dist/assets/{templateActions-BDzt5tYG.js → templateActions-BlnfhXAQ.js} +1 -1
- package/dist/assets/{useBeforeUnload-DAuWtScP.js → useBeforeUnload-Db4Xtdlx.js} +1 -2
- package/dist/assets/{useExecutionDebugging-DjezN4ny.js → useExecutionDebugging-rQ2a9vrr.js} +1 -2
- package/dist/assets/{usePushConnection-C-AngCFB.js → usePushConnection-Bg_ZQZs0.js} +12 -17
- package/dist/assets/{useWorkflowActivate-CgGEceEs.js → useWorkflowActivate-DXNYJQNZ.js} +1 -2
- package/dist/index.html +2 -33
- package/package.json +1 -1
- package/vite.config.mts +0 -41
- package/dist/assets/@jsplumb/browser-ui-D3WTv2iL.js +0 -5431
- package/dist/assets/@jsplumb/common-Cn2WooAp.js +0 -142
- package/dist/assets/@jsplumb/connector-bezier-BsoOTqok.js +0 -1019
- package/dist/assets/@jsplumb/core-DLCSr9D4.js +0 -7317
- package/dist/assets/@jsplumb/util-DggqnqQo.js +0 -936
- package/dist/assets/@lezer/common-Bs5t-XhT.js +0 -1988
- package/dist/assets/@n8n/api-types-Clq_Leox.js +0 -1
- package/dist/assets/@n8n/codemirror-lang-Bizw8G99.js +0 -20928
- package/dist/assets/@n8n/codemirror-lang-sql-C9sfSTUi.js +0 -14443
- package/dist/assets/@n8n/permissions-BxSXRD9U.js +0 -52
- package/dist/assets/@sentry/vue-By9cUXYj.js +0 -23618
- package/dist/assets/@vue-flow/background-B1J8rodd.js +0 -123
- package/dist/assets/@vue-flow/controls-B4bXJQnK.js +0 -204
- package/dist/assets/@vue-flow/core-tETEFGtP.js +0 -9818
- package/dist/assets/@vue-flow/minimap-CGW7BbeH.js +0 -2951
- package/dist/assets/@vue-flow/node-resizer-C7hxX6Ea.js +0 -1398
- package/dist/assets/@vueuse/core-BTO0AmLR.js +0 -8894
- package/dist/assets/RunDataJsonActions-0J53luAF.js +0 -270
- package/dist/assets/SettingsFakeDoorView-CpouiCJM.js +0 -74
- package/dist/assets/SettingsLdapView-DtUi0T-K.js +0 -746
- package/dist/assets/SignoutView-DN2qdM5U.js +0 -57
- package/dist/assets/aws-secrets-manager-NwVFybsa.svg +0 -18
- package/dist/assets/axios-BW6T4tHC.js +0 -2403
- package/dist/assets/azure-key-vault-DTTl_IR7.svg +0 -23
- package/dist/assets/bowser-CDCHPFWD.js +0 -1931
- package/dist/assets/change-case-Dux1iW35.js +0 -137
- package/dist/assets/chart.js-BYpPl_l4.js +0 -14318
- package/dist/assets/cloud-DJUTi_f-.js +0 -95
- package/dist/assets/codemirror-lang-html-n8n-BElKE4vf.js +0 -2498
- package/dist/assets/dateformat-BevCJF2z.js +0 -208
- package/dist/assets/email-providers-Brdpqw-Z.js +0 -1
- package/dist/assets/esprima-next-DUEu30kB.js +0 -6712
- package/dist/assets/fast-json-stable-stringify-D9R5x91P.js +0 -55
- package/dist/assets/flatted-BLlNkUR-.js +0 -76
- package/dist/assets/gcp-secrets-manager-BcK0Zj6Y.svg +0 -9
- package/dist/assets/hashicorp-5zlHdJCj.webp +0 -0
- package/dist/assets/highlight.js-Brdpqw-Z.js +0 -1
- package/dist/assets/index-DOjaKjUd.js +0 -87778
- package/dist/assets/infisical-Db7VXgLp.webp +0 -0
- package/dist/assets/lodash-es-DCRmYdQ5.js +0 -6061
- package/dist/assets/luxon-N8mghSWH.js +0 -6159
- package/dist/assets/n8n-C6KBCWah.css +0 -4973
- package/dist/assets/n8n-o-6nV4eX.js +0 -163925
- package/dist/assets/pinia-BWzoPyXU.js +0 -1650
- package/dist/assets/prettier-eWLVZldr.js +0 -2294
- package/dist/assets/qrcode.vue-BavVPFUM.js +0 -1132
- package/dist/assets/timeago.js-CgQus8nl.js +0 -116
- package/dist/assets/useUserHelpers-nsswfS_i.js +0 -27
- package/dist/assets/uuid-DRDfXVM2.js +0 -542
- package/dist/assets/v3-infinite-loading-CHlSsXAy.js +0 -114
- package/dist/assets/vendor-D8YCjNHu.js +0 -14463
- package/dist/assets/vue-agile-B2NGbzqY.css +0 -93
- package/dist/assets/vue-agile-Busf3nxn.js +0 -727
- package/dist/assets/vue-chartjs-DBNEiLG-.js +0 -203
- package/dist/assets/vue-i18n-CeifA_Nk.js +0 -5329
- package/dist/assets/vue-json-pretty-DHS8nWi_.js +0 -340
- package/dist/assets/vue3-touch-events-DVOgU3fI.js +0 -301
- package/dist/assets/xss-Brdpqw-Z.js +0 -1
|
@@ -1,2951 +0,0 @@
|
|
|
1
|
-
import { I as defineComponent, i as inject, ab as useAttrs, j as toRef, u as unref, J as openBlock, V as createBlock, a5 as resolveDynamicComponent, aj as normalizeProps, a0 as mergeProps, K as createElementBlock, _ as normalizeClass, a1 as useSlots, r as ref, p as provide, f as computed, w as watchEffect, a3 as withCtx, a7 as toDisplayString, U as createCommentVNode, R as Fragment, af as renderList, $ as normalizeStyle, L as createBaseVNode } from "../vendor-D8YCjNHu.js";
|
|
2
|
-
import { u as useVueFlow, g as getRectOfNodes, a as getBoundsofRects, b as getConnectedEdges, _ as _sfc_main$2 } from "./core-tETEFGtP.js";
|
|
3
|
-
const style = "";
|
|
4
|
-
var noop = { value: () => {
|
|
5
|
-
} };
|
|
6
|
-
function dispatch() {
|
|
7
|
-
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
|
|
8
|
-
if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t))
|
|
9
|
-
throw new Error("illegal type: " + t);
|
|
10
|
-
_[t] = [];
|
|
11
|
-
}
|
|
12
|
-
return new Dispatch(_);
|
|
13
|
-
}
|
|
14
|
-
function Dispatch(_) {
|
|
15
|
-
this._ = _;
|
|
16
|
-
}
|
|
17
|
-
function parseTypenames$1(typenames, types) {
|
|
18
|
-
return typenames.trim().split(/^|\s+/).map(function(t) {
|
|
19
|
-
var name = "", i = t.indexOf(".");
|
|
20
|
-
if (i >= 0)
|
|
21
|
-
name = t.slice(i + 1), t = t.slice(0, i);
|
|
22
|
-
if (t && !types.hasOwnProperty(t))
|
|
23
|
-
throw new Error("unknown type: " + t);
|
|
24
|
-
return { type: t, name };
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
Dispatch.prototype = dispatch.prototype = {
|
|
28
|
-
constructor: Dispatch,
|
|
29
|
-
on: function(typename, callback) {
|
|
30
|
-
var _ = this._, T = parseTypenames$1(typename + "", _), t, i = -1, n = T.length;
|
|
31
|
-
if (arguments.length < 2) {
|
|
32
|
-
while (++i < n)
|
|
33
|
-
if ((t = (typename = T[i]).type) && (t = get$1(_[t], typename.name)))
|
|
34
|
-
return t;
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (callback != null && typeof callback !== "function")
|
|
38
|
-
throw new Error("invalid callback: " + callback);
|
|
39
|
-
while (++i < n) {
|
|
40
|
-
if (t = (typename = T[i]).type)
|
|
41
|
-
_[t] = set$1(_[t], typename.name, callback);
|
|
42
|
-
else if (callback == null)
|
|
43
|
-
for (t in _)
|
|
44
|
-
_[t] = set$1(_[t], typename.name, null);
|
|
45
|
-
}
|
|
46
|
-
return this;
|
|
47
|
-
},
|
|
48
|
-
copy: function() {
|
|
49
|
-
var copy = {}, _ = this._;
|
|
50
|
-
for (var t in _)
|
|
51
|
-
copy[t] = _[t].slice();
|
|
52
|
-
return new Dispatch(copy);
|
|
53
|
-
},
|
|
54
|
-
call: function(type, that) {
|
|
55
|
-
if ((n = arguments.length - 2) > 0)
|
|
56
|
-
for (var args = new Array(n), i = 0, n, t; i < n; ++i)
|
|
57
|
-
args[i] = arguments[i + 2];
|
|
58
|
-
if (!this._.hasOwnProperty(type))
|
|
59
|
-
throw new Error("unknown type: " + type);
|
|
60
|
-
for (t = this._[type], i = 0, n = t.length; i < n; ++i)
|
|
61
|
-
t[i].value.apply(that, args);
|
|
62
|
-
},
|
|
63
|
-
apply: function(type, that, args) {
|
|
64
|
-
if (!this._.hasOwnProperty(type))
|
|
65
|
-
throw new Error("unknown type: " + type);
|
|
66
|
-
for (var t = this._[type], i = 0, n = t.length; i < n; ++i)
|
|
67
|
-
t[i].value.apply(that, args);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
function get$1(type, name) {
|
|
71
|
-
for (var i = 0, n = type.length, c; i < n; ++i) {
|
|
72
|
-
if ((c = type[i]).name === name) {
|
|
73
|
-
return c.value;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function set$1(type, name, callback) {
|
|
78
|
-
for (var i = 0, n = type.length; i < n; ++i) {
|
|
79
|
-
if (type[i].name === name) {
|
|
80
|
-
type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (callback != null)
|
|
85
|
-
type.push({ name, value: callback });
|
|
86
|
-
return type;
|
|
87
|
-
}
|
|
88
|
-
var xhtml = "http://www.w3.org/1999/xhtml";
|
|
89
|
-
const namespaces = {
|
|
90
|
-
svg: "http://www.w3.org/2000/svg",
|
|
91
|
-
xhtml,
|
|
92
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
93
|
-
xml: "http://www.w3.org/XML/1998/namespace",
|
|
94
|
-
xmlns: "http://www.w3.org/2000/xmlns/"
|
|
95
|
-
};
|
|
96
|
-
function namespace(name) {
|
|
97
|
-
var prefix = name += "", i = prefix.indexOf(":");
|
|
98
|
-
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns")
|
|
99
|
-
name = name.slice(i + 1);
|
|
100
|
-
return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name } : name;
|
|
101
|
-
}
|
|
102
|
-
function creatorInherit(name) {
|
|
103
|
-
return function() {
|
|
104
|
-
var document2 = this.ownerDocument, uri = this.namespaceURI;
|
|
105
|
-
return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function creatorFixed(fullname) {
|
|
109
|
-
return function() {
|
|
110
|
-
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function creator(name) {
|
|
114
|
-
var fullname = namespace(name);
|
|
115
|
-
return (fullname.local ? creatorFixed : creatorInherit)(fullname);
|
|
116
|
-
}
|
|
117
|
-
function none() {
|
|
118
|
-
}
|
|
119
|
-
function selector(selector2) {
|
|
120
|
-
return selector2 == null ? none : function() {
|
|
121
|
-
return this.querySelector(selector2);
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function selection_select(select2) {
|
|
125
|
-
if (typeof select2 !== "function")
|
|
126
|
-
select2 = selector(select2);
|
|
127
|
-
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
128
|
-
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|
129
|
-
if ((node = group[i]) && (subnode = select2.call(node, node.__data__, i, group))) {
|
|
130
|
-
if ("__data__" in node)
|
|
131
|
-
subnode.__data__ = node.__data__;
|
|
132
|
-
subgroup[i] = subnode;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return new Selection$1(subgroups, this._parents);
|
|
137
|
-
}
|
|
138
|
-
function array(x) {
|
|
139
|
-
return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
|
|
140
|
-
}
|
|
141
|
-
function empty() {
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
function selectorAll(selector2) {
|
|
145
|
-
return selector2 == null ? empty : function() {
|
|
146
|
-
return this.querySelectorAll(selector2);
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function arrayAll(select2) {
|
|
150
|
-
return function() {
|
|
151
|
-
return array(select2.apply(this, arguments));
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function selection_selectAll(select2) {
|
|
155
|
-
if (typeof select2 === "function")
|
|
156
|
-
select2 = arrayAll(select2);
|
|
157
|
-
else
|
|
158
|
-
select2 = selectorAll(select2);
|
|
159
|
-
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
|
160
|
-
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
161
|
-
if (node = group[i]) {
|
|
162
|
-
subgroups.push(select2.call(node, node.__data__, i, group));
|
|
163
|
-
parents.push(node);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return new Selection$1(subgroups, parents);
|
|
168
|
-
}
|
|
169
|
-
function matcher(selector2) {
|
|
170
|
-
return function() {
|
|
171
|
-
return this.matches(selector2);
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function childMatcher(selector2) {
|
|
175
|
-
return function(node) {
|
|
176
|
-
return node.matches(selector2);
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
var find = Array.prototype.find;
|
|
180
|
-
function childFind(match) {
|
|
181
|
-
return function() {
|
|
182
|
-
return find.call(this.children, match);
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function childFirst() {
|
|
186
|
-
return this.firstElementChild;
|
|
187
|
-
}
|
|
188
|
-
function selection_selectChild(match) {
|
|
189
|
-
return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
|
|
190
|
-
}
|
|
191
|
-
var filter = Array.prototype.filter;
|
|
192
|
-
function children() {
|
|
193
|
-
return Array.from(this.children);
|
|
194
|
-
}
|
|
195
|
-
function childrenFilter(match) {
|
|
196
|
-
return function() {
|
|
197
|
-
return filter.call(this.children, match);
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function selection_selectChildren(match) {
|
|
201
|
-
return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
|
202
|
-
}
|
|
203
|
-
function selection_filter(match) {
|
|
204
|
-
if (typeof match !== "function")
|
|
205
|
-
match = matcher(match);
|
|
206
|
-
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
207
|
-
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
|
208
|
-
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
|
209
|
-
subgroup.push(node);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return new Selection$1(subgroups, this._parents);
|
|
214
|
-
}
|
|
215
|
-
function sparse(update) {
|
|
216
|
-
return new Array(update.length);
|
|
217
|
-
}
|
|
218
|
-
function selection_enter() {
|
|
219
|
-
return new Selection$1(this._enter || this._groups.map(sparse), this._parents);
|
|
220
|
-
}
|
|
221
|
-
function EnterNode(parent, datum2) {
|
|
222
|
-
this.ownerDocument = parent.ownerDocument;
|
|
223
|
-
this.namespaceURI = parent.namespaceURI;
|
|
224
|
-
this._next = null;
|
|
225
|
-
this._parent = parent;
|
|
226
|
-
this.__data__ = datum2;
|
|
227
|
-
}
|
|
228
|
-
EnterNode.prototype = {
|
|
229
|
-
constructor: EnterNode,
|
|
230
|
-
appendChild: function(child) {
|
|
231
|
-
return this._parent.insertBefore(child, this._next);
|
|
232
|
-
},
|
|
233
|
-
insertBefore: function(child, next) {
|
|
234
|
-
return this._parent.insertBefore(child, next);
|
|
235
|
-
},
|
|
236
|
-
querySelector: function(selector2) {
|
|
237
|
-
return this._parent.querySelector(selector2);
|
|
238
|
-
},
|
|
239
|
-
querySelectorAll: function(selector2) {
|
|
240
|
-
return this._parent.querySelectorAll(selector2);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
function constant$2(x) {
|
|
244
|
-
return function() {
|
|
245
|
-
return x;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
function bindIndex(parent, group, enter, update, exit, data) {
|
|
249
|
-
var i = 0, node, groupLength = group.length, dataLength = data.length;
|
|
250
|
-
for (; i < dataLength; ++i) {
|
|
251
|
-
if (node = group[i]) {
|
|
252
|
-
node.__data__ = data[i];
|
|
253
|
-
update[i] = node;
|
|
254
|
-
} else {
|
|
255
|
-
enter[i] = new EnterNode(parent, data[i]);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
for (; i < groupLength; ++i) {
|
|
259
|
-
if (node = group[i]) {
|
|
260
|
-
exit[i] = node;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function bindKey(parent, group, enter, update, exit, data, key) {
|
|
265
|
-
var i, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
|
|
266
|
-
for (i = 0; i < groupLength; ++i) {
|
|
267
|
-
if (node = group[i]) {
|
|
268
|
-
keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
|
|
269
|
-
if (nodeByKeyValue.has(keyValue)) {
|
|
270
|
-
exit[i] = node;
|
|
271
|
-
} else {
|
|
272
|
-
nodeByKeyValue.set(keyValue, node);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
for (i = 0; i < dataLength; ++i) {
|
|
277
|
-
keyValue = key.call(parent, data[i], i, data) + "";
|
|
278
|
-
if (node = nodeByKeyValue.get(keyValue)) {
|
|
279
|
-
update[i] = node;
|
|
280
|
-
node.__data__ = data[i];
|
|
281
|
-
nodeByKeyValue.delete(keyValue);
|
|
282
|
-
} else {
|
|
283
|
-
enter[i] = new EnterNode(parent, data[i]);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
for (i = 0; i < groupLength; ++i) {
|
|
287
|
-
if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) {
|
|
288
|
-
exit[i] = node;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function datum(node) {
|
|
293
|
-
return node.__data__;
|
|
294
|
-
}
|
|
295
|
-
function selection_data(value, key) {
|
|
296
|
-
if (!arguments.length)
|
|
297
|
-
return Array.from(this, datum);
|
|
298
|
-
var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
|
|
299
|
-
if (typeof value !== "function")
|
|
300
|
-
value = constant$2(value);
|
|
301
|
-
for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
|
|
302
|
-
var parent = parents[j], group = groups[j], groupLength = group.length, data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
|
|
303
|
-
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
|
304
|
-
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
|
|
305
|
-
if (previous = enterGroup[i0]) {
|
|
306
|
-
if (i0 >= i1)
|
|
307
|
-
i1 = i0 + 1;
|
|
308
|
-
while (!(next = updateGroup[i1]) && ++i1 < dataLength)
|
|
309
|
-
;
|
|
310
|
-
previous._next = next || null;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
update = new Selection$1(update, parents);
|
|
315
|
-
update._enter = enter;
|
|
316
|
-
update._exit = exit;
|
|
317
|
-
return update;
|
|
318
|
-
}
|
|
319
|
-
function arraylike(data) {
|
|
320
|
-
return typeof data === "object" && "length" in data ? data : Array.from(data);
|
|
321
|
-
}
|
|
322
|
-
function selection_exit() {
|
|
323
|
-
return new Selection$1(this._exit || this._groups.map(sparse), this._parents);
|
|
324
|
-
}
|
|
325
|
-
function selection_join(onenter, onupdate, onexit) {
|
|
326
|
-
var enter = this.enter(), update = this, exit = this.exit();
|
|
327
|
-
if (typeof onenter === "function") {
|
|
328
|
-
enter = onenter(enter);
|
|
329
|
-
if (enter)
|
|
330
|
-
enter = enter.selection();
|
|
331
|
-
} else {
|
|
332
|
-
enter = enter.append(onenter + "");
|
|
333
|
-
}
|
|
334
|
-
if (onupdate != null) {
|
|
335
|
-
update = onupdate(update);
|
|
336
|
-
if (update)
|
|
337
|
-
update = update.selection();
|
|
338
|
-
}
|
|
339
|
-
if (onexit == null)
|
|
340
|
-
exit.remove();
|
|
341
|
-
else
|
|
342
|
-
onexit(exit);
|
|
343
|
-
return enter && update ? enter.merge(update).order() : update;
|
|
344
|
-
}
|
|
345
|
-
function selection_merge(context) {
|
|
346
|
-
var selection2 = context.selection ? context.selection() : context;
|
|
347
|
-
for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
|
348
|
-
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
349
|
-
if (node = group0[i] || group1[i]) {
|
|
350
|
-
merge[i] = node;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
for (; j < m0; ++j) {
|
|
355
|
-
merges[j] = groups0[j];
|
|
356
|
-
}
|
|
357
|
-
return new Selection$1(merges, this._parents);
|
|
358
|
-
}
|
|
359
|
-
function selection_order() {
|
|
360
|
-
for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) {
|
|
361
|
-
for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
|
|
362
|
-
if (node = group[i]) {
|
|
363
|
-
if (next && node.compareDocumentPosition(next) ^ 4)
|
|
364
|
-
next.parentNode.insertBefore(node, next);
|
|
365
|
-
next = node;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return this;
|
|
370
|
-
}
|
|
371
|
-
function selection_sort(compare) {
|
|
372
|
-
if (!compare)
|
|
373
|
-
compare = ascending;
|
|
374
|
-
function compareNode(a, b) {
|
|
375
|
-
return a && b ? compare(a.__data__, b.__data__) : !a - !b;
|
|
376
|
-
}
|
|
377
|
-
for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
|
|
378
|
-
for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
379
|
-
if (node = group[i]) {
|
|
380
|
-
sortgroup[i] = node;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
sortgroup.sort(compareNode);
|
|
384
|
-
}
|
|
385
|
-
return new Selection$1(sortgroups, this._parents).order();
|
|
386
|
-
}
|
|
387
|
-
function ascending(a, b) {
|
|
388
|
-
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
|
389
|
-
}
|
|
390
|
-
function selection_call() {
|
|
391
|
-
var callback = arguments[0];
|
|
392
|
-
arguments[0] = this;
|
|
393
|
-
callback.apply(null, arguments);
|
|
394
|
-
return this;
|
|
395
|
-
}
|
|
396
|
-
function selection_nodes() {
|
|
397
|
-
return Array.from(this);
|
|
398
|
-
}
|
|
399
|
-
function selection_node() {
|
|
400
|
-
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
|
401
|
-
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
|
|
402
|
-
var node = group[i];
|
|
403
|
-
if (node)
|
|
404
|
-
return node;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
return null;
|
|
408
|
-
}
|
|
409
|
-
function selection_size() {
|
|
410
|
-
let size = 0;
|
|
411
|
-
for (const node of this)
|
|
412
|
-
++size;
|
|
413
|
-
return size;
|
|
414
|
-
}
|
|
415
|
-
function selection_empty() {
|
|
416
|
-
return !this.node();
|
|
417
|
-
}
|
|
418
|
-
function selection_each(callback) {
|
|
419
|
-
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
|
420
|
-
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
|
421
|
-
if (node = group[i])
|
|
422
|
-
callback.call(node, node.__data__, i, group);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
return this;
|
|
426
|
-
}
|
|
427
|
-
function attrRemove$1(name) {
|
|
428
|
-
return function() {
|
|
429
|
-
this.removeAttribute(name);
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
function attrRemoveNS$1(fullname) {
|
|
433
|
-
return function() {
|
|
434
|
-
this.removeAttributeNS(fullname.space, fullname.local);
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function attrConstant$1(name, value) {
|
|
438
|
-
return function() {
|
|
439
|
-
this.setAttribute(name, value);
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
function attrConstantNS$1(fullname, value) {
|
|
443
|
-
return function() {
|
|
444
|
-
this.setAttributeNS(fullname.space, fullname.local, value);
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
function attrFunction$1(name, value) {
|
|
448
|
-
return function() {
|
|
449
|
-
var v = value.apply(this, arguments);
|
|
450
|
-
if (v == null)
|
|
451
|
-
this.removeAttribute(name);
|
|
452
|
-
else
|
|
453
|
-
this.setAttribute(name, v);
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
function attrFunctionNS$1(fullname, value) {
|
|
457
|
-
return function() {
|
|
458
|
-
var v = value.apply(this, arguments);
|
|
459
|
-
if (v == null)
|
|
460
|
-
this.removeAttributeNS(fullname.space, fullname.local);
|
|
461
|
-
else
|
|
462
|
-
this.setAttributeNS(fullname.space, fullname.local, v);
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
function selection_attr(name, value) {
|
|
466
|
-
var fullname = namespace(name);
|
|
467
|
-
if (arguments.length < 2) {
|
|
468
|
-
var node = this.node();
|
|
469
|
-
return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
|
|
470
|
-
}
|
|
471
|
-
return this.each((value == null ? fullname.local ? attrRemoveNS$1 : attrRemove$1 : typeof value === "function" ? fullname.local ? attrFunctionNS$1 : attrFunction$1 : fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, value));
|
|
472
|
-
}
|
|
473
|
-
function defaultView(node) {
|
|
474
|
-
return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
|
|
475
|
-
}
|
|
476
|
-
function styleRemove$1(name) {
|
|
477
|
-
return function() {
|
|
478
|
-
this.style.removeProperty(name);
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
function styleConstant$1(name, value, priority) {
|
|
482
|
-
return function() {
|
|
483
|
-
this.style.setProperty(name, value, priority);
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function styleFunction$1(name, value, priority) {
|
|
487
|
-
return function() {
|
|
488
|
-
var v = value.apply(this, arguments);
|
|
489
|
-
if (v == null)
|
|
490
|
-
this.style.removeProperty(name);
|
|
491
|
-
else
|
|
492
|
-
this.style.setProperty(name, v, priority);
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
function selection_style(name, value, priority) {
|
|
496
|
-
return arguments.length > 1 ? this.each((value == null ? styleRemove$1 : typeof value === "function" ? styleFunction$1 : styleConstant$1)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
|
|
497
|
-
}
|
|
498
|
-
function styleValue(node, name) {
|
|
499
|
-
return node.style.getPropertyValue(name) || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
|
|
500
|
-
}
|
|
501
|
-
function propertyRemove(name) {
|
|
502
|
-
return function() {
|
|
503
|
-
delete this[name];
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
function propertyConstant(name, value) {
|
|
507
|
-
return function() {
|
|
508
|
-
this[name] = value;
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
function propertyFunction(name, value) {
|
|
512
|
-
return function() {
|
|
513
|
-
var v = value.apply(this, arguments);
|
|
514
|
-
if (v == null)
|
|
515
|
-
delete this[name];
|
|
516
|
-
else
|
|
517
|
-
this[name] = v;
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
function selection_property(name, value) {
|
|
521
|
-
return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
|
|
522
|
-
}
|
|
523
|
-
function classArray(string) {
|
|
524
|
-
return string.trim().split(/^|\s+/);
|
|
525
|
-
}
|
|
526
|
-
function classList(node) {
|
|
527
|
-
return node.classList || new ClassList(node);
|
|
528
|
-
}
|
|
529
|
-
function ClassList(node) {
|
|
530
|
-
this._node = node;
|
|
531
|
-
this._names = classArray(node.getAttribute("class") || "");
|
|
532
|
-
}
|
|
533
|
-
ClassList.prototype = {
|
|
534
|
-
add: function(name) {
|
|
535
|
-
var i = this._names.indexOf(name);
|
|
536
|
-
if (i < 0) {
|
|
537
|
-
this._names.push(name);
|
|
538
|
-
this._node.setAttribute("class", this._names.join(" "));
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
remove: function(name) {
|
|
542
|
-
var i = this._names.indexOf(name);
|
|
543
|
-
if (i >= 0) {
|
|
544
|
-
this._names.splice(i, 1);
|
|
545
|
-
this._node.setAttribute("class", this._names.join(" "));
|
|
546
|
-
}
|
|
547
|
-
},
|
|
548
|
-
contains: function(name) {
|
|
549
|
-
return this._names.indexOf(name) >= 0;
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
function classedAdd(node, names) {
|
|
553
|
-
var list = classList(node), i = -1, n = names.length;
|
|
554
|
-
while (++i < n)
|
|
555
|
-
list.add(names[i]);
|
|
556
|
-
}
|
|
557
|
-
function classedRemove(node, names) {
|
|
558
|
-
var list = classList(node), i = -1, n = names.length;
|
|
559
|
-
while (++i < n)
|
|
560
|
-
list.remove(names[i]);
|
|
561
|
-
}
|
|
562
|
-
function classedTrue(names) {
|
|
563
|
-
return function() {
|
|
564
|
-
classedAdd(this, names);
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
function classedFalse(names) {
|
|
568
|
-
return function() {
|
|
569
|
-
classedRemove(this, names);
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
function classedFunction(names, value) {
|
|
573
|
-
return function() {
|
|
574
|
-
(value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
function selection_classed(name, value) {
|
|
578
|
-
var names = classArray(name + "");
|
|
579
|
-
if (arguments.length < 2) {
|
|
580
|
-
var list = classList(this.node()), i = -1, n = names.length;
|
|
581
|
-
while (++i < n)
|
|
582
|
-
if (!list.contains(names[i]))
|
|
583
|
-
return false;
|
|
584
|
-
return true;
|
|
585
|
-
}
|
|
586
|
-
return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
|
|
587
|
-
}
|
|
588
|
-
function textRemove() {
|
|
589
|
-
this.textContent = "";
|
|
590
|
-
}
|
|
591
|
-
function textConstant$1(value) {
|
|
592
|
-
return function() {
|
|
593
|
-
this.textContent = value;
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
function textFunction$1(value) {
|
|
597
|
-
return function() {
|
|
598
|
-
var v = value.apply(this, arguments);
|
|
599
|
-
this.textContent = v == null ? "" : v;
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
function selection_text(value) {
|
|
603
|
-
return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction$1 : textConstant$1)(value)) : this.node().textContent;
|
|
604
|
-
}
|
|
605
|
-
function htmlRemove() {
|
|
606
|
-
this.innerHTML = "";
|
|
607
|
-
}
|
|
608
|
-
function htmlConstant(value) {
|
|
609
|
-
return function() {
|
|
610
|
-
this.innerHTML = value;
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
function htmlFunction(value) {
|
|
614
|
-
return function() {
|
|
615
|
-
var v = value.apply(this, arguments);
|
|
616
|
-
this.innerHTML = v == null ? "" : v;
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
function selection_html(value) {
|
|
620
|
-
return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
|
|
621
|
-
}
|
|
622
|
-
function raise() {
|
|
623
|
-
if (this.nextSibling)
|
|
624
|
-
this.parentNode.appendChild(this);
|
|
625
|
-
}
|
|
626
|
-
function selection_raise() {
|
|
627
|
-
return this.each(raise);
|
|
628
|
-
}
|
|
629
|
-
function lower() {
|
|
630
|
-
if (this.previousSibling)
|
|
631
|
-
this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
|
632
|
-
}
|
|
633
|
-
function selection_lower() {
|
|
634
|
-
return this.each(lower);
|
|
635
|
-
}
|
|
636
|
-
function selection_append(name) {
|
|
637
|
-
var create2 = typeof name === "function" ? name : creator(name);
|
|
638
|
-
return this.select(function() {
|
|
639
|
-
return this.appendChild(create2.apply(this, arguments));
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
function constantNull() {
|
|
643
|
-
return null;
|
|
644
|
-
}
|
|
645
|
-
function selection_insert(name, before) {
|
|
646
|
-
var create2 = typeof name === "function" ? name : creator(name), select2 = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
|
647
|
-
return this.select(function() {
|
|
648
|
-
return this.insertBefore(create2.apply(this, arguments), select2.apply(this, arguments) || null);
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
function remove() {
|
|
652
|
-
var parent = this.parentNode;
|
|
653
|
-
if (parent)
|
|
654
|
-
parent.removeChild(this);
|
|
655
|
-
}
|
|
656
|
-
function selection_remove() {
|
|
657
|
-
return this.each(remove);
|
|
658
|
-
}
|
|
659
|
-
function selection_cloneShallow() {
|
|
660
|
-
var clone = this.cloneNode(false), parent = this.parentNode;
|
|
661
|
-
return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
|
662
|
-
}
|
|
663
|
-
function selection_cloneDeep() {
|
|
664
|
-
var clone = this.cloneNode(true), parent = this.parentNode;
|
|
665
|
-
return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
|
666
|
-
}
|
|
667
|
-
function selection_clone(deep) {
|
|
668
|
-
return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
|
|
669
|
-
}
|
|
670
|
-
function selection_datum(value) {
|
|
671
|
-
return arguments.length ? this.property("__data__", value) : this.node().__data__;
|
|
672
|
-
}
|
|
673
|
-
function contextListener(listener) {
|
|
674
|
-
return function(event) {
|
|
675
|
-
listener.call(this, event, this.__data__);
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
function parseTypenames(typenames) {
|
|
679
|
-
return typenames.trim().split(/^|\s+/).map(function(t) {
|
|
680
|
-
var name = "", i = t.indexOf(".");
|
|
681
|
-
if (i >= 0)
|
|
682
|
-
name = t.slice(i + 1), t = t.slice(0, i);
|
|
683
|
-
return { type: t, name };
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
function onRemove(typename) {
|
|
687
|
-
return function() {
|
|
688
|
-
var on = this.__on;
|
|
689
|
-
if (!on)
|
|
690
|
-
return;
|
|
691
|
-
for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
|
|
692
|
-
if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
|
|
693
|
-
this.removeEventListener(o.type, o.listener, o.options);
|
|
694
|
-
} else {
|
|
695
|
-
on[++i] = o;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
if (++i)
|
|
699
|
-
on.length = i;
|
|
700
|
-
else
|
|
701
|
-
delete this.__on;
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
function onAdd(typename, value, options) {
|
|
705
|
-
return function() {
|
|
706
|
-
var on = this.__on, o, listener = contextListener(value);
|
|
707
|
-
if (on)
|
|
708
|
-
for (var j = 0, m = on.length; j < m; ++j) {
|
|
709
|
-
if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
|
710
|
-
this.removeEventListener(o.type, o.listener, o.options);
|
|
711
|
-
this.addEventListener(o.type, o.listener = listener, o.options = options);
|
|
712
|
-
o.value = value;
|
|
713
|
-
return;
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
this.addEventListener(typename.type, listener, options);
|
|
717
|
-
o = { type: typename.type, name: typename.name, value, listener, options };
|
|
718
|
-
if (!on)
|
|
719
|
-
this.__on = [o];
|
|
720
|
-
else
|
|
721
|
-
on.push(o);
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
function selection_on(typename, value, options) {
|
|
725
|
-
var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
|
|
726
|
-
if (arguments.length < 2) {
|
|
727
|
-
var on = this.node().__on;
|
|
728
|
-
if (on)
|
|
729
|
-
for (var j = 0, m = on.length, o; j < m; ++j) {
|
|
730
|
-
for (i = 0, o = on[j]; i < n; ++i) {
|
|
731
|
-
if ((t = typenames[i]).type === o.type && t.name === o.name) {
|
|
732
|
-
return o.value;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
on = value ? onAdd : onRemove;
|
|
739
|
-
for (i = 0; i < n; ++i)
|
|
740
|
-
this.each(on(typenames[i], value, options));
|
|
741
|
-
return this;
|
|
742
|
-
}
|
|
743
|
-
function dispatchEvent(node, type, params) {
|
|
744
|
-
var window2 = defaultView(node), event = window2.CustomEvent;
|
|
745
|
-
if (typeof event === "function") {
|
|
746
|
-
event = new event(type, params);
|
|
747
|
-
} else {
|
|
748
|
-
event = window2.document.createEvent("Event");
|
|
749
|
-
if (params)
|
|
750
|
-
event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
|
|
751
|
-
else
|
|
752
|
-
event.initEvent(type, false, false);
|
|
753
|
-
}
|
|
754
|
-
node.dispatchEvent(event);
|
|
755
|
-
}
|
|
756
|
-
function dispatchConstant(type, params) {
|
|
757
|
-
return function() {
|
|
758
|
-
return dispatchEvent(this, type, params);
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
function dispatchFunction(type, params) {
|
|
762
|
-
return function() {
|
|
763
|
-
return dispatchEvent(this, type, params.apply(this, arguments));
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
function selection_dispatch(type, params) {
|
|
767
|
-
return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
|
|
768
|
-
}
|
|
769
|
-
function* selection_iterator() {
|
|
770
|
-
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
|
771
|
-
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
|
772
|
-
if (node = group[i])
|
|
773
|
-
yield node;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
var root = [null];
|
|
778
|
-
function Selection$1(groups, parents) {
|
|
779
|
-
this._groups = groups;
|
|
780
|
-
this._parents = parents;
|
|
781
|
-
}
|
|
782
|
-
function selection() {
|
|
783
|
-
return new Selection$1([[document.documentElement]], root);
|
|
784
|
-
}
|
|
785
|
-
function selection_selection() {
|
|
786
|
-
return this;
|
|
787
|
-
}
|
|
788
|
-
Selection$1.prototype = selection.prototype = {
|
|
789
|
-
constructor: Selection$1,
|
|
790
|
-
select: selection_select,
|
|
791
|
-
selectAll: selection_selectAll,
|
|
792
|
-
selectChild: selection_selectChild,
|
|
793
|
-
selectChildren: selection_selectChildren,
|
|
794
|
-
filter: selection_filter,
|
|
795
|
-
data: selection_data,
|
|
796
|
-
enter: selection_enter,
|
|
797
|
-
exit: selection_exit,
|
|
798
|
-
join: selection_join,
|
|
799
|
-
merge: selection_merge,
|
|
800
|
-
selection: selection_selection,
|
|
801
|
-
order: selection_order,
|
|
802
|
-
sort: selection_sort,
|
|
803
|
-
call: selection_call,
|
|
804
|
-
nodes: selection_nodes,
|
|
805
|
-
node: selection_node,
|
|
806
|
-
size: selection_size,
|
|
807
|
-
empty: selection_empty,
|
|
808
|
-
each: selection_each,
|
|
809
|
-
attr: selection_attr,
|
|
810
|
-
style: selection_style,
|
|
811
|
-
property: selection_property,
|
|
812
|
-
classed: selection_classed,
|
|
813
|
-
text: selection_text,
|
|
814
|
-
html: selection_html,
|
|
815
|
-
raise: selection_raise,
|
|
816
|
-
lower: selection_lower,
|
|
817
|
-
append: selection_append,
|
|
818
|
-
insert: selection_insert,
|
|
819
|
-
remove: selection_remove,
|
|
820
|
-
clone: selection_clone,
|
|
821
|
-
datum: selection_datum,
|
|
822
|
-
on: selection_on,
|
|
823
|
-
dispatch: selection_dispatch,
|
|
824
|
-
[Symbol.iterator]: selection_iterator
|
|
825
|
-
};
|
|
826
|
-
function select(selector2) {
|
|
827
|
-
return typeof selector2 === "string" ? new Selection$1([[document.querySelector(selector2)]], [document.documentElement]) : new Selection$1([[selector2]], root);
|
|
828
|
-
}
|
|
829
|
-
function sourceEvent(event) {
|
|
830
|
-
let sourceEvent2;
|
|
831
|
-
while (sourceEvent2 = event.sourceEvent)
|
|
832
|
-
event = sourceEvent2;
|
|
833
|
-
return event;
|
|
834
|
-
}
|
|
835
|
-
function pointer(event, node) {
|
|
836
|
-
event = sourceEvent(event);
|
|
837
|
-
if (node === void 0)
|
|
838
|
-
node = event.currentTarget;
|
|
839
|
-
if (node) {
|
|
840
|
-
var svg = node.ownerSVGElement || node;
|
|
841
|
-
if (svg.createSVGPoint) {
|
|
842
|
-
var point = svg.createSVGPoint();
|
|
843
|
-
point.x = event.clientX, point.y = event.clientY;
|
|
844
|
-
point = point.matrixTransform(node.getScreenCTM().inverse());
|
|
845
|
-
return [point.x, point.y];
|
|
846
|
-
}
|
|
847
|
-
if (node.getBoundingClientRect) {
|
|
848
|
-
var rect = node.getBoundingClientRect();
|
|
849
|
-
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
return [event.pageX, event.pageY];
|
|
853
|
-
}
|
|
854
|
-
const nonpassivecapture = { capture: true, passive: false };
|
|
855
|
-
function noevent$1(event) {
|
|
856
|
-
event.preventDefault();
|
|
857
|
-
event.stopImmediatePropagation();
|
|
858
|
-
}
|
|
859
|
-
function dragDisable(view) {
|
|
860
|
-
var root2 = view.document.documentElement, selection2 = select(view).on("dragstart.drag", noevent$1, nonpassivecapture);
|
|
861
|
-
if ("onselectstart" in root2) {
|
|
862
|
-
selection2.on("selectstart.drag", noevent$1, nonpassivecapture);
|
|
863
|
-
} else {
|
|
864
|
-
root2.__noselect = root2.style.MozUserSelect;
|
|
865
|
-
root2.style.MozUserSelect = "none";
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
function yesdrag(view, noclick) {
|
|
869
|
-
var root2 = view.document.documentElement, selection2 = select(view).on("dragstart.drag", null);
|
|
870
|
-
if (noclick) {
|
|
871
|
-
selection2.on("click.drag", noevent$1, nonpassivecapture);
|
|
872
|
-
setTimeout(function() {
|
|
873
|
-
selection2.on("click.drag", null);
|
|
874
|
-
}, 0);
|
|
875
|
-
}
|
|
876
|
-
if ("onselectstart" in root2) {
|
|
877
|
-
selection2.on("selectstart.drag", null);
|
|
878
|
-
} else {
|
|
879
|
-
root2.style.MozUserSelect = root2.__noselect;
|
|
880
|
-
delete root2.__noselect;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
function define(constructor, factory, prototype) {
|
|
884
|
-
constructor.prototype = factory.prototype = prototype;
|
|
885
|
-
prototype.constructor = constructor;
|
|
886
|
-
}
|
|
887
|
-
function extend(parent, definition) {
|
|
888
|
-
var prototype = Object.create(parent.prototype);
|
|
889
|
-
for (var key in definition)
|
|
890
|
-
prototype[key] = definition[key];
|
|
891
|
-
return prototype;
|
|
892
|
-
}
|
|
893
|
-
function Color() {
|
|
894
|
-
}
|
|
895
|
-
var darker = 0.7;
|
|
896
|
-
var brighter = 1 / darker;
|
|
897
|
-
var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
898
|
-
var named = {
|
|
899
|
-
aliceblue: 15792383,
|
|
900
|
-
antiquewhite: 16444375,
|
|
901
|
-
aqua: 65535,
|
|
902
|
-
aquamarine: 8388564,
|
|
903
|
-
azure: 15794175,
|
|
904
|
-
beige: 16119260,
|
|
905
|
-
bisque: 16770244,
|
|
906
|
-
black: 0,
|
|
907
|
-
blanchedalmond: 16772045,
|
|
908
|
-
blue: 255,
|
|
909
|
-
blueviolet: 9055202,
|
|
910
|
-
brown: 10824234,
|
|
911
|
-
burlywood: 14596231,
|
|
912
|
-
cadetblue: 6266528,
|
|
913
|
-
chartreuse: 8388352,
|
|
914
|
-
chocolate: 13789470,
|
|
915
|
-
coral: 16744272,
|
|
916
|
-
cornflowerblue: 6591981,
|
|
917
|
-
cornsilk: 16775388,
|
|
918
|
-
crimson: 14423100,
|
|
919
|
-
cyan: 65535,
|
|
920
|
-
darkblue: 139,
|
|
921
|
-
darkcyan: 35723,
|
|
922
|
-
darkgoldenrod: 12092939,
|
|
923
|
-
darkgray: 11119017,
|
|
924
|
-
darkgreen: 25600,
|
|
925
|
-
darkgrey: 11119017,
|
|
926
|
-
darkkhaki: 12433259,
|
|
927
|
-
darkmagenta: 9109643,
|
|
928
|
-
darkolivegreen: 5597999,
|
|
929
|
-
darkorange: 16747520,
|
|
930
|
-
darkorchid: 10040012,
|
|
931
|
-
darkred: 9109504,
|
|
932
|
-
darksalmon: 15308410,
|
|
933
|
-
darkseagreen: 9419919,
|
|
934
|
-
darkslateblue: 4734347,
|
|
935
|
-
darkslategray: 3100495,
|
|
936
|
-
darkslategrey: 3100495,
|
|
937
|
-
darkturquoise: 52945,
|
|
938
|
-
darkviolet: 9699539,
|
|
939
|
-
deeppink: 16716947,
|
|
940
|
-
deepskyblue: 49151,
|
|
941
|
-
dimgray: 6908265,
|
|
942
|
-
dimgrey: 6908265,
|
|
943
|
-
dodgerblue: 2003199,
|
|
944
|
-
firebrick: 11674146,
|
|
945
|
-
floralwhite: 16775920,
|
|
946
|
-
forestgreen: 2263842,
|
|
947
|
-
fuchsia: 16711935,
|
|
948
|
-
gainsboro: 14474460,
|
|
949
|
-
ghostwhite: 16316671,
|
|
950
|
-
gold: 16766720,
|
|
951
|
-
goldenrod: 14329120,
|
|
952
|
-
gray: 8421504,
|
|
953
|
-
green: 32768,
|
|
954
|
-
greenyellow: 11403055,
|
|
955
|
-
grey: 8421504,
|
|
956
|
-
honeydew: 15794160,
|
|
957
|
-
hotpink: 16738740,
|
|
958
|
-
indianred: 13458524,
|
|
959
|
-
indigo: 4915330,
|
|
960
|
-
ivory: 16777200,
|
|
961
|
-
khaki: 15787660,
|
|
962
|
-
lavender: 15132410,
|
|
963
|
-
lavenderblush: 16773365,
|
|
964
|
-
lawngreen: 8190976,
|
|
965
|
-
lemonchiffon: 16775885,
|
|
966
|
-
lightblue: 11393254,
|
|
967
|
-
lightcoral: 15761536,
|
|
968
|
-
lightcyan: 14745599,
|
|
969
|
-
lightgoldenrodyellow: 16448210,
|
|
970
|
-
lightgray: 13882323,
|
|
971
|
-
lightgreen: 9498256,
|
|
972
|
-
lightgrey: 13882323,
|
|
973
|
-
lightpink: 16758465,
|
|
974
|
-
lightsalmon: 16752762,
|
|
975
|
-
lightseagreen: 2142890,
|
|
976
|
-
lightskyblue: 8900346,
|
|
977
|
-
lightslategray: 7833753,
|
|
978
|
-
lightslategrey: 7833753,
|
|
979
|
-
lightsteelblue: 11584734,
|
|
980
|
-
lightyellow: 16777184,
|
|
981
|
-
lime: 65280,
|
|
982
|
-
limegreen: 3329330,
|
|
983
|
-
linen: 16445670,
|
|
984
|
-
magenta: 16711935,
|
|
985
|
-
maroon: 8388608,
|
|
986
|
-
mediumaquamarine: 6737322,
|
|
987
|
-
mediumblue: 205,
|
|
988
|
-
mediumorchid: 12211667,
|
|
989
|
-
mediumpurple: 9662683,
|
|
990
|
-
mediumseagreen: 3978097,
|
|
991
|
-
mediumslateblue: 8087790,
|
|
992
|
-
mediumspringgreen: 64154,
|
|
993
|
-
mediumturquoise: 4772300,
|
|
994
|
-
mediumvioletred: 13047173,
|
|
995
|
-
midnightblue: 1644912,
|
|
996
|
-
mintcream: 16121850,
|
|
997
|
-
mistyrose: 16770273,
|
|
998
|
-
moccasin: 16770229,
|
|
999
|
-
navajowhite: 16768685,
|
|
1000
|
-
navy: 128,
|
|
1001
|
-
oldlace: 16643558,
|
|
1002
|
-
olive: 8421376,
|
|
1003
|
-
olivedrab: 7048739,
|
|
1004
|
-
orange: 16753920,
|
|
1005
|
-
orangered: 16729344,
|
|
1006
|
-
orchid: 14315734,
|
|
1007
|
-
palegoldenrod: 15657130,
|
|
1008
|
-
palegreen: 10025880,
|
|
1009
|
-
paleturquoise: 11529966,
|
|
1010
|
-
palevioletred: 14381203,
|
|
1011
|
-
papayawhip: 16773077,
|
|
1012
|
-
peachpuff: 16767673,
|
|
1013
|
-
peru: 13468991,
|
|
1014
|
-
pink: 16761035,
|
|
1015
|
-
plum: 14524637,
|
|
1016
|
-
powderblue: 11591910,
|
|
1017
|
-
purple: 8388736,
|
|
1018
|
-
rebeccapurple: 6697881,
|
|
1019
|
-
red: 16711680,
|
|
1020
|
-
rosybrown: 12357519,
|
|
1021
|
-
royalblue: 4286945,
|
|
1022
|
-
saddlebrown: 9127187,
|
|
1023
|
-
salmon: 16416882,
|
|
1024
|
-
sandybrown: 16032864,
|
|
1025
|
-
seagreen: 3050327,
|
|
1026
|
-
seashell: 16774638,
|
|
1027
|
-
sienna: 10506797,
|
|
1028
|
-
silver: 12632256,
|
|
1029
|
-
skyblue: 8900331,
|
|
1030
|
-
slateblue: 6970061,
|
|
1031
|
-
slategray: 7372944,
|
|
1032
|
-
slategrey: 7372944,
|
|
1033
|
-
snow: 16775930,
|
|
1034
|
-
springgreen: 65407,
|
|
1035
|
-
steelblue: 4620980,
|
|
1036
|
-
tan: 13808780,
|
|
1037
|
-
teal: 32896,
|
|
1038
|
-
thistle: 14204888,
|
|
1039
|
-
tomato: 16737095,
|
|
1040
|
-
turquoise: 4251856,
|
|
1041
|
-
violet: 15631086,
|
|
1042
|
-
wheat: 16113331,
|
|
1043
|
-
white: 16777215,
|
|
1044
|
-
whitesmoke: 16119285,
|
|
1045
|
-
yellow: 16776960,
|
|
1046
|
-
yellowgreen: 10145074
|
|
1047
|
-
};
|
|
1048
|
-
define(Color, color, {
|
|
1049
|
-
copy(channels) {
|
|
1050
|
-
return Object.assign(new this.constructor(), this, channels);
|
|
1051
|
-
},
|
|
1052
|
-
displayable() {
|
|
1053
|
-
return this.rgb().displayable();
|
|
1054
|
-
},
|
|
1055
|
-
hex: color_formatHex,
|
|
1056
|
-
// Deprecated! Use color.formatHex.
|
|
1057
|
-
formatHex: color_formatHex,
|
|
1058
|
-
formatHex8: color_formatHex8,
|
|
1059
|
-
formatHsl: color_formatHsl,
|
|
1060
|
-
formatRgb: color_formatRgb,
|
|
1061
|
-
toString: color_formatRgb
|
|
1062
|
-
});
|
|
1063
|
-
function color_formatHex() {
|
|
1064
|
-
return this.rgb().formatHex();
|
|
1065
|
-
}
|
|
1066
|
-
function color_formatHex8() {
|
|
1067
|
-
return this.rgb().formatHex8();
|
|
1068
|
-
}
|
|
1069
|
-
function color_formatHsl() {
|
|
1070
|
-
return hslConvert(this).formatHsl();
|
|
1071
|
-
}
|
|
1072
|
-
function color_formatRgb() {
|
|
1073
|
-
return this.rgb().formatRgb();
|
|
1074
|
-
}
|
|
1075
|
-
function color(format) {
|
|
1076
|
-
var m, l;
|
|
1077
|
-
format = (format + "").trim().toLowerCase();
|
|
1078
|
-
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format) ? rgbn(named[format]) : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
|
1079
|
-
}
|
|
1080
|
-
function rgbn(n) {
|
|
1081
|
-
return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
|
|
1082
|
-
}
|
|
1083
|
-
function rgba(r, g, b, a) {
|
|
1084
|
-
if (a <= 0)
|
|
1085
|
-
r = g = b = NaN;
|
|
1086
|
-
return new Rgb(r, g, b, a);
|
|
1087
|
-
}
|
|
1088
|
-
function rgbConvert(o) {
|
|
1089
|
-
if (!(o instanceof Color))
|
|
1090
|
-
o = color(o);
|
|
1091
|
-
if (!o)
|
|
1092
|
-
return new Rgb();
|
|
1093
|
-
o = o.rgb();
|
|
1094
|
-
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
1095
|
-
}
|
|
1096
|
-
function rgb(r, g, b, opacity) {
|
|
1097
|
-
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
1098
|
-
}
|
|
1099
|
-
function Rgb(r, g, b, opacity) {
|
|
1100
|
-
this.r = +r;
|
|
1101
|
-
this.g = +g;
|
|
1102
|
-
this.b = +b;
|
|
1103
|
-
this.opacity = +opacity;
|
|
1104
|
-
}
|
|
1105
|
-
define(Rgb, rgb, extend(Color, {
|
|
1106
|
-
brighter(k) {
|
|
1107
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1108
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1109
|
-
},
|
|
1110
|
-
darker(k) {
|
|
1111
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
1112
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
1113
|
-
},
|
|
1114
|
-
rgb() {
|
|
1115
|
-
return this;
|
|
1116
|
-
},
|
|
1117
|
-
clamp() {
|
|
1118
|
-
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
1119
|
-
},
|
|
1120
|
-
displayable() {
|
|
1121
|
-
return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
|
|
1122
|
-
},
|
|
1123
|
-
hex: rgb_formatHex,
|
|
1124
|
-
// Deprecated! Use color.formatHex.
|
|
1125
|
-
formatHex: rgb_formatHex,
|
|
1126
|
-
formatHex8: rgb_formatHex8,
|
|
1127
|
-
formatRgb: rgb_formatRgb,
|
|
1128
|
-
toString: rgb_formatRgb
|
|
1129
|
-
}));
|
|
1130
|
-
function rgb_formatHex() {
|
|
1131
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
1132
|
-
}
|
|
1133
|
-
function rgb_formatHex8() {
|
|
1134
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1135
|
-
}
|
|
1136
|
-
function rgb_formatRgb() {
|
|
1137
|
-
const a = clampa(this.opacity);
|
|
1138
|
-
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
1139
|
-
}
|
|
1140
|
-
function clampa(opacity) {
|
|
1141
|
-
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
1142
|
-
}
|
|
1143
|
-
function clampi(value) {
|
|
1144
|
-
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
1145
|
-
}
|
|
1146
|
-
function hex(value) {
|
|
1147
|
-
value = clampi(value);
|
|
1148
|
-
return (value < 16 ? "0" : "") + value.toString(16);
|
|
1149
|
-
}
|
|
1150
|
-
function hsla(h, s, l, a) {
|
|
1151
|
-
if (a <= 0)
|
|
1152
|
-
h = s = l = NaN;
|
|
1153
|
-
else if (l <= 0 || l >= 1)
|
|
1154
|
-
h = s = NaN;
|
|
1155
|
-
else if (s <= 0)
|
|
1156
|
-
h = NaN;
|
|
1157
|
-
return new Hsl(h, s, l, a);
|
|
1158
|
-
}
|
|
1159
|
-
function hslConvert(o) {
|
|
1160
|
-
if (o instanceof Hsl)
|
|
1161
|
-
return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
1162
|
-
if (!(o instanceof Color))
|
|
1163
|
-
o = color(o);
|
|
1164
|
-
if (!o)
|
|
1165
|
-
return new Hsl();
|
|
1166
|
-
if (o instanceof Hsl)
|
|
1167
|
-
return o;
|
|
1168
|
-
o = o.rgb();
|
|
1169
|
-
var r = o.r / 255, g = o.g / 255, b = o.b / 255, min = Math.min(r, g, b), max = Math.max(r, g, b), h = NaN, s = max - min, l = (max + min) / 2;
|
|
1170
|
-
if (s) {
|
|
1171
|
-
if (r === max)
|
|
1172
|
-
h = (g - b) / s + (g < b) * 6;
|
|
1173
|
-
else if (g === max)
|
|
1174
|
-
h = (b - r) / s + 2;
|
|
1175
|
-
else
|
|
1176
|
-
h = (r - g) / s + 4;
|
|
1177
|
-
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
1178
|
-
h *= 60;
|
|
1179
|
-
} else {
|
|
1180
|
-
s = l > 0 && l < 1 ? 0 : h;
|
|
1181
|
-
}
|
|
1182
|
-
return new Hsl(h, s, l, o.opacity);
|
|
1183
|
-
}
|
|
1184
|
-
function hsl(h, s, l, opacity) {
|
|
1185
|
-
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
1186
|
-
}
|
|
1187
|
-
function Hsl(h, s, l, opacity) {
|
|
1188
|
-
this.h = +h;
|
|
1189
|
-
this.s = +s;
|
|
1190
|
-
this.l = +l;
|
|
1191
|
-
this.opacity = +opacity;
|
|
1192
|
-
}
|
|
1193
|
-
define(Hsl, hsl, extend(Color, {
|
|
1194
|
-
brighter(k) {
|
|
1195
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
1196
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1197
|
-
},
|
|
1198
|
-
darker(k) {
|
|
1199
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
1200
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
1201
|
-
},
|
|
1202
|
-
rgb() {
|
|
1203
|
-
var h = this.h % 360 + (this.h < 0) * 360, s = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s, m1 = 2 * l - m2;
|
|
1204
|
-
return new Rgb(
|
|
1205
|
-
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
1206
|
-
hsl2rgb(h, m1, m2),
|
|
1207
|
-
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
1208
|
-
this.opacity
|
|
1209
|
-
);
|
|
1210
|
-
},
|
|
1211
|
-
clamp() {
|
|
1212
|
-
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
1213
|
-
},
|
|
1214
|
-
displayable() {
|
|
1215
|
-
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
|
|
1216
|
-
},
|
|
1217
|
-
formatHsl() {
|
|
1218
|
-
const a = clampa(this.opacity);
|
|
1219
|
-
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
1220
|
-
}
|
|
1221
|
-
}));
|
|
1222
|
-
function clamph(value) {
|
|
1223
|
-
value = (value || 0) % 360;
|
|
1224
|
-
return value < 0 ? value + 360 : value;
|
|
1225
|
-
}
|
|
1226
|
-
function clampt(value) {
|
|
1227
|
-
return Math.max(0, Math.min(1, value || 0));
|
|
1228
|
-
}
|
|
1229
|
-
function hsl2rgb(h, m1, m2) {
|
|
1230
|
-
return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
|
1231
|
-
}
|
|
1232
|
-
const constant$1 = (x) => () => x;
|
|
1233
|
-
function linear(a, d) {
|
|
1234
|
-
return function(t) {
|
|
1235
|
-
return a + t * d;
|
|
1236
|
-
};
|
|
1237
|
-
}
|
|
1238
|
-
function exponential(a, b, y) {
|
|
1239
|
-
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
|
1240
|
-
return Math.pow(a + t * b, y);
|
|
1241
|
-
};
|
|
1242
|
-
}
|
|
1243
|
-
function gamma(y) {
|
|
1244
|
-
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
1245
|
-
return b - a ? exponential(a, b, y) : constant$1(isNaN(a) ? b : a);
|
|
1246
|
-
};
|
|
1247
|
-
}
|
|
1248
|
-
function nogamma(a, b) {
|
|
1249
|
-
var d = b - a;
|
|
1250
|
-
return d ? linear(a, d) : constant$1(isNaN(a) ? b : a);
|
|
1251
|
-
}
|
|
1252
|
-
const interpolateRgb = function rgbGamma(y) {
|
|
1253
|
-
var color2 = gamma(y);
|
|
1254
|
-
function rgb$1(start2, end) {
|
|
1255
|
-
var r = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
|
|
1256
|
-
return function(t) {
|
|
1257
|
-
start2.r = r(t);
|
|
1258
|
-
start2.g = g(t);
|
|
1259
|
-
start2.b = b(t);
|
|
1260
|
-
start2.opacity = opacity(t);
|
|
1261
|
-
return start2 + "";
|
|
1262
|
-
};
|
|
1263
|
-
}
|
|
1264
|
-
rgb$1.gamma = rgbGamma;
|
|
1265
|
-
return rgb$1;
|
|
1266
|
-
}(1);
|
|
1267
|
-
function interpolateNumber(a, b) {
|
|
1268
|
-
return a = +a, b = +b, function(t) {
|
|
1269
|
-
return a * (1 - t) + b * t;
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
|
|
1273
|
-
function zero(b) {
|
|
1274
|
-
return function() {
|
|
1275
|
-
return b;
|
|
1276
|
-
};
|
|
1277
|
-
}
|
|
1278
|
-
function one(b) {
|
|
1279
|
-
return function(t) {
|
|
1280
|
-
return b(t) + "";
|
|
1281
|
-
};
|
|
1282
|
-
}
|
|
1283
|
-
function interpolateString(a, b) {
|
|
1284
|
-
var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
|
|
1285
|
-
a = a + "", b = b + "";
|
|
1286
|
-
while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
|
|
1287
|
-
if ((bs = bm.index) > bi) {
|
|
1288
|
-
bs = b.slice(bi, bs);
|
|
1289
|
-
if (s[i])
|
|
1290
|
-
s[i] += bs;
|
|
1291
|
-
else
|
|
1292
|
-
s[++i] = bs;
|
|
1293
|
-
}
|
|
1294
|
-
if ((am = am[0]) === (bm = bm[0])) {
|
|
1295
|
-
if (s[i])
|
|
1296
|
-
s[i] += bm;
|
|
1297
|
-
else
|
|
1298
|
-
s[++i] = bm;
|
|
1299
|
-
} else {
|
|
1300
|
-
s[++i] = null;
|
|
1301
|
-
q.push({ i, x: interpolateNumber(am, bm) });
|
|
1302
|
-
}
|
|
1303
|
-
bi = reB.lastIndex;
|
|
1304
|
-
}
|
|
1305
|
-
if (bi < b.length) {
|
|
1306
|
-
bs = b.slice(bi);
|
|
1307
|
-
if (s[i])
|
|
1308
|
-
s[i] += bs;
|
|
1309
|
-
else
|
|
1310
|
-
s[++i] = bs;
|
|
1311
|
-
}
|
|
1312
|
-
return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
|
|
1313
|
-
for (var i2 = 0, o; i2 < b; ++i2)
|
|
1314
|
-
s[(o = q[i2]).i] = o.x(t);
|
|
1315
|
-
return s.join("");
|
|
1316
|
-
});
|
|
1317
|
-
}
|
|
1318
|
-
var degrees = 180 / Math.PI;
|
|
1319
|
-
var identity$1 = {
|
|
1320
|
-
translateX: 0,
|
|
1321
|
-
translateY: 0,
|
|
1322
|
-
rotate: 0,
|
|
1323
|
-
skewX: 0,
|
|
1324
|
-
scaleX: 1,
|
|
1325
|
-
scaleY: 1
|
|
1326
|
-
};
|
|
1327
|
-
function decompose(a, b, c, d, e, f) {
|
|
1328
|
-
var scaleX, scaleY, skewX;
|
|
1329
|
-
if (scaleX = Math.sqrt(a * a + b * b))
|
|
1330
|
-
a /= scaleX, b /= scaleX;
|
|
1331
|
-
if (skewX = a * c + b * d)
|
|
1332
|
-
c -= a * skewX, d -= b * skewX;
|
|
1333
|
-
if (scaleY = Math.sqrt(c * c + d * d))
|
|
1334
|
-
c /= scaleY, d /= scaleY, skewX /= scaleY;
|
|
1335
|
-
if (a * d < b * c)
|
|
1336
|
-
a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
|
|
1337
|
-
return {
|
|
1338
|
-
translateX: e,
|
|
1339
|
-
translateY: f,
|
|
1340
|
-
rotate: Math.atan2(b, a) * degrees,
|
|
1341
|
-
skewX: Math.atan(skewX) * degrees,
|
|
1342
|
-
scaleX,
|
|
1343
|
-
scaleY
|
|
1344
|
-
};
|
|
1345
|
-
}
|
|
1346
|
-
var svgNode;
|
|
1347
|
-
function parseCss(value) {
|
|
1348
|
-
const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
|
1349
|
-
return m.isIdentity ? identity$1 : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
|
1350
|
-
}
|
|
1351
|
-
function parseSvg(value) {
|
|
1352
|
-
if (value == null)
|
|
1353
|
-
return identity$1;
|
|
1354
|
-
if (!svgNode)
|
|
1355
|
-
svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1356
|
-
svgNode.setAttribute("transform", value);
|
|
1357
|
-
if (!(value = svgNode.transform.baseVal.consolidate()))
|
|
1358
|
-
return identity$1;
|
|
1359
|
-
value = value.matrix;
|
|
1360
|
-
return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
|
|
1361
|
-
}
|
|
1362
|
-
function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
|
1363
|
-
function pop(s) {
|
|
1364
|
-
return s.length ? s.pop() + " " : "";
|
|
1365
|
-
}
|
|
1366
|
-
function translate(xa, ya, xb, yb, s, q) {
|
|
1367
|
-
if (xa !== xb || ya !== yb) {
|
|
1368
|
-
var i = s.push("translate(", null, pxComma, null, pxParen);
|
|
1369
|
-
q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
|
1370
|
-
} else if (xb || yb) {
|
|
1371
|
-
s.push("translate(" + xb + pxComma + yb + pxParen);
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
function rotate(a, b, s, q) {
|
|
1375
|
-
if (a !== b) {
|
|
1376
|
-
if (a - b > 180)
|
|
1377
|
-
b += 360;
|
|
1378
|
-
else if (b - a > 180)
|
|
1379
|
-
a += 360;
|
|
1380
|
-
q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b) });
|
|
1381
|
-
} else if (b) {
|
|
1382
|
-
s.push(pop(s) + "rotate(" + b + degParen);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
function skewX(a, b, s, q) {
|
|
1386
|
-
if (a !== b) {
|
|
1387
|
-
q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b) });
|
|
1388
|
-
} else if (b) {
|
|
1389
|
-
s.push(pop(s) + "skewX(" + b + degParen);
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
function scale(xa, ya, xb, yb, s, q) {
|
|
1393
|
-
if (xa !== xb || ya !== yb) {
|
|
1394
|
-
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
|
1395
|
-
q.push({ i: i - 4, x: interpolateNumber(xa, xb) }, { i: i - 2, x: interpolateNumber(ya, yb) });
|
|
1396
|
-
} else if (xb !== 1 || yb !== 1) {
|
|
1397
|
-
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
return function(a, b) {
|
|
1401
|
-
var s = [], q = [];
|
|
1402
|
-
a = parse(a), b = parse(b);
|
|
1403
|
-
translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
|
|
1404
|
-
rotate(a.rotate, b.rotate, s, q);
|
|
1405
|
-
skewX(a.skewX, b.skewX, s, q);
|
|
1406
|
-
scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
|
|
1407
|
-
a = b = null;
|
|
1408
|
-
return function(t) {
|
|
1409
|
-
var i = -1, n = q.length, o;
|
|
1410
|
-
while (++i < n)
|
|
1411
|
-
s[(o = q[i]).i] = o.x(t);
|
|
1412
|
-
return s.join("");
|
|
1413
|
-
};
|
|
1414
|
-
};
|
|
1415
|
-
}
|
|
1416
|
-
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
|
1417
|
-
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
|
1418
|
-
var epsilon2 = 1e-12;
|
|
1419
|
-
function cosh(x) {
|
|
1420
|
-
return ((x = Math.exp(x)) + 1 / x) / 2;
|
|
1421
|
-
}
|
|
1422
|
-
function sinh(x) {
|
|
1423
|
-
return ((x = Math.exp(x)) - 1 / x) / 2;
|
|
1424
|
-
}
|
|
1425
|
-
function tanh(x) {
|
|
1426
|
-
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
|
1427
|
-
}
|
|
1428
|
-
const interpolateZoom = function zoomRho(rho, rho2, rho4) {
|
|
1429
|
-
function zoom2(p0, p1) {
|
|
1430
|
-
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
|
|
1431
|
-
if (d2 < epsilon2) {
|
|
1432
|
-
S = Math.log(w1 / w0) / rho;
|
|
1433
|
-
i = function(t) {
|
|
1434
|
-
return [
|
|
1435
|
-
ux0 + t * dx,
|
|
1436
|
-
uy0 + t * dy,
|
|
1437
|
-
w0 * Math.exp(rho * t * S)
|
|
1438
|
-
];
|
|
1439
|
-
};
|
|
1440
|
-
} else {
|
|
1441
|
-
var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
|
1442
|
-
S = (r1 - r0) / rho;
|
|
1443
|
-
i = function(t) {
|
|
1444
|
-
var s = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
|
1445
|
-
return [
|
|
1446
|
-
ux0 + u * dx,
|
|
1447
|
-
uy0 + u * dy,
|
|
1448
|
-
w0 * coshr0 / cosh(rho * s + r0)
|
|
1449
|
-
];
|
|
1450
|
-
};
|
|
1451
|
-
}
|
|
1452
|
-
i.duration = S * 1e3 * rho / Math.SQRT2;
|
|
1453
|
-
return i;
|
|
1454
|
-
}
|
|
1455
|
-
zoom2.rho = function(_) {
|
|
1456
|
-
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
|
|
1457
|
-
return zoomRho(_1, _2, _4);
|
|
1458
|
-
};
|
|
1459
|
-
return zoom2;
|
|
1460
|
-
}(Math.SQRT2, 2, 4);
|
|
1461
|
-
var frame = 0, timeout$1 = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance === "object" && performance.now ? performance : Date, setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
|
|
1462
|
-
setTimeout(f, 17);
|
|
1463
|
-
};
|
|
1464
|
-
function now() {
|
|
1465
|
-
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
|
1466
|
-
}
|
|
1467
|
-
function clearNow() {
|
|
1468
|
-
clockNow = 0;
|
|
1469
|
-
}
|
|
1470
|
-
function Timer() {
|
|
1471
|
-
this._call = this._time = this._next = null;
|
|
1472
|
-
}
|
|
1473
|
-
Timer.prototype = timer.prototype = {
|
|
1474
|
-
constructor: Timer,
|
|
1475
|
-
restart: function(callback, delay, time) {
|
|
1476
|
-
if (typeof callback !== "function")
|
|
1477
|
-
throw new TypeError("callback is not a function");
|
|
1478
|
-
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
|
1479
|
-
if (!this._next && taskTail !== this) {
|
|
1480
|
-
if (taskTail)
|
|
1481
|
-
taskTail._next = this;
|
|
1482
|
-
else
|
|
1483
|
-
taskHead = this;
|
|
1484
|
-
taskTail = this;
|
|
1485
|
-
}
|
|
1486
|
-
this._call = callback;
|
|
1487
|
-
this._time = time;
|
|
1488
|
-
sleep();
|
|
1489
|
-
},
|
|
1490
|
-
stop: function() {
|
|
1491
|
-
if (this._call) {
|
|
1492
|
-
this._call = null;
|
|
1493
|
-
this._time = Infinity;
|
|
1494
|
-
sleep();
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
};
|
|
1498
|
-
function timer(callback, delay, time) {
|
|
1499
|
-
var t = new Timer();
|
|
1500
|
-
t.restart(callback, delay, time);
|
|
1501
|
-
return t;
|
|
1502
|
-
}
|
|
1503
|
-
function timerFlush() {
|
|
1504
|
-
now();
|
|
1505
|
-
++frame;
|
|
1506
|
-
var t = taskHead, e;
|
|
1507
|
-
while (t) {
|
|
1508
|
-
if ((e = clockNow - t._time) >= 0)
|
|
1509
|
-
t._call.call(void 0, e);
|
|
1510
|
-
t = t._next;
|
|
1511
|
-
}
|
|
1512
|
-
--frame;
|
|
1513
|
-
}
|
|
1514
|
-
function wake() {
|
|
1515
|
-
clockNow = (clockLast = clock.now()) + clockSkew;
|
|
1516
|
-
frame = timeout$1 = 0;
|
|
1517
|
-
try {
|
|
1518
|
-
timerFlush();
|
|
1519
|
-
} finally {
|
|
1520
|
-
frame = 0;
|
|
1521
|
-
nap();
|
|
1522
|
-
clockNow = 0;
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
function poke() {
|
|
1526
|
-
var now2 = clock.now(), delay = now2 - clockLast;
|
|
1527
|
-
if (delay > pokeDelay)
|
|
1528
|
-
clockSkew -= delay, clockLast = now2;
|
|
1529
|
-
}
|
|
1530
|
-
function nap() {
|
|
1531
|
-
var t0, t1 = taskHead, t2, time = Infinity;
|
|
1532
|
-
while (t1) {
|
|
1533
|
-
if (t1._call) {
|
|
1534
|
-
if (time > t1._time)
|
|
1535
|
-
time = t1._time;
|
|
1536
|
-
t0 = t1, t1 = t1._next;
|
|
1537
|
-
} else {
|
|
1538
|
-
t2 = t1._next, t1._next = null;
|
|
1539
|
-
t1 = t0 ? t0._next = t2 : taskHead = t2;
|
|
1540
|
-
}
|
|
1541
|
-
}
|
|
1542
|
-
taskTail = t0;
|
|
1543
|
-
sleep(time);
|
|
1544
|
-
}
|
|
1545
|
-
function sleep(time) {
|
|
1546
|
-
if (frame)
|
|
1547
|
-
return;
|
|
1548
|
-
if (timeout$1)
|
|
1549
|
-
timeout$1 = clearTimeout(timeout$1);
|
|
1550
|
-
var delay = time - clockNow;
|
|
1551
|
-
if (delay > 24) {
|
|
1552
|
-
if (time < Infinity)
|
|
1553
|
-
timeout$1 = setTimeout(wake, time - clock.now() - clockSkew);
|
|
1554
|
-
if (interval)
|
|
1555
|
-
interval = clearInterval(interval);
|
|
1556
|
-
} else {
|
|
1557
|
-
if (!interval)
|
|
1558
|
-
clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
|
1559
|
-
frame = 1, setFrame(wake);
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
function timeout(callback, delay, time) {
|
|
1563
|
-
var t = new Timer();
|
|
1564
|
-
delay = delay == null ? 0 : +delay;
|
|
1565
|
-
t.restart((elapsed) => {
|
|
1566
|
-
t.stop();
|
|
1567
|
-
callback(elapsed + delay);
|
|
1568
|
-
}, delay, time);
|
|
1569
|
-
return t;
|
|
1570
|
-
}
|
|
1571
|
-
var emptyOn = dispatch("start", "end", "cancel", "interrupt");
|
|
1572
|
-
var emptyTween = [];
|
|
1573
|
-
var CREATED = 0;
|
|
1574
|
-
var SCHEDULED = 1;
|
|
1575
|
-
var STARTING = 2;
|
|
1576
|
-
var STARTED = 3;
|
|
1577
|
-
var RUNNING = 4;
|
|
1578
|
-
var ENDING = 5;
|
|
1579
|
-
var ENDED = 6;
|
|
1580
|
-
function schedule(node, name, id2, index, group, timing) {
|
|
1581
|
-
var schedules = node.__transition;
|
|
1582
|
-
if (!schedules)
|
|
1583
|
-
node.__transition = {};
|
|
1584
|
-
else if (id2 in schedules)
|
|
1585
|
-
return;
|
|
1586
|
-
create(node, id2, {
|
|
1587
|
-
name,
|
|
1588
|
-
index,
|
|
1589
|
-
// For context during callback.
|
|
1590
|
-
group,
|
|
1591
|
-
// For context during callback.
|
|
1592
|
-
on: emptyOn,
|
|
1593
|
-
tween: emptyTween,
|
|
1594
|
-
time: timing.time,
|
|
1595
|
-
delay: timing.delay,
|
|
1596
|
-
duration: timing.duration,
|
|
1597
|
-
ease: timing.ease,
|
|
1598
|
-
timer: null,
|
|
1599
|
-
state: CREATED
|
|
1600
|
-
});
|
|
1601
|
-
}
|
|
1602
|
-
function init(node, id2) {
|
|
1603
|
-
var schedule2 = get(node, id2);
|
|
1604
|
-
if (schedule2.state > CREATED)
|
|
1605
|
-
throw new Error("too late; already scheduled");
|
|
1606
|
-
return schedule2;
|
|
1607
|
-
}
|
|
1608
|
-
function set(node, id2) {
|
|
1609
|
-
var schedule2 = get(node, id2);
|
|
1610
|
-
if (schedule2.state > STARTED)
|
|
1611
|
-
throw new Error("too late; already running");
|
|
1612
|
-
return schedule2;
|
|
1613
|
-
}
|
|
1614
|
-
function get(node, id2) {
|
|
1615
|
-
var schedule2 = node.__transition;
|
|
1616
|
-
if (!schedule2 || !(schedule2 = schedule2[id2]))
|
|
1617
|
-
throw new Error("transition not found");
|
|
1618
|
-
return schedule2;
|
|
1619
|
-
}
|
|
1620
|
-
function create(node, id2, self) {
|
|
1621
|
-
var schedules = node.__transition, tween;
|
|
1622
|
-
schedules[id2] = self;
|
|
1623
|
-
self.timer = timer(schedule2, 0, self.time);
|
|
1624
|
-
function schedule2(elapsed) {
|
|
1625
|
-
self.state = SCHEDULED;
|
|
1626
|
-
self.timer.restart(start2, self.delay, self.time);
|
|
1627
|
-
if (self.delay <= elapsed)
|
|
1628
|
-
start2(elapsed - self.delay);
|
|
1629
|
-
}
|
|
1630
|
-
function start2(elapsed) {
|
|
1631
|
-
var i, j, n, o;
|
|
1632
|
-
if (self.state !== SCHEDULED)
|
|
1633
|
-
return stop();
|
|
1634
|
-
for (i in schedules) {
|
|
1635
|
-
o = schedules[i];
|
|
1636
|
-
if (o.name !== self.name)
|
|
1637
|
-
continue;
|
|
1638
|
-
if (o.state === STARTED)
|
|
1639
|
-
return timeout(start2);
|
|
1640
|
-
if (o.state === RUNNING) {
|
|
1641
|
-
o.state = ENDED;
|
|
1642
|
-
o.timer.stop();
|
|
1643
|
-
o.on.call("interrupt", node, node.__data__, o.index, o.group);
|
|
1644
|
-
delete schedules[i];
|
|
1645
|
-
} else if (+i < id2) {
|
|
1646
|
-
o.state = ENDED;
|
|
1647
|
-
o.timer.stop();
|
|
1648
|
-
o.on.call("cancel", node, node.__data__, o.index, o.group);
|
|
1649
|
-
delete schedules[i];
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
timeout(function() {
|
|
1653
|
-
if (self.state === STARTED) {
|
|
1654
|
-
self.state = RUNNING;
|
|
1655
|
-
self.timer.restart(tick, self.delay, self.time);
|
|
1656
|
-
tick(elapsed);
|
|
1657
|
-
}
|
|
1658
|
-
});
|
|
1659
|
-
self.state = STARTING;
|
|
1660
|
-
self.on.call("start", node, node.__data__, self.index, self.group);
|
|
1661
|
-
if (self.state !== STARTING)
|
|
1662
|
-
return;
|
|
1663
|
-
self.state = STARTED;
|
|
1664
|
-
tween = new Array(n = self.tween.length);
|
|
1665
|
-
for (i = 0, j = -1; i < n; ++i) {
|
|
1666
|
-
if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
|
|
1667
|
-
tween[++j] = o;
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
tween.length = j + 1;
|
|
1671
|
-
}
|
|
1672
|
-
function tick(elapsed) {
|
|
1673
|
-
var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length;
|
|
1674
|
-
while (++i < n) {
|
|
1675
|
-
tween[i].call(node, t);
|
|
1676
|
-
}
|
|
1677
|
-
if (self.state === ENDING) {
|
|
1678
|
-
self.on.call("end", node, node.__data__, self.index, self.group);
|
|
1679
|
-
stop();
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
function stop() {
|
|
1683
|
-
self.state = ENDED;
|
|
1684
|
-
self.timer.stop();
|
|
1685
|
-
delete schedules[id2];
|
|
1686
|
-
for (var i in schedules)
|
|
1687
|
-
return;
|
|
1688
|
-
delete node.__transition;
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
function interrupt(node, name) {
|
|
1692
|
-
var schedules = node.__transition, schedule2, active, empty2 = true, i;
|
|
1693
|
-
if (!schedules)
|
|
1694
|
-
return;
|
|
1695
|
-
name = name == null ? null : name + "";
|
|
1696
|
-
for (i in schedules) {
|
|
1697
|
-
if ((schedule2 = schedules[i]).name !== name) {
|
|
1698
|
-
empty2 = false;
|
|
1699
|
-
continue;
|
|
1700
|
-
}
|
|
1701
|
-
active = schedule2.state > STARTING && schedule2.state < ENDING;
|
|
1702
|
-
schedule2.state = ENDED;
|
|
1703
|
-
schedule2.timer.stop();
|
|
1704
|
-
schedule2.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule2.index, schedule2.group);
|
|
1705
|
-
delete schedules[i];
|
|
1706
|
-
}
|
|
1707
|
-
if (empty2)
|
|
1708
|
-
delete node.__transition;
|
|
1709
|
-
}
|
|
1710
|
-
function selection_interrupt(name) {
|
|
1711
|
-
return this.each(function() {
|
|
1712
|
-
interrupt(this, name);
|
|
1713
|
-
});
|
|
1714
|
-
}
|
|
1715
|
-
function tweenRemove(id2, name) {
|
|
1716
|
-
var tween0, tween1;
|
|
1717
|
-
return function() {
|
|
1718
|
-
var schedule2 = set(this, id2), tween = schedule2.tween;
|
|
1719
|
-
if (tween !== tween0) {
|
|
1720
|
-
tween1 = tween0 = tween;
|
|
1721
|
-
for (var i = 0, n = tween1.length; i < n; ++i) {
|
|
1722
|
-
if (tween1[i].name === name) {
|
|
1723
|
-
tween1 = tween1.slice();
|
|
1724
|
-
tween1.splice(i, 1);
|
|
1725
|
-
break;
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
schedule2.tween = tween1;
|
|
1730
|
-
};
|
|
1731
|
-
}
|
|
1732
|
-
function tweenFunction(id2, name, value) {
|
|
1733
|
-
var tween0, tween1;
|
|
1734
|
-
if (typeof value !== "function")
|
|
1735
|
-
throw new Error();
|
|
1736
|
-
return function() {
|
|
1737
|
-
var schedule2 = set(this, id2), tween = schedule2.tween;
|
|
1738
|
-
if (tween !== tween0) {
|
|
1739
|
-
tween1 = (tween0 = tween).slice();
|
|
1740
|
-
for (var t = { name, value }, i = 0, n = tween1.length; i < n; ++i) {
|
|
1741
|
-
if (tween1[i].name === name) {
|
|
1742
|
-
tween1[i] = t;
|
|
1743
|
-
break;
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
if (i === n)
|
|
1747
|
-
tween1.push(t);
|
|
1748
|
-
}
|
|
1749
|
-
schedule2.tween = tween1;
|
|
1750
|
-
};
|
|
1751
|
-
}
|
|
1752
|
-
function transition_tween(name, value) {
|
|
1753
|
-
var id2 = this._id;
|
|
1754
|
-
name += "";
|
|
1755
|
-
if (arguments.length < 2) {
|
|
1756
|
-
var tween = get(this.node(), id2).tween;
|
|
1757
|
-
for (var i = 0, n = tween.length, t; i < n; ++i) {
|
|
1758
|
-
if ((t = tween[i]).name === name) {
|
|
1759
|
-
return t.value;
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
return null;
|
|
1763
|
-
}
|
|
1764
|
-
return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
|
|
1765
|
-
}
|
|
1766
|
-
function tweenValue(transition, name, value) {
|
|
1767
|
-
var id2 = transition._id;
|
|
1768
|
-
transition.each(function() {
|
|
1769
|
-
var schedule2 = set(this, id2);
|
|
1770
|
-
(schedule2.value || (schedule2.value = {}))[name] = value.apply(this, arguments);
|
|
1771
|
-
});
|
|
1772
|
-
return function(node) {
|
|
1773
|
-
return get(node, id2).value[name];
|
|
1774
|
-
};
|
|
1775
|
-
}
|
|
1776
|
-
function interpolate(a, b) {
|
|
1777
|
-
var c;
|
|
1778
|
-
return (typeof b === "number" ? interpolateNumber : b instanceof color ? interpolateRgb : (c = color(b)) ? (b = c, interpolateRgb) : interpolateString)(a, b);
|
|
1779
|
-
}
|
|
1780
|
-
function attrRemove(name) {
|
|
1781
|
-
return function() {
|
|
1782
|
-
this.removeAttribute(name);
|
|
1783
|
-
};
|
|
1784
|
-
}
|
|
1785
|
-
function attrRemoveNS(fullname) {
|
|
1786
|
-
return function() {
|
|
1787
|
-
this.removeAttributeNS(fullname.space, fullname.local);
|
|
1788
|
-
};
|
|
1789
|
-
}
|
|
1790
|
-
function attrConstant(name, interpolate2, value1) {
|
|
1791
|
-
var string00, string1 = value1 + "", interpolate0;
|
|
1792
|
-
return function() {
|
|
1793
|
-
var string0 = this.getAttribute(name);
|
|
1794
|
-
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
|
1795
|
-
};
|
|
1796
|
-
}
|
|
1797
|
-
function attrConstantNS(fullname, interpolate2, value1) {
|
|
1798
|
-
var string00, string1 = value1 + "", interpolate0;
|
|
1799
|
-
return function() {
|
|
1800
|
-
var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
|
1801
|
-
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
|
1802
|
-
};
|
|
1803
|
-
}
|
|
1804
|
-
function attrFunction(name, interpolate2, value) {
|
|
1805
|
-
var string00, string10, interpolate0;
|
|
1806
|
-
return function() {
|
|
1807
|
-
var string0, value1 = value(this), string1;
|
|
1808
|
-
if (value1 == null)
|
|
1809
|
-
return void this.removeAttribute(name);
|
|
1810
|
-
string0 = this.getAttribute(name);
|
|
1811
|
-
string1 = value1 + "";
|
|
1812
|
-
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
|
1813
|
-
};
|
|
1814
|
-
}
|
|
1815
|
-
function attrFunctionNS(fullname, interpolate2, value) {
|
|
1816
|
-
var string00, string10, interpolate0;
|
|
1817
|
-
return function() {
|
|
1818
|
-
var string0, value1 = value(this), string1;
|
|
1819
|
-
if (value1 == null)
|
|
1820
|
-
return void this.removeAttributeNS(fullname.space, fullname.local);
|
|
1821
|
-
string0 = this.getAttributeNS(fullname.space, fullname.local);
|
|
1822
|
-
string1 = value1 + "";
|
|
1823
|
-
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
|
1824
|
-
};
|
|
1825
|
-
}
|
|
1826
|
-
function transition_attr(name, value) {
|
|
1827
|
-
var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
|
|
1828
|
-
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));
|
|
1829
|
-
}
|
|
1830
|
-
function attrInterpolate(name, i) {
|
|
1831
|
-
return function(t) {
|
|
1832
|
-
this.setAttribute(name, i.call(this, t));
|
|
1833
|
-
};
|
|
1834
|
-
}
|
|
1835
|
-
function attrInterpolateNS(fullname, i) {
|
|
1836
|
-
return function(t) {
|
|
1837
|
-
this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
|
1838
|
-
};
|
|
1839
|
-
}
|
|
1840
|
-
function attrTweenNS(fullname, value) {
|
|
1841
|
-
var t0, i0;
|
|
1842
|
-
function tween() {
|
|
1843
|
-
var i = value.apply(this, arguments);
|
|
1844
|
-
if (i !== i0)
|
|
1845
|
-
t0 = (i0 = i) && attrInterpolateNS(fullname, i);
|
|
1846
|
-
return t0;
|
|
1847
|
-
}
|
|
1848
|
-
tween._value = value;
|
|
1849
|
-
return tween;
|
|
1850
|
-
}
|
|
1851
|
-
function attrTween(name, value) {
|
|
1852
|
-
var t0, i0;
|
|
1853
|
-
function tween() {
|
|
1854
|
-
var i = value.apply(this, arguments);
|
|
1855
|
-
if (i !== i0)
|
|
1856
|
-
t0 = (i0 = i) && attrInterpolate(name, i);
|
|
1857
|
-
return t0;
|
|
1858
|
-
}
|
|
1859
|
-
tween._value = value;
|
|
1860
|
-
return tween;
|
|
1861
|
-
}
|
|
1862
|
-
function transition_attrTween(name, value) {
|
|
1863
|
-
var key = "attr." + name;
|
|
1864
|
-
if (arguments.length < 2)
|
|
1865
|
-
return (key = this.tween(key)) && key._value;
|
|
1866
|
-
if (value == null)
|
|
1867
|
-
return this.tween(key, null);
|
|
1868
|
-
if (typeof value !== "function")
|
|
1869
|
-
throw new Error();
|
|
1870
|
-
var fullname = namespace(name);
|
|
1871
|
-
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
|
1872
|
-
}
|
|
1873
|
-
function delayFunction(id2, value) {
|
|
1874
|
-
return function() {
|
|
1875
|
-
init(this, id2).delay = +value.apply(this, arguments);
|
|
1876
|
-
};
|
|
1877
|
-
}
|
|
1878
|
-
function delayConstant(id2, value) {
|
|
1879
|
-
return value = +value, function() {
|
|
1880
|
-
init(this, id2).delay = value;
|
|
1881
|
-
};
|
|
1882
|
-
}
|
|
1883
|
-
function transition_delay(value) {
|
|
1884
|
-
var id2 = this._id;
|
|
1885
|
-
return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get(this.node(), id2).delay;
|
|
1886
|
-
}
|
|
1887
|
-
function durationFunction(id2, value) {
|
|
1888
|
-
return function() {
|
|
1889
|
-
set(this, id2).duration = +value.apply(this, arguments);
|
|
1890
|
-
};
|
|
1891
|
-
}
|
|
1892
|
-
function durationConstant(id2, value) {
|
|
1893
|
-
return value = +value, function() {
|
|
1894
|
-
set(this, id2).duration = value;
|
|
1895
|
-
};
|
|
1896
|
-
}
|
|
1897
|
-
function transition_duration(value) {
|
|
1898
|
-
var id2 = this._id;
|
|
1899
|
-
return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get(this.node(), id2).duration;
|
|
1900
|
-
}
|
|
1901
|
-
function easeConstant(id2, value) {
|
|
1902
|
-
if (typeof value !== "function")
|
|
1903
|
-
throw new Error();
|
|
1904
|
-
return function() {
|
|
1905
|
-
set(this, id2).ease = value;
|
|
1906
|
-
};
|
|
1907
|
-
}
|
|
1908
|
-
function transition_ease(value) {
|
|
1909
|
-
var id2 = this._id;
|
|
1910
|
-
return arguments.length ? this.each(easeConstant(id2, value)) : get(this.node(), id2).ease;
|
|
1911
|
-
}
|
|
1912
|
-
function easeVarying(id2, value) {
|
|
1913
|
-
return function() {
|
|
1914
|
-
var v = value.apply(this, arguments);
|
|
1915
|
-
if (typeof v !== "function")
|
|
1916
|
-
throw new Error();
|
|
1917
|
-
set(this, id2).ease = v;
|
|
1918
|
-
};
|
|
1919
|
-
}
|
|
1920
|
-
function transition_easeVarying(value) {
|
|
1921
|
-
if (typeof value !== "function")
|
|
1922
|
-
throw new Error();
|
|
1923
|
-
return this.each(easeVarying(this._id, value));
|
|
1924
|
-
}
|
|
1925
|
-
function transition_filter(match) {
|
|
1926
|
-
if (typeof match !== "function")
|
|
1927
|
-
match = matcher(match);
|
|
1928
|
-
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
1929
|
-
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
|
1930
|
-
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
|
1931
|
-
subgroup.push(node);
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
return new Transition(subgroups, this._parents, this._name, this._id);
|
|
1936
|
-
}
|
|
1937
|
-
function transition_merge(transition) {
|
|
1938
|
-
if (transition._id !== this._id)
|
|
1939
|
-
throw new Error();
|
|
1940
|
-
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
|
1941
|
-
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
|
1942
|
-
if (node = group0[i] || group1[i]) {
|
|
1943
|
-
merge[i] = node;
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
for (; j < m0; ++j) {
|
|
1948
|
-
merges[j] = groups0[j];
|
|
1949
|
-
}
|
|
1950
|
-
return new Transition(merges, this._parents, this._name, this._id);
|
|
1951
|
-
}
|
|
1952
|
-
function start(name) {
|
|
1953
|
-
return (name + "").trim().split(/^|\s+/).every(function(t) {
|
|
1954
|
-
var i = t.indexOf(".");
|
|
1955
|
-
if (i >= 0)
|
|
1956
|
-
t = t.slice(0, i);
|
|
1957
|
-
return !t || t === "start";
|
|
1958
|
-
});
|
|
1959
|
-
}
|
|
1960
|
-
function onFunction(id2, name, listener) {
|
|
1961
|
-
var on0, on1, sit = start(name) ? init : set;
|
|
1962
|
-
return function() {
|
|
1963
|
-
var schedule2 = sit(this, id2), on = schedule2.on;
|
|
1964
|
-
if (on !== on0)
|
|
1965
|
-
(on1 = (on0 = on).copy()).on(name, listener);
|
|
1966
|
-
schedule2.on = on1;
|
|
1967
|
-
};
|
|
1968
|
-
}
|
|
1969
|
-
function transition_on(name, listener) {
|
|
1970
|
-
var id2 = this._id;
|
|
1971
|
-
return arguments.length < 2 ? get(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
|
|
1972
|
-
}
|
|
1973
|
-
function removeFunction(id2) {
|
|
1974
|
-
return function() {
|
|
1975
|
-
var parent = this.parentNode;
|
|
1976
|
-
for (var i in this.__transition)
|
|
1977
|
-
if (+i !== id2)
|
|
1978
|
-
return;
|
|
1979
|
-
if (parent)
|
|
1980
|
-
parent.removeChild(this);
|
|
1981
|
-
};
|
|
1982
|
-
}
|
|
1983
|
-
function transition_remove() {
|
|
1984
|
-
return this.on("end.remove", removeFunction(this._id));
|
|
1985
|
-
}
|
|
1986
|
-
function transition_select(select2) {
|
|
1987
|
-
var name = this._name, id2 = this._id;
|
|
1988
|
-
if (typeof select2 !== "function")
|
|
1989
|
-
select2 = selector(select2);
|
|
1990
|
-
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
|
|
1991
|
-
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
|
|
1992
|
-
if ((node = group[i]) && (subnode = select2.call(node, node.__data__, i, group))) {
|
|
1993
|
-
if ("__data__" in node)
|
|
1994
|
-
subnode.__data__ = node.__data__;
|
|
1995
|
-
subgroup[i] = subnode;
|
|
1996
|
-
schedule(subgroup[i], name, id2, i, subgroup, get(node, id2));
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
}
|
|
2000
|
-
return new Transition(subgroups, this._parents, name, id2);
|
|
2001
|
-
}
|
|
2002
|
-
function transition_selectAll(select2) {
|
|
2003
|
-
var name = this._name, id2 = this._id;
|
|
2004
|
-
if (typeof select2 !== "function")
|
|
2005
|
-
select2 = selectorAll(select2);
|
|
2006
|
-
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
|
2007
|
-
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
2008
|
-
if (node = group[i]) {
|
|
2009
|
-
for (var children2 = select2.call(node, node.__data__, i, group), child, inherit2 = get(node, id2), k = 0, l = children2.length; k < l; ++k) {
|
|
2010
|
-
if (child = children2[k]) {
|
|
2011
|
-
schedule(child, name, id2, k, children2, inherit2);
|
|
2012
|
-
}
|
|
2013
|
-
}
|
|
2014
|
-
subgroups.push(children2);
|
|
2015
|
-
parents.push(node);
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
return new Transition(subgroups, parents, name, id2);
|
|
2020
|
-
}
|
|
2021
|
-
var Selection = selection.prototype.constructor;
|
|
2022
|
-
function transition_selection() {
|
|
2023
|
-
return new Selection(this._groups, this._parents);
|
|
2024
|
-
}
|
|
2025
|
-
function styleNull(name, interpolate2) {
|
|
2026
|
-
var string00, string10, interpolate0;
|
|
2027
|
-
return function() {
|
|
2028
|
-
var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
|
|
2029
|
-
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, string10 = string1);
|
|
2030
|
-
};
|
|
2031
|
-
}
|
|
2032
|
-
function styleRemove(name) {
|
|
2033
|
-
return function() {
|
|
2034
|
-
this.style.removeProperty(name);
|
|
2035
|
-
};
|
|
2036
|
-
}
|
|
2037
|
-
function styleConstant(name, interpolate2, value1) {
|
|
2038
|
-
var string00, string1 = value1 + "", interpolate0;
|
|
2039
|
-
return function() {
|
|
2040
|
-
var string0 = styleValue(this, name);
|
|
2041
|
-
return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate2(string00 = string0, value1);
|
|
2042
|
-
};
|
|
2043
|
-
}
|
|
2044
|
-
function styleFunction(name, interpolate2, value) {
|
|
2045
|
-
var string00, string10, interpolate0;
|
|
2046
|
-
return function() {
|
|
2047
|
-
var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
|
|
2048
|
-
if (value1 == null)
|
|
2049
|
-
string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
|
|
2050
|
-
return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate2(string00 = string0, value1));
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
function styleMaybeRemove(id2, name) {
|
|
2054
|
-
var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
|
|
2055
|
-
return function() {
|
|
2056
|
-
var schedule2 = set(this, id2), on = schedule2.on, listener = schedule2.value[key] == null ? remove2 || (remove2 = styleRemove(name)) : void 0;
|
|
2057
|
-
if (on !== on0 || listener0 !== listener)
|
|
2058
|
-
(on1 = (on0 = on).copy()).on(event, listener0 = listener);
|
|
2059
|
-
schedule2.on = on1;
|
|
2060
|
-
};
|
|
2061
|
-
}
|
|
2062
|
-
function transition_style(name, value, priority) {
|
|
2063
|
-
var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
|
|
2064
|
-
return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove(name)) : typeof value === "function" ? this.styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant(name, i, value), priority).on("end.style." + name, null);
|
|
2065
|
-
}
|
|
2066
|
-
function styleInterpolate(name, i, priority) {
|
|
2067
|
-
return function(t) {
|
|
2068
|
-
this.style.setProperty(name, i.call(this, t), priority);
|
|
2069
|
-
};
|
|
2070
|
-
}
|
|
2071
|
-
function styleTween(name, value, priority) {
|
|
2072
|
-
var t, i0;
|
|
2073
|
-
function tween() {
|
|
2074
|
-
var i = value.apply(this, arguments);
|
|
2075
|
-
if (i !== i0)
|
|
2076
|
-
t = (i0 = i) && styleInterpolate(name, i, priority);
|
|
2077
|
-
return t;
|
|
2078
|
-
}
|
|
2079
|
-
tween._value = value;
|
|
2080
|
-
return tween;
|
|
2081
|
-
}
|
|
2082
|
-
function transition_styleTween(name, value, priority) {
|
|
2083
|
-
var key = "style." + (name += "");
|
|
2084
|
-
if (arguments.length < 2)
|
|
2085
|
-
return (key = this.tween(key)) && key._value;
|
|
2086
|
-
if (value == null)
|
|
2087
|
-
return this.tween(key, null);
|
|
2088
|
-
if (typeof value !== "function")
|
|
2089
|
-
throw new Error();
|
|
2090
|
-
return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
|
|
2091
|
-
}
|
|
2092
|
-
function textConstant(value) {
|
|
2093
|
-
return function() {
|
|
2094
|
-
this.textContent = value;
|
|
2095
|
-
};
|
|
2096
|
-
}
|
|
2097
|
-
function textFunction(value) {
|
|
2098
|
-
return function() {
|
|
2099
|
-
var value1 = value(this);
|
|
2100
|
-
this.textContent = value1 == null ? "" : value1;
|
|
2101
|
-
};
|
|
2102
|
-
}
|
|
2103
|
-
function transition_text(value) {
|
|
2104
|
-
return this.tween("text", typeof value === "function" ? textFunction(tweenValue(this, "text", value)) : textConstant(value == null ? "" : value + ""));
|
|
2105
|
-
}
|
|
2106
|
-
function textInterpolate(i) {
|
|
2107
|
-
return function(t) {
|
|
2108
|
-
this.textContent = i.call(this, t);
|
|
2109
|
-
};
|
|
2110
|
-
}
|
|
2111
|
-
function textTween(value) {
|
|
2112
|
-
var t0, i0;
|
|
2113
|
-
function tween() {
|
|
2114
|
-
var i = value.apply(this, arguments);
|
|
2115
|
-
if (i !== i0)
|
|
2116
|
-
t0 = (i0 = i) && textInterpolate(i);
|
|
2117
|
-
return t0;
|
|
2118
|
-
}
|
|
2119
|
-
tween._value = value;
|
|
2120
|
-
return tween;
|
|
2121
|
-
}
|
|
2122
|
-
function transition_textTween(value) {
|
|
2123
|
-
var key = "text";
|
|
2124
|
-
if (arguments.length < 1)
|
|
2125
|
-
return (key = this.tween(key)) && key._value;
|
|
2126
|
-
if (value == null)
|
|
2127
|
-
return this.tween(key, null);
|
|
2128
|
-
if (typeof value !== "function")
|
|
2129
|
-
throw new Error();
|
|
2130
|
-
return this.tween(key, textTween(value));
|
|
2131
|
-
}
|
|
2132
|
-
function transition_transition() {
|
|
2133
|
-
var name = this._name, id0 = this._id, id1 = newId();
|
|
2134
|
-
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
|
2135
|
-
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
2136
|
-
if (node = group[i]) {
|
|
2137
|
-
var inherit2 = get(node, id0);
|
|
2138
|
-
schedule(node, name, id1, i, group, {
|
|
2139
|
-
time: inherit2.time + inherit2.delay + inherit2.duration,
|
|
2140
|
-
delay: 0,
|
|
2141
|
-
duration: inherit2.duration,
|
|
2142
|
-
ease: inherit2.ease
|
|
2143
|
-
});
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
return new Transition(groups, this._parents, name, id1);
|
|
2148
|
-
}
|
|
2149
|
-
function transition_end() {
|
|
2150
|
-
var on0, on1, that = this, id2 = that._id, size = that.size();
|
|
2151
|
-
return new Promise(function(resolve, reject) {
|
|
2152
|
-
var cancel = { value: reject }, end = { value: function() {
|
|
2153
|
-
if (--size === 0)
|
|
2154
|
-
resolve();
|
|
2155
|
-
} };
|
|
2156
|
-
that.each(function() {
|
|
2157
|
-
var schedule2 = set(this, id2), on = schedule2.on;
|
|
2158
|
-
if (on !== on0) {
|
|
2159
|
-
on1 = (on0 = on).copy();
|
|
2160
|
-
on1._.cancel.push(cancel);
|
|
2161
|
-
on1._.interrupt.push(cancel);
|
|
2162
|
-
on1._.end.push(end);
|
|
2163
|
-
}
|
|
2164
|
-
schedule2.on = on1;
|
|
2165
|
-
});
|
|
2166
|
-
if (size === 0)
|
|
2167
|
-
resolve();
|
|
2168
|
-
});
|
|
2169
|
-
}
|
|
2170
|
-
var id = 0;
|
|
2171
|
-
function Transition(groups, parents, name, id2) {
|
|
2172
|
-
this._groups = groups;
|
|
2173
|
-
this._parents = parents;
|
|
2174
|
-
this._name = name;
|
|
2175
|
-
this._id = id2;
|
|
2176
|
-
}
|
|
2177
|
-
function newId() {
|
|
2178
|
-
return ++id;
|
|
2179
|
-
}
|
|
2180
|
-
var selection_prototype = selection.prototype;
|
|
2181
|
-
Transition.prototype = {
|
|
2182
|
-
constructor: Transition,
|
|
2183
|
-
select: transition_select,
|
|
2184
|
-
selectAll: transition_selectAll,
|
|
2185
|
-
selectChild: selection_prototype.selectChild,
|
|
2186
|
-
selectChildren: selection_prototype.selectChildren,
|
|
2187
|
-
filter: transition_filter,
|
|
2188
|
-
merge: transition_merge,
|
|
2189
|
-
selection: transition_selection,
|
|
2190
|
-
transition: transition_transition,
|
|
2191
|
-
call: selection_prototype.call,
|
|
2192
|
-
nodes: selection_prototype.nodes,
|
|
2193
|
-
node: selection_prototype.node,
|
|
2194
|
-
size: selection_prototype.size,
|
|
2195
|
-
empty: selection_prototype.empty,
|
|
2196
|
-
each: selection_prototype.each,
|
|
2197
|
-
on: transition_on,
|
|
2198
|
-
attr: transition_attr,
|
|
2199
|
-
attrTween: transition_attrTween,
|
|
2200
|
-
style: transition_style,
|
|
2201
|
-
styleTween: transition_styleTween,
|
|
2202
|
-
text: transition_text,
|
|
2203
|
-
textTween: transition_textTween,
|
|
2204
|
-
remove: transition_remove,
|
|
2205
|
-
tween: transition_tween,
|
|
2206
|
-
delay: transition_delay,
|
|
2207
|
-
duration: transition_duration,
|
|
2208
|
-
ease: transition_ease,
|
|
2209
|
-
easeVarying: transition_easeVarying,
|
|
2210
|
-
end: transition_end,
|
|
2211
|
-
[Symbol.iterator]: selection_prototype[Symbol.iterator]
|
|
2212
|
-
};
|
|
2213
|
-
function cubicInOut(t) {
|
|
2214
|
-
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
|
2215
|
-
}
|
|
2216
|
-
var defaultTiming = {
|
|
2217
|
-
time: null,
|
|
2218
|
-
// Set on use.
|
|
2219
|
-
delay: 0,
|
|
2220
|
-
duration: 250,
|
|
2221
|
-
ease: cubicInOut
|
|
2222
|
-
};
|
|
2223
|
-
function inherit(node, id2) {
|
|
2224
|
-
var timing;
|
|
2225
|
-
while (!(timing = node.__transition) || !(timing = timing[id2])) {
|
|
2226
|
-
if (!(node = node.parentNode)) {
|
|
2227
|
-
throw new Error(`transition ${id2} not found`);
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
return timing;
|
|
2231
|
-
}
|
|
2232
|
-
function selection_transition(name) {
|
|
2233
|
-
var id2, timing;
|
|
2234
|
-
if (name instanceof Transition) {
|
|
2235
|
-
id2 = name._id, name = name._name;
|
|
2236
|
-
} else {
|
|
2237
|
-
id2 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
|
|
2238
|
-
}
|
|
2239
|
-
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
|
2240
|
-
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
|
2241
|
-
if (node = group[i]) {
|
|
2242
|
-
schedule(node, name, id2, i, group, timing || inherit(node, id2));
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
}
|
|
2246
|
-
return new Transition(groups, this._parents, name, id2);
|
|
2247
|
-
}
|
|
2248
|
-
selection.prototype.interrupt = selection_interrupt;
|
|
2249
|
-
selection.prototype.transition = selection_transition;
|
|
2250
|
-
const constant = (x) => () => x;
|
|
2251
|
-
function ZoomEvent(type, {
|
|
2252
|
-
sourceEvent: sourceEvent2,
|
|
2253
|
-
target,
|
|
2254
|
-
transform,
|
|
2255
|
-
dispatch: dispatch2
|
|
2256
|
-
}) {
|
|
2257
|
-
Object.defineProperties(this, {
|
|
2258
|
-
type: { value: type, enumerable: true, configurable: true },
|
|
2259
|
-
sourceEvent: { value: sourceEvent2, enumerable: true, configurable: true },
|
|
2260
|
-
target: { value: target, enumerable: true, configurable: true },
|
|
2261
|
-
transform: { value: transform, enumerable: true, configurable: true },
|
|
2262
|
-
_: { value: dispatch2 }
|
|
2263
|
-
});
|
|
2264
|
-
}
|
|
2265
|
-
function Transform(k, x, y) {
|
|
2266
|
-
this.k = k;
|
|
2267
|
-
this.x = x;
|
|
2268
|
-
this.y = y;
|
|
2269
|
-
}
|
|
2270
|
-
Transform.prototype = {
|
|
2271
|
-
constructor: Transform,
|
|
2272
|
-
scale: function(k) {
|
|
2273
|
-
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
|
2274
|
-
},
|
|
2275
|
-
translate: function(x, y) {
|
|
2276
|
-
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
|
2277
|
-
},
|
|
2278
|
-
apply: function(point) {
|
|
2279
|
-
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
2280
|
-
},
|
|
2281
|
-
applyX: function(x) {
|
|
2282
|
-
return x * this.k + this.x;
|
|
2283
|
-
},
|
|
2284
|
-
applyY: function(y) {
|
|
2285
|
-
return y * this.k + this.y;
|
|
2286
|
-
},
|
|
2287
|
-
invert: function(location) {
|
|
2288
|
-
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
2289
|
-
},
|
|
2290
|
-
invertX: function(x) {
|
|
2291
|
-
return (x - this.x) / this.k;
|
|
2292
|
-
},
|
|
2293
|
-
invertY: function(y) {
|
|
2294
|
-
return (y - this.y) / this.k;
|
|
2295
|
-
},
|
|
2296
|
-
rescaleX: function(x) {
|
|
2297
|
-
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
|
2298
|
-
},
|
|
2299
|
-
rescaleY: function(y) {
|
|
2300
|
-
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
|
2301
|
-
},
|
|
2302
|
-
toString: function() {
|
|
2303
|
-
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
2304
|
-
}
|
|
2305
|
-
};
|
|
2306
|
-
var identity = new Transform(1, 0, 0);
|
|
2307
|
-
Transform.prototype;
|
|
2308
|
-
function nopropagation(event) {
|
|
2309
|
-
event.stopImmediatePropagation();
|
|
2310
|
-
}
|
|
2311
|
-
function noevent(event) {
|
|
2312
|
-
event.preventDefault();
|
|
2313
|
-
event.stopImmediatePropagation();
|
|
2314
|
-
}
|
|
2315
|
-
function defaultFilter(event) {
|
|
2316
|
-
return (!event.ctrlKey || event.type === "wheel") && !event.button;
|
|
2317
|
-
}
|
|
2318
|
-
function defaultExtent() {
|
|
2319
|
-
var e = this;
|
|
2320
|
-
if (e instanceof SVGElement) {
|
|
2321
|
-
e = e.ownerSVGElement || e;
|
|
2322
|
-
if (e.hasAttribute("viewBox")) {
|
|
2323
|
-
e = e.viewBox.baseVal;
|
|
2324
|
-
return [[e.x, e.y], [e.x + e.width, e.y + e.height]];
|
|
2325
|
-
}
|
|
2326
|
-
return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];
|
|
2327
|
-
}
|
|
2328
|
-
return [[0, 0], [e.clientWidth, e.clientHeight]];
|
|
2329
|
-
}
|
|
2330
|
-
function defaultTransform() {
|
|
2331
|
-
return this.__zoom || identity;
|
|
2332
|
-
}
|
|
2333
|
-
function defaultWheelDelta(event) {
|
|
2334
|
-
return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
|
|
2335
|
-
}
|
|
2336
|
-
function defaultTouchable() {
|
|
2337
|
-
return navigator.maxTouchPoints || "ontouchstart" in this;
|
|
2338
|
-
}
|
|
2339
|
-
function defaultConstrain(transform, extent, translateExtent) {
|
|
2340
|
-
var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];
|
|
2341
|
-
return transform.translate(
|
|
2342
|
-
dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
|
|
2343
|
-
dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
|
|
2344
|
-
);
|
|
2345
|
-
}
|
|
2346
|
-
function zoom() {
|
|
2347
|
-
var filter2 = defaultFilter, extent = defaultExtent, constrain = defaultConstrain, wheelDelta = defaultWheelDelta, touchable = defaultTouchable, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], duration = 250, interpolate2 = interpolateZoom, listeners = dispatch("start", "zoom", "end"), touchstarting, touchfirst, touchending, touchDelay = 500, wheelDelay = 150, clickDistance2 = 0, tapDistance = 10;
|
|
2348
|
-
function zoom2(selection2) {
|
|
2349
|
-
selection2.property("__zoom", defaultTransform).on("wheel.zoom", wheeled, { passive: false }).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
2350
|
-
}
|
|
2351
|
-
zoom2.transform = function(collection, transform, point, event) {
|
|
2352
|
-
var selection2 = collection.selection ? collection.selection() : collection;
|
|
2353
|
-
selection2.property("__zoom", defaultTransform);
|
|
2354
|
-
if (collection !== selection2) {
|
|
2355
|
-
schedule2(collection, transform, point, event);
|
|
2356
|
-
} else {
|
|
2357
|
-
selection2.interrupt().each(function() {
|
|
2358
|
-
gesture(this, arguments).event(event).start().zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform).end();
|
|
2359
|
-
});
|
|
2360
|
-
}
|
|
2361
|
-
};
|
|
2362
|
-
zoom2.scaleBy = function(selection2, k, p, event) {
|
|
2363
|
-
zoom2.scaleTo(selection2, function() {
|
|
2364
|
-
var k0 = this.__zoom.k, k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
|
2365
|
-
return k0 * k1;
|
|
2366
|
-
}, p, event);
|
|
2367
|
-
};
|
|
2368
|
-
zoom2.scaleTo = function(selection2, k, p, event) {
|
|
2369
|
-
zoom2.transform(selection2, function() {
|
|
2370
|
-
var e = extent.apply(this, arguments), t0 = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, p1 = t0.invert(p0), k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
|
2371
|
-
return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);
|
|
2372
|
-
}, p, event);
|
|
2373
|
-
};
|
|
2374
|
-
zoom2.translateBy = function(selection2, x, y, event) {
|
|
2375
|
-
zoom2.transform(selection2, function() {
|
|
2376
|
-
return constrain(this.__zoom.translate(
|
|
2377
|
-
typeof x === "function" ? x.apply(this, arguments) : x,
|
|
2378
|
-
typeof y === "function" ? y.apply(this, arguments) : y
|
|
2379
|
-
), extent.apply(this, arguments), translateExtent);
|
|
2380
|
-
}, null, event);
|
|
2381
|
-
};
|
|
2382
|
-
zoom2.translateTo = function(selection2, x, y, p, event) {
|
|
2383
|
-
zoom2.transform(selection2, function() {
|
|
2384
|
-
var e = extent.apply(this, arguments), t = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p;
|
|
2385
|
-
return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(
|
|
2386
|
-
typeof x === "function" ? -x.apply(this, arguments) : -x,
|
|
2387
|
-
typeof y === "function" ? -y.apply(this, arguments) : -y
|
|
2388
|
-
), e, translateExtent);
|
|
2389
|
-
}, p, event);
|
|
2390
|
-
};
|
|
2391
|
-
function scale(transform, k) {
|
|
2392
|
-
k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));
|
|
2393
|
-
return k === transform.k ? transform : new Transform(k, transform.x, transform.y);
|
|
2394
|
-
}
|
|
2395
|
-
function translate(transform, p0, p1) {
|
|
2396
|
-
var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;
|
|
2397
|
-
return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
|
|
2398
|
-
}
|
|
2399
|
-
function centroid(extent2) {
|
|
2400
|
-
return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
|
|
2401
|
-
}
|
|
2402
|
-
function schedule2(transition, transform, point, event) {
|
|
2403
|
-
transition.on("start.zoom", function() {
|
|
2404
|
-
gesture(this, arguments).event(event).start();
|
|
2405
|
-
}).on("interrupt.zoom end.zoom", function() {
|
|
2406
|
-
gesture(this, arguments).event(event).end();
|
|
2407
|
-
}).tween("zoom", function() {
|
|
2408
|
-
var that = this, args = arguments, g = gesture(that, args).event(event), e = extent.apply(that, args), p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), a = that.__zoom, b = typeof transform === "function" ? transform.apply(that, args) : transform, i = interpolate2(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
|
|
2409
|
-
return function(t) {
|
|
2410
|
-
if (t === 1)
|
|
2411
|
-
t = b;
|
|
2412
|
-
else {
|
|
2413
|
-
var l = i(t), k = w / l[2];
|
|
2414
|
-
t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
|
2415
|
-
}
|
|
2416
|
-
g.zoom(null, t);
|
|
2417
|
-
};
|
|
2418
|
-
});
|
|
2419
|
-
}
|
|
2420
|
-
function gesture(that, args, clean) {
|
|
2421
|
-
return !clean && that.__zooming || new Gesture(that, args);
|
|
2422
|
-
}
|
|
2423
|
-
function Gesture(that, args) {
|
|
2424
|
-
this.that = that;
|
|
2425
|
-
this.args = args;
|
|
2426
|
-
this.active = 0;
|
|
2427
|
-
this.sourceEvent = null;
|
|
2428
|
-
this.extent = extent.apply(that, args);
|
|
2429
|
-
this.taps = 0;
|
|
2430
|
-
}
|
|
2431
|
-
Gesture.prototype = {
|
|
2432
|
-
event: function(event) {
|
|
2433
|
-
if (event)
|
|
2434
|
-
this.sourceEvent = event;
|
|
2435
|
-
return this;
|
|
2436
|
-
},
|
|
2437
|
-
start: function() {
|
|
2438
|
-
if (++this.active === 1) {
|
|
2439
|
-
this.that.__zooming = this;
|
|
2440
|
-
this.emit("start");
|
|
2441
|
-
}
|
|
2442
|
-
return this;
|
|
2443
|
-
},
|
|
2444
|
-
zoom: function(key, transform) {
|
|
2445
|
-
if (this.mouse && key !== "mouse")
|
|
2446
|
-
this.mouse[1] = transform.invert(this.mouse[0]);
|
|
2447
|
-
if (this.touch0 && key !== "touch")
|
|
2448
|
-
this.touch0[1] = transform.invert(this.touch0[0]);
|
|
2449
|
-
if (this.touch1 && key !== "touch")
|
|
2450
|
-
this.touch1[1] = transform.invert(this.touch1[0]);
|
|
2451
|
-
this.that.__zoom = transform;
|
|
2452
|
-
this.emit("zoom");
|
|
2453
|
-
return this;
|
|
2454
|
-
},
|
|
2455
|
-
end: function() {
|
|
2456
|
-
if (--this.active === 0) {
|
|
2457
|
-
delete this.that.__zooming;
|
|
2458
|
-
this.emit("end");
|
|
2459
|
-
}
|
|
2460
|
-
return this;
|
|
2461
|
-
},
|
|
2462
|
-
emit: function(type) {
|
|
2463
|
-
var d = select(this.that).datum();
|
|
2464
|
-
listeners.call(
|
|
2465
|
-
type,
|
|
2466
|
-
this.that,
|
|
2467
|
-
new ZoomEvent(type, {
|
|
2468
|
-
sourceEvent: this.sourceEvent,
|
|
2469
|
-
target: zoom2,
|
|
2470
|
-
type,
|
|
2471
|
-
transform: this.that.__zoom,
|
|
2472
|
-
dispatch: listeners
|
|
2473
|
-
}),
|
|
2474
|
-
d
|
|
2475
|
-
);
|
|
2476
|
-
}
|
|
2477
|
-
};
|
|
2478
|
-
function wheeled(event, ...args) {
|
|
2479
|
-
if (!filter2.apply(this, arguments))
|
|
2480
|
-
return;
|
|
2481
|
-
var g = gesture(this, args).event(event), t = this.__zoom, k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p = pointer(event);
|
|
2482
|
-
if (g.wheel) {
|
|
2483
|
-
if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
|
|
2484
|
-
g.mouse[1] = t.invert(g.mouse[0] = p);
|
|
2485
|
-
}
|
|
2486
|
-
clearTimeout(g.wheel);
|
|
2487
|
-
} else if (t.k === k)
|
|
2488
|
-
return;
|
|
2489
|
-
else {
|
|
2490
|
-
g.mouse = [p, t.invert(p)];
|
|
2491
|
-
interrupt(this);
|
|
2492
|
-
g.start();
|
|
2493
|
-
}
|
|
2494
|
-
noevent(event);
|
|
2495
|
-
g.wheel = setTimeout(wheelidled, wheelDelay);
|
|
2496
|
-
g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
|
|
2497
|
-
function wheelidled() {
|
|
2498
|
-
g.wheel = null;
|
|
2499
|
-
g.end();
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
function mousedowned(event, ...args) {
|
|
2503
|
-
if (touchending || !filter2.apply(this, arguments))
|
|
2504
|
-
return;
|
|
2505
|
-
var currentTarget = event.currentTarget, g = gesture(this, args, true).event(event), v = select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), p = pointer(event, currentTarget), x0 = event.clientX, y0 = event.clientY;
|
|
2506
|
-
dragDisable(event.view);
|
|
2507
|
-
nopropagation(event);
|
|
2508
|
-
g.mouse = [p, this.__zoom.invert(p)];
|
|
2509
|
-
interrupt(this);
|
|
2510
|
-
g.start();
|
|
2511
|
-
function mousemoved(event2) {
|
|
2512
|
-
noevent(event2);
|
|
2513
|
-
if (!g.moved) {
|
|
2514
|
-
var dx = event2.clientX - x0, dy = event2.clientY - y0;
|
|
2515
|
-
g.moved = dx * dx + dy * dy > clickDistance2;
|
|
2516
|
-
}
|
|
2517
|
-
g.event(event2).zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event2, currentTarget), g.mouse[1]), g.extent, translateExtent));
|
|
2518
|
-
}
|
|
2519
|
-
function mouseupped(event2) {
|
|
2520
|
-
v.on("mousemove.zoom mouseup.zoom", null);
|
|
2521
|
-
yesdrag(event2.view, g.moved);
|
|
2522
|
-
noevent(event2);
|
|
2523
|
-
g.event(event2).end();
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
function dblclicked(event, ...args) {
|
|
2527
|
-
if (!filter2.apply(this, arguments))
|
|
2528
|
-
return;
|
|
2529
|
-
var t0 = this.__zoom, p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this), p1 = t0.invert(p0), k1 = t0.k * (event.shiftKey ? 0.5 : 2), t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);
|
|
2530
|
-
noevent(event);
|
|
2531
|
-
if (duration > 0)
|
|
2532
|
-
select(this).transition().duration(duration).call(schedule2, t1, p0, event);
|
|
2533
|
-
else
|
|
2534
|
-
select(this).call(zoom2.transform, t1, p0, event);
|
|
2535
|
-
}
|
|
2536
|
-
function touchstarted(event, ...args) {
|
|
2537
|
-
if (!filter2.apply(this, arguments))
|
|
2538
|
-
return;
|
|
2539
|
-
var touches = event.touches, n = touches.length, g = gesture(this, args, event.changedTouches.length === n).event(event), started, i, t, p;
|
|
2540
|
-
nopropagation(event);
|
|
2541
|
-
for (i = 0; i < n; ++i) {
|
|
2542
|
-
t = touches[i], p = pointer(t, this);
|
|
2543
|
-
p = [p, this.__zoom.invert(p), t.identifier];
|
|
2544
|
-
if (!g.touch0)
|
|
2545
|
-
g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;
|
|
2546
|
-
else if (!g.touch1 && g.touch0[2] !== p[2])
|
|
2547
|
-
g.touch1 = p, g.taps = 0;
|
|
2548
|
-
}
|
|
2549
|
-
if (touchstarting)
|
|
2550
|
-
touchstarting = clearTimeout(touchstarting);
|
|
2551
|
-
if (started) {
|
|
2552
|
-
if (g.taps < 2)
|
|
2553
|
-
touchfirst = p[0], touchstarting = setTimeout(function() {
|
|
2554
|
-
touchstarting = null;
|
|
2555
|
-
}, touchDelay);
|
|
2556
|
-
interrupt(this);
|
|
2557
|
-
g.start();
|
|
2558
|
-
}
|
|
2559
|
-
}
|
|
2560
|
-
function touchmoved(event, ...args) {
|
|
2561
|
-
if (!this.__zooming)
|
|
2562
|
-
return;
|
|
2563
|
-
var g = gesture(this, args).event(event), touches = event.changedTouches, n = touches.length, i, t, p, l;
|
|
2564
|
-
noevent(event);
|
|
2565
|
-
for (i = 0; i < n; ++i) {
|
|
2566
|
-
t = touches[i], p = pointer(t, this);
|
|
2567
|
-
if (g.touch0 && g.touch0[2] === t.identifier)
|
|
2568
|
-
g.touch0[0] = p;
|
|
2569
|
-
else if (g.touch1 && g.touch1[2] === t.identifier)
|
|
2570
|
-
g.touch1[0] = p;
|
|
2571
|
-
}
|
|
2572
|
-
t = g.that.__zoom;
|
|
2573
|
-
if (g.touch1) {
|
|
2574
|
-
var p0 = g.touch0[0], l0 = g.touch0[1], p1 = g.touch1[0], l1 = g.touch1[1], dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
|
2575
|
-
t = scale(t, Math.sqrt(dp / dl));
|
|
2576
|
-
p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];
|
|
2577
|
-
l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
|
2578
|
-
} else if (g.touch0)
|
|
2579
|
-
p = g.touch0[0], l = g.touch0[1];
|
|
2580
|
-
else
|
|
2581
|
-
return;
|
|
2582
|
-
g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent));
|
|
2583
|
-
}
|
|
2584
|
-
function touchended(event, ...args) {
|
|
2585
|
-
if (!this.__zooming)
|
|
2586
|
-
return;
|
|
2587
|
-
var g = gesture(this, args).event(event), touches = event.changedTouches, n = touches.length, i, t;
|
|
2588
|
-
nopropagation(event);
|
|
2589
|
-
if (touchending)
|
|
2590
|
-
clearTimeout(touchending);
|
|
2591
|
-
touchending = setTimeout(function() {
|
|
2592
|
-
touchending = null;
|
|
2593
|
-
}, touchDelay);
|
|
2594
|
-
for (i = 0; i < n; ++i) {
|
|
2595
|
-
t = touches[i];
|
|
2596
|
-
if (g.touch0 && g.touch0[2] === t.identifier)
|
|
2597
|
-
delete g.touch0;
|
|
2598
|
-
else if (g.touch1 && g.touch1[2] === t.identifier)
|
|
2599
|
-
delete g.touch1;
|
|
2600
|
-
}
|
|
2601
|
-
if (g.touch1 && !g.touch0)
|
|
2602
|
-
g.touch0 = g.touch1, delete g.touch1;
|
|
2603
|
-
if (g.touch0)
|
|
2604
|
-
g.touch0[1] = this.__zoom.invert(g.touch0[0]);
|
|
2605
|
-
else {
|
|
2606
|
-
g.end();
|
|
2607
|
-
if (g.taps === 2) {
|
|
2608
|
-
t = pointer(t, this);
|
|
2609
|
-
if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {
|
|
2610
|
-
var p = select(this).on("dblclick.zoom");
|
|
2611
|
-
if (p)
|
|
2612
|
-
p.apply(this, arguments);
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
zoom2.wheelDelta = function(_) {
|
|
2618
|
-
return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant(+_), zoom2) : wheelDelta;
|
|
2619
|
-
};
|
|
2620
|
-
zoom2.filter = function(_) {
|
|
2621
|
-
return arguments.length ? (filter2 = typeof _ === "function" ? _ : constant(!!_), zoom2) : filter2;
|
|
2622
|
-
};
|
|
2623
|
-
zoom2.touchable = function(_) {
|
|
2624
|
-
return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), zoom2) : touchable;
|
|
2625
|
-
};
|
|
2626
|
-
zoom2.extent = function(_) {
|
|
2627
|
-
return arguments.length ? (extent = typeof _ === "function" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom2) : extent;
|
|
2628
|
-
};
|
|
2629
|
-
zoom2.scaleExtent = function(_) {
|
|
2630
|
-
return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom2) : [scaleExtent[0], scaleExtent[1]];
|
|
2631
|
-
};
|
|
2632
|
-
zoom2.translateExtent = function(_) {
|
|
2633
|
-
return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom2) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
|
|
2634
|
-
};
|
|
2635
|
-
zoom2.constrain = function(_) {
|
|
2636
|
-
return arguments.length ? (constrain = _, zoom2) : constrain;
|
|
2637
|
-
};
|
|
2638
|
-
zoom2.duration = function(_) {
|
|
2639
|
-
return arguments.length ? (duration = +_, zoom2) : duration;
|
|
2640
|
-
};
|
|
2641
|
-
zoom2.interpolate = function(_) {
|
|
2642
|
-
return arguments.length ? (interpolate2 = _, zoom2) : interpolate2;
|
|
2643
|
-
};
|
|
2644
|
-
zoom2.on = function() {
|
|
2645
|
-
var value = listeners.on.apply(listeners, arguments);
|
|
2646
|
-
return value === listeners ? zoom2 : value;
|
|
2647
|
-
};
|
|
2648
|
-
zoom2.clickDistance = function(_) {
|
|
2649
|
-
return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom2) : Math.sqrt(clickDistance2);
|
|
2650
|
-
};
|
|
2651
|
-
zoom2.tapDistance = function(_) {
|
|
2652
|
-
return arguments.length ? (tapDistance = +_, zoom2) : tapDistance;
|
|
2653
|
-
};
|
|
2654
|
-
return zoom2;
|
|
2655
|
-
}
|
|
2656
|
-
const Slots = Symbol("MiniMapSlots");
|
|
2657
|
-
const _hoisted_1$1 = ["id", "x", "y", "rx", "ry", "width", "height", "fill", "stroke", "stroke-width", "shape-rendering"];
|
|
2658
|
-
const __default__$1 = {
|
|
2659
|
-
name: "MiniMapNode",
|
|
2660
|
-
compatConfig: { MODE: 3 }
|
|
2661
|
-
};
|
|
2662
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2663
|
-
...__default__$1,
|
|
2664
|
-
props: {
|
|
2665
|
-
id: {},
|
|
2666
|
-
type: {},
|
|
2667
|
-
selected: { type: Boolean },
|
|
2668
|
-
dragging: { type: Boolean },
|
|
2669
|
-
position: {},
|
|
2670
|
-
dimensions: {},
|
|
2671
|
-
borderRadius: {},
|
|
2672
|
-
color: {},
|
|
2673
|
-
shapeRendering: {},
|
|
2674
|
-
strokeColor: {},
|
|
2675
|
-
strokeWidth: {}
|
|
2676
|
-
},
|
|
2677
|
-
emits: ["click", "dblclick", "mouseenter", "mousemove", "mouseleave"],
|
|
2678
|
-
setup(__props, { emit: emits }) {
|
|
2679
|
-
const props = __props;
|
|
2680
|
-
const miniMapSlots = inject(Slots);
|
|
2681
|
-
const attrs = useAttrs();
|
|
2682
|
-
const style2 = toRef(() => attrs.style ?? {});
|
|
2683
|
-
function onClick(event) {
|
|
2684
|
-
emits("click", event);
|
|
2685
|
-
}
|
|
2686
|
-
function onDblclick(event) {
|
|
2687
|
-
emits("dblclick", event);
|
|
2688
|
-
}
|
|
2689
|
-
function onMouseEnter(event) {
|
|
2690
|
-
emits("mouseenter", event);
|
|
2691
|
-
}
|
|
2692
|
-
function onMouseMove(event) {
|
|
2693
|
-
emits("mousemove", event);
|
|
2694
|
-
}
|
|
2695
|
-
function onMouseLeave(event) {
|
|
2696
|
-
emits("mouseleave", event);
|
|
2697
|
-
}
|
|
2698
|
-
return (_ctx, _cache) => {
|
|
2699
|
-
return unref(miniMapSlots)[`node-${props.type}`] ? (openBlock(), createBlock(resolveDynamicComponent(unref(miniMapSlots)[`node-${props.type}`]), normalizeProps(mergeProps({ key: 0 }, props)), null, 16)) : (openBlock(), createElementBlock("rect", {
|
|
2700
|
-
key: 1,
|
|
2701
|
-
id: _ctx.id,
|
|
2702
|
-
class: normalizeClass(["vue-flow__minimap-node", { selected: _ctx.selected, dragging: _ctx.dragging }]),
|
|
2703
|
-
x: _ctx.position.x,
|
|
2704
|
-
y: _ctx.position.y,
|
|
2705
|
-
rx: _ctx.borderRadius,
|
|
2706
|
-
ry: _ctx.borderRadius,
|
|
2707
|
-
width: _ctx.dimensions.width,
|
|
2708
|
-
height: _ctx.dimensions.height,
|
|
2709
|
-
fill: _ctx.color || style2.value.background || style2.value.backgroundColor,
|
|
2710
|
-
stroke: _ctx.strokeColor,
|
|
2711
|
-
"stroke-width": _ctx.strokeWidth,
|
|
2712
|
-
"shape-rendering": _ctx.shapeRendering,
|
|
2713
|
-
onClick,
|
|
2714
|
-
onDblclick,
|
|
2715
|
-
onMouseenter: onMouseEnter,
|
|
2716
|
-
onMousemove: onMouseMove,
|
|
2717
|
-
onMouseleave: onMouseLeave
|
|
2718
|
-
}, null, 42, _hoisted_1$1));
|
|
2719
|
-
};
|
|
2720
|
-
}
|
|
2721
|
-
});
|
|
2722
|
-
const _hoisted_1 = ["width", "height", "viewBox", "aria-labelledby"];
|
|
2723
|
-
const _hoisted_2 = ["id"];
|
|
2724
|
-
const _hoisted_3 = ["d", "fill", "stroke", "stroke-width"];
|
|
2725
|
-
const __default__ = {
|
|
2726
|
-
name: "MiniMap",
|
|
2727
|
-
compatConfig: { MODE: 3 }
|
|
2728
|
-
};
|
|
2729
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2730
|
-
...__default__,
|
|
2731
|
-
props: {
|
|
2732
|
-
nodeColor: { type: [String, Function], default: "#e2e2e2" },
|
|
2733
|
-
nodeStrokeColor: { type: [String, Function], default: "transparent" },
|
|
2734
|
-
nodeClassName: { type: [String, Function] },
|
|
2735
|
-
nodeBorderRadius: { default: 5 },
|
|
2736
|
-
nodeStrokeWidth: { default: 2 },
|
|
2737
|
-
maskColor: { default: "rgb(240, 240, 240, 0.6)" },
|
|
2738
|
-
maskStrokeColor: { default: "none" },
|
|
2739
|
-
maskStrokeWidth: { default: 1 },
|
|
2740
|
-
position: { default: "bottom-right" },
|
|
2741
|
-
pannable: { type: Boolean, default: false },
|
|
2742
|
-
zoomable: { type: Boolean, default: false },
|
|
2743
|
-
width: {},
|
|
2744
|
-
height: {},
|
|
2745
|
-
ariaLabel: { default: "Vue Flow mini map" },
|
|
2746
|
-
inversePan: { type: Boolean, default: false },
|
|
2747
|
-
zoomStep: { default: 10 },
|
|
2748
|
-
offsetScale: { default: 5 },
|
|
2749
|
-
maskBorderRadius: { default: 0 }
|
|
2750
|
-
},
|
|
2751
|
-
emits: ["click", "nodeClick", "nodeDblclick", "nodeMouseenter", "nodeMousemove", "nodeMouseleave"],
|
|
2752
|
-
setup(__props, { emit }) {
|
|
2753
|
-
const slots = useSlots();
|
|
2754
|
-
const attrs = useAttrs();
|
|
2755
|
-
const defaultWidth = 200;
|
|
2756
|
-
const defaultHeight = 150;
|
|
2757
|
-
const { id: id2, edges, viewport, translateExtent, dimensions, emits, d3Selection, d3Zoom, getNodesInitialized } = useVueFlow();
|
|
2758
|
-
const el = ref();
|
|
2759
|
-
provide(Slots, slots);
|
|
2760
|
-
const elementWidth = toRef(() => {
|
|
2761
|
-
var _a;
|
|
2762
|
-
return __props.width ?? ((_a = attrs.style) == null ? void 0 : _a.width) ?? defaultWidth;
|
|
2763
|
-
});
|
|
2764
|
-
const elementHeight = toRef(() => {
|
|
2765
|
-
var _a;
|
|
2766
|
-
return __props.height ?? ((_a = attrs.style) == null ? void 0 : _a.height) ?? defaultHeight;
|
|
2767
|
-
});
|
|
2768
|
-
const shapeRendering = typeof window === "undefined" || !!window.chrome ? "crispEdges" : "geometricPrecision";
|
|
2769
|
-
const nodeColorFunc = computed(() => typeof __props.nodeColor === "string" ? () => __props.nodeColor : __props.nodeColor);
|
|
2770
|
-
const nodeStrokeColorFunc = computed(
|
|
2771
|
-
() => typeof __props.nodeStrokeColor === "string" ? () => __props.nodeStrokeColor : __props.nodeStrokeColor
|
|
2772
|
-
);
|
|
2773
|
-
const nodeClassNameFunc = computed(
|
|
2774
|
-
() => typeof __props.nodeClassName === "string" ? () => __props.nodeClassName : typeof __props.nodeClassName === "function" ? __props.nodeClassName : () => ""
|
|
2775
|
-
);
|
|
2776
|
-
const bb = computed(() => getRectOfNodes(getNodesInitialized.value));
|
|
2777
|
-
const viewBB = computed(() => ({
|
|
2778
|
-
x: -viewport.value.x / viewport.value.zoom,
|
|
2779
|
-
y: -viewport.value.y / viewport.value.zoom,
|
|
2780
|
-
width: dimensions.value.width / viewport.value.zoom,
|
|
2781
|
-
height: dimensions.value.height / viewport.value.zoom
|
|
2782
|
-
}));
|
|
2783
|
-
const boundingRect = computed(
|
|
2784
|
-
() => getNodesInitialized.value && getNodesInitialized.value.length ? getBoundsofRects(bb.value, viewBB.value) : viewBB.value
|
|
2785
|
-
);
|
|
2786
|
-
const viewScale = computed(() => {
|
|
2787
|
-
const scaledWidth = boundingRect.value.width / elementWidth.value;
|
|
2788
|
-
const scaledHeight = boundingRect.value.height / elementHeight.value;
|
|
2789
|
-
return Math.max(scaledWidth, scaledHeight);
|
|
2790
|
-
});
|
|
2791
|
-
const viewBox = computed(() => {
|
|
2792
|
-
const viewWidth = viewScale.value * elementWidth.value;
|
|
2793
|
-
const viewHeight = viewScale.value * elementHeight.value;
|
|
2794
|
-
const offset = __props.offsetScale * viewScale.value;
|
|
2795
|
-
return {
|
|
2796
|
-
offset,
|
|
2797
|
-
x: boundingRect.value.x - (viewWidth - boundingRect.value.width) / 2 - offset,
|
|
2798
|
-
y: boundingRect.value.y - (viewHeight - boundingRect.value.height) / 2 - offset,
|
|
2799
|
-
width: viewWidth + offset * 2,
|
|
2800
|
-
height: viewHeight + offset * 2
|
|
2801
|
-
};
|
|
2802
|
-
});
|
|
2803
|
-
const d = computed(() => {
|
|
2804
|
-
if (!viewBox.value.x || !viewBox.value.y) {
|
|
2805
|
-
return "";
|
|
2806
|
-
}
|
|
2807
|
-
return `
|
|
2808
|
-
M${viewBox.value.x - viewBox.value.offset},${viewBox.value.y - viewBox.value.offset}
|
|
2809
|
-
h${viewBox.value.width + viewBox.value.offset * 2}
|
|
2810
|
-
v${viewBox.value.height + viewBox.value.offset * 2}
|
|
2811
|
-
h${-viewBox.value.width - viewBox.value.offset * 2}z
|
|
2812
|
-
M${viewBB.value.x + __props.maskBorderRadius},${viewBB.value.y}
|
|
2813
|
-
h${viewBB.value.width - 2 * __props.maskBorderRadius}
|
|
2814
|
-
a${__props.maskBorderRadius},${__props.maskBorderRadius} 0 0 1 ${__props.maskBorderRadius},${__props.maskBorderRadius}
|
|
2815
|
-
v${viewBB.value.height - 2 * __props.maskBorderRadius}
|
|
2816
|
-
a${__props.maskBorderRadius},${__props.maskBorderRadius} 0 0 1 -${__props.maskBorderRadius},${__props.maskBorderRadius}
|
|
2817
|
-
h${-(viewBB.value.width - 2 * __props.maskBorderRadius)}
|
|
2818
|
-
a${__props.maskBorderRadius},${__props.maskBorderRadius} 0 0 1 -${__props.maskBorderRadius},-${__props.maskBorderRadius}
|
|
2819
|
-
v${-(viewBB.value.height - 2 * __props.maskBorderRadius)}
|
|
2820
|
-
a${__props.maskBorderRadius},${__props.maskBorderRadius} 0 0 1 ${__props.maskBorderRadius},-${__props.maskBorderRadius}z`;
|
|
2821
|
-
});
|
|
2822
|
-
watchEffect(
|
|
2823
|
-
(onCleanup) => {
|
|
2824
|
-
if (el.value) {
|
|
2825
|
-
const selection2 = select(el.value);
|
|
2826
|
-
const zoomHandler = (event) => {
|
|
2827
|
-
if (event.sourceEvent.type !== "wheel" || !d3Selection.value || !d3Zoom.value) {
|
|
2828
|
-
return;
|
|
2829
|
-
}
|
|
2830
|
-
const pinchDelta = -event.sourceEvent.deltaY * (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 2e-3) * __props.zoomStep;
|
|
2831
|
-
const zoom2 = viewport.value.zoom * 2 ** pinchDelta;
|
|
2832
|
-
d3Zoom.value.scaleTo(d3Selection.value, zoom2);
|
|
2833
|
-
};
|
|
2834
|
-
const panHandler = (event) => {
|
|
2835
|
-
if (event.sourceEvent.type !== "mousemove" || !d3Selection.value || !d3Zoom.value) {
|
|
2836
|
-
return;
|
|
2837
|
-
}
|
|
2838
|
-
const moveScale = viewScale.value * Math.max(1, viewport.value.zoom) * (__props.inversePan ? -1 : 1);
|
|
2839
|
-
const position = {
|
|
2840
|
-
x: viewport.value.x - event.sourceEvent.movementX * moveScale,
|
|
2841
|
-
y: viewport.value.y - event.sourceEvent.movementY * moveScale
|
|
2842
|
-
};
|
|
2843
|
-
const extent = [
|
|
2844
|
-
[0, 0],
|
|
2845
|
-
[dimensions.value.width, dimensions.value.height]
|
|
2846
|
-
];
|
|
2847
|
-
const nextTransform = identity.translate(position.x, position.y).scale(viewport.value.zoom);
|
|
2848
|
-
const constrainedTransform = d3Zoom.value.constrain()(nextTransform, extent, translateExtent.value);
|
|
2849
|
-
d3Zoom.value.transform(d3Selection.value, constrainedTransform);
|
|
2850
|
-
};
|
|
2851
|
-
const zoomAndPanHandler = zoom().on("zoom", __props.pannable ? panHandler : () => {
|
|
2852
|
-
}).on("zoom.wheel", __props.zoomable ? zoomHandler : () => {
|
|
2853
|
-
});
|
|
2854
|
-
selection2.call(zoomAndPanHandler);
|
|
2855
|
-
onCleanup(() => {
|
|
2856
|
-
selection2.on("zoom", null);
|
|
2857
|
-
});
|
|
2858
|
-
}
|
|
2859
|
-
},
|
|
2860
|
-
{ flush: "post" }
|
|
2861
|
-
);
|
|
2862
|
-
function onSvgClick(event) {
|
|
2863
|
-
const [x, y] = pointer(event);
|
|
2864
|
-
emit("click", { event, position: { x, y } });
|
|
2865
|
-
}
|
|
2866
|
-
function onNodeClick(event, node) {
|
|
2867
|
-
const param = { event, node, connectedEdges: getConnectedEdges([node], edges.value) };
|
|
2868
|
-
emits.miniMapNodeClick(param);
|
|
2869
|
-
emit("nodeClick", param);
|
|
2870
|
-
}
|
|
2871
|
-
function onNodeDblClick(event, node) {
|
|
2872
|
-
const param = { event, node, connectedEdges: getConnectedEdges([node], edges.value) };
|
|
2873
|
-
emits.miniMapNodeDoubleClick(param);
|
|
2874
|
-
emit("nodeDblclick", param);
|
|
2875
|
-
}
|
|
2876
|
-
function onNodeMouseEnter(event, node) {
|
|
2877
|
-
const param = { event, node, connectedEdges: getConnectedEdges([node], edges.value) };
|
|
2878
|
-
emits.miniMapNodeMouseEnter(param);
|
|
2879
|
-
emit("nodeMouseenter", param);
|
|
2880
|
-
}
|
|
2881
|
-
function onNodeMouseMove(event, node) {
|
|
2882
|
-
const param = { event, node, connectedEdges: getConnectedEdges([node], edges.value) };
|
|
2883
|
-
emits.miniMapNodeMouseMove(param);
|
|
2884
|
-
emit("nodeMousemove", param);
|
|
2885
|
-
}
|
|
2886
|
-
function onNodeMouseLeave(event, node) {
|
|
2887
|
-
const param = { event, node, connectedEdges: getConnectedEdges([node], edges.value) };
|
|
2888
|
-
emits.miniMapNodeMouseLeave(param);
|
|
2889
|
-
emit("nodeMouseleave", param);
|
|
2890
|
-
}
|
|
2891
|
-
return (_ctx, _cache) => {
|
|
2892
|
-
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
2893
|
-
position: _ctx.position,
|
|
2894
|
-
class: normalizeClass(["vue-flow__minimap", { pannable: _ctx.pannable, zoomable: _ctx.zoomable }])
|
|
2895
|
-
}, {
|
|
2896
|
-
default: withCtx(() => [
|
|
2897
|
-
(openBlock(), createElementBlock("svg", {
|
|
2898
|
-
ref_key: "el",
|
|
2899
|
-
ref: el,
|
|
2900
|
-
width: elementWidth.value,
|
|
2901
|
-
height: elementHeight.value,
|
|
2902
|
-
viewBox: [viewBox.value.x, viewBox.value.y, viewBox.value.width, viewBox.value.height].join(" "),
|
|
2903
|
-
role: "img",
|
|
2904
|
-
"aria-labelledby": `vue-flow__minimap-${unref(id2)}`,
|
|
2905
|
-
onClick: onSvgClick
|
|
2906
|
-
}, [
|
|
2907
|
-
_ctx.ariaLabel ? (openBlock(), createElementBlock("title", {
|
|
2908
|
-
key: 0,
|
|
2909
|
-
id: `vue-flow__minimap-${unref(id2)}`
|
|
2910
|
-
}, toDisplayString(_ctx.ariaLabel), 9, _hoisted_2)) : createCommentVNode("", true),
|
|
2911
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getNodesInitialized), (node) => {
|
|
2912
|
-
return openBlock(), createBlock(_sfc_main$1, {
|
|
2913
|
-
id: node.id,
|
|
2914
|
-
key: node.id,
|
|
2915
|
-
position: node.computedPosition,
|
|
2916
|
-
dimensions: node.dimensions,
|
|
2917
|
-
selected: node.selected,
|
|
2918
|
-
dragging: node.dragging,
|
|
2919
|
-
style: normalizeStyle(node.style),
|
|
2920
|
-
class: normalizeClass(nodeClassNameFunc.value(node)),
|
|
2921
|
-
color: nodeColorFunc.value(node),
|
|
2922
|
-
"border-radius": _ctx.nodeBorderRadius,
|
|
2923
|
-
"stroke-color": nodeStrokeColorFunc.value(node),
|
|
2924
|
-
"stroke-width": _ctx.nodeStrokeWidth,
|
|
2925
|
-
"shape-rendering": unref(shapeRendering),
|
|
2926
|
-
type: node.type,
|
|
2927
|
-
onClick: ($event) => onNodeClick($event, node),
|
|
2928
|
-
onDblclick: ($event) => onNodeDblClick($event, node),
|
|
2929
|
-
onMouseenter: ($event) => onNodeMouseEnter($event, node),
|
|
2930
|
-
onMousemove: ($event) => onNodeMouseMove($event, node),
|
|
2931
|
-
onMouseleave: ($event) => onNodeMouseLeave($event, node)
|
|
2932
|
-
}, null, 8, ["id", "position", "dimensions", "selected", "dragging", "style", "class", "color", "border-radius", "stroke-color", "stroke-width", "shape-rendering", "type", "onClick", "onDblclick", "onMouseenter", "onMousemove", "onMouseleave"]);
|
|
2933
|
-
}), 128)),
|
|
2934
|
-
createBaseVNode("path", {
|
|
2935
|
-
class: "vue-flow__minimap-mask",
|
|
2936
|
-
d: d.value,
|
|
2937
|
-
fill: _ctx.maskColor,
|
|
2938
|
-
stroke: _ctx.maskStrokeColor,
|
|
2939
|
-
"stroke-width": _ctx.maskStrokeWidth,
|
|
2940
|
-
"fill-rule": "evenodd"
|
|
2941
|
-
}, null, 8, _hoisted_3)
|
|
2942
|
-
], 8, _hoisted_1))
|
|
2943
|
-
]),
|
|
2944
|
-
_: 1
|
|
2945
|
-
}, 8, ["position", "class"]);
|
|
2946
|
-
};
|
|
2947
|
-
}
|
|
2948
|
-
});
|
|
2949
|
-
export {
|
|
2950
|
-
_sfc_main as _
|
|
2951
|
-
};
|