No Description

stats.html 131KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <title>RollUp Visualizer</title>
  8. <style>
  9. :root {
  10. --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
  11. "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
  12. "Noto Color Emoji";
  13. --background-color: #f7eedf;
  14. --text-color: #333;
  15. }
  16. @media (prefers-color-scheme: dark) {
  17. :root {
  18. --background-color: #2b2d42;
  19. --text-color: #edf2f4;
  20. }
  21. }
  22. html {
  23. box-sizing: border-box;
  24. }
  25. *,
  26. *:before,
  27. *:after {
  28. box-sizing: inherit;
  29. }
  30. html {
  31. background-color: var(--background-color);
  32. color: var(--text-color);
  33. font-family: var(--font-family);
  34. }
  35. body {
  36. padding: 0;
  37. margin: 0;
  38. }
  39. html,
  40. body {
  41. height: 100%;
  42. width: 100%;
  43. }
  44. body {
  45. display: flex;
  46. flex-direction: column;
  47. }
  48. svg {
  49. vertical-align: middle;
  50. height: 100%;
  51. }
  52. main {
  53. position: relative;
  54. margin: 0 auto;
  55. flex: 1;
  56. height: 100%;
  57. padding: 20px;
  58. }
  59. .tooltip {
  60. position: absolute;
  61. z-index: 1070;
  62. display: block;
  63. border: solid;
  64. border-width: 2px;
  65. border-radius: 5px;
  66. margin: 0;
  67. padding: 5px;
  68. font-style: normal;
  69. font-weight: 400;
  70. line-height: 1.5;
  71. text-align: left;
  72. text-decoration: none;
  73. text-shadow: none;
  74. text-transform: none;
  75. letter-spacing: normal;
  76. word-break: normal;
  77. word-spacing: normal;
  78. word-wrap: break-word;
  79. white-space: normal;
  80. line-break: auto;
  81. font-size: 0.875rem;
  82. opacity: 0;
  83. background-color: var(--background-color);
  84. color: var(--text-color);
  85. }
  86. </style>
  87. <style>
  88. </style>
  89. </head>
  90. <body>
  91. <main></main>
  92. <script>
  93. var drawChart = (function () {
  94. 'use strict';
  95. var xhtml = "http://www.w3.org/1999/xhtml";
  96. var namespaces = {
  97. svg: "http://www.w3.org/2000/svg",
  98. xhtml: xhtml,
  99. xlink: "http://www.w3.org/1999/xlink",
  100. xml: "http://www.w3.org/XML/1998/namespace",
  101. xmlns: "http://www.w3.org/2000/xmlns/"
  102. };
  103. function namespace(name) {
  104. var prefix = name += "", i = prefix.indexOf(":");
  105. if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
  106. return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins
  107. }
  108. function creatorInherit(name) {
  109. return function() {
  110. var document = this.ownerDocument,
  111. uri = this.namespaceURI;
  112. return uri === xhtml && document.documentElement.namespaceURI === xhtml
  113. ? document.createElement(name)
  114. : document.createElementNS(uri, name);
  115. };
  116. }
  117. function creatorFixed(fullname) {
  118. return function() {
  119. return this.ownerDocument.createElementNS(fullname.space, fullname.local);
  120. };
  121. }
  122. function creator(name) {
  123. var fullname = namespace(name);
  124. return (fullname.local
  125. ? creatorFixed
  126. : creatorInherit)(fullname);
  127. }
  128. function none() {}
  129. function selector(selector) {
  130. return selector == null ? none : function() {
  131. return this.querySelector(selector);
  132. };
  133. }
  134. function selection_select(select) {
  135. if (typeof select !== "function") select = selector(select);
  136. for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
  137. for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
  138. if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
  139. if ("__data__" in node) subnode.__data__ = node.__data__;
  140. subgroup[i] = subnode;
  141. }
  142. }
  143. }
  144. return new Selection(subgroups, this._parents);
  145. }
  146. function array(x) {
  147. return typeof x === "object" && "length" in x
  148. ? x // Array, TypedArray, NodeList, array-like
  149. : Array.from(x); // Map, Set, iterable, string, or anything else
  150. }
  151. function empty() {
  152. return [];
  153. }
  154. function selectorAll(selector) {
  155. return selector == null ? empty : function() {
  156. return this.querySelectorAll(selector);
  157. };
  158. }
  159. function arrayAll(select) {
  160. return function() {
  161. var group = select.apply(this, arguments);
  162. return group == null ? [] : array(group);
  163. };
  164. }
  165. function selection_selectAll(select) {
  166. if (typeof select === "function") select = arrayAll(select);
  167. else select = selectorAll(select);
  168. for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
  169. for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
  170. if (node = group[i]) {
  171. subgroups.push(select.call(node, node.__data__, i, group));
  172. parents.push(node);
  173. }
  174. }
  175. }
  176. return new Selection(subgroups, parents);
  177. }
  178. function matcher(selector) {
  179. return function() {
  180. return this.matches(selector);
  181. };
  182. }
  183. function selection_filter(match) {
  184. if (typeof match !== "function") match = matcher(match);
  185. for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
  186. for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
  187. if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
  188. subgroup.push(node);
  189. }
  190. }
  191. }
  192. return new Selection(subgroups, this._parents);
  193. }
  194. function sparse(update) {
  195. return new Array(update.length);
  196. }
  197. function selection_enter() {
  198. return new Selection(this._enter || this._groups.map(sparse), this._parents);
  199. }
  200. function EnterNode(parent, datum) {
  201. this.ownerDocument = parent.ownerDocument;
  202. this.namespaceURI = parent.namespaceURI;
  203. this._next = null;
  204. this._parent = parent;
  205. this.__data__ = datum;
  206. }
  207. EnterNode.prototype = {
  208. constructor: EnterNode,
  209. appendChild: function(child) { return this._parent.insertBefore(child, this._next); },
  210. insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },
  211. querySelector: function(selector) { return this._parent.querySelector(selector); },
  212. querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }
  213. };
  214. function constant(x) {
  215. return function() {
  216. return x;
  217. };
  218. }
  219. function bindIndex(parent, group, enter, update, exit, data) {
  220. var i = 0,
  221. node,
  222. groupLength = group.length,
  223. dataLength = data.length;
  224. // Put any non-null nodes that fit into update.
  225. // Put any null nodes into enter.
  226. // Put any remaining data into enter.
  227. for (; i < dataLength; ++i) {
  228. if (node = group[i]) {
  229. node.__data__ = data[i];
  230. update[i] = node;
  231. } else {
  232. enter[i] = new EnterNode(parent, data[i]);
  233. }
  234. }
  235. // Put any non-null nodes that don’t fit into exit.
  236. for (; i < groupLength; ++i) {
  237. if (node = group[i]) {
  238. exit[i] = node;
  239. }
  240. }
  241. }
  242. function bindKey(parent, group, enter, update, exit, data, key) {
  243. var i,
  244. node,
  245. nodeByKeyValue = new Map,
  246. groupLength = group.length,
  247. dataLength = data.length,
  248. keyValues = new Array(groupLength),
  249. keyValue;
  250. // Compute the key for each node.
  251. // If multiple nodes have the same key, the duplicates are added to exit.
  252. for (i = 0; i < groupLength; ++i) {
  253. if (node = group[i]) {
  254. keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
  255. if (nodeByKeyValue.has(keyValue)) {
  256. exit[i] = node;
  257. } else {
  258. nodeByKeyValue.set(keyValue, node);
  259. }
  260. }
  261. }
  262. // Compute the key for each datum.
  263. // If there a node associated with this key, join and add it to update.
  264. // If there is not (or the key is a duplicate), add it to enter.
  265. for (i = 0; i < dataLength; ++i) {
  266. keyValue = key.call(parent, data[i], i, data) + "";
  267. if (node = nodeByKeyValue.get(keyValue)) {
  268. update[i] = node;
  269. node.__data__ = data[i];
  270. nodeByKeyValue.delete(keyValue);
  271. } else {
  272. enter[i] = new EnterNode(parent, data[i]);
  273. }
  274. }
  275. // Add any remaining nodes that were not bound to data to exit.
  276. for (i = 0; i < groupLength; ++i) {
  277. if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {
  278. exit[i] = node;
  279. }
  280. }
  281. }
  282. function datum(node) {
  283. return node.__data__;
  284. }
  285. function selection_data(value, key) {
  286. if (!arguments.length) return Array.from(this, datum);
  287. var bind = key ? bindKey : bindIndex,
  288. parents = this._parents,
  289. groups = this._groups;
  290. if (typeof value !== "function") value = constant(value);
  291. for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
  292. var parent = parents[j],
  293. group = groups[j],
  294. groupLength = group.length,
  295. data = array(value.call(parent, parent && parent.__data__, j, parents)),
  296. dataLength = data.length,
  297. enterGroup = enter[j] = new Array(dataLength),
  298. updateGroup = update[j] = new Array(dataLength),
  299. exitGroup = exit[j] = new Array(groupLength);
  300. bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
  301. // Now connect the enter nodes to their following update node, such that
  302. // appendChild can insert the materialized enter node before this node,
  303. // rather than at the end of the parent node.
  304. for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
  305. if (previous = enterGroup[i0]) {
  306. if (i0 >= i1) i1 = i0 + 1;
  307. while (!(next = updateGroup[i1]) && ++i1 < dataLength);
  308. previous._next = next || null;
  309. }
  310. }
  311. }
  312. update = new Selection(update, parents);
  313. update._enter = enter;
  314. update._exit = exit;
  315. return update;
  316. }
  317. function selection_exit() {
  318. return new Selection(this._exit || this._groups.map(sparse), this._parents);
  319. }
  320. function selection_join(onenter, onupdate, onexit) {
  321. var enter = this.enter(), update = this, exit = this.exit();
  322. enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + "");
  323. if (onupdate != null) update = onupdate(update);
  324. if (onexit == null) exit.remove(); else onexit(exit);
  325. return enter && update ? enter.merge(update).order() : update;
  326. }
  327. function selection_merge(selection) {
  328. if (!(selection instanceof Selection)) throw new Error("invalid merge");
  329. for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
  330. for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
  331. if (node = group0[i] || group1[i]) {
  332. merge[i] = node;
  333. }
  334. }
  335. }
  336. for (; j < m0; ++j) {
  337. merges[j] = groups0[j];
  338. }
  339. return new Selection(merges, this._parents);
  340. }
  341. function selection_order() {
  342. for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {
  343. for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
  344. if (node = group[i]) {
  345. if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
  346. next = node;
  347. }
  348. }
  349. }
  350. return this;
  351. }
  352. function selection_sort(compare) {
  353. if (!compare) compare = ascending;
  354. function compareNode(a, b) {
  355. return a && b ? compare(a.__data__, b.__data__) : !a - !b;
  356. }
  357. for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
  358. for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
  359. if (node = group[i]) {
  360. sortgroup[i] = node;
  361. }
  362. }
  363. sortgroup.sort(compareNode);
  364. }
  365. return new Selection(sortgroups, this._parents).order();
  366. }
  367. function ascending(a, b) {
  368. return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
  369. }
  370. function selection_call() {
  371. var callback = arguments[0];
  372. arguments[0] = this;
  373. callback.apply(null, arguments);
  374. return this;
  375. }
  376. function selection_nodes() {
  377. return Array.from(this);
  378. }
  379. function selection_node() {
  380. for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
  381. for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
  382. var node = group[i];
  383. if (node) return node;
  384. }
  385. }
  386. return null;
  387. }
  388. function selection_size() {
  389. let size = 0;
  390. for (const node of this) ++size; // eslint-disable-line no-unused-vars
  391. return size;
  392. }
  393. function selection_empty() {
  394. return !this.node();
  395. }
  396. function selection_each(callback) {
  397. for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
  398. for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
  399. if (node = group[i]) callback.call(node, node.__data__, i, group);
  400. }
  401. }
  402. return this;
  403. }
  404. function attrRemove(name) {
  405. return function() {
  406. this.removeAttribute(name);
  407. };
  408. }
  409. function attrRemoveNS(fullname) {
  410. return function() {
  411. this.removeAttributeNS(fullname.space, fullname.local);
  412. };
  413. }
  414. function attrConstant(name, value) {
  415. return function() {
  416. this.setAttribute(name, value);
  417. };
  418. }
  419. function attrConstantNS(fullname, value) {
  420. return function() {
  421. this.setAttributeNS(fullname.space, fullname.local, value);
  422. };
  423. }
  424. function attrFunction(name, value) {
  425. return function() {
  426. var v = value.apply(this, arguments);
  427. if (v == null) this.removeAttribute(name);
  428. else this.setAttribute(name, v);
  429. };
  430. }
  431. function attrFunctionNS(fullname, value) {
  432. return function() {
  433. var v = value.apply(this, arguments);
  434. if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
  435. else this.setAttributeNS(fullname.space, fullname.local, v);
  436. };
  437. }
  438. function selection_attr(name, value) {
  439. var fullname = namespace(name);
  440. if (arguments.length < 2) {
  441. var node = this.node();
  442. return fullname.local
  443. ? node.getAttributeNS(fullname.space, fullname.local)
  444. : node.getAttribute(fullname);
  445. }
  446. return this.each((value == null
  447. ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function"
  448. ? (fullname.local ? attrFunctionNS : attrFunction)
  449. : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));
  450. }
  451. function defaultView(node) {
  452. return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
  453. || (node.document && node) // node is a Window
  454. || node.defaultView; // node is a Document
  455. }
  456. function styleRemove(name) {
  457. return function() {
  458. this.style.removeProperty(name);
  459. };
  460. }
  461. function styleConstant(name, value, priority) {
  462. return function() {
  463. this.style.setProperty(name, value, priority);
  464. };
  465. }
  466. function styleFunction(name, value, priority) {
  467. return function() {
  468. var v = value.apply(this, arguments);
  469. if (v == null) this.style.removeProperty(name);
  470. else this.style.setProperty(name, v, priority);
  471. };
  472. }
  473. function selection_style(name, value, priority) {
  474. return arguments.length > 1
  475. ? this.each((value == null
  476. ? styleRemove : typeof value === "function"
  477. ? styleFunction
  478. : styleConstant)(name, value, priority == null ? "" : priority))
  479. : styleValue(this.node(), name);
  480. }
  481. function styleValue(node, name) {
  482. return node.style.getPropertyValue(name)
  483. || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
  484. }
  485. function propertyRemove(name) {
  486. return function() {
  487. delete this[name];
  488. };
  489. }
  490. function propertyConstant(name, value) {
  491. return function() {
  492. this[name] = value;
  493. };
  494. }
  495. function propertyFunction(name, value) {
  496. return function() {
  497. var v = value.apply(this, arguments);
  498. if (v == null) delete this[name];
  499. else this[name] = v;
  500. };
  501. }
  502. function selection_property(name, value) {
  503. return arguments.length > 1
  504. ? this.each((value == null
  505. ? propertyRemove : typeof value === "function"
  506. ? propertyFunction
  507. : propertyConstant)(name, value))
  508. : this.node()[name];
  509. }
  510. function classArray(string) {
  511. return string.trim().split(/^|\s+/);
  512. }
  513. function classList(node) {
  514. return node.classList || new ClassList(node);
  515. }
  516. function ClassList(node) {
  517. this._node = node;
  518. this._names = classArray(node.getAttribute("class") || "");
  519. }
  520. ClassList.prototype = {
  521. add: function(name) {
  522. var i = this._names.indexOf(name);
  523. if (i < 0) {
  524. this._names.push(name);
  525. this._node.setAttribute("class", this._names.join(" "));
  526. }
  527. },
  528. remove: function(name) {
  529. var i = this._names.indexOf(name);
  530. if (i >= 0) {
  531. this._names.splice(i, 1);
  532. this._node.setAttribute("class", this._names.join(" "));
  533. }
  534. },
  535. contains: function(name) {
  536. return this._names.indexOf(name) >= 0;
  537. }
  538. };
  539. function classedAdd(node, names) {
  540. var list = classList(node), i = -1, n = names.length;
  541. while (++i < n) list.add(names[i]);
  542. }
  543. function classedRemove(node, names) {
  544. var list = classList(node), i = -1, n = names.length;
  545. while (++i < n) list.remove(names[i]);
  546. }
  547. function classedTrue(names) {
  548. return function() {
  549. classedAdd(this, names);
  550. };
  551. }
  552. function classedFalse(names) {
  553. return function() {
  554. classedRemove(this, names);
  555. };
  556. }
  557. function classedFunction(names, value) {
  558. return function() {
  559. (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
  560. };
  561. }
  562. function selection_classed(name, value) {
  563. var names = classArray(name + "");
  564. if (arguments.length < 2) {
  565. var list = classList(this.node()), i = -1, n = names.length;
  566. while (++i < n) if (!list.contains(names[i])) return false;
  567. return true;
  568. }
  569. return this.each((typeof value === "function"
  570. ? classedFunction : value
  571. ? classedTrue
  572. : classedFalse)(names, value));
  573. }
  574. function textRemove() {
  575. this.textContent = "";
  576. }
  577. function textConstant(value) {
  578. return function() {
  579. this.textContent = value;
  580. };
  581. }
  582. function textFunction(value) {
  583. return function() {
  584. var v = value.apply(this, arguments);
  585. this.textContent = v == null ? "" : v;
  586. };
  587. }
  588. function selection_text(value) {
  589. return arguments.length
  590. ? this.each(value == null
  591. ? textRemove : (typeof value === "function"
  592. ? textFunction
  593. : textConstant)(value))
  594. : this.node().textContent;
  595. }
  596. function htmlRemove() {
  597. this.innerHTML = "";
  598. }
  599. function htmlConstant(value) {
  600. return function() {
  601. this.innerHTML = value;
  602. };
  603. }
  604. function htmlFunction(value) {
  605. return function() {
  606. var v = value.apply(this, arguments);
  607. this.innerHTML = v == null ? "" : v;
  608. };
  609. }
  610. function selection_html(value) {
  611. return arguments.length
  612. ? this.each(value == null
  613. ? htmlRemove : (typeof value === "function"
  614. ? htmlFunction
  615. : htmlConstant)(value))
  616. : this.node().innerHTML;
  617. }
  618. function raise() {
  619. if (this.nextSibling) this.parentNode.appendChild(this);
  620. }
  621. function selection_raise() {
  622. return this.each(raise);
  623. }
  624. function lower() {
  625. if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
  626. }
  627. function selection_lower() {
  628. return this.each(lower);
  629. }
  630. function selection_append(name) {
  631. var create = typeof name === "function" ? name : creator(name);
  632. return this.select(function() {
  633. return this.appendChild(create.apply(this, arguments));
  634. });
  635. }
  636. function constantNull() {
  637. return null;
  638. }
  639. function selection_insert(name, before) {
  640. var create = typeof name === "function" ? name : creator(name),
  641. select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
  642. return this.select(function() {
  643. return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
  644. });
  645. }
  646. function remove() {
  647. var parent = this.parentNode;
  648. if (parent) parent.removeChild(this);
  649. }
  650. function selection_remove() {
  651. return this.each(remove);
  652. }
  653. function selection_cloneShallow() {
  654. var clone = this.cloneNode(false), parent = this.parentNode;
  655. return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
  656. }
  657. function selection_cloneDeep() {
  658. var clone = this.cloneNode(true), parent = this.parentNode;
  659. return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
  660. }
  661. function selection_clone(deep) {
  662. return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
  663. }
  664. function selection_datum(value) {
  665. return arguments.length
  666. ? this.property("__data__", value)
  667. : this.node().__data__;
  668. }
  669. function contextListener(listener) {
  670. return function(event) {
  671. listener.call(this, event, this.__data__);
  672. };
  673. }
  674. function parseTypenames(typenames) {
  675. return typenames.trim().split(/^|\s+/).map(function(t) {
  676. var name = "", i = t.indexOf(".");
  677. if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
  678. return {type: t, name: name};
  679. });
  680. }
  681. function onRemove(typename) {
  682. return function() {
  683. var on = this.__on;
  684. if (!on) return;
  685. for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
  686. if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
  687. this.removeEventListener(o.type, o.listener, o.options);
  688. } else {
  689. on[++i] = o;
  690. }
  691. }
  692. if (++i) on.length = i;
  693. else delete this.__on;
  694. };
  695. }
  696. function onAdd(typename, value, options) {
  697. return function() {
  698. var on = this.__on, o, listener = contextListener(value);
  699. if (on) for (var j = 0, m = on.length; j < m; ++j) {
  700. if ((o = on[j]).type === typename.type && o.name === typename.name) {
  701. this.removeEventListener(o.type, o.listener, o.options);
  702. this.addEventListener(o.type, o.listener = listener, o.options = options);
  703. o.value = value;
  704. return;
  705. }
  706. }
  707. this.addEventListener(typename.type, listener, options);
  708. o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};
  709. if (!on) this.__on = [o];
  710. else on.push(o);
  711. };
  712. }
  713. function selection_on(typename, value, options) {
  714. var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
  715. if (arguments.length < 2) {
  716. var on = this.node().__on;
  717. if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
  718. for (i = 0, o = on[j]; i < n; ++i) {
  719. if ((t = typenames[i]).type === o.type && t.name === o.name) {
  720. return o.value;
  721. }
  722. }
  723. }
  724. return;
  725. }
  726. on = value ? onAdd : onRemove;
  727. for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
  728. return this;
  729. }
  730. function dispatchEvent(node, type, params) {
  731. var window = defaultView(node),
  732. event = window.CustomEvent;
  733. if (typeof event === "function") {
  734. event = new event(type, params);
  735. } else {
  736. event = window.document.createEvent("Event");
  737. if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
  738. else event.initEvent(type, false, false);
  739. }
  740. node.dispatchEvent(event);
  741. }
  742. function dispatchConstant(type, params) {
  743. return function() {
  744. return dispatchEvent(this, type, params);
  745. };
  746. }
  747. function dispatchFunction(type, params) {
  748. return function() {
  749. return dispatchEvent(this, type, params.apply(this, arguments));
  750. };
  751. }
  752. function selection_dispatch(type, params) {
  753. return this.each((typeof params === "function"
  754. ? dispatchFunction
  755. : dispatchConstant)(type, params));
  756. }
  757. function* selection_iterator() {
  758. for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
  759. for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
  760. if (node = group[i]) yield node;
  761. }
  762. }
  763. }
  764. var root = [null];
  765. function Selection(groups, parents) {
  766. this._groups = groups;
  767. this._parents = parents;
  768. }
  769. function selection() {
  770. return new Selection([[document.documentElement]], root);
  771. }
  772. Selection.prototype = selection.prototype = {
  773. constructor: Selection,
  774. select: selection_select,
  775. selectAll: selection_selectAll,
  776. filter: selection_filter,
  777. data: selection_data,
  778. enter: selection_enter,
  779. exit: selection_exit,
  780. join: selection_join,
  781. merge: selection_merge,
  782. order: selection_order,
  783. sort: selection_sort,
  784. call: selection_call,
  785. nodes: selection_nodes,
  786. node: selection_node,
  787. size: selection_size,
  788. empty: selection_empty,
  789. each: selection_each,
  790. attr: selection_attr,
  791. style: selection_style,
  792. property: selection_property,
  793. classed: selection_classed,
  794. text: selection_text,
  795. html: selection_html,
  796. raise: selection_raise,
  797. lower: selection_lower,
  798. append: selection_append,
  799. insert: selection_insert,
  800. remove: selection_remove,
  801. clone: selection_clone,
  802. datum: selection_datum,
  803. on: selection_on,
  804. dispatch: selection_dispatch,
  805. [Symbol.iterator]: selection_iterator
  806. };
  807. function select(selector) {
  808. return typeof selector === "string"
  809. ? new Selection([[document.querySelector(selector)]], [document.documentElement])
  810. : new Selection([[selector]], root);
  811. }
  812. function pointer(event, node = event.currentTarget) {
  813. if (node) {
  814. var svg = node.ownerSVGElement || node;
  815. if (svg.createSVGPoint) {
  816. var point = svg.createSVGPoint();
  817. point.x = event.clientX, point.y = event.clientY;
  818. point = point.matrixTransform(node.getScreenCTM().inverse());
  819. return [point.x, point.y];
  820. }
  821. if (node.getBoundingClientRect) {
  822. var rect = node.getBoundingClientRect();
  823. return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
  824. }
  825. }
  826. return [event.pageX, event.pageY];
  827. }
  828. function ascending$1(a, b) {
  829. return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
  830. }
  831. function bisector(compare) {
  832. if (compare.length === 1) compare = ascendingComparator(compare);
  833. return {
  834. left: function(a, x, lo, hi) {
  835. if (lo == null) lo = 0;
  836. if (hi == null) hi = a.length;
  837. while (lo < hi) {
  838. var mid = lo + hi >>> 1;
  839. if (compare(a[mid], x) < 0) lo = mid + 1;
  840. else hi = mid;
  841. }
  842. return lo;
  843. },
  844. right: function(a, x, lo, hi) {
  845. if (lo == null) lo = 0;
  846. if (hi == null) hi = a.length;
  847. while (lo < hi) {
  848. var mid = lo + hi >>> 1;
  849. if (compare(a[mid], x) > 0) hi = mid;
  850. else lo = mid + 1;
  851. }
  852. return lo;
  853. }
  854. };
  855. }
  856. function ascendingComparator(f) {
  857. return function(d, x) {
  858. return ascending$1(f(d), x);
  859. };
  860. }
  861. var ascendingBisect = bisector(ascending$1);
  862. var bisectRight = ascendingBisect.right;
  863. function identity(x) {
  864. return x;
  865. }
  866. function group(values, ...keys) {
  867. return nest(values, identity, identity, keys);
  868. }
  869. function nest(values, map, reduce, keys) {
  870. return (function regroup(values, i) {
  871. if (i >= keys.length) return reduce(values);
  872. const groups = new Map();
  873. const keyof = keys[i++];
  874. let index = -1;
  875. for (const value of values) {
  876. const key = keyof(value, ++index, values);
  877. const group = groups.get(key);
  878. if (group) group.push(value);
  879. else groups.set(key, [value]);
  880. }
  881. for (const [key, values] of groups) {
  882. groups.set(key, regroup(values, i));
  883. }
  884. return map(groups);
  885. })(values, 0);
  886. }
  887. var e10 = Math.sqrt(50),
  888. e5 = Math.sqrt(10),
  889. e2 = Math.sqrt(2);
  890. function ticks(start, stop, count) {
  891. var reverse,
  892. i = -1,
  893. n,
  894. ticks,
  895. step;
  896. stop = +stop, start = +start, count = +count;
  897. if (start === stop && count > 0) return [start];
  898. if (reverse = stop < start) n = start, start = stop, stop = n;
  899. if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
  900. if (step > 0) {
  901. start = Math.ceil(start / step);
  902. stop = Math.floor(stop / step);
  903. ticks = new Array(n = Math.ceil(stop - start + 1));
  904. while (++i < n) ticks[i] = (start + i) * step;
  905. } else {
  906. start = Math.floor(start * step);
  907. stop = Math.ceil(stop * step);
  908. ticks = new Array(n = Math.ceil(start - stop + 1));
  909. while (++i < n) ticks[i] = (start - i) / step;
  910. }
  911. if (reverse) ticks.reverse();
  912. return ticks;
  913. }
  914. function tickIncrement(start, stop, count) {
  915. var step = (stop - start) / Math.max(0, count),
  916. power = Math.floor(Math.log(step) / Math.LN10),
  917. error = step / Math.pow(10, power);
  918. return power >= 0
  919. ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)
  920. : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);
  921. }
  922. function tickStep(start, stop, count) {
  923. var step0 = Math.abs(stop - start) / Math.max(0, count),
  924. step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
  925. error = step0 / step1;
  926. if (error >= e10) step1 *= 10;
  927. else if (error >= e5) step1 *= 5;
  928. else if (error >= e2) step1 *= 2;
  929. return stop < start ? -step1 : step1;
  930. }
  931. function count(node) {
  932. var sum = 0,
  933. children = node.children,
  934. i = children && children.length;
  935. if (!i) sum = 1;
  936. else while (--i >= 0) sum += children[i].value;
  937. node.value = sum;
  938. }
  939. function node_count() {
  940. return this.eachAfter(count);
  941. }
  942. function node_each(callback) {
  943. var node = this, current, next = [node], children, i, n;
  944. do {
  945. current = next.reverse(), next = [];
  946. while (node = current.pop()) {
  947. callback(node), children = node.children;
  948. if (children) for (i = 0, n = children.length; i < n; ++i) {
  949. next.push(children[i]);
  950. }
  951. }
  952. } while (next.length);
  953. return this;
  954. }
  955. function node_eachBefore(callback) {
  956. var node = this, nodes = [node], children, i;
  957. while (node = nodes.pop()) {
  958. callback(node), children = node.children;
  959. if (children) for (i = children.length - 1; i >= 0; --i) {
  960. nodes.push(children[i]);
  961. }
  962. }
  963. return this;
  964. }
  965. function node_eachAfter(callback) {
  966. var node = this, nodes = [node], next = [], children, i, n;
  967. while (node = nodes.pop()) {
  968. next.push(node), children = node.children;
  969. if (children) for (i = 0, n = children.length; i < n; ++i) {
  970. nodes.push(children[i]);
  971. }
  972. }
  973. while (node = next.pop()) {
  974. callback(node);
  975. }
  976. return this;
  977. }
  978. function node_sum(value) {
  979. return this.eachAfter(function(node) {
  980. var sum = +value(node.data) || 0,
  981. children = node.children,
  982. i = children && children.length;
  983. while (--i >= 0) sum += children[i].value;
  984. node.value = sum;
  985. });
  986. }
  987. function node_sort(compare) {
  988. return this.eachBefore(function(node) {
  989. if (node.children) {
  990. node.children.sort(compare);
  991. }
  992. });
  993. }
  994. function node_path(end) {
  995. var start = this,
  996. ancestor = leastCommonAncestor(start, end),
  997. nodes = [start];
  998. while (start !== ancestor) {
  999. start = start.parent;
  1000. nodes.push(start);
  1001. }
  1002. var k = nodes.length;
  1003. while (end !== ancestor) {
  1004. nodes.splice(k, 0, end);
  1005. end = end.parent;
  1006. }
  1007. return nodes;
  1008. }
  1009. function leastCommonAncestor(a, b) {
  1010. if (a === b) return a;
  1011. var aNodes = a.ancestors(),
  1012. bNodes = b.ancestors(),
  1013. c = null;
  1014. a = aNodes.pop();
  1015. b = bNodes.pop();
  1016. while (a === b) {
  1017. c = a;
  1018. a = aNodes.pop();
  1019. b = bNodes.pop();
  1020. }
  1021. return c;
  1022. }
  1023. function node_ancestors() {
  1024. var node = this, nodes = [node];
  1025. while (node = node.parent) {
  1026. nodes.push(node);
  1027. }
  1028. return nodes;
  1029. }
  1030. function node_descendants() {
  1031. var nodes = [];
  1032. this.each(function(node) {
  1033. nodes.push(node);
  1034. });
  1035. return nodes;
  1036. }
  1037. function node_leaves() {
  1038. var leaves = [];
  1039. this.eachBefore(function(node) {
  1040. if (!node.children) {
  1041. leaves.push(node);
  1042. }
  1043. });
  1044. return leaves;
  1045. }
  1046. function node_links() {
  1047. var root = this, links = [];
  1048. root.each(function(node) {
  1049. if (node !== root) { // Don’t include the root’s parent, if any.
  1050. links.push({source: node.parent, target: node});
  1051. }
  1052. });
  1053. return links;
  1054. }
  1055. function hierarchy(data, children) {
  1056. var root = new Node(data),
  1057. valued = +data.value && (root.value = data.value),
  1058. node,
  1059. nodes = [root],
  1060. child,
  1061. childs,
  1062. i,
  1063. n;
  1064. if (children == null) children = defaultChildren;
  1065. while (node = nodes.pop()) {
  1066. if (valued) node.value = +node.data.value;
  1067. if ((childs = children(node.data)) && (n = childs.length)) {
  1068. node.children = new Array(n);
  1069. for (i = n - 1; i >= 0; --i) {
  1070. nodes.push(child = node.children[i] = new Node(childs[i]));
  1071. child.parent = node;
  1072. child.depth = node.depth + 1;
  1073. }
  1074. }
  1075. }
  1076. return root.eachBefore(computeHeight);
  1077. }
  1078. function node_copy() {
  1079. return hierarchy(this).eachBefore(copyData);
  1080. }
  1081. function defaultChildren(d) {
  1082. return d.children;
  1083. }
  1084. function copyData(node) {
  1085. node.data = node.data.data;
  1086. }
  1087. function computeHeight(node) {
  1088. var height = 0;
  1089. do node.height = height;
  1090. while ((node = node.parent) && (node.height < ++height));
  1091. }
  1092. function Node(data) {
  1093. this.data = data;
  1094. this.depth =
  1095. this.height = 0;
  1096. this.parent = null;
  1097. }
  1098. Node.prototype = hierarchy.prototype = {
  1099. constructor: Node,
  1100. count: node_count,
  1101. each: node_each,
  1102. eachAfter: node_eachAfter,
  1103. eachBefore: node_eachBefore,
  1104. sum: node_sum,
  1105. sort: node_sort,
  1106. path: node_path,
  1107. ancestors: node_ancestors,
  1108. descendants: node_descendants,
  1109. leaves: node_leaves,
  1110. links: node_links,
  1111. copy: node_copy
  1112. };
  1113. function required(f) {
  1114. if (typeof f !== "function") throw new Error;
  1115. return f;
  1116. }
  1117. function constantZero() {
  1118. return 0;
  1119. }
  1120. function constant$1(x) {
  1121. return function() {
  1122. return x;
  1123. };
  1124. }
  1125. function roundNode(node) {
  1126. node.x0 = Math.round(node.x0);
  1127. node.y0 = Math.round(node.y0);
  1128. node.x1 = Math.round(node.x1);
  1129. node.y1 = Math.round(node.y1);
  1130. }
  1131. function treemapDice(parent, x0, y0, x1, y1) {
  1132. var nodes = parent.children,
  1133. node,
  1134. i = -1,
  1135. n = nodes.length,
  1136. k = parent.value && (x1 - x0) / parent.value;
  1137. while (++i < n) {
  1138. node = nodes[i], node.y0 = y0, node.y1 = y1;
  1139. node.x0 = x0, node.x1 = x0 += node.value * k;
  1140. }
  1141. }
  1142. function treemapSlice(parent, x0, y0, x1, y1) {
  1143. var nodes = parent.children,
  1144. node,
  1145. i = -1,
  1146. n = nodes.length,
  1147. k = parent.value && (y1 - y0) / parent.value;
  1148. while (++i < n) {
  1149. node = nodes[i], node.x0 = x0, node.x1 = x1;
  1150. node.y0 = y0, node.y1 = y0 += node.value * k;
  1151. }
  1152. }
  1153. var phi = (1 + Math.sqrt(5)) / 2;
  1154. function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
  1155. var rows = [],
  1156. nodes = parent.children,
  1157. row,
  1158. nodeValue,
  1159. i0 = 0,
  1160. i1 = 0,
  1161. n = nodes.length,
  1162. dx, dy,
  1163. value = parent.value,
  1164. sumValue,
  1165. minValue,
  1166. maxValue,
  1167. newRatio,
  1168. minRatio,
  1169. alpha,
  1170. beta;
  1171. while (i0 < n) {
  1172. dx = x1 - x0, dy = y1 - y0;
  1173. // Find the next non-empty node.
  1174. do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);
  1175. minValue = maxValue = sumValue;
  1176. alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
  1177. beta = sumValue * sumValue * alpha;
  1178. minRatio = Math.max(maxValue / beta, beta / minValue);
  1179. // Keep adding nodes while the aspect ratio maintains or improves.
  1180. for (; i1 < n; ++i1) {
  1181. sumValue += nodeValue = nodes[i1].value;
  1182. if (nodeValue < minValue) minValue = nodeValue;
  1183. if (nodeValue > maxValue) maxValue = nodeValue;
  1184. beta = sumValue * sumValue * alpha;
  1185. newRatio = Math.max(maxValue / beta, beta / minValue);
  1186. if (newRatio > minRatio) { sumValue -= nodeValue; break; }
  1187. minRatio = newRatio;
  1188. }
  1189. // Position and record the row orientation.
  1190. rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});
  1191. if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
  1192. else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
  1193. value -= sumValue, i0 = i1;
  1194. }
  1195. return rows;
  1196. }
  1197. var squarify = (function custom(ratio) {
  1198. function squarify(parent, x0, y0, x1, y1) {
  1199. squarifyRatio(ratio, parent, x0, y0, x1, y1);
  1200. }
  1201. squarify.ratio = function(x) {
  1202. return custom((x = +x) > 1 ? x : 1);
  1203. };
  1204. return squarify;
  1205. })(phi);
  1206. function d3treemap() {
  1207. var tile = squarify,
  1208. round = false,
  1209. dx = 1,
  1210. dy = 1,
  1211. paddingStack = [0],
  1212. paddingInner = constantZero,
  1213. paddingTop = constantZero,
  1214. paddingRight = constantZero,
  1215. paddingBottom = constantZero,
  1216. paddingLeft = constantZero;
  1217. function treemap(root) {
  1218. root.x0 =
  1219. root.y0 = 0;
  1220. root.x1 = dx;
  1221. root.y1 = dy;
  1222. root.eachBefore(positionNode);
  1223. paddingStack = [0];
  1224. if (round) root.eachBefore(roundNode);
  1225. return root;
  1226. }
  1227. function positionNode(node) {
  1228. var p = paddingStack[node.depth],
  1229. x0 = node.x0 + p,
  1230. y0 = node.y0 + p,
  1231. x1 = node.x1 - p,
  1232. y1 = node.y1 - p;
  1233. if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
  1234. if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
  1235. node.x0 = x0;
  1236. node.y0 = y0;
  1237. node.x1 = x1;
  1238. node.y1 = y1;
  1239. if (node.children) {
  1240. p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
  1241. x0 += paddingLeft(node) - p;
  1242. y0 += paddingTop(node) - p;
  1243. x1 -= paddingRight(node) - p;
  1244. y1 -= paddingBottom(node) - p;
  1245. if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
  1246. if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
  1247. tile(node, x0, y0, x1, y1);
  1248. }
  1249. }
  1250. treemap.round = function(x) {
  1251. return arguments.length ? (round = !!x, treemap) : round;
  1252. };
  1253. treemap.size = function(x) {
  1254. return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
  1255. };
  1256. treemap.tile = function(x) {
  1257. return arguments.length ? (tile = required(x), treemap) : tile;
  1258. };
  1259. treemap.padding = function(x) {
  1260. return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
  1261. };
  1262. treemap.paddingInner = function(x) {
  1263. return arguments.length ? (paddingInner = typeof x === "function" ? x : constant$1(+x), treemap) : paddingInner;
  1264. };
  1265. treemap.paddingOuter = function(x) {
  1266. return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
  1267. };
  1268. treemap.paddingTop = function(x) {
  1269. return arguments.length ? (paddingTop = typeof x === "function" ? x : constant$1(+x), treemap) : paddingTop;
  1270. };
  1271. treemap.paddingRight = function(x) {
  1272. return arguments.length ? (paddingRight = typeof x === "function" ? x : constant$1(+x), treemap) : paddingRight;
  1273. };
  1274. treemap.paddingBottom = function(x) {
  1275. return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant$1(+x), treemap) : paddingBottom;
  1276. };
  1277. treemap.paddingLeft = function(x) {
  1278. return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant$1(+x), treemap) : paddingLeft;
  1279. };
  1280. return treemap;
  1281. }
  1282. var treemapResquarify = (function custom(ratio) {
  1283. function resquarify(parent, x0, y0, x1, y1) {
  1284. if ((rows = parent._squarify) && (rows.ratio === ratio)) {
  1285. var rows,
  1286. row,
  1287. nodes,
  1288. i,
  1289. j = -1,
  1290. n,
  1291. m = rows.length,
  1292. value = parent.value;
  1293. while (++j < m) {
  1294. row = rows[j], nodes = row.children;
  1295. for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
  1296. if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
  1297. else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
  1298. value -= row.value;
  1299. }
  1300. } else {
  1301. parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
  1302. rows.ratio = ratio;
  1303. }
  1304. }
  1305. resquarify.ratio = function(x) {
  1306. return custom((x = +x) > 1 ? x : 1);
  1307. };
  1308. return resquarify;
  1309. })(phi);
  1310. /*!
  1311. * bytes
  1312. * Copyright(c) 2012-2014 TJ Holowaychuk
  1313. * Copyright(c) 2015 Jed Watson
  1314. * MIT Licensed
  1315. */
  1316. var format_1 = format;
  1317. /**
  1318. * Module variables.
  1319. * @private
  1320. */
  1321. var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
  1322. var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
  1323. var map = {
  1324. b: 1,
  1325. kb: 1 << 10,
  1326. mb: 1 << 20,
  1327. gb: 1 << 30,
  1328. tb: Math.pow(1024, 4),
  1329. pb: Math.pow(1024, 5),
  1330. };
  1331. /**
  1332. * Format the given value in bytes into a string.
  1333. *
  1334. * If the value is negative, it is kept as such. If it is a float,
  1335. * it is rounded.
  1336. *
  1337. * @param {number} value
  1338. * @param {object} [options]
  1339. * @param {number} [options.decimalPlaces=2]
  1340. * @param {number} [options.fixedDecimals=false]
  1341. * @param {string} [options.thousandsSeparator=]
  1342. * @param {string} [options.unit=]
  1343. * @param {string} [options.unitSeparator=]
  1344. *
  1345. * @returns {string|null}
  1346. * @public
  1347. */
  1348. function format(value, options) {
  1349. if (!Number.isFinite(value)) {
  1350. return null;
  1351. }
  1352. var mag = Math.abs(value);
  1353. var thousandsSeparator = (options && options.thousandsSeparator) || '';
  1354. var unitSeparator = (options && options.unitSeparator) || '';
  1355. var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
  1356. var fixedDecimals = Boolean(options && options.fixedDecimals);
  1357. var unit = (options && options.unit) || '';
  1358. if (!unit || !map[unit.toLowerCase()]) {
  1359. if (mag >= map.pb) {
  1360. unit = 'PB';
  1361. } else if (mag >= map.tb) {
  1362. unit = 'TB';
  1363. } else if (mag >= map.gb) {
  1364. unit = 'GB';
  1365. } else if (mag >= map.mb) {
  1366. unit = 'MB';
  1367. } else if (mag >= map.kb) {
  1368. unit = 'KB';
  1369. } else {
  1370. unit = 'B';
  1371. }
  1372. }
  1373. var val = value / map[unit.toLowerCase()];
  1374. var str = val.toFixed(decimalPlaces);
  1375. if (!fixedDecimals) {
  1376. str = str.replace(formatDecimalsRegExp, '$1');
  1377. }
  1378. if (thousandsSeparator) {
  1379. str = str.replace(formatThousandsRegExp, thousandsSeparator);
  1380. }
  1381. return str + unitSeparator + unit;
  1382. }
  1383. let count$1 = 0;
  1384. class Id {
  1385. constructor(id) {
  1386. this._id = id;
  1387. this._href = createUrl({ hash: id }).href;
  1388. }
  1389. get id() {
  1390. return this._id;
  1391. }
  1392. get href() {
  1393. return this._href;
  1394. }
  1395. toString() {
  1396. return `url(${this.href})`;
  1397. }
  1398. }
  1399. function uid(name) {
  1400. count$1 += 1;
  1401. const id = ["O", name, count$1].filter(Boolean).join("-");
  1402. return new Id(id);
  1403. }
  1404. function createUrl(options = {}) {
  1405. const url = new URL(window.location);
  1406. return Object.assign(url, options);
  1407. }
  1408. function initRange(domain, range) {
  1409. switch (arguments.length) {
  1410. case 0: break;
  1411. case 1: this.range(domain); break;
  1412. default: this.range(range).domain(domain); break;
  1413. }
  1414. return this;
  1415. }
  1416. function initInterpolator(domain, interpolator) {
  1417. switch (arguments.length) {
  1418. case 0: break;
  1419. case 1: {
  1420. if (typeof domain === "function") this.interpolator(domain);
  1421. else this.range(domain);
  1422. break;
  1423. }
  1424. default: {
  1425. this.domain(domain);
  1426. if (typeof interpolator === "function") this.interpolator(interpolator);
  1427. else this.range(interpolator);
  1428. break;
  1429. }
  1430. }
  1431. return this;
  1432. }
  1433. function define(constructor, factory, prototype) {
  1434. constructor.prototype = factory.prototype = prototype;
  1435. prototype.constructor = constructor;
  1436. }
  1437. function extend(parent, definition) {
  1438. var prototype = Object.create(parent.prototype);
  1439. for (var key in definition) prototype[key] = definition[key];
  1440. return prototype;
  1441. }
  1442. function Color() {}
  1443. var darker = 0.7;
  1444. var brighter = 1 / darker;
  1445. var reI = "\\s*([+-]?\\d+)\\s*",
  1446. reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
  1447. reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
  1448. reHex = /^#([0-9a-f]{3,8})$/,
  1449. reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
  1450. reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
  1451. reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
  1452. reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
  1453. reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
  1454. reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
  1455. var named = {
  1456. aliceblue: 0xf0f8ff,
  1457. antiquewhite: 0xfaebd7,
  1458. aqua: 0x00ffff,
  1459. aquamarine: 0x7fffd4,
  1460. azure: 0xf0ffff,
  1461. beige: 0xf5f5dc,
  1462. bisque: 0xffe4c4,
  1463. black: 0x000000,
  1464. blanchedalmond: 0xffebcd,
  1465. blue: 0x0000ff,
  1466. blueviolet: 0x8a2be2,
  1467. brown: 0xa52a2a,
  1468. burlywood: 0xdeb887,
  1469. cadetblue: 0x5f9ea0,
  1470. chartreuse: 0x7fff00,
  1471. chocolate: 0xd2691e,
  1472. coral: 0xff7f50,
  1473. cornflowerblue: 0x6495ed,
  1474. cornsilk: 0xfff8dc,
  1475. crimson: 0xdc143c,
  1476. cyan: 0x00ffff,
  1477. darkblue: 0x00008b,
  1478. darkcyan: 0x008b8b,
  1479. darkgoldenrod: 0xb8860b,
  1480. darkgray: 0xa9a9a9,
  1481. darkgreen: 0x006400,
  1482. darkgrey: 0xa9a9a9,
  1483. darkkhaki: 0xbdb76b,
  1484. darkmagenta: 0x8b008b,
  1485. darkolivegreen: 0x556b2f,
  1486. darkorange: 0xff8c00,
  1487. darkorchid: 0x9932cc,
  1488. darkred: 0x8b0000,
  1489. darksalmon: 0xe9967a,
  1490. darkseagreen: 0x8fbc8f,
  1491. darkslateblue: 0x483d8b,
  1492. darkslategray: 0x2f4f4f,
  1493. darkslategrey: 0x2f4f4f,
  1494. darkturquoise: 0x00ced1,
  1495. darkviolet: 0x9400d3,
  1496. deeppink: 0xff1493,
  1497. deepskyblue: 0x00bfff,
  1498. dimgray: 0x696969,
  1499. dimgrey: 0x696969,
  1500. dodgerblue: 0x1e90ff,
  1501. firebrick: 0xb22222,
  1502. floralwhite: 0xfffaf0,
  1503. forestgreen: 0x228b22,
  1504. fuchsia: 0xff00ff,
  1505. gainsboro: 0xdcdcdc,
  1506. ghostwhite: 0xf8f8ff,
  1507. gold: 0xffd700,
  1508. goldenrod: 0xdaa520,
  1509. gray: 0x808080,
  1510. green: 0x008000,
  1511. greenyellow: 0xadff2f,
  1512. grey: 0x808080,
  1513. honeydew: 0xf0fff0,
  1514. hotpink: 0xff69b4,
  1515. indianred: 0xcd5c5c,
  1516. indigo: 0x4b0082,
  1517. ivory: 0xfffff0,
  1518. khaki: 0xf0e68c,
  1519. lavender: 0xe6e6fa,
  1520. lavenderblush: 0xfff0f5,
  1521. lawngreen: 0x7cfc00,
  1522. lemonchiffon: 0xfffacd,
  1523. lightblue: 0xadd8e6,
  1524. lightcoral: 0xf08080,
  1525. lightcyan: 0xe0ffff,
  1526. lightgoldenrodyellow: 0xfafad2,
  1527. lightgray: 0xd3d3d3,
  1528. lightgreen: 0x90ee90,
  1529. lightgrey: 0xd3d3d3,
  1530. lightpink: 0xffb6c1,
  1531. lightsalmon: 0xffa07a,
  1532. lightseagreen: 0x20b2aa,
  1533. lightskyblue: 0x87cefa,
  1534. lightslategray: 0x778899,
  1535. lightslategrey: 0x778899,
  1536. lightsteelblue: 0xb0c4de,
  1537. lightyellow: 0xffffe0,
  1538. lime: 0x00ff00,
  1539. limegreen: 0x32cd32,
  1540. linen: 0xfaf0e6,
  1541. magenta: 0xff00ff,
  1542. maroon: 0x800000,
  1543. mediumaquamarine: 0x66cdaa,
  1544. mediumblue: 0x0000cd,
  1545. mediumorchid: 0xba55d3,
  1546. mediumpurple: 0x9370db,
  1547. mediumseagreen: 0x3cb371,
  1548. mediumslateblue: 0x7b68ee,
  1549. mediumspringgreen: 0x00fa9a,
  1550. mediumturquoise: 0x48d1cc,
  1551. mediumvioletred: 0xc71585,
  1552. midnightblue: 0x191970,
  1553. mintcream: 0xf5fffa,
  1554. mistyrose: 0xffe4e1,
  1555. moccasin: 0xffe4b5,
  1556. navajowhite: 0xffdead,
  1557. navy: 0x000080,
  1558. oldlace: 0xfdf5e6,
  1559. olive: 0x808000,
  1560. olivedrab: 0x6b8e23,
  1561. orange: 0xffa500,
  1562. orangered: 0xff4500,
  1563. orchid: 0xda70d6,
  1564. palegoldenrod: 0xeee8aa,
  1565. palegreen: 0x98fb98,
  1566. paleturquoise: 0xafeeee,
  1567. palevioletred: 0xdb7093,
  1568. papayawhip: 0xffefd5,
  1569. peachpuff: 0xffdab9,
  1570. peru: 0xcd853f,
  1571. pink: 0xffc0cb,
  1572. plum: 0xdda0dd,
  1573. powderblue: 0xb0e0e6,
  1574. purple: 0x800080,
  1575. rebeccapurple: 0x663399,
  1576. red: 0xff0000,
  1577. rosybrown: 0xbc8f8f,
  1578. royalblue: 0x4169e1,
  1579. saddlebrown: 0x8b4513,
  1580. salmon: 0xfa8072,
  1581. sandybrown: 0xf4a460,
  1582. seagreen: 0x2e8b57,
  1583. seashell: 0xfff5ee,
  1584. sienna: 0xa0522d,
  1585. silver: 0xc0c0c0,
  1586. skyblue: 0x87ceeb,
  1587. slateblue: 0x6a5acd,
  1588. slategray: 0x708090,
  1589. slategrey: 0x708090,
  1590. snow: 0xfffafa,
  1591. springgreen: 0x00ff7f,
  1592. steelblue: 0x4682b4,
  1593. tan: 0xd2b48c,
  1594. teal: 0x008080,
  1595. thistle: 0xd8bfd8,
  1596. tomato: 0xff6347,
  1597. turquoise: 0x40e0d0,
  1598. violet: 0xee82ee,
  1599. wheat: 0xf5deb3,
  1600. white: 0xffffff,
  1601. whitesmoke: 0xf5f5f5,
  1602. yellow: 0xffff00,
  1603. yellowgreen: 0x9acd32
  1604. };
  1605. define(Color, color, {
  1606. copy: function(channels) {
  1607. return Object.assign(new this.constructor, this, channels);
  1608. },
  1609. displayable: function() {
  1610. return this.rgb().displayable();
  1611. },
  1612. hex: color_formatHex, // Deprecated! Use color.formatHex.
  1613. formatHex: color_formatHex,
  1614. formatHsl: color_formatHsl,
  1615. formatRgb: color_formatRgb,
  1616. toString: color_formatRgb
  1617. });
  1618. function color_formatHex() {
  1619. return this.rgb().formatHex();
  1620. }
  1621. function color_formatHsl() {
  1622. return hslConvert(this).formatHsl();
  1623. }
  1624. function color_formatRgb() {
  1625. return this.rgb().formatRgb();
  1626. }
  1627. function color(format) {
  1628. var m, l;
  1629. format = (format + "").trim().toLowerCase();
  1630. return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
  1631. : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
  1632. : l === 8 ? new Rgb(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
  1633. : l === 4 ? new Rgb((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
  1634. : null) // invalid hex
  1635. : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
  1636. : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
  1637. : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
  1638. : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
  1639. : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
  1640. : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
  1641. : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
  1642. : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
  1643. : null;
  1644. }
  1645. function rgbn(n) {
  1646. return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
  1647. }
  1648. function rgba(r, g, b, a) {
  1649. if (a <= 0) r = g = b = NaN;
  1650. return new Rgb(r, g, b, a);
  1651. }
  1652. function rgbConvert(o) {
  1653. if (!(o instanceof Color)) o = color(o);
  1654. if (!o) return new Rgb;
  1655. o = o.rgb();
  1656. return new Rgb(o.r, o.g, o.b, o.opacity);
  1657. }
  1658. function rgb(r, g, b, opacity) {
  1659. return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
  1660. }
  1661. function Rgb(r, g, b, opacity) {
  1662. this.r = +r;
  1663. this.g = +g;
  1664. this.b = +b;
  1665. this.opacity = +opacity;
  1666. }
  1667. define(Rgb, rgb, extend(Color, {
  1668. brighter: function(k) {
  1669. k = k == null ? brighter : Math.pow(brighter, k);
  1670. return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
  1671. },
  1672. darker: function(k) {
  1673. k = k == null ? darker : Math.pow(darker, k);
  1674. return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
  1675. },
  1676. rgb: function() {
  1677. return this;
  1678. },
  1679. displayable: function() {
  1680. return (-0.5 <= this.r && this.r < 255.5)
  1681. && (-0.5 <= this.g && this.g < 255.5)
  1682. && (-0.5 <= this.b && this.b < 255.5)
  1683. && (0 <= this.opacity && this.opacity <= 1);
  1684. },
  1685. hex: rgb_formatHex, // Deprecated! Use color.formatHex.
  1686. formatHex: rgb_formatHex,
  1687. formatRgb: rgb_formatRgb,
  1688. toString: rgb_formatRgb
  1689. }));
  1690. function rgb_formatHex() {
  1691. return "#" + hex(this.r) + hex(this.g) + hex(this.b);
  1692. }
  1693. function rgb_formatRgb() {
  1694. var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
  1695. return (a === 1 ? "rgb(" : "rgba(")
  1696. + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
  1697. + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
  1698. + Math.max(0, Math.min(255, Math.round(this.b) || 0))
  1699. + (a === 1 ? ")" : ", " + a + ")");
  1700. }
  1701. function hex(value) {
  1702. value = Math.max(0, Math.min(255, Math.round(value) || 0));
  1703. return (value < 16 ? "0" : "") + value.toString(16);
  1704. }
  1705. function hsla(h, s, l, a) {
  1706. if (a <= 0) h = s = l = NaN;
  1707. else if (l <= 0 || l >= 1) h = s = NaN;
  1708. else if (s <= 0) h = NaN;
  1709. return new Hsl(h, s, l, a);
  1710. }
  1711. function hslConvert(o) {
  1712. if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
  1713. if (!(o instanceof Color)) o = color(o);
  1714. if (!o) return new Hsl;
  1715. if (o instanceof Hsl) return o;
  1716. o = o.rgb();
  1717. var r = o.r / 255,
  1718. g = o.g / 255,
  1719. b = o.b / 255,
  1720. min = Math.min(r, g, b),
  1721. max = Math.max(r, g, b),
  1722. h = NaN,
  1723. s = max - min,
  1724. l = (max + min) / 2;
  1725. if (s) {
  1726. if (r === max) h = (g - b) / s + (g < b) * 6;
  1727. else if (g === max) h = (b - r) / s + 2;
  1728. else h = (r - g) / s + 4;
  1729. s /= l < 0.5 ? max + min : 2 - max - min;
  1730. h *= 60;
  1731. } else {
  1732. s = l > 0 && l < 1 ? 0 : h;
  1733. }
  1734. return new Hsl(h, s, l, o.opacity);
  1735. }
  1736. function hsl(h, s, l, opacity) {
  1737. return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
  1738. }
  1739. function Hsl(h, s, l, opacity) {
  1740. this.h = +h;
  1741. this.s = +s;
  1742. this.l = +l;
  1743. this.opacity = +opacity;
  1744. }
  1745. define(Hsl, hsl, extend(Color, {
  1746. brighter: function(k) {
  1747. k = k == null ? brighter : Math.pow(brighter, k);
  1748. return new Hsl(this.h, this.s, this.l * k, this.opacity);
  1749. },
  1750. darker: function(k) {
  1751. k = k == null ? darker : Math.pow(darker, k);
  1752. return new Hsl(this.h, this.s, this.l * k, this.opacity);
  1753. },
  1754. rgb: function() {
  1755. var h = this.h % 360 + (this.h < 0) * 360,
  1756. s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
  1757. l = this.l,
  1758. m2 = l + (l < 0.5 ? l : 1 - l) * s,
  1759. m1 = 2 * l - m2;
  1760. return new Rgb(
  1761. hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
  1762. hsl2rgb(h, m1, m2),
  1763. hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
  1764. this.opacity
  1765. );
  1766. },
  1767. displayable: function() {
  1768. return (0 <= this.s && this.s <= 1 || isNaN(this.s))
  1769. && (0 <= this.l && this.l <= 1)
  1770. && (0 <= this.opacity && this.opacity <= 1);
  1771. },
  1772. formatHsl: function() {
  1773. var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
  1774. return (a === 1 ? "hsl(" : "hsla(")
  1775. + (this.h || 0) + ", "
  1776. + (this.s || 0) * 100 + "%, "
  1777. + (this.l || 0) * 100 + "%"
  1778. + (a === 1 ? ")" : ", " + a + ")");
  1779. }
  1780. }));
  1781. /* From FvD 13.37, CSS Color Module Level 3 */
  1782. function hsl2rgb(h, m1, m2) {
  1783. return (h < 60 ? m1 + (m2 - m1) * h / 60
  1784. : h < 180 ? m2
  1785. : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
  1786. : m1) * 255;
  1787. }
  1788. function basis(t1, v0, v1, v2, v3) {
  1789. var t2 = t1 * t1, t3 = t2 * t1;
  1790. return ((1 - 3 * t1 + 3 * t2 - t3) * v0
  1791. + (4 - 6 * t2 + 3 * t3) * v1
  1792. + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
  1793. + t3 * v3) / 6;
  1794. }
  1795. function basis$1(values) {
  1796. var n = values.length - 1;
  1797. return function(t) {
  1798. var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
  1799. v1 = values[i],
  1800. v2 = values[i + 1],
  1801. v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
  1802. v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
  1803. return basis((t - i / n) * n, v0, v1, v2, v3);
  1804. };
  1805. }
  1806. function constant$2(x) {
  1807. return function() {
  1808. return x;
  1809. };
  1810. }
  1811. function linear(a, d) {
  1812. return function(t) {
  1813. return a + t * d;
  1814. };
  1815. }
  1816. function exponential(a, b, y) {
  1817. return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
  1818. return Math.pow(a + t * b, y);
  1819. };
  1820. }
  1821. function gamma(y) {
  1822. return (y = +y) === 1 ? nogamma : function(a, b) {
  1823. return b - a ? exponential(a, b, y) : constant$2(isNaN(a) ? b : a);
  1824. };
  1825. }
  1826. function nogamma(a, b) {
  1827. var d = b - a;
  1828. return d ? linear(a, d) : constant$2(isNaN(a) ? b : a);
  1829. }
  1830. var rgb$1 = (function rgbGamma(y) {
  1831. var color = gamma(y);
  1832. function rgb$1(start, end) {
  1833. var r = color((start = rgb(start)).r, (end = rgb(end)).r),
  1834. g = color(start.g, end.g),
  1835. b = color(start.b, end.b),
  1836. opacity = nogamma(start.opacity, end.opacity);
  1837. return function(t) {
  1838. start.r = r(t);
  1839. start.g = g(t);
  1840. start.b = b(t);
  1841. start.opacity = opacity(t);
  1842. return start + "";
  1843. };
  1844. }
  1845. rgb$1.gamma = rgbGamma;
  1846. return rgb$1;
  1847. })(1);
  1848. function rgbSpline(spline) {
  1849. return function(colors) {
  1850. var n = colors.length,
  1851. r = new Array(n),
  1852. g = new Array(n),
  1853. b = new Array(n),
  1854. i, color;
  1855. for (i = 0; i < n; ++i) {
  1856. color = rgb(colors[i]);
  1857. r[i] = color.r || 0;
  1858. g[i] = color.g || 0;
  1859. b[i] = color.b || 0;
  1860. }
  1861. r = spline(r);
  1862. g = spline(g);
  1863. b = spline(b);
  1864. color.opacity = 1;
  1865. return function(t) {
  1866. color.r = r(t);
  1867. color.g = g(t);
  1868. color.b = b(t);
  1869. return color + "";
  1870. };
  1871. };
  1872. }
  1873. var rgbBasis = rgbSpline(basis$1);
  1874. function numberArray(a, b) {
  1875. if (!b) b = [];
  1876. var n = a ? Math.min(b.length, a.length) : 0,
  1877. c = b.slice(),
  1878. i;
  1879. return function(t) {
  1880. for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
  1881. return c;
  1882. };
  1883. }
  1884. function isNumberArray(x) {
  1885. return ArrayBuffer.isView(x) && !(x instanceof DataView);
  1886. }
  1887. function genericArray(a, b) {
  1888. var nb = b ? b.length : 0,
  1889. na = a ? Math.min(nb, a.length) : 0,
  1890. x = new Array(na),
  1891. c = new Array(nb),
  1892. i;
  1893. for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
  1894. for (; i < nb; ++i) c[i] = b[i];
  1895. return function(t) {
  1896. for (i = 0; i < na; ++i) c[i] = x[i](t);
  1897. return c;
  1898. };
  1899. }
  1900. function date(a, b) {
  1901. var d = new Date;
  1902. return a = +a, b = +b, function(t) {
  1903. return d.setTime(a * (1 - t) + b * t), d;
  1904. };
  1905. }
  1906. function interpolateNumber(a, b) {
  1907. return a = +a, b = +b, function(t) {
  1908. return a * (1 - t) + b * t;
  1909. };
  1910. }
  1911. function object(a, b) {
  1912. var i = {},
  1913. c = {},
  1914. k;
  1915. if (a === null || typeof a !== "object") a = {};
  1916. if (b === null || typeof b !== "object") b = {};
  1917. for (k in b) {
  1918. if (k in a) {
  1919. i[k] = interpolate(a[k], b[k]);
  1920. } else {
  1921. c[k] = b[k];
  1922. }
  1923. }
  1924. return function(t) {
  1925. for (k in i) c[k] = i[k](t);
  1926. return c;
  1927. };
  1928. }
  1929. var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
  1930. reB = new RegExp(reA.source, "g");
  1931. function zero(b) {
  1932. return function() {
  1933. return b;
  1934. };
  1935. }
  1936. function one(b) {
  1937. return function(t) {
  1938. return b(t) + "";
  1939. };
  1940. }
  1941. function string(a, b) {
  1942. var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
  1943. am, // current match in a
  1944. bm, // current match in b
  1945. bs, // string preceding current number in b, if any
  1946. i = -1, // index in s
  1947. s = [], // string constants and placeholders
  1948. q = []; // number interpolators
  1949. // Coerce inputs to strings.
  1950. a = a + "", b = b + "";
  1951. // Interpolate pairs of numbers in a & b.
  1952. while ((am = reA.exec(a))
  1953. && (bm = reB.exec(b))) {
  1954. if ((bs = bm.index) > bi) { // a string precedes the next number in b
  1955. bs = b.slice(bi, bs);
  1956. if (s[i]) s[i] += bs; // coalesce with previous string
  1957. else s[++i] = bs;
  1958. }
  1959. if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
  1960. if (s[i]) s[i] += bm; // coalesce with previous string
  1961. else s[++i] = bm;
  1962. } else { // interpolate non-matching numbers
  1963. s[++i] = null;
  1964. q.push({i: i, x: interpolateNumber(am, bm)});
  1965. }
  1966. bi = reB.lastIndex;
  1967. }
  1968. // Add remains of b.
  1969. if (bi < b.length) {
  1970. bs = b.slice(bi);
  1971. if (s[i]) s[i] += bs; // coalesce with previous string
  1972. else s[++i] = bs;
  1973. }
  1974. // Special optimization for only a single match.
  1975. // Otherwise, interpolate each of the numbers and rejoin the string.
  1976. return s.length < 2 ? (q[0]
  1977. ? one(q[0].x)
  1978. : zero(b))
  1979. : (b = q.length, function(t) {
  1980. for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
  1981. return s.join("");
  1982. });
  1983. }
  1984. function interpolate(a, b) {
  1985. var t = typeof b, c;
  1986. return b == null || t === "boolean" ? constant$2(b)
  1987. : (t === "number" ? interpolateNumber
  1988. : t === "string" ? ((c = color(b)) ? (b = c, rgb$1) : string)
  1989. : b instanceof color ? rgb$1
  1990. : b instanceof Date ? date
  1991. : isNumberArray(b) ? numberArray
  1992. : Array.isArray(b) ? genericArray
  1993. : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
  1994. : interpolateNumber)(a, b);
  1995. }
  1996. function interpolateRound(a, b) {
  1997. return a = +a, b = +b, function(t) {
  1998. return Math.round(a * (1 - t) + b * t);
  1999. };
  2000. }
  2001. function constant$3(x) {
  2002. return function() {
  2003. return x;
  2004. };
  2005. }
  2006. function number(x) {
  2007. return +x;
  2008. }
  2009. var unit = [0, 1];
  2010. function identity$1(x) {
  2011. return x;
  2012. }
  2013. function normalize(a, b) {
  2014. return (b -= (a = +a))
  2015. ? function(x) { return (x - a) / b; }
  2016. : constant$3(isNaN(b) ? NaN : 0.5);
  2017. }
  2018. function clamper(a, b) {
  2019. var t;
  2020. if (a > b) t = a, a = b, b = t;
  2021. return function(x) { return Math.max(a, Math.min(b, x)); };
  2022. }
  2023. // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
  2024. // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
  2025. function bimap(domain, range, interpolate) {
  2026. var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
  2027. if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
  2028. else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
  2029. return function(x) { return r0(d0(x)); };
  2030. }
  2031. function polymap(domain, range, interpolate) {
  2032. var j = Math.min(domain.length, range.length) - 1,
  2033. d = new Array(j),
  2034. r = new Array(j),
  2035. i = -1;
  2036. // Reverse descending domains.
  2037. if (domain[j] < domain[0]) {
  2038. domain = domain.slice().reverse();
  2039. range = range.slice().reverse();
  2040. }
  2041. while (++i < j) {
  2042. d[i] = normalize(domain[i], domain[i + 1]);
  2043. r[i] = interpolate(range[i], range[i + 1]);
  2044. }
  2045. return function(x) {
  2046. var i = bisectRight(domain, x, 1, j) - 1;
  2047. return r[i](d[i](x));
  2048. };
  2049. }
  2050. function copy(source, target) {
  2051. return target
  2052. .domain(source.domain())
  2053. .range(source.range())
  2054. .interpolate(source.interpolate())
  2055. .clamp(source.clamp())
  2056. .unknown(source.unknown());
  2057. }
  2058. function transformer() {
  2059. var domain = unit,
  2060. range = unit,
  2061. interpolate$1 = interpolate,
  2062. transform,
  2063. untransform,
  2064. unknown,
  2065. clamp = identity$1,
  2066. piecewise,
  2067. output,
  2068. input;
  2069. function rescale() {
  2070. var n = Math.min(domain.length, range.length);
  2071. if (clamp !== identity$1) clamp = clamper(domain[0], domain[n - 1]);
  2072. piecewise = n > 2 ? polymap : bimap;
  2073. output = input = null;
  2074. return scale;
  2075. }
  2076. function scale(x) {
  2077. return isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
  2078. }
  2079. scale.invert = function(y) {
  2080. return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
  2081. };
  2082. scale.domain = function(_) {
  2083. return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
  2084. };
  2085. scale.range = function(_) {
  2086. return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
  2087. };
  2088. scale.rangeRound = function(_) {
  2089. return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
  2090. };
  2091. scale.clamp = function(_) {
  2092. return arguments.length ? (clamp = _ ? true : identity$1, rescale()) : clamp !== identity$1;
  2093. };
  2094. scale.interpolate = function(_) {
  2095. return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
  2096. };
  2097. scale.unknown = function(_) {
  2098. return arguments.length ? (unknown = _, scale) : unknown;
  2099. };
  2100. return function(t, u) {
  2101. transform = t, untransform = u;
  2102. return rescale();
  2103. };
  2104. }
  2105. function continuous() {
  2106. return transformer()(identity$1, identity$1);
  2107. }
  2108. // Computes the decimal coefficient and exponent of the specified number x with
  2109. // significant digits p, where x is positive and p is in [1, 21] or undefined.
  2110. // For example, formatDecimal(1.23) returns ["123", 0].
  2111. function formatDecimal(x, p) {
  2112. if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
  2113. var i, coefficient = x.slice(0, i);
  2114. // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
  2115. // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
  2116. return [
  2117. coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
  2118. +x.slice(i + 1)
  2119. ];
  2120. }
  2121. function exponent(x) {
  2122. return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
  2123. }
  2124. function formatGroup(grouping, thousands) {
  2125. return function(value, width) {
  2126. var i = value.length,
  2127. t = [],
  2128. j = 0,
  2129. g = grouping[0],
  2130. length = 0;
  2131. while (i > 0 && g > 0) {
  2132. if (length + g + 1 > width) g = Math.max(1, width - length);
  2133. t.push(value.substring(i -= g, i + g));
  2134. if ((length += g + 1) > width) break;
  2135. g = grouping[j = (j + 1) % grouping.length];
  2136. }
  2137. return t.reverse().join(thousands);
  2138. };
  2139. }
  2140. function formatNumerals(numerals) {
  2141. return function(value) {
  2142. return value.replace(/[0-9]/g, function(i) {
  2143. return numerals[+i];
  2144. });
  2145. };
  2146. }
  2147. // [[fill]align][sign][symbol][0][width][,][.precision][~][type]
  2148. var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
  2149. function formatSpecifier(specifier) {
  2150. if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
  2151. var match;
  2152. return new FormatSpecifier({
  2153. fill: match[1],
  2154. align: match[2],
  2155. sign: match[3],
  2156. symbol: match[4],
  2157. zero: match[5],
  2158. width: match[6],
  2159. comma: match[7],
  2160. precision: match[8] && match[8].slice(1),
  2161. trim: match[9],
  2162. type: match[10]
  2163. });
  2164. }
  2165. formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
  2166. function FormatSpecifier(specifier) {
  2167. this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
  2168. this.align = specifier.align === undefined ? ">" : specifier.align + "";
  2169. this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
  2170. this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
  2171. this.zero = !!specifier.zero;
  2172. this.width = specifier.width === undefined ? undefined : +specifier.width;
  2173. this.comma = !!specifier.comma;
  2174. this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
  2175. this.trim = !!specifier.trim;
  2176. this.type = specifier.type === undefined ? "" : specifier.type + "";
  2177. }
  2178. FormatSpecifier.prototype.toString = function() {
  2179. return this.fill
  2180. + this.align
  2181. + this.sign
  2182. + this.symbol
  2183. + (this.zero ? "0" : "")
  2184. + (this.width === undefined ? "" : Math.max(1, this.width | 0))
  2185. + (this.comma ? "," : "")
  2186. + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
  2187. + (this.trim ? "~" : "")
  2188. + this.type;
  2189. };
  2190. // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
  2191. function formatTrim(s) {
  2192. out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
  2193. switch (s[i]) {
  2194. case ".": i0 = i1 = i; break;
  2195. case "0": if (i0 === 0) i0 = i; i1 = i; break;
  2196. default: if (i0 > 0) { if (!+s[i]) break out; i0 = 0; } break;
  2197. }
  2198. }
  2199. return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
  2200. }
  2201. var prefixExponent;
  2202. function formatPrefixAuto(x, p) {
  2203. var d = formatDecimal(x, p);
  2204. if (!d) return x + "";
  2205. var coefficient = d[0],
  2206. exponent = d[1],
  2207. i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
  2208. n = coefficient.length;
  2209. return i === n ? coefficient
  2210. : i > n ? coefficient + new Array(i - n + 1).join("0")
  2211. : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
  2212. : "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
  2213. }
  2214. function formatRounded(x, p) {
  2215. var d = formatDecimal(x, p);
  2216. if (!d) return x + "";
  2217. var coefficient = d[0],
  2218. exponent = d[1];
  2219. return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
  2220. : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
  2221. : coefficient + new Array(exponent - coefficient.length + 2).join("0");
  2222. }
  2223. var formatTypes = {
  2224. "%": function(x, p) { return (x * 100).toFixed(p); },
  2225. "b": function(x) { return Math.round(x).toString(2); },
  2226. "c": function(x) { return x + ""; },
  2227. "d": function(x) { return Math.round(x).toString(10); },
  2228. "e": function(x, p) { return x.toExponential(p); },
  2229. "f": function(x, p) { return x.toFixed(p); },
  2230. "g": function(x, p) { return x.toPrecision(p); },
  2231. "o": function(x) { return Math.round(x).toString(8); },
  2232. "p": function(x, p) { return formatRounded(x * 100, p); },
  2233. "r": formatRounded,
  2234. "s": formatPrefixAuto,
  2235. "X": function(x) { return Math.round(x).toString(16).toUpperCase(); },
  2236. "x": function(x) { return Math.round(x).toString(16); }
  2237. };
  2238. function identity$2(x) {
  2239. return x;
  2240. }
  2241. var map$1 = Array.prototype.map,
  2242. prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
  2243. function formatLocale(locale) {
  2244. var group = locale.grouping === undefined || locale.thousands === undefined ? identity$2 : formatGroup(map$1.call(locale.grouping, Number), locale.thousands + ""),
  2245. currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
  2246. currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
  2247. decimal = locale.decimal === undefined ? "." : locale.decimal + "",
  2248. numerals = locale.numerals === undefined ? identity$2 : formatNumerals(map$1.call(locale.numerals, String)),
  2249. percent = locale.percent === undefined ? "%" : locale.percent + "",
  2250. minus = locale.minus === undefined ? "-" : locale.minus + "",
  2251. nan = locale.nan === undefined ? "NaN" : locale.nan + "";
  2252. function newFormat(specifier) {
  2253. specifier = formatSpecifier(specifier);
  2254. var fill = specifier.fill,
  2255. align = specifier.align,
  2256. sign = specifier.sign,
  2257. symbol = specifier.symbol,
  2258. zero = specifier.zero,
  2259. width = specifier.width,
  2260. comma = specifier.comma,
  2261. precision = specifier.precision,
  2262. trim = specifier.trim,
  2263. type = specifier.type;
  2264. // The "n" type is an alias for ",g".
  2265. if (type === "n") comma = true, type = "g";
  2266. // The "" type, and any invalid type, is an alias for ".12~g".
  2267. else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
  2268. // If zero fill is specified, padding goes after sign and before digits.
  2269. if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
  2270. // Compute the prefix and suffix.
  2271. // For SI-prefix, the suffix is lazily computed.
  2272. var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
  2273. suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
  2274. // What format function should we use?
  2275. // Is this an integer type?
  2276. // Can this type generate exponential notation?
  2277. var formatType = formatTypes[type],
  2278. maybeSuffix = /[defgprs%]/.test(type);
  2279. // Set the default precision if not specified,
  2280. // or clamp the specified precision to the supported range.
  2281. // For significant precision, it must be in [1, 21].
  2282. // For fixed precision, it must be in [0, 20].
  2283. precision = precision === undefined ? 6
  2284. : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
  2285. : Math.max(0, Math.min(20, precision));
  2286. function format(value) {
  2287. var valuePrefix = prefix,
  2288. valueSuffix = suffix,
  2289. i, n, c;
  2290. if (type === "c") {
  2291. valueSuffix = formatType(value) + valueSuffix;
  2292. value = "";
  2293. } else {
  2294. value = +value;
  2295. // Perform the initial formatting.
  2296. var valueNegative = value < 0;
  2297. value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
  2298. // Trim insignificant zeros.
  2299. if (trim) value = formatTrim(value);
  2300. // If a negative value rounds to zero during formatting, treat as positive.
  2301. if (valueNegative && +value === 0) valueNegative = false;
  2302. // Compute the prefix and suffix.
  2303. valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
  2304. valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
  2305. // Break the formatted value into the integer “value” part that can be
  2306. // grouped, and fractional or exponential “suffix” part that is not.
  2307. if (maybeSuffix) {
  2308. i = -1, n = value.length;
  2309. while (++i < n) {
  2310. if (c = value.charCodeAt(i), 48 > c || c > 57) {
  2311. valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
  2312. value = value.slice(0, i);
  2313. break;
  2314. }
  2315. }
  2316. }
  2317. }
  2318. // If the fill character is not "0", grouping is applied before padding.
  2319. if (comma && !zero) value = group(value, Infinity);
  2320. // Compute the padding.
  2321. var length = valuePrefix.length + value.length + valueSuffix.length,
  2322. padding = length < width ? new Array(width - length + 1).join(fill) : "";
  2323. // If the fill character is "0", grouping is applied after padding.
  2324. if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
  2325. // Reconstruct the final output based on the desired alignment.
  2326. switch (align) {
  2327. case "<": value = valuePrefix + value + valueSuffix + padding; break;
  2328. case "=": value = valuePrefix + padding + value + valueSuffix; break;
  2329. case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
  2330. default: value = padding + valuePrefix + value + valueSuffix; break;
  2331. }
  2332. return numerals(value);
  2333. }
  2334. format.toString = function() {
  2335. return specifier + "";
  2336. };
  2337. return format;
  2338. }
  2339. function formatPrefix(specifier, value) {
  2340. var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
  2341. e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
  2342. k = Math.pow(10, -e),
  2343. prefix = prefixes[8 + e / 3];
  2344. return function(value) {
  2345. return f(k * value) + prefix;
  2346. };
  2347. }
  2348. return {
  2349. format: newFormat,
  2350. formatPrefix: formatPrefix
  2351. };
  2352. }
  2353. var locale;
  2354. var format$1;
  2355. var formatPrefix;
  2356. defaultLocale({
  2357. decimal: ".",
  2358. thousands: ",",
  2359. grouping: [3],
  2360. currency: ["$", ""],
  2361. minus: "-"
  2362. });
  2363. function defaultLocale(definition) {
  2364. locale = formatLocale(definition);
  2365. format$1 = locale.format;
  2366. formatPrefix = locale.formatPrefix;
  2367. return locale;
  2368. }
  2369. function precisionFixed(step) {
  2370. return Math.max(0, -exponent(Math.abs(step)));
  2371. }
  2372. function precisionPrefix(step, value) {
  2373. return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
  2374. }
  2375. function precisionRound(step, max) {
  2376. step = Math.abs(step), max = Math.abs(max) - step;
  2377. return Math.max(0, exponent(max) - exponent(step)) + 1;
  2378. }
  2379. function tickFormat(start, stop, count, specifier) {
  2380. var step = tickStep(start, stop, count),
  2381. precision;
  2382. specifier = formatSpecifier(specifier == null ? ",f" : specifier);
  2383. switch (specifier.type) {
  2384. case "s": {
  2385. var value = Math.max(Math.abs(start), Math.abs(stop));
  2386. if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
  2387. return formatPrefix(specifier, value);
  2388. }
  2389. case "":
  2390. case "e":
  2391. case "g":
  2392. case "p":
  2393. case "r": {
  2394. if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
  2395. break;
  2396. }
  2397. case "f":
  2398. case "%": {
  2399. if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
  2400. break;
  2401. }
  2402. }
  2403. return format$1(specifier);
  2404. }
  2405. function linearish(scale) {
  2406. var domain = scale.domain;
  2407. scale.ticks = function(count) {
  2408. var d = domain();
  2409. return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
  2410. };
  2411. scale.tickFormat = function(count, specifier) {
  2412. var d = domain();
  2413. return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
  2414. };
  2415. scale.nice = function(count) {
  2416. if (count == null) count = 10;
  2417. var d = domain(),
  2418. i0 = 0,
  2419. i1 = d.length - 1,
  2420. start = d[i0],
  2421. stop = d[i1],
  2422. step;
  2423. if (stop < start) {
  2424. step = start, start = stop, stop = step;
  2425. step = i0, i0 = i1, i1 = step;
  2426. }
  2427. step = tickIncrement(start, stop, count);
  2428. if (step > 0) {
  2429. start = Math.floor(start / step) * step;
  2430. stop = Math.ceil(stop / step) * step;
  2431. step = tickIncrement(start, stop, count);
  2432. } else if (step < 0) {
  2433. start = Math.ceil(start * step) / step;
  2434. stop = Math.floor(stop * step) / step;
  2435. step = tickIncrement(start, stop, count);
  2436. }
  2437. if (step > 0) {
  2438. d[i0] = Math.floor(start / step) * step;
  2439. d[i1] = Math.ceil(stop / step) * step;
  2440. domain(d);
  2441. } else if (step < 0) {
  2442. d[i0] = Math.ceil(start * step) / step;
  2443. d[i1] = Math.floor(stop * step) / step;
  2444. domain(d);
  2445. }
  2446. return scale;
  2447. };
  2448. return scale;
  2449. }
  2450. function linear$1() {
  2451. var scale = continuous();
  2452. scale.copy = function() {
  2453. return copy(scale, linear$1());
  2454. };
  2455. initRange.apply(scale, arguments);
  2456. return linearish(scale);
  2457. }
  2458. function transformer$1() {
  2459. var x0 = 0,
  2460. x1 = 1,
  2461. t0,
  2462. t1,
  2463. k10,
  2464. transform,
  2465. interpolator = identity$1,
  2466. clamp = false,
  2467. unknown;
  2468. function scale(x) {
  2469. return isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
  2470. }
  2471. scale.domain = function(_) {
  2472. return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];
  2473. };
  2474. scale.clamp = function(_) {
  2475. return arguments.length ? (clamp = !!_, scale) : clamp;
  2476. };
  2477. scale.interpolator = function(_) {
  2478. return arguments.length ? (interpolator = _, scale) : interpolator;
  2479. };
  2480. function range(interpolate) {
  2481. return function(_) {
  2482. var r0, r1;
  2483. return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
  2484. };
  2485. }
  2486. scale.range = range(interpolate);
  2487. scale.rangeRound = range(interpolateRound);
  2488. scale.unknown = function(_) {
  2489. return arguments.length ? (unknown = _, scale) : unknown;
  2490. };
  2491. return function(t) {
  2492. transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);
  2493. return scale;
  2494. };
  2495. }
  2496. function copy$1(source, target) {
  2497. return target
  2498. .domain(source.domain())
  2499. .interpolator(source.interpolator())
  2500. .clamp(source.clamp())
  2501. .unknown(source.unknown());
  2502. }
  2503. function sequential() {
  2504. var scale = linearish(transformer$1()(identity$1));
  2505. scale.copy = function() {
  2506. return copy$1(scale, sequential());
  2507. };
  2508. return initInterpolator.apply(scale, arguments);
  2509. }
  2510. function colors(specifier) {
  2511. var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;
  2512. while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
  2513. return colors;
  2514. }
  2515. function ramp(scheme) {
  2516. return rgbBasis(scheme[scheme.length - 1]);
  2517. }
  2518. var scheme = new Array(3).concat(
  2519. "fc8d59ffffbf99d594",
  2520. "d7191cfdae61abdda42b83ba",
  2521. "d7191cfdae61ffffbfabdda42b83ba",
  2522. "d53e4ffc8d59fee08be6f59899d5943288bd",
  2523. "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
  2524. "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
  2525. "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
  2526. "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
  2527. "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
  2528. ).map(colors);
  2529. var colorRainbow = ramp(scheme);
  2530. const COLOR_BASE = "#cecece";
  2531. // https://www.w3.org/TR/WCAG20/#relativeluminancedef
  2532. const rc = 0.2126;
  2533. const gc = 0.7152;
  2534. const bc = 0.0722;
  2535. // low-gamma adjust coefficient
  2536. const lowc = 1 / 12.92;
  2537. function adjustGamma(_) {
  2538. return Math.pow((_ + 0.055) / 1.055, 2.4);
  2539. }
  2540. function relativeLuminance(o) {
  2541. const rsrgb = o.r / 255;
  2542. const gsrgb = o.g / 255;
  2543. const bsrgb = o.b / 255;
  2544. const r = rsrgb <= 0.03928 ? rsrgb * lowc : adjustGamma(rsrgb);
  2545. const g = gsrgb <= 0.03928 ? gsrgb * lowc : adjustGamma(gsrgb);
  2546. const b = bsrgb <= 0.03928 ? bsrgb * lowc : adjustGamma(bsrgb);
  2547. return r * rc + g * gc + b * bc;
  2548. }
  2549. const createRainbowColor = root => {
  2550. const colorParentMap = new Map();
  2551. colorParentMap.set(root, COLOR_BASE);
  2552. if (root.children != null) {
  2553. const colorScale = sequential(
  2554. [0, root.children.length - 1],
  2555. colorRainbow
  2556. );
  2557. root.children.forEach((c, id) => {
  2558. colorParentMap.set(c, colorScale(id));
  2559. });
  2560. }
  2561. const colorMap = new Map();
  2562. const lightScale = linear$1()
  2563. .domain([0, root.height])
  2564. .range([0.8, 0.1]);
  2565. const getBackgroundColor = node => {
  2566. const parents = node.ancestors();
  2567. const colorStr =
  2568. parents.length === 1
  2569. ? colorParentMap.get(parents[0])
  2570. : colorParentMap.get(parents[parents.length - 2]);
  2571. const hslColor = hsl(colorStr);
  2572. hslColor.l = lightScale(node.depth);
  2573. return hslColor;
  2574. };
  2575. return node => {
  2576. if (!colorMap.has(node)) {
  2577. const backgroundColor = getBackgroundColor(node);
  2578. const l = relativeLuminance(backgroundColor.rgb());
  2579. const fontColor = l > 0.179 ? "#000" : "#fff";
  2580. colorMap.set(node, { backgroundColor, fontColor });
  2581. }
  2582. return colorMap.get(node);
  2583. };
  2584. };
  2585. const getNodePathTree = d =>
  2586. d
  2587. .ancestors()
  2588. .reverse()
  2589. .map(d => d.data.name)
  2590. .join("/");
  2591. const getNodeSizeTree = d => d.value;
  2592. const getNodeUidTree = d => d.data.uid;
  2593. class Tooltip {
  2594. constructor(container) {
  2595. this.tooltip = container
  2596. .append("div")
  2597. .style("opacity", 0)
  2598. .attr("class", "tooltip");
  2599. this.container = container;
  2600. this.onMouseLeave = this.onMouseLeave.bind(this);
  2601. this.onMouseOver = this.onMouseOver.bind(this);
  2602. this.onMouseMove = this.onMouseMove.bind(this);
  2603. }
  2604. onMouseOver() {
  2605. this.tooltip.style("opacity", 1);
  2606. }
  2607. onMouseMove(event, data) {
  2608. const { html } = this.tooltipContentCache.get(data);
  2609. this.tooltip.html(html);
  2610. const [x, y] = pointer(event, this.container.node());
  2611. const tooltipBox = this.tooltip.node().getBoundingClientRect();
  2612. const containerBox = this.container.node().getBoundingClientRect();
  2613. const availableWidthRight = containerBox.width - x;
  2614. const availableHeightBottom = containerBox.height - y;
  2615. const positionStyles = [];
  2616. const offsetX = 10;
  2617. const offsetY = 10;
  2618. if (availableHeightBottom >= tooltipBox.height + offsetY) {
  2619. positionStyles.push(["top", y + offsetY], ["bottom", null]);
  2620. } else {
  2621. positionStyles.push(
  2622. ["top", null],
  2623. ["bottom", availableHeightBottom + offsetY]
  2624. );
  2625. }
  2626. if (availableWidthRight >= tooltipBox.width + offsetX) {
  2627. positionStyles.push(["left", x + offsetX], ["right", null]);
  2628. } else {
  2629. positionStyles.push(
  2630. ["left", null],
  2631. ["right", availableWidthRight + offsetX]
  2632. );
  2633. }
  2634. for (const [pos, offset] of positionStyles) {
  2635. this.tooltip.style(
  2636. pos,
  2637. typeof offset === "number" ? offset + "px" : offset
  2638. );
  2639. }
  2640. }
  2641. onMouseLeave() {
  2642. this.tooltip.style("opacity", 0);
  2643. }
  2644. buildCache(
  2645. contentNodes,
  2646. {
  2647. totalSize,
  2648. getNodeSize = getNodeSizeTree,
  2649. getNodePath = getNodePathTree,
  2650. getNodeUid = getNodeUidTree,
  2651. nodes,
  2652. links
  2653. }
  2654. ) {
  2655. this.tooltipContentCache = new Map();
  2656. const importedByCache = new Map();
  2657. const importedCache = new Map();
  2658. for (const { source, target } of links || []) {
  2659. if (!importedByCache.has(target)) {
  2660. importedByCache.set(target, []);
  2661. }
  2662. if (!importedCache.has(source)) {
  2663. importedCache.set(source, []);
  2664. }
  2665. importedByCache.get(target).push({ uid: source, ...nodes[source] });
  2666. importedCache.get(source).push({ uid: target, ...nodes[target] });
  2667. }
  2668. contentNodes.each(data => {
  2669. const contentCache = {};
  2670. const str = [];
  2671. if (getNodePath != null) {
  2672. str.push(getNodePath(data));
  2673. }
  2674. const value = getNodeSize(data);
  2675. if (value !== 0) {
  2676. let sizeStr = `<b>Size: ${format_1(value)}</b>`;
  2677. if (totalSize != null) {
  2678. const percentageNum = (100 * value) / totalSize;
  2679. const percentage = percentageNum.toFixed(2);
  2680. const percentageString = percentage + "%";
  2681. sizeStr += ` (${percentageString})`;
  2682. }
  2683. str.push(sizeStr);
  2684. }
  2685. const uid = getNodeUid(data);
  2686. if (uid && importedByCache.has(uid)) {
  2687. const importedBy = importedByCache.get(uid);
  2688. str.push(
  2689. `<b>Imported By</b>: <br/>${[
  2690. ...new Set(importedBy.map(({ id }) => id))
  2691. ].join("<br/>")}`
  2692. );
  2693. }
  2694. contentCache.html = str.join("<br/>");
  2695. this.tooltipContentCache.set(data, contentCache);
  2696. });
  2697. }
  2698. }
  2699. const drawChart = (parentNode, { tree, nodes, links }, width, height) => {
  2700. const layout = d3treemap()
  2701. .size([width, height])
  2702. .paddingOuter(8)
  2703. .paddingTop(20)
  2704. .paddingInner(5)
  2705. .round(true)
  2706. .tile(treemapResquarify);
  2707. const charNode = select(parentNode);
  2708. const svg = charNode.append("svg").attr("viewBox", [0, 0, width, height]);
  2709. const tooltip = new Tooltip(charNode);
  2710. let root = hierarchy(tree)
  2711. .eachAfter(node => {
  2712. let sum = 0;
  2713. const children = node.children;
  2714. if (children != null) {
  2715. let i = children.length;
  2716. while (--i >= 0) sum += children[i].value;
  2717. } else {
  2718. sum = nodes[node.data.uid].renderedLength;
  2719. }
  2720. node.clipUid = uid("clip");
  2721. node.nodeUid = uid("node");
  2722. node.originalValue = sum;
  2723. node.value = sum;
  2724. })
  2725. .sort((a, b) => b.originalValue - a.originalValue);
  2726. const color = createRainbowColor(root);
  2727. const desiredValue = root.originalValue * 0.2;
  2728. const updateChart = selectedNode => {
  2729. //handle zoom of selected node
  2730. const selectedNodeMultiplier =
  2731. selectedNode != null
  2732. ? desiredValue > selectedNode.originalValue
  2733. ? desiredValue / selectedNode.originalValue
  2734. : 3
  2735. : 1;
  2736. // i only need to increase value of leaf nodes
  2737. // as folders will sum they up
  2738. const nodesToIncrease =
  2739. selectedNode != null
  2740. ? selectedNode.children != null
  2741. ? selectedNode.leaves()
  2742. : [selectedNode]
  2743. : [];
  2744. const nodesToIncreaseSet = new Set(nodesToIncrease);
  2745. // update value for nodes
  2746. root = root.eachAfter(node => {
  2747. let sum = 0;
  2748. const children = node.children;
  2749. if (children != null) {
  2750. let i = children.length;
  2751. while (--i >= 0) sum += children[i].value;
  2752. } else {
  2753. sum = nodesToIncreaseSet.has(node)
  2754. ? node.originalValue * selectedNodeMultiplier
  2755. : node.originalValue;
  2756. }
  2757. node.value = sum;
  2758. });
  2759. layout(root);
  2760. // this will make groups by height
  2761. const nestedDataMap = group(root.descendants(), d => d.height);
  2762. const nestedData = Array.from(nestedDataMap, ([key, values]) => ({
  2763. key,
  2764. values
  2765. }));
  2766. nestedData.sort((a, b) => b.key - a.key);
  2767. const layers = svg
  2768. .selectAll(".layer")
  2769. .data(nestedData, d => d.key)
  2770. .join("g")
  2771. .attr("class", "layer");
  2772. const nodeGroups = layers
  2773. .selectAll(".node")
  2774. .data(
  2775. d => d.values,
  2776. d => d
  2777. )
  2778. .join("g")
  2779. .attr("class", "node")
  2780. .attr("transform", d => `translate(${d.x0},${d.y0})`)
  2781. .on("mouseover", tooltip.onMouseOver)
  2782. .on("mousemove", tooltip.onMouseMove)
  2783. .on("mouseleave", tooltip.onMouseLeave)
  2784. .on("click", (event, d) => {
  2785. if (d === selectedNode) {
  2786. updateChart();
  2787. } else {
  2788. updateChart(d);
  2789. }
  2790. });
  2791. //fill node groups
  2792. const rect = nodeGroups
  2793. .selectAll("rect")
  2794. .data(d => [d])
  2795. .join("rect")
  2796. .attr("id", d => d.nodeUid.id)
  2797. .attr("fill", d => color(d).backgroundColor)
  2798. .attr("rx", 2)
  2799. .attr("ry", 2)
  2800. .attr("width", d => d.x1 - d.x0)
  2801. .attr("height", d => d.y1 - d.y0)
  2802. .style("stroke", null)
  2803. .attr("stroke-width", null);
  2804. if (selectedNode != null) {
  2805. rect
  2806. .filter(d => d === selectedNode)
  2807. .style("stroke", "#fff")
  2808. .attr("stroke-width", 2);
  2809. }
  2810. // add clipPath so text do not go out of node
  2811. nodeGroups
  2812. .selectAll("clipPath")
  2813. .data(d => [d])
  2814. .join("clipPath")
  2815. .attr("id", d => d.clipUid.id)
  2816. .selectAll("use")
  2817. .data(d => [d])
  2818. .join("use")
  2819. .attr("xlink:href", d => d.nodeUid.href);
  2820. // add text with clipping
  2821. const text = nodeGroups
  2822. .selectAll("text")
  2823. .data(d => [d])
  2824. .join("text")
  2825. .attr("clip-path", d => d.clipUid)
  2826. .style("fill", d => color(d).fontColor);
  2827. text
  2828. .selectAll("tspan")
  2829. .data(d => [d.data.name, format_1(d.originalValue)])
  2830. .join("tspan")
  2831. .attr("fill-opacity", (d, i, nodes) =>
  2832. i === nodes.length - 1 ? 0.7 : null
  2833. )
  2834. .style("font-size", "0.7em")
  2835. .text(d => d);
  2836. nodeGroups
  2837. .filter(d => d.children)
  2838. .selectAll("tspan")
  2839. .attr("dx", 3)
  2840. .attr("y", 13);
  2841. nodeGroups
  2842. .filter(d => !d.children)
  2843. .selectAll("tspan")
  2844. .attr("x", 3)
  2845. .attr(
  2846. "y",
  2847. (d, i, nodes) => `${(i === nodes.length - 1) * 0.3 + 1.1 + i * 0.9}em`
  2848. );
  2849. tooltip.buildCache(nodeGroups, {
  2850. getNodeSize: d => d.originalValue,
  2851. totalSize: root.originalValue,
  2852. nodes,
  2853. links
  2854. });
  2855. };
  2856. updateChart();
  2857. };
  2858. return drawChart;
  2859. }());
  2860. </script>
  2861. <script>
  2862. const chartParameters = {};
  2863. const data = {"version":1,"tree":{"name":"root","children":[{"name":"Modal/index.js","children":[{"name":"Utils","children":[{"name":"utils.ts","uid":"228b-1"}]},{"name":"Modal","children":[{"name":"index.tsx","uid":"228b-2"}]},{"name":"\u0000unknown-Modal/index.js","uid":"228b-0"}]},{"name":"Common/index.js","children":[{"name":"\u0000unknown-Common/index.js","uid":"228b-3"},{"name":"\u0000unknown-Common/index.js","uid":"228b-3"}]},{"name":"ConsumeListView/index.js","children":[{"name":"assets","children":[{"name":"icon","children":[{"name":"popovers_list_huangguan.png","uid":"228b-5"}]}]},{"name":"ConsumeListView","children":[{"name":"index.tsx","uid":"228b-6"}]},{"name":"\u0000unknown-ConsumeListView/index.js","uid":"228b-4"}]},{"name":"PayPlatformOptions/index.js","children":[{"name":"assets","children":[{"name":"pay_zhifubao@2x.png","uid":"228b-8"},{"name":"pay_wechat@2x.png","uid":"228b-9"},{"name":"pay_paypal@2x.png","uid":"228b-10"},{"name":"payment_btn_pay_alipay@2x.png","uid":"228b-11"},{"name":"payment_btn_pay_wechatpay@2x.png","uid":"228b-12"},{"name":"payment_btn_pay_paypal@2x.png","uid":"228b-13"}]},{"name":"PayPlatformOptions","children":[{"name":"index.tsx","uid":"228b-14"}]},{"name":"\u0000unknown-PayPlatformOptions/index.js","uid":"228b-7"}]},{"name":"PriceOptions/index.js","children":[{"name":"index.tsx","uid":"228b-16"},{"name":"\u0000unknown-PriceOptions/index.js","uid":"228b-15"}]},{"name":"WaitPayInfoView/index.js","children":[{"name":"assets","children":[{"name":"icon","children":[{"name":"icon-info-blue@2x.svg","uid":"228b-18"}]}]},{"name":"WaitPayInfoView","children":[{"name":"index.tsx","uid":"228b-19"}]},{"name":"\u0000unknown-WaitPayInfoView/index.js","uid":"228b-17"}]},{"name":"AllocWantedModal/index.js","children":[{"name":"assets","children":[{"name":"icon","children":[{"name":"close.png","uid":"228b-21"}]}]},{"name":"AllocWantedModal","children":[{"name":"index.tsx","uid":"228b-22"}]},{"name":"\u0000unknown-AllocWantedModal/index.js","uid":"228b-20"}]},{"name":"WantedPublishView/index.js","children":[{"name":"assets","children":[{"name":"cover_wanted@2x.png","uid":"228b-24"},{"name":"icon","children":[{"name":"question-circle-o@2x.png","uid":"228b-25"}]}]},{"name":"WantedPublishView","children":[{"name":"index.tsx","uid":"228b-26"}]},{"name":"\u0000unknown-WantedPublishView/index.js","uid":"228b-23"}]},{"name":"WantedPublishPopover/index.js","children":[{"name":"assets","children":[{"name":"icon","children":[{"name":"close@2x.png","uid":"228b-28"}]}]},{"name":"WantedPublishPopover","children":[{"name":"index.tsx","uid":"228b-29"}]},{"name":"\u0000unknown-WantedPublishPopover/index.js","uid":"228b-27"}]},{"name":"Payment/index.js","children":[{"name":"\u0000unknown-Payment/index.js","uid":"228b-30"},{"name":"\u0000unknown-Payment/index.js","uid":"228b-30"}]},{"name":"./index.js","children":[{"name":"\u0000unknown-./index.js","uid":"228b-31"},{"name":"\u0000unknown-./index.js","uid":"228b-31"}]},{"name":"BraftEditor/index.js","children":[{"name":"index.tsx","uid":"228b-33"},{"name":"\u0000unknown-BraftEditor/index.js","uid":"228b-32"}]},{"name":"Editor/index.js","children":[{"name":"CommonTool","children":[{"name":"ControlsToolBar.tsx","uid":"228b-35"}]},{"name":"ImgTxtEditor","children":[{"name":"SimpleEditor.tsx","uid":"228b-36"}]},{"name":"\u0000unknown-Editor/index.js","uid":"228b-34"}]},{"name":"WantedPublishModal/index.js","children":[{"name":"index.tsx","uid":"228b-38"},{"name":"\u0000unknown-WantedPublishModal/index.js","uid":"228b-37"}]},{"name":"inherits-c86d64c1.js","children":[{"name":"classCallCheck.js","uid":"228b-40"},{"name":"createClass.js","uid":"228b-41"},{"name":"typeof.js","uid":"228b-42"},{"name":"assertThisInitialized.js","uid":"228b-43"},{"name":"possibleConstructorReturn.js","uid":"228b-44"},{"name":"getPrototypeOf.js","uid":"228b-45"},{"name":"setPrototypeOf.js","uid":"228b-46"},{"name":"inherits.js","uid":"228b-47"},{"name":"\u0000unknown-inherits-c86d64c1.js","uid":"228b-39"}]},{"name":"style-inject.es-dcee06b6.js","children":[{"name":"style-inject.es.js","uid":"228b-49"},{"name":"\u0000unknown-style-inject.es-dcee06b6.js","uid":"228b-48"}]},{"name":"defineProperty-ba7cd53d.js","children":[{"name":"defineProperty.js","uid":"228b-51"},{"name":"\u0000unknown-defineProperty-ba7cd53d.js","uid":"228b-50"}]},{"name":"index-4c407188.js","children":[{"name":"index.js","uid":"228b-53"},{"name":"\u0000unknown-index-4c407188.js","uid":"228b-52"}]},{"name":"utils-b800dc99.js","children":[{"name":"utils.ts","uid":"228b-55"},{"name":"\u0000unknown-utils-b800dc99.js","uid":"228b-54"}]},{"name":"slicedToArray-172f4624.js","children":[{"name":"arrayWithHoles.js","uid":"228b-57"},{"name":"iterableToArrayLimit.js","uid":"228b-58"},{"name":"nonIterableRest.js","uid":"228b-59"},{"name":"slicedToArray.js","uid":"228b-60"},{"name":"\u0000unknown-slicedToArray-172f4624.js","uid":"228b-56"}]},{"name":"WantedPublish-761aab8e.js","children":[{"name":"WantedPublish.tsx","uid":"228b-62"},{"name":"\u0000unknown-WantedPublish-761aab8e.js","uid":"228b-61"}]}]},"nodes":{"228b-0":{"renderedLength":2496,"id":"\u0000unknown-Modal/index.js"},"228b-1":{"renderedLength":114,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Common/Utils/utils.ts"},"228b-2":{"renderedLength":2699,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Common/Modal/index.tsx"},"228b-3":{"renderedLength":309,"id":"\u0000unknown-Common/index.js"},"228b-4":{"renderedLength":4841,"id":"\u0000unknown-ConsumeListView/index.js"},"228b-5":{"renderedLength":708,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/icon/popovers_list_huangguan.png"},"228b-6":{"renderedLength":3641,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/ConsumeListView/index.tsx"},"228b-7":{"renderedLength":6149,"id":"\u0000unknown-PayPlatformOptions/index.js"},"228b-8":{"renderedLength":5140,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/pay_zhifubao@2x.png"},"228b-9":{"renderedLength":5430,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/pay_wechat@2x.png"},"228b-10":{"renderedLength":4674,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/pay_paypal@2x.png"},"228b-11":{"renderedLength":918,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/payment_btn_pay_alipay@2x.png"},"228b-12":{"renderedLength":926,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/payment_btn_pay_wechatpay@2x.png"},"228b-13":{"renderedLength":974,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/payment_btn_pay_paypal@2x.png"},"228b-14":{"renderedLength":3981,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/PayPlatformOptions/index.tsx"},"228b-15":{"renderedLength":5545,"id":"\u0000unknown-PriceOptions/index.js"},"228b-16":{"renderedLength":3638,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/PriceOptions/index.tsx"},"228b-17":{"renderedLength":1312,"id":"\u0000unknown-WaitPayInfoView/index.js"},"228b-18":{"renderedLength":2063,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/icon/icon-info-blue@2x.svg"},"228b-19":{"renderedLength":1645,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/WaitPayInfoView/index.tsx"},"228b-20":{"renderedLength":4920,"id":"\u0000unknown-AllocWantedModal/index.js"},"228b-21":{"renderedLength":860,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/icon/close.png"},"228b-22":{"renderedLength":6672,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/AllocWantedModal/index.tsx"},"228b-23":{"renderedLength":6908,"id":"\u0000unknown-WantedPublishView/index.js"},"228b-24":{"renderedLength":5920,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/cover_wanted@2x.png"},"228b-25":{"renderedLength":1558,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/icon/question-circle-o@2x.png"},"228b-26":{"renderedLength":4293,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/WantedPublishView/index.tsx"},"228b-27":{"renderedLength":2729,"id":"\u0000unknown-WantedPublishPopover/index.js"},"228b-28":{"renderedLength":1888,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/assets/icon/close@2x.png"},"228b-29":{"renderedLength":2887,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/WantedPublishPopover/index.tsx"},"228b-30":{"renderedLength":1330,"id":"\u0000unknown-Payment/index.js"},"228b-31":{"renderedLength":1393,"id":"\u0000unknown-./index.js"},"228b-32":{"renderedLength":2024,"id":"\u0000unknown-BraftEditor/index.js"},"228b-33":{"renderedLength":2433,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Editor/BraftEditor/index.tsx"},"228b-34":{"renderedLength":2917,"id":"\u0000unknown-Editor/index.js"},"228b-35":{"renderedLength":1537,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Editor/CommonTool/ControlsToolBar.tsx"},"228b-36":{"renderedLength":2747,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Editor/ImgTxtEditor/SimpleEditor.tsx"},"228b-37":{"renderedLength":1888,"id":"\u0000unknown-WantedPublishModal/index.js"},"228b-38":{"renderedLength":2217,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/src/components/Payment/WantedPublishModal/index.tsx"},"228b-39":{"renderedLength":269,"id":"\u0000unknown-inherits-c86d64c1.js"},"228b-40":{"renderedLength":162,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/classCallCheck.js"},"228b-41":{"renderedLength":573,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/createClass.js"},"228b-42":{"renderedLength":419,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/typeof.js"},"228b-43":{"renderedLength":178,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"},"228b-44":{"renderedLength":189,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js"},"228b-45":{"renderedLength":216,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js"},"228b-46":{"renderedLength":186,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"},"228b-47":{"renderedLength":419,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/inherits.js"},"228b-48":{"renderedLength":51,"id":"\u0000unknown-style-inject.es-dcee06b6.js"},"228b-49":{"renderedLength":637,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/style-inject/dist/style-inject.es.js"},"228b-50":{"renderedLength":59,"id":"\u0000unknown-defineProperty-ba7cd53d.js"},"228b-51":{"renderedLength":255,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/defineProperty.js"},"228b-52":{"renderedLength":236,"id":"\u0000unknown-index-4c407188.js"},"228b-53":{"renderedLength":926,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/classnames/index.js"},"228b-54":{"renderedLength":337,"id":"\u0000unknown-utils-b800dc99.js"},"228b-55":{"renderedLength":688,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/Utils/utils.ts"},"228b-56":{"renderedLength":60,"id":"\u0000unknown-slicedToArray-172f4624.js"},"228b-57":{"renderedLength":72,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js"},"228b-58":{"renderedLength":615,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"},"228b-59":{"renderedLength":111,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js"},"228b-60":{"renderedLength":114,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js"},"228b-61":{"renderedLength":814,"id":"\u0000unknown-WantedPublish-761aab8e.js"},"228b-62":{"renderedLength":612,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/BaseClassComponents/WantedPublish.tsx"},"228b-63":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Common/Modal/index.tsx"},"228b-64":{"renderedLength":0,"isExternal":true,"id":"react"},"228b-65":{"renderedLength":0,"isExternal":true,"id":"react-dom"},"228b-66":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Common/Utils/utils.ts"},"228b-67":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Common/Modal/Modal.less"},"228b-68":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Common/index.ts"},"228b-69":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/ConsumeListView/index.tsx"},"228b-70":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/icon/popovers_list_huangguan.png"},"228b-71":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/ConsumeListView/ConsumeListView.less"},"228b-72":{"renderedLength":0,"id":"\u0000commonjsHelpers.js"},"228b-73":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/PayPlatformOptions/index.tsx"},"228b-74":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/pay_zhifubao@2x.png"},"228b-75":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/pay_wechat@2x.png"},"228b-76":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/pay_paypal@2x.png"},"228b-77":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/payment_btn_pay_alipay@2x.png"},"228b-78":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/payment_btn_pay_wechatpay@2x.png"},"228b-79":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/payment_btn_pay_paypal@2x.png"},"228b-80":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/PayPlatformOptions/PayPlatformOptions.less"},"228b-81":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/PriceOptions/index.tsx"},"228b-82":{"renderedLength":0,"isExternal":true,"id":"antd"},"228b-83":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/PriceOptions/PriceOptions.less"},"228b-84":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WaitPayInfoView/index.tsx"},"228b-85":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WaitPayInfoView/WaitPayInfoView.less"},"228b-86":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/icon/icon-info-blue@2x.svg"},"228b-87":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/AllocWantedModal/index.tsx"},"228b-88":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/icon/close.png"},"228b-89":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/AllocWantedModal/AllocWantedModal.less"},"228b-90":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WantedPublishView/index.tsx"},"228b-91":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/cover_wanted@2x.png"},"228b-92":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/icon/question-circle-o@2x.png"},"228b-93":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WantedPublishView/WantedPublishView.less"},"228b-94":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WantedPublishPopover/index.tsx"},"228b-95":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/assets/icon/close@2x.png"},"228b-96":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WantedPublishPopover/WantedPublishPopover.less"},"228b-97":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/index.ts"},"228b-98":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/lib-build.ts"},"228b-99":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Editor/BraftEditor/index.tsx"},"228b-100":{"renderedLength":0,"isExternal":true,"id":"braft-editor"},"228b-101":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Editor/BraftEditor/index.less"},"228b-102":{"renderedLength":0,"isExternal":true,"id":"braft-editor/dist/index.css"},"228b-103":{"renderedLength":0,"isExternal":true,"id":"braft-extensions/dist/emoticon.css"},"228b-104":{"renderedLength":0,"isExternal":true,"id":"braft-extensions/dist/emoticon"},"228b-105":{"renderedLength":0,"isExternal":true,"id":"braft-extensions/dist/max-length"},"228b-106":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Editor/index.ts"},"228b-107":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Editor/ImgTxtEditor/SimpleEditor.tsx"},"228b-108":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Editor/CommonTool/ControlsToolBar.tsx"},"228b-109":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Editor/ImgTxtEditor/index.less"},"228b-110":{"renderedLength":0,"isEntry":true,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WantedPublishModal/index.tsx"},"228b-111":{"renderedLength":0,"id":"/Users/roxasansem/Desktop/CODE/StorybookUI/bilingo-ui/src/components/Payment/WantedPublishModal/WantedPublishModal.less"}},"links":[{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-68","target":"228b-63"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-69","target":"228b-51"},{"source":"228b-69","target":"228b-40"},{"source":"228b-69","target":"228b-41"},{"source":"228b-69","target":"228b-44"},{"source":"228b-69","target":"228b-45"},{"source":"228b-69","target":"228b-47"},{"source":"228b-69","target":"228b-64"},{"source":"228b-69","target":"228b-53"},{"source":"228b-69","target":"228b-55"},{"source":"228b-69","target":"228b-70"},{"source":"228b-69","target":"228b-71"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-53","target":"228b-72"},{"source":"228b-55","target":"228b-51"},{"source":"228b-71","target":"228b-49"},{"source":"228b-73","target":"228b-51"},{"source":"228b-73","target":"228b-64"},{"source":"228b-73","target":"228b-53"},{"source":"228b-73","target":"228b-74"},{"source":"228b-73","target":"228b-75"},{"source":"228b-73","target":"228b-76"},{"source":"228b-73","target":"228b-77"},{"source":"228b-73","target":"228b-78"},{"source":"228b-73","target":"228b-79"},{"source":"228b-73","target":"228b-80"},{"source":"228b-73","target":"228b-55"},{"source":"228b-53","target":"228b-72"},{"source":"228b-80","target":"228b-49"},{"source":"228b-55","target":"228b-51"},{"source":"228b-81","target":"228b-51"},{"source":"228b-81","target":"228b-60"},{"source":"228b-81","target":"228b-64"},{"source":"228b-81","target":"228b-53"},{"source":"228b-81","target":"228b-82"},{"source":"228b-81","target":"228b-83"},{"source":"228b-81","target":"228b-55"},{"source":"228b-60","target":"228b-57"},{"source":"228b-60","target":"228b-58"},{"source":"228b-60","target":"228b-59"},{"source":"228b-53","target":"228b-72"},{"source":"228b-83","target":"228b-49"},{"source":"228b-55","target":"228b-51"},{"source":"228b-84","target":"228b-40"},{"source":"228b-84","target":"228b-41"},{"source":"228b-84","target":"228b-44"},{"source":"228b-84","target":"228b-45"},{"source":"228b-84","target":"228b-47"},{"source":"228b-84","target":"228b-64"},{"source":"228b-84","target":"228b-53"},{"source":"228b-84","target":"228b-85"},{"source":"228b-84","target":"228b-86"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-53","target":"228b-72"},{"source":"228b-85","target":"228b-49"},{"source":"228b-87","target":"228b-40"},{"source":"228b-87","target":"228b-41"},{"source":"228b-87","target":"228b-44"},{"source":"228b-87","target":"228b-45"},{"source":"228b-87","target":"228b-47"},{"source":"228b-87","target":"228b-64"},{"source":"228b-87","target":"228b-82"},{"source":"228b-87","target":"228b-63"},{"source":"228b-87","target":"228b-88"},{"source":"228b-87","target":"228b-89"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-89","target":"228b-49"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-90","target":"228b-51"},{"source":"228b-90","target":"228b-40"},{"source":"228b-90","target":"228b-41"},{"source":"228b-90","target":"228b-44"},{"source":"228b-90","target":"228b-45"},{"source":"228b-90","target":"228b-47"},{"source":"228b-90","target":"228b-64"},{"source":"228b-90","target":"228b-53"},{"source":"228b-90","target":"228b-82"},{"source":"228b-90","target":"228b-91"},{"source":"228b-90","target":"228b-92"},{"source":"228b-90","target":"228b-93"},{"source":"228b-90","target":"228b-63"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-53","target":"228b-72"},{"source":"228b-93","target":"228b-49"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-94","target":"228b-40"},{"source":"228b-94","target":"228b-41"},{"source":"228b-94","target":"228b-44"},{"source":"228b-94","target":"228b-45"},{"source":"228b-94","target":"228b-47"},{"source":"228b-94","target":"228b-64"},{"source":"228b-94","target":"228b-82"},{"source":"228b-94","target":"228b-90"},{"source":"228b-94","target":"228b-95"},{"source":"228b-94","target":"228b-96"},{"source":"228b-94","target":"228b-62"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-90","target":"228b-51"},{"source":"228b-90","target":"228b-40"},{"source":"228b-90","target":"228b-41"},{"source":"228b-90","target":"228b-44"},{"source":"228b-90","target":"228b-45"},{"source":"228b-90","target":"228b-47"},{"source":"228b-90","target":"228b-64"},{"source":"228b-90","target":"228b-53"},{"source":"228b-90","target":"228b-82"},{"source":"228b-90","target":"228b-91"},{"source":"228b-90","target":"228b-92"},{"source":"228b-90","target":"228b-93"},{"source":"228b-90","target":"228b-63"},{"source":"228b-96","target":"228b-49"},{"source":"228b-62","target":"228b-40"},{"source":"228b-62","target":"228b-44"},{"source":"228b-62","target":"228b-45"},{"source":"228b-62","target":"228b-47"},{"source":"228b-62","target":"228b-64"},{"source":"228b-53","target":"228b-72"},{"source":"228b-93","target":"228b-49"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-97","target":"228b-69"},{"source":"228b-97","target":"228b-73"},{"source":"228b-97","target":"228b-81"},{"source":"228b-97","target":"228b-84"},{"source":"228b-97","target":"228b-87"},{"source":"228b-97","target":"228b-94"},{"source":"228b-97","target":"228b-90"},{"source":"228b-69","target":"228b-51"},{"source":"228b-69","target":"228b-40"},{"source":"228b-69","target":"228b-41"},{"source":"228b-69","target":"228b-44"},{"source":"228b-69","target":"228b-45"},{"source":"228b-69","target":"228b-47"},{"source":"228b-69","target":"228b-64"},{"source":"228b-69","target":"228b-53"},{"source":"228b-69","target":"228b-55"},{"source":"228b-69","target":"228b-70"},{"source":"228b-69","target":"228b-71"},{"source":"228b-73","target":"228b-51"},{"source":"228b-73","target":"228b-64"},{"source":"228b-73","target":"228b-53"},{"source":"228b-73","target":"228b-74"},{"source":"228b-73","target":"228b-75"},{"source":"228b-73","target":"228b-76"},{"source":"228b-73","target":"228b-77"},{"source":"228b-73","target":"228b-78"},{"source":"228b-73","target":"228b-79"},{"source":"228b-73","target":"228b-80"},{"source":"228b-73","target":"228b-55"},{"source":"228b-81","target":"228b-51"},{"source":"228b-81","target":"228b-60"},{"source":"228b-81","target":"228b-64"},{"source":"228b-81","target":"228b-53"},{"source":"228b-81","target":"228b-82"},{"source":"228b-81","target":"228b-83"},{"source":"228b-81","target":"228b-55"},{"source":"228b-84","target":"228b-40"},{"source":"228b-84","target":"228b-41"},{"source":"228b-84","target":"228b-44"},{"source":"228b-84","target":"228b-45"},{"source":"228b-84","target":"228b-47"},{"source":"228b-84","target":"228b-64"},{"source":"228b-84","target":"228b-53"},{"source":"228b-84","target":"228b-85"},{"source":"228b-84","target":"228b-86"},{"source":"228b-87","target":"228b-40"},{"source":"228b-87","target":"228b-41"},{"source":"228b-87","target":"228b-44"},{"source":"228b-87","target":"228b-45"},{"source":"228b-87","target":"228b-47"},{"source":"228b-87","target":"228b-64"},{"source":"228b-87","target":"228b-82"},{"source":"228b-87","target":"228b-63"},{"source":"228b-87","target":"228b-88"},{"source":"228b-87","target":"228b-89"},{"source":"228b-94","target":"228b-40"},{"source":"228b-94","target":"228b-41"},{"source":"228b-94","target":"228b-44"},{"source":"228b-94","target":"228b-45"},{"source":"228b-94","target":"228b-47"},{"source":"228b-94","target":"228b-64"},{"source":"228b-94","target":"228b-82"},{"source":"228b-94","target":"228b-90"},{"source":"228b-94","target":"228b-95"},{"source":"228b-94","target":"228b-96"},{"source":"228b-94","target":"228b-62"},{"source":"228b-90","target":"228b-51"},{"source":"228b-90","target":"228b-40"},{"source":"228b-90","target":"228b-41"},{"source":"228b-90","target":"228b-44"},{"source":"228b-90","target":"228b-45"},{"source":"228b-90","target":"228b-47"},{"source":"228b-90","target":"228b-64"},{"source":"228b-90","target":"228b-53"},{"source":"228b-90","target":"228b-82"},{"source":"228b-90","target":"228b-91"},{"source":"228b-90","target":"228b-92"},{"source":"228b-90","target":"228b-93"},{"source":"228b-90","target":"228b-63"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-53","target":"228b-72"},{"source":"228b-55","target":"228b-51"},{"source":"228b-71","target":"228b-49"},{"source":"228b-80","target":"228b-49"},{"source":"228b-60","target":"228b-57"},{"source":"228b-60","target":"228b-58"},{"source":"228b-60","target":"228b-59"},{"source":"228b-83","target":"228b-49"},{"source":"228b-85","target":"228b-49"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-89","target":"228b-49"},{"source":"228b-96","target":"228b-49"},{"source":"228b-62","target":"228b-40"},{"source":"228b-62","target":"228b-44"},{"source":"228b-62","target":"228b-45"},{"source":"228b-62","target":"228b-47"},{"source":"228b-62","target":"228b-64"},{"source":"228b-93","target":"228b-49"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-98","target":"228b-68"},{"source":"228b-98","target":"228b-97"},{"source":"228b-68","target":"228b-63"},{"source":"228b-97","target":"228b-69"},{"source":"228b-97","target":"228b-73"},{"source":"228b-97","target":"228b-81"},{"source":"228b-97","target":"228b-84"},{"source":"228b-97","target":"228b-87"},{"source":"228b-97","target":"228b-94"},{"source":"228b-97","target":"228b-90"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-69","target":"228b-51"},{"source":"228b-69","target":"228b-40"},{"source":"228b-69","target":"228b-41"},{"source":"228b-69","target":"228b-44"},{"source":"228b-69","target":"228b-45"},{"source":"228b-69","target":"228b-47"},{"source":"228b-69","target":"228b-64"},{"source":"228b-69","target":"228b-53"},{"source":"228b-69","target":"228b-55"},{"source":"228b-69","target":"228b-70"},{"source":"228b-69","target":"228b-71"},{"source":"228b-73","target":"228b-51"},{"source":"228b-73","target":"228b-64"},{"source":"228b-73","target":"228b-53"},{"source":"228b-73","target":"228b-74"},{"source":"228b-73","target":"228b-75"},{"source":"228b-73","target":"228b-76"},{"source":"228b-73","target":"228b-77"},{"source":"228b-73","target":"228b-78"},{"source":"228b-73","target":"228b-79"},{"source":"228b-73","target":"228b-80"},{"source":"228b-73","target":"228b-55"},{"source":"228b-81","target":"228b-51"},{"source":"228b-81","target":"228b-60"},{"source":"228b-81","target":"228b-64"},{"source":"228b-81","target":"228b-53"},{"source":"228b-81","target":"228b-82"},{"source":"228b-81","target":"228b-83"},{"source":"228b-81","target":"228b-55"},{"source":"228b-84","target":"228b-40"},{"source":"228b-84","target":"228b-41"},{"source":"228b-84","target":"228b-44"},{"source":"228b-84","target":"228b-45"},{"source":"228b-84","target":"228b-47"},{"source":"228b-84","target":"228b-64"},{"source":"228b-84","target":"228b-53"},{"source":"228b-84","target":"228b-85"},{"source":"228b-84","target":"228b-86"},{"source":"228b-87","target":"228b-40"},{"source":"228b-87","target":"228b-41"},{"source":"228b-87","target":"228b-44"},{"source":"228b-87","target":"228b-45"},{"source":"228b-87","target":"228b-47"},{"source":"228b-87","target":"228b-64"},{"source":"228b-87","target":"228b-82"},{"source":"228b-87","target":"228b-63"},{"source":"228b-87","target":"228b-88"},{"source":"228b-87","target":"228b-89"},{"source":"228b-94","target":"228b-40"},{"source":"228b-94","target":"228b-41"},{"source":"228b-94","target":"228b-44"},{"source":"228b-94","target":"228b-45"},{"source":"228b-94","target":"228b-47"},{"source":"228b-94","target":"228b-64"},{"source":"228b-94","target":"228b-82"},{"source":"228b-94","target":"228b-90"},{"source":"228b-94","target":"228b-95"},{"source":"228b-94","target":"228b-96"},{"source":"228b-94","target":"228b-62"},{"source":"228b-90","target":"228b-51"},{"source":"228b-90","target":"228b-40"},{"source":"228b-90","target":"228b-41"},{"source":"228b-90","target":"228b-44"},{"source":"228b-90","target":"228b-45"},{"source":"228b-90","target":"228b-47"},{"source":"228b-90","target":"228b-64"},{"source":"228b-90","target":"228b-53"},{"source":"228b-90","target":"228b-82"},{"source":"228b-90","target":"228b-91"},{"source":"228b-90","target":"228b-92"},{"source":"228b-90","target":"228b-93"},{"source":"228b-90","target":"228b-63"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-53","target":"228b-72"},{"source":"228b-55","target":"228b-51"},{"source":"228b-71","target":"228b-49"},{"source":"228b-80","target":"228b-49"},{"source":"228b-60","target":"228b-57"},{"source":"228b-60","target":"228b-58"},{"source":"228b-60","target":"228b-59"},{"source":"228b-83","target":"228b-49"},{"source":"228b-85","target":"228b-49"},{"source":"228b-89","target":"228b-49"},{"source":"228b-96","target":"228b-49"},{"source":"228b-62","target":"228b-40"},{"source":"228b-62","target":"228b-44"},{"source":"228b-62","target":"228b-45"},{"source":"228b-62","target":"228b-47"},{"source":"228b-62","target":"228b-64"},{"source":"228b-93","target":"228b-49"},{"source":"228b-99","target":"228b-51"},{"source":"228b-99","target":"228b-60"},{"source":"228b-99","target":"228b-64"},{"source":"228b-99","target":"228b-53"},{"source":"228b-99","target":"228b-100"},{"source":"228b-99","target":"228b-101"},{"source":"228b-99","target":"228b-102"},{"source":"228b-99","target":"228b-103"},{"source":"228b-99","target":"228b-104"},{"source":"228b-99","target":"228b-105"},{"source":"228b-60","target":"228b-57"},{"source":"228b-60","target":"228b-58"},{"source":"228b-60","target":"228b-59"},{"source":"228b-53","target":"228b-72"},{"source":"228b-101","target":"228b-49"},{"source":"228b-106","target":"228b-99"},{"source":"228b-106","target":"228b-107"},{"source":"228b-99","target":"228b-51"},{"source":"228b-99","target":"228b-60"},{"source":"228b-99","target":"228b-64"},{"source":"228b-99","target":"228b-53"},{"source":"228b-99","target":"228b-100"},{"source":"228b-99","target":"228b-101"},{"source":"228b-99","target":"228b-102"},{"source":"228b-99","target":"228b-103"},{"source":"228b-99","target":"228b-104"},{"source":"228b-99","target":"228b-105"},{"source":"228b-107","target":"228b-64"},{"source":"228b-107","target":"228b-53"},{"source":"228b-107","target":"228b-99"},{"source":"228b-107","target":"228b-108"},{"source":"228b-107","target":"228b-109"},{"source":"228b-60","target":"228b-57"},{"source":"228b-60","target":"228b-58"},{"source":"228b-60","target":"228b-59"},{"source":"228b-53","target":"228b-72"},{"source":"228b-101","target":"228b-49"},{"source":"228b-108","target":"228b-51"},{"source":"228b-108","target":"228b-64"},{"source":"228b-109","target":"228b-49"},{"source":"228b-110","target":"228b-40"},{"source":"228b-110","target":"228b-41"},{"source":"228b-110","target":"228b-44"},{"source":"228b-110","target":"228b-45"},{"source":"228b-110","target":"228b-47"},{"source":"228b-110","target":"228b-64"},{"source":"228b-110","target":"228b-63"},{"source":"228b-110","target":"228b-90"},{"source":"228b-110","target":"228b-111"},{"source":"228b-110","target":"228b-62"},{"source":"228b-44","target":"228b-42"},{"source":"228b-44","target":"228b-43"},{"source":"228b-47","target":"228b-46"},{"source":"228b-63","target":"228b-40"},{"source":"228b-63","target":"228b-41"},{"source":"228b-63","target":"228b-44"},{"source":"228b-63","target":"228b-45"},{"source":"228b-63","target":"228b-47"},{"source":"228b-63","target":"228b-64"},{"source":"228b-63","target":"228b-65"},{"source":"228b-63","target":"228b-66"},{"source":"228b-63","target":"228b-67"},{"source":"228b-90","target":"228b-51"},{"source":"228b-90","target":"228b-40"},{"source":"228b-90","target":"228b-41"},{"source":"228b-90","target":"228b-44"},{"source":"228b-90","target":"228b-45"},{"source":"228b-90","target":"228b-47"},{"source":"228b-90","target":"228b-64"},{"source":"228b-90","target":"228b-53"},{"source":"228b-90","target":"228b-82"},{"source":"228b-90","target":"228b-91"},{"source":"228b-90","target":"228b-92"},{"source":"228b-90","target":"228b-93"},{"source":"228b-90","target":"228b-63"},{"source":"228b-111","target":"228b-49"},{"source":"228b-62","target":"228b-40"},{"source":"228b-62","target":"228b-44"},{"source":"228b-62","target":"228b-45"},{"source":"228b-62","target":"228b-47"},{"source":"228b-62","target":"228b-64"},{"source":"228b-66","target":"228b-42"},{"source":"228b-67","target":"228b-49"},{"source":"228b-53","target":"228b-72"},{"source":"228b-93","target":"228b-49"}]};
  2864. document.addEventListener('DOMContentLoaded', () => {
  2865. const width = chartParameters.width || window.innerWidth;
  2866. const height = chartParameters.height || window.innerHeight;
  2867. const chartNode = document.querySelector("main");
  2868. drawChart(chartNode, data, width, height);
  2869. });
  2870. </script>
  2871. </body>
  2872. </html>