-
Notifications
You must be signed in to change notification settings - Fork 34
/
d3-temp-rh-sensor-tsv-series-chart.html
635 lines (525 loc) · 160 KB
/
d3-temp-rh-sensor-tsv-series-chart.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>t/rh time-series tsv chart</title>
<style>
body {
margin: 0 auto;
padding: 1em;
max-width: 1000px;
}
.src-zone {
border: 2px dashed #586e75;
border-radius: 5px;
padding: 1em;
margin-top: 2em;
}
.src-zone label { text-decoration: underline; cursor: pointer; }
.src-zone label input { position: fixed; top: -1000px; }
.src-zone output dt { float: left; clear: left; }
.src-zone output dd { float: left; margin-left: 1em; }
.vis-box ul { padding: 1em 3em; }
.vis-box svg { font: 10px sans-serif; }
.vis-box svg line { shape-rendering: crispEdges; }
.vis-box svg .hover line { stroke: #000; }
.vis-box svg .axis text { fill: #528474; }
.vis-box svg .axis line, svg .axis path { stroke: #528474; }
.vis-box svg .grid line { stroke: #a8bfab; }
.vis-box svg .grid .domain { stroke: none; }
.vis-box svg .brush .selection { stroke: #528474; }
/* Brightness and Gamma Switch
by Joseph Shenton @TeamiHackify -- https://codepen.io/TeamiHackify/pen/YqVoJB */
body { background: #f8fdff; color: #000; transition: background-color 150ms ease-out !important; }
body.bg-night { background: #002a36; color: #65b46f; }
body.bg-night svg { fill: #2e4b39; }
body.bg-night svg .hover line { stroke: #65b46f; }
body.bg-night svg .hover text { fill: #65b46f; }
body.bg-night svg .grid line { stroke: #304a43; }
body.bg-night svg .brush .selection { stroke: #65b46f; }
.btn-light {
cursor: default;
position: fixed;
top: 20px;
right: 2px;
z-index: 10;
font-size: 15px;
}
.btn-light .icon.day {
position: relative;
width: 26px;
height: 26px;
top: -3px;
margin: 0 7px;
fill: #9caec0;
}
.btn-light .icon.night {
position: relative;
width: 26px;
height: 26px;
top: -3px;
margin: 0 7px;
fill: #9caec0;
}
.btn-light .icon { cursor: pointer; }
.btn-light .toggle { display: none; }
.btn-light .toggle, .btn-light .toggle:after, .btn-light .toggle:before, .btn-light .toggle *, .btn-light .toggle *:after,
.btn-light .toggle *:before, .btn-light .toggle + .toggle-button { box-sizing: border-box; }
.btn-light .toggle + .toggle-button {
outline: 0;
display: inline-block;
width: 4em;
height: 2em;
position: relative;
cursor: pointer;
border: 2px solid #333;
}
.btn-light .toggle + .toggle-button:after,
.btn-light .toggle + .toggle-button:before {
position: relative;
display: block;
content: "";
width: 50%;
height: 100%;
}
.btn-light .toggle + .toggle-button:after { left: 0; }
.btn-light .toggle + .toggle-button:before { display: none; }
.btn-light .toggle:checked + .toggle-button:after { left: 50%; }
.btn-light .toggle:checked + .toggle-button:after { left: 50%; }
.btn-light .toggle + .toggle-button {
padding: 2px;
transition: all .2s ease;
border: 2px solid rgba(156, 174, 192, 0.27);
border-radius: 2em;
}
.btn-light .toggle + .toggle-button:after {
transition: all .2s ease;
background: rgba(156, 174, 192, 0.27);
content: "";
border-radius: 1em;
}
</style>
</head>
<body>
<!-- Brightness and Gamma Switch
by Joseph Shenton @TeamiHackify -- https://codepen.io/TeamiHackify/pen/YqVoJB -->
<div class=btn-light>
<label for=btn-light-cb>
<svg class='icon night' viewBox='0 0 100 100'>
<path d='M96.76,66.458c-0.853-0.852-2.15-1.064-3.23-0.534c-6.063,2.991-12.858,4.571-19.655,4.571 C62.022,70.495,50.88,65.88,42.5,57.5C29.043,44.043,25.658,23.536,34.076,6.47c0.532-1.08,0.318-2.379-0.534-3.23 c-0.851-0.852-2.15-1.064-3.23-0.534c-4.918,2.427-9.375,5.619-13.246,9.491c-9.447,9.447-14.65,22.008-14.65,35.369 c0,13.36,5.203,25.921,14.65,35.368s22.008,14.65,35.368,14.65c13.361,0,25.921-5.203,35.369-14.65 c3.872-3.871,7.064-8.328,9.491-13.246C97.826,68.608,97.611,67.309,96.76,66.458z'>
</svg>
</label>
<input class=toggle id=btn-light-cb type=checkbox>
<label class=toggle-button for=btn-light-cb></label>
<label for=btn-light-cb>
<svg class='icon day' viewBox='0 0 35 35'>
<path style='fill-rule:evenodd;clip-rule:evenodd;' d='M6,17.5C6,16.672,5.328,16,4.5,16h-3C0.672,16,0,16.672,0,17.5 S0.672,19,1.5,19h3C5.328,19,6,18.328,6,17.5z M7.5,26c-0.414,0-0.789,0.168-1.061,0.439l-2,2C4.168,28.711,4,29.086,4,29.5 C4,30.328,4.671,31,5.5,31c0.414,0,0.789-0.168,1.06-0.44l2-2C8.832,28.289,9,27.914,9,27.5C9,26.672,8.329,26,7.5,26z M17.5,6 C18.329,6,19,5.328,19,4.5v-3C19,0.672,18.329,0,17.5,0S16,0.672,16,1.5v3C16,5.328,16.671,6,17.5,6z M27.5,9 c0.414,0,0.789-0.168,1.06-0.439l2-2C30.832,6.289,31,5.914,31,5.5C31,4.672,30.329,4,29.5,4c-0.414,0-0.789,0.168-1.061,0.44 l-2,2C26.168,6.711,26,7.086,26,7.5C26,8.328,26.671,9,27.5,9z M6.439,8.561C6.711,8.832,7.086,9,7.5,9C8.328,9,9,8.328,9,7.5 c0-0.414-0.168-0.789-0.439-1.061l-2-2C6.289,4.168,5.914,4,5.5,4C4.672,4,4,4.672,4,5.5c0,0.414,0.168,0.789,0.439,1.06 L6.439,8.561z M33.5,16h-3c-0.828,0-1.5,0.672-1.5,1.5s0.672,1.5,1.5,1.5h3c0.828,0,1.5-0.672,1.5-1.5S34.328,16,33.5,16z M28.561,26.439C28.289,26.168,27.914,26,27.5,26c-0.828,0-1.5,0.672-1.5,1.5c0,0.414,0.168,0.789,0.439,1.06l2,2 C28.711,30.832,29.086,31,29.5,31c0.828,0,1.5-0.672,1.5-1.5c0-0.414-0.168-0.789-0.439-1.061L28.561,26.439z M17.5,29 c-0.829,0-1.5,0.672-1.5,1.5v3c0,0.828,0.671,1.5,1.5,1.5s1.5-0.672,1.5-1.5v-3C19,29.672,18.329,29,17.5,29z M17.5,7 C11.71,7,7,11.71,7,17.5S11.71,28,17.5,28S28,23.29,28,17.5S23.29,7,17.5,7z M17.5,25c-4.136,0-7.5-3.364-7.5-7.5 c0-4.136,3.364-7.5,7.5-7.5c4.136,0,7.5,3.364,7.5,7.5C25,21.636,21.636,25,17.5,25z'>
</svg>
</label>
</div>
<div id=vis class=vis-box style='height:0'>
<svg class=chart></svg>
<ul id=stats></ul>
<svg height=0 class=hist>
<g class=t></g><g class=rh></g>
</svg>
</div>
<fieldset id=src-zone class=src-zone>
<p><span>Drop files here or</span>
<label>
<input type=file id=src name=src[] multiple />
<span>browse/pick them</span>
</label>
</p>
<output id=src-list></output>
</fieldset>
<script>
'use strict'
//// ServiceWorker API refuses to load data: urls as "insecure"... oh well
// if ('serviceWorker' in navigator) {
// let sw = document.getElementById('sw-js').dataset.script
// navigator.serviceWorker.register(sw, {scope: '/sw-test/'})
// .then(reg => {
// if (reg.installing) console.log('ServiceWorker: installing...')
// else if (reg.waiting) console.log('ServiceWorker: installed')
// else if (reg.active) console.log('ServiceWorker: active') })
// .catch(err => console.log(`ServiceWorker registration failed: ${err}`))
// }
window.onload = () => {
if (!window.d3) {
document.getElementById('src-zone').style.display = 'none'
return alert('d3.js failed to init or load, nothing will work') }
let html_enc = str => String(str)
.replace(/&/g, '&')
.replace( /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
c => '&#' +
(((c.charCodeAt(0) - 0xd800) * 0x400) +
(c.charCodeAt(1) - 0xdc00) + 0x10000) + ';' )
.replace(/([^!-~])/g, c => `&#${c.charCodeAt(0)};`)
.replace(/</g, '<').replace(/>/g, '>').replace(/\//g, '/')
.replace(/"/g, '"').replace(/'/g, ''')
let repr_num = (bytes, opts) => {
opts = Object.assign({base: 1024, dec: 0, b: 'B', bs: 'iB', sep: ' '}, opts || {})
let {base, dec, b, bs, sep} = opts
dec += 1
if (bytes === 0) return `0${b?' '+b:''}`
let sizes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'],
n = Math.floor(Math.log(bytes) / Math.log(base))
return (
parseFloat((bytes / Math.pow(base, n)).toFixed(dec))
+ `${sep}${sizes[n]}${sizes[n]?bs:b}` )
}
let repr_num_raw = n => repr_num(n, {b:'', bs:'', sep: ''})
// ---------- Chart
// Chart elements: [svg -> [focus, gap, context], stats]
// Histogram elements: svg -> [g.t, gap, g.rh]
let pos = {
left: 40, right: 40, top: 10, bottom: 20, gap: 20,
w_svg: document.getElementById('vis').offsetWidth,
h_focus: 400, h_context: 100, h_hist: 200,
ax_label_top: 20, ax_label_horiz: -5 }
pos.w = pos.w_svg - pos.left - pos.right
pos.w_hist = (pos.w - pos.gap) / 2
pos.h = pos.h_focus + pos.h_context + pos.gap
pos.h_svg = pos.h + pos.top + pos.bottom
pos.h_hist_svg = pos.h_hist + pos.top + pos.bottom
pos.top_context = pos.top + pos.h_focus + pos.gap
let opts = {
title_base: document.title,
y_margin_t: 3, y_margin_rh: 5,
x_time_gap_s: 4*60*60, x_tick_count: 16,
grid_ticks_x: 8, grid_ticks_yrh: 4,
hist_margin_t: 0.5, hist_margin_rh: 5, hist_delay: 300,
num_fmt: repr_num, num_fmt_raw: repr_num_raw,
ts_fmt: d3.timeFormat('%Y-%m-%dT%H:%M:%S%Z'),
ts_suffix: d3.timeFormat('%Z')(new Date()) }
let scale = {
focus: {
x: d3.scaleTime().range([0, pos.w]),
yt: d3.scaleLinear().range([pos.h_focus, 0]),
yrh: d3.scaleLinear().range([pos.h_focus, 0]) },
context: {
x: d3.scaleTime().range([0, pos.w]),
yt: d3.scaleLinear().range([pos.h_context, 0]),
yrh: d3.scaleLinear().range([pos.h_context, 0]) },
color: d3.scaleOrdinal(d3.schemeDark2) }
let axis = {
focus: {
x: d3.axisBottom(scale.focus.x).ticks(opts.x_tick_count),
yt: d3.axisLeft(scale.focus.yt),
yrh: d3.axisRight(scale.focus.yrh),
grid_x:
d3.axisBottom(scale.focus.x)
.ticks(opts.grid_ticks_x).tickSize(pos.h_focus, 0).tickFormat(''),
grid_yrh:
d3.axisLeft(scale.focus.yrh)
.ticks(opts.grid_ticks_yrh).tickSize(-pos.w, 0).tickFormat('') },
context: {x: d3.axisBottom(scale.context.x)} }
let color = {t: scale.color(0), rh: scale.color(1)}
let line_for = (k, x, y) => d3.line()
.defined(d => d[k] !== undefined)
.x(d => x(d.ts)).y(d => y(d[k]))
.curve(d3.curveMonotoneX)
let line = {
focus: {
t: line_for('t', scale.focus.x, scale.focus.yt),
rh: line_for('rh', scale.focus.x, scale.focus.yrh)},
context: {
t: line_for('t', scale.context.x, scale.context.yt),
rh: line_for('rh', scale.context.x, scale.context.yrh)} }
let chart // cache for major chart parts, re-used only on new data uploads
let chart_init = ds => {
if (chart) {
chart[0].datum(ds)
return chart }
let vis = d3.select('#vis').style('height', 'auto').datum(ds),
svg = vis.select('svg.chart').attr('width', pos.w_svg).attr('height', pos.h_svg)
let focus = svg.append('g')
.attr('class', 'focus')
.attr('transform', `translate(${pos.left},${pos.top})`)
.call( s => s.append('g')
.attr('class', 'x axis')
.attr('transform', `translate(0,${pos.h_focus})`) )
.call( s => s.append('g').attr('class', 'y axis t') )
.call( s => s.append('text')
.attr('transform',
`translate(${0 - pos.ax_label_horiz},${pos.h_focus + pos.ax_label_top})` )
.attr('text-anchor', 'end')
.style('fill', color.t).text('▣ t,°C') )
.call( s => s.append('g')
.attr('class', 'y axis rh')
.attr('transform', `translate(${pos.w},0)`) )
.call( s => s.append('text')
.attr('transform',
`translate(${pos.w + pos.ax_label_horiz},${pos.h_focus + pos.ax_label_top})` )
.attr('text-anchor', 'start')
.style('fill', color.rh).text('%RH ▣') )
.call(s => s.append('g').attr('class', 'x grid'))
.call(s => s.append('g').attr('class', 'y grid rh'))
HoverInfoOverlay: {
let hover_box = focus.append('g').attr('class', 'hover').attr('opacity', 0),
hover_line = hover_box.append('line')
.attr('x1', 0).attr('y1', 0)
.attr('x2', 0).attr('y2', pos.h_focus)
.style('fill', 'none'),
hover_text = hover_box.append('text')
let hover_func = () => {
let [x, y] = d3.mouse(focus.node()), ds = vis.datum()
let ts = scale.focus.x.invert(x),
idx = d3.bisector(d => d.ts).left(ds, ts),
d0 = ds[idx-1], d1 = ds[idx],
d = (!d0 || ts - d0.ts > d1.ts - ts) ? d1 : d0,
dx = scale.focus.x(d.ts),
side = dx < pos.w / 2 ? 1 : -1, // 1=right, -1=left
lines = [`${opts.ts_fmt(d.ts)}`, `${d.t} °C, ${d.rh} %RH`]
lines = hover_text.selectAll('tspan').data(lines)
lines
.join(enter => enter.append('tspan').attr('dy', '1.2em'))
.attr('x', side * 5).text(d => d)
hover_box.attr('opacity', 1)
hover_text
.attr('transform', `translate(${dx},0)`)
.attr('text-anchor', side > 0 ? 'start' : 'end')
hover_line.attr('x1', dx).attr('x2', dx) }
focus.append('rect')
.attr('class', 'overlay')
.attr('width', pos.w)
.attr('height', pos.h_focus)
.attr('fill', 'transparent')
.on('mousemove', hover_func).on('mouseover', hover_func) }
let context, brush
ZoomedOutContextBar: {
context = svg.append('g')
.attr('class', 'context')
.attr('transform', `translate(${pos.left},${pos.top_context})`)
context.append('g')
.attr('class', 'x axis')
.attr('transform', `translate(0,${pos.h_context})`)
.call(axis.context.x)
brush = d3.brushX(scale.context.x)
.extent([[0,0], [pos.w, pos.h_context]])
.on( 'brush', () => {
scale.focus.x.domain( d3.event.selection ?
d3.event.selection.map(scale.context.x.invert) :
scale.context.x.domain() )
focus.select('.hover').attr('opacity', 0)
focus.select('.line.t').attr('d', line.focus.t)
focus.select('.line.rh').attr('d', line.focus.rh)
focus.select('.x.axis').call(axis.focus.x)
focus.select('.x.grid').call(axis.focus.grid_x)
stats_update() }) }
let stats_update
StatsAndHistogram: {
let stats_histogram = (hist, hist_data, ext, color) => {
hist.selectAll('*').remove()
let w = hist.attr('width'), h = hist.attr('height')
let count_fmt = d3.format(",.0f")
let x = d3.scaleLinear()
.rangeRound([0, w - 1])
.domain(ext)
let bins = d3.histogram()
.domain(x.domain())
.thresholds(x.ticks(10))(hist_data)
let y = d3.scaleLinear()
.range([h, 0])
.domain([0, d3.max(bins, d => d.length)])
hist.append('g')
.attr('class', 'axis x')
.attr('transform', `translate(0, ${h})`)
.call(d3.axisBottom(x))
bins.forEach(d => {
if (!x(d.x0)) return
let bar = hist.append('g')
.attr('class', 'bar')
.attr('transform', `translate(${x(d.x0)}, ${y(d.length)})`)
bar.append('rect')
.attr('x', 1)
.attr('width', x(d.x1) - x(d.x0) - 1)
.attr('height', h - y(d.length))
.style('fill', color || '#ddd')
bar.append('text')
.attr('dy', '.75em')
.attr('y', 6)
.attr('x', (x(d.x1) - x(d.x0)) / 2)
.attr('text-anchor', 'middle')
.text(d.length > 0 ? count_fmt(d.length) : '') }) }
stats_update = () => {
let stats_box = vis.select('#stats'),
ds = vis.datum(),
[ts0, ts1] = scale.focus.x.domain(),
idx0 = d3.bisector(d => d.ts).left(ds, ts0),
idx1 = d3.bisector(d => d.ts).right(ds, ts1, idx0),
dss = ds.slice(idx0, idx1),
stats = [], ext, hist_data, hist_func
ext = d3.extent(dss, d => d.ts)
ts0 = ext[0], ts1 = ext[1]
stats.push(`measurements: ${opts.num_fmt_raw(dss.length)}`)
stats.push(`timespan: ${opts.ts_fmt(ts0)} - ${opts.ts_fmt(ts1)}`)
ext = d3.extent(dss, d => d.t)
stats.push(`t <sub>min/max</sub> = ${html_enc(ext[0])} / ${html_enc(ext[1])} °C`)
ext = d3.extent(dss, d => d.rh)
stats.push(`rh <sub>min/max</sub> = ${html_enc(ext[0])} / ${html_enc(ext[1])} %RH`)
stats = stats_box.selectAll('li').data(stats)
stats.enter().append('li').merge(stats).html(d => d)
let hist = vis.select('svg.hist')
.attr('width', pos.w_svg).attr('height', pos.h_hist_svg)
let [timer_t, timer_rh] = hist.datum() || [null, null]
if (timer_t) clearTimeout(timer_t)
hist_data = dss.map(d => d.t)
ext = d3.extent(hist_data)
ext = [ext[0] - opts.hist_margin_t, ext[1] + opts.hist_margin_t]
hist_func = (...args) => hist.select('.t')
.attr('width', pos.w_hist).attr('height', pos.h_hist)
.attr('transform', `translate(${pos.left}, ${pos.top})`)
.call(stats_histogram, ...args)
timer_t = setTimeout(hist_func, opts.hist_delay, hist_data, ext, color.t)
if (timer_rh) clearTimeout(timer_rh)
hist_data = dss.map(d => d.rh)
ext = d3.extent(hist_data)
ext = [ext[0] - opts.hist_margin_rh, ext[1] + opts.hist_margin_rh]
hist_func = (...args) => hist.select('.rh')
.attr('width', pos.w_hist).attr('height', pos.h_hist)
.attr('transform', `translate(${pos.left + pos.w_hist + pos.gap}, ${pos.top})`)
.call(stats_histogram, ...args)
timer_rh = setTimeout(hist_func, opts.hist_delay, hist_data, ext, color.rh)
hist.datum([timer_t, timer_rh]) }
} // StatsAndHistogram
chart = [vis, focus, context, brush, stats_update]
return chart
} // chart_init
let chart_rebuild_with_uploaded_data = (ds) => {
let ts0 = new Date().getTime()
let [vis, focus, context, brush, stats_update] = chart_init(ds)
let y_ext
y_ext = d3.extent(ds, d => d.t)
scale.focus.yt.domain([y_ext[0] - opts.y_margin_t, y_ext[1] + opts.y_margin_t])
scale.context.yt.domain(scale.focus.yt.domain())
y_ext = d3.extent(ds, d => d.rh)
scale.focus.yrh.domain([y_ext[0] - opts.y_margin_rh, y_ext[1] + opts.y_margin_rh])
scale.context.yrh.domain(scale.focus.yrh.domain())
scale.focus.x.domain(d3.extent(ds, d => d.ts))
scale.context.x.domain(scale.focus.x.domain())
focus.selectAll('.line').remove()
focus.append('path')
.datum(ds)
.attr('class', 'line t')
.attr('d', line.focus.t)
.style('fill', 'none')
.style('stroke', color.t)
focus.append('path')
.datum(ds)
.attr('class', 'line rh')
.attr('d', line.focus.rh)
.style('fill', 'none')
.style('stroke', color.rh)
focus.select('.x.axis').call(axis.focus.x)
focus.select('.y.axis.t').call(axis.focus.yt)
focus.select('.y.axis.rh').call(axis.focus.yrh)
focus.select('.x.grid').call(axis.focus.grid_x)
focus.select('.y.grid.rh').call(axis.focus.grid_yrh)
focus.select('.hover').attr('opacity', 1)
context.selectAll('.line').remove()
context.append('path')
.datum(ds)
.attr('class', 'line t')
.attr('d', line.context.t)
.style('fill', 'none')
.style('stroke', color.t)
context.append('path')
.datum(ds)
.attr('class', 'line rh')
.attr('d', line.context.rh)
.style('fill', 'none')
.style('stroke', color.rh)
context.select('.x.axis').call(axis.context.x)
context.select('.brush').remove()
context.append('g')
.attr('class', 'x brush')
.call(brush)
context.on('click', ev => context.select('.brush').call(brush.move, null))
stats_update()
let ts1 = new Date().getTime()
console.log(`Updated chart data (${opts.num_fmt_raw(ts1 - ts0)} ms)`)
} // chart_rebuild_with_uploaded_data
FileUploadHandling: {
UseTestDataFromGlobalVar: {
if (!window.test_chart_data) break UseTestDataFromGlobalVar
let rows = 0, data = new Map()
d3.tsvParseRows(test_chart_data, d => {
let [ts, t, rh] = d.map(v => v.replace(/\0/g, ''))
if (!ts.match(/([-+]\d{2}:\d{2}|Z)$/)) ts += opts.ts_suffix
let row = {ts: d3.isoParse(ts), t: Number.parseFloat(t), rh: Number.parseFloat(rh)}
rows += 1
data.set(row.ts.getTime(), row) })
let ds = Array.from(data.keys()).sort().map(ts => data.get(ts) || {ts: new Date(ts)})
chart_rebuild_with_uploaded_data(ds)
let [ts0, ts1] = d3.extent(ds, d => d.ts)
document.title = `${opts.title_base} [${opts.ts_fmt(ts0)} - ${opts.ts_fmt(ts1)}]`
break FileUploadHandling }
if (!(window.File && window.FileReader && window.FileList && window.Blob))
alert('Browser lacks File APIs support, nothing will work x_x')
let handle_uploads = () => {
let status, output = document.getElementById('src-list')
output.innerHTML = '<p>Status: processing files...</p><dl></dl>'
status = output.firstChild, output = output.lastChild
let data = new Map() // key=ts, val={ts: Date(ts), t: ..., rh: ...}
let uploads = Array.from(d3.event.target.files).map(file => {
output.insertAdjacentHTML( 'beforeend',
`<dt><strong>${html_enc(file.name)}</strong>`+
` (${file.type || 'n/a'}) - ${opts.num_fmt(file.size)},`+
` ${file.lastModifiedDate ? opts.ts_fmt(file.lastModifiedDate) : 'n/a'} ...</dt>` )
output.insertAdjacentHTML('beforeend', '<dd></dd>')
let output_status = output.lastChild
return new Promise((resolve, reject) => {
let reader = new FileReader()
reader.onload = ev => {
let res = 'error', rows = 0
if (file.size === 0) res = 'empty file'
else d3.tsvParseRows(ev.target.result, d => {
try {
let [ts, t, rh] = d.map(v => v.replace(/\0/g, ''))
if (!ts.match(/([-+]\d{2}:\d{2}|Z)$/)) ts += opts.ts_suffix
let row = {ts: d3.isoParse(ts), t: Number.parseFloat(t), rh: Number.parseFloat(rh)}
rows += 1
data.set(row.ts.getTime(), row) }
catch (err) { console.log(`Failed to parse tsv row from d3: ${d} - ${err}`) } })
if (rows > 0) res = `done (${opts.num_fmt_raw(rows)} rows)`
output_status.innerHTML = html_enc(res)
resolve() }
reader.readAsText(file) }) })
Promise.all(uploads).then(results => {
status.innerHTML = 'Status: processing data...'
let ds = Array.from(data.keys())
ConvertDataToArrayWithNullGaps: {
let d0, d_gap
ds.sort().forEach(d => {
if (d0 && (d - d0) / 1000 > opts.x_time_gap_s) {
d_gap = Number.parseInt((d + d0) / 2)
if (!data.get(d_gap)) ds.push(d_gap) }
d0 = d })
ds.sort()
ds = ds.map(ts => data.get(ts) || {ts: new Date(ts)}) }
status.innerHTML = 'Status: done!'
chart_rebuild_with_uploaded_data(ds)
let [ts0, ts1] = d3.extent(ds, d => d.ts)
document.title = `${opts.title_base} [${opts.ts_fmt(ts0)} - ${opts.ts_fmt(ts1)}]` }) }
d3.select('#src').on('change', handle_uploads)
d3.select('#src-zone').on('drop', handle_uploads).on('dragover', d => { d3.event.dataTransfer.dropEffect = 'copy' })
} // FileUploadHandling
} // window.onload
FancyDayNightButton: {
// by Joseph Shenton @TeamiHackify -- https://codepen.io/TeamiHackify/pen/YqVoJB
let night_mode, daytime = new Date()
daytime = daytime.getHours() + daytime.getMinutes() / 60.0
night_mode = daytime > 20 || daytime < 8
let btn = document.getElementById('btn-light-cb')
btn.addEventListener('click', ev => document.body.classList.toggle('bg-night'))
if (night_mode) document.body.classList.add('bg-night')
btn.checked = !night_mode
}
</script>
<script>
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function n(t){var n;return 1===t.length&&(n=t,t=function(t,r){return e(n(t),r)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}var r=n(e),i=r.right,a=r.left;function f(t,e){return[t,e]}function c(t){return null===t?NaN:+t}function o(t,e){var n,r,i=t.length,a=0,f=-1,o=0,u=0;if(null==e)for(;++f<i;)isNaN(n=c(t[f]))||(u+=(r=n-o)*(n-(o+=r/++a)));else for(;++f<i;)isNaN(n=c(e(t[f],f,t)))||(u+=(r=n-o)*(n-(o+=r/++a)));if(a>1)return u/(a-1)}function u(t,e){var n=o(t,e);return n?Math.sqrt(n):n}function s(t,e){var n,r,i,a=t.length,f=-1;if(null==e){for(;++f<a;)if(null!=(n=t[f])&&n>=n)for(r=i=n;++f<a;)null!=(n=t[f])&&(r>n&&(r=n),i<n&&(i=n))}else for(;++f<a;)if(null!=(n=e(t[f],f,t))&&n>=n)for(r=i=n;++f<a;)null!=(n=e(t[f],f,t))&&(r>n&&(r=n),i<n&&(i=n));return[r,i]}var l=Array.prototype,h=l.slice,d=l.map;function b(t){return function(){return t}}function p(t){return t}function _(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var y=Math.sqrt(50),g=Math.sqrt(10),v=Math.sqrt(2);function m(t,e,n){var r,i,a,f,c=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(f=x(t,e,n))||!isFinite(f))return[];if(f>0)for(t=Math.ceil(t/f),e=Math.floor(e/f),a=new Array(i=Math.ceil(e-t+1));++c<i;)a[c]=(t+c)*f;else for(t=Math.floor(t*f),e=Math.ceil(e*f),a=new Array(i=Math.ceil(t-e+1));++c<i;)a[c]=(t-c)/f;return r&&a.reverse(),a}function x(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=y?10:a>=g?5:a>=v?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=g?5:a>=v?2:1)}function w(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=y?i*=10:a>=g?i*=5:a>=v&&(i*=2),e<t?-i:i}function M(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function T(t,e,n){if(null==n&&(n=c),r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),f=+n(t[a],a,t);return f+(+n(t[a+1],a+1,t)-f)*(i-a)}}function k(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(n=t[a])&&n>=n)for(r=n;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else for(;++a<i;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=n;++a<i;)null!=(n=e(t[a],a,t))&&r>n&&(r=n);return r}function A(t){if(!(i=t.length))return[];for(var e=-1,n=k(t,N),r=new Array(n);++e<n;)for(var i,a=-1,f=r[e]=new Array(i);++a<i;)f[a]=t[a][e];return r}function N(t){return t.length}var S=Array.prototype.slice;function C(t){return t}var E=1,P=2,D=3,U=4,F=1e-6;function Y(t){return"translate("+(t+.5)+",0)"}function R(t){return"translate(0,"+(t+.5)+")"}function O(){return!this.__axis}function q(t,e){var n=[],r=null,i=null,a=6,f=6,c=3,o=t===E||t===U?-1:1,u=t===U||t===P?"x":"y",s=t===E||t===D?Y:R;function l(l){var h=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,d=null==i?e.tickFormat?e.tickFormat.apply(e,n):C:i,b=Math.max(a,0)+c,p=e.range(),_=+p[0]+.5,y=+p[p.length-1]+.5,g=(e.bandwidth?function(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(n){return+t(n)+e}}:function(t){return function(e){return+t(e)}})(e.copy()),v=l.selection?l.selection():l,m=v.selectAll(".domain").data([null]),x=v.selectAll(".tick").data(h,e).order(),w=x.exit(),M=x.enter().append("g").attr("class","tick"),T=x.select("line"),k=x.select("text");m=m.merge(m.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(M),T=T.merge(M.append("line").attr("stroke","currentColor").attr(u+"2",o*a)),k=k.merge(M.append("text").attr("fill","currentColor").attr(u,o*b).attr("dy",t===E?"0em":t===D?"0.71em":"0.32em")),l!==v&&(m=m.transition(l),x=x.transition(l),T=T.transition(l),k=k.transition(l),w=w.transition(l).attr("opacity",F).attr("transform",function(t){return isFinite(t=g(t))?s(t):this.getAttribute("transform")}),M.attr("opacity",F).attr("transform",function(t){var e=this.parentNode.__axis;return s(e&&isFinite(e=e(t))?e:g(t))})),w.remove(),m.attr("d",t===U||t==P?f?"M"+o*f+","+_+"H0.5V"+y+"H"+o*f:"M0.5,"+_+"V"+y:f?"M"+_+","+o*f+"V0.5H"+y+"V"+o*f:"M"+_+",0.5H"+y),x.attr("opacity",1).attr("transform",function(t){return s(g(t))}),T.attr(u+"2",o*a),k.attr(u,o*b).text(d),v.filter(O).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===P?"start":t===U?"end":"middle"),v.each(function(){this.__axis=g})}return l.scale=function(t){return arguments.length?(e=t,l):e},l.ticks=function(){return n=S.call(arguments),l},l.tickArguments=function(t){return arguments.length?(n=null==t?[]:S.call(t),l):n.slice()},l.tickValues=function(t){return arguments.length?(r=null==t?null:S.call(t),l):r&&r.slice()},l.tickFormat=function(t){return arguments.length?(i=t,l):i},l.tickSize=function(t){return arguments.length?(a=f=+t,l):a},l.tickSizeInner=function(t){return arguments.length?(a=+t,l):a},l.tickSizeOuter=function(t){return arguments.length?(f=+t,l):f},l.tickPadding=function(t){return arguments.length?(c=+t,l):c},l}var L={value:function(){}};function z(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new B(r)}function B(t){this._=t}function I(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function H(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=L,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}B.prototype=z.prototype={constructor:B,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),f=-1,c=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++f<c;)if(n=(t=a[f]).type)i[n]=H(i[n],t.name,e);else if(null==e)for(n in i)i[n]=H(i[n],t.name,null);return this}for(;++f<c;)if((n=(t=a[f]).type)&&(n=I(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new B(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var j="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:j,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function V(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),X.hasOwnProperty(e)?{space:X[e],local:t}:t}function G(t){var e=V(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===j&&e.documentElement.namespaceURI===j?e.createElement(t):e.createElementNS(n,t)}})(e)}function $(){}function Z(t){return null==t?$:function(){return this.querySelector(t)}}function W(){return[]}function Q(t){return null==t?W:function(){return this.querySelectorAll(t)}}function J(t){return function(){return this.matches(t)}}function K(t){return new Array(t.length)}function tt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}tt.prototype={constructor:tt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var et="$";function nt(t,e,n,r,i,a){for(var f,c=0,o=e.length,u=a.length;c<u;++c)(f=e[c])?(f.__data__=a[c],r[c]=f):n[c]=new tt(t,a[c]);for(;c<o;++c)(f=e[c])&&(i[c]=f)}function rt(t,e,n,r,i,a,f){var c,o,u,s={},l=e.length,h=a.length,d=new Array(l);for(c=0;c<l;++c)(o=e[c])&&(d[c]=u=et+f.call(o,o.__data__,c,e),u in s?i[c]=o:s[u]=o);for(c=0;c<h;++c)(o=s[u=et+f.call(t,a[c],c,a)])?(r[c]=o,o.__data__=a[c],s[u]=null):n[c]=new tt(t,a[c]);for(c=0;c<l;++c)(o=e[c])&&s[d[c]]===o&&(i[c]=o)}function it(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function at(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ft(t,e){return t.style.getPropertyValue(e)||at(t).getComputedStyle(t,null).getPropertyValue(e)}function ct(t){return t.trim().split(/^|\s+/)}function ot(t){return t.classList||new ut(t)}function ut(t){this._node=t,this._names=ct(t.getAttribute("class")||"")}function st(t,e){for(var n=ot(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function lt(t,e){for(var n=ot(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ht(){this.textContent=""}function dt(){this.innerHTML=""}function bt(){this.nextSibling&&this.parentNode.appendChild(this)}function pt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _t(){return null}function yt(){var t=this.parentNode;t&&t.removeChild(this)}function gt(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function vt(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}ut.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var mt={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(mt={mouseenter:"mouseover",mouseleave:"mouseout"}));function xt(t,e,n){return t=wt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function wt(e,n,r){return function(i){var a=t.event;t.event=i;try{e.call(this,this.__data__,n,r)}finally{t.event=a}}}function Mt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function Tt(t,e,n){var r=mt.hasOwnProperty(t.type)?xt:wt;return function(i,a,f){var c,o=this.__on,u=r(e,a,f);if(o)for(var s=0,l=o.length;s<l;++s)if((c=o[s]).type===t.type&&c.name===t.name)return this.removeEventListener(c.type,c.listener,c.capture),this.addEventListener(c.type,c.listener=u,c.capture=n),void(c.value=e);this.addEventListener(t.type,u,n),c={type:t.type,name:t.name,value:e,listener:u,capture:n},o?o.push(c):this.__on=[c]}}function kt(e,n,r,i){var a=t.event;e.sourceEvent=t.event,t.event=e;try{return n.apply(r,i)}finally{t.event=a}}function At(t,e,n){var r=at(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}var Nt=[null];function St(t,e){this._groups=t,this._parents=e}function Ct(){return new St([[document.documentElement]],Nt)}function Et(t){return"string"==typeof t?new St([[document.querySelector(t)]],[document.documentElement]):new St([[t]],Nt)}St.prototype=Ct.prototype={constructor:St,select:function(t){"function"!=typeof t&&(t=Z(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,f,c=e[i],o=c.length,u=r[i]=new Array(o),s=0;s<o;++s)(a=c[s])&&(f=t.call(a,a.__data__,s,c))&&("__data__"in a&&(f.__data__=a.__data__),u[s]=f);return new St(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=Q(t));for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var f,c=e[a],o=c.length,u=0;u<o;++u)(f=c[u])&&(r.push(t.call(f,f.__data__,u,c)),i.push(f));return new St(r,i)},filter:function(t){"function"!=typeof t&&(t=J(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,f=e[i],c=f.length,o=r[i]=[],u=0;u<c;++u)(a=f[u])&&t.call(a,a.__data__,u,f)&&o.push(a);return new St(r,this._parents)},data:function(t,e){if(!t)return b=new Array(this.size()),s=-1,this.each(function(t){b[++s]=t}),b;var n,r=e?rt:nt,i=this._parents,a=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var f=a.length,c=new Array(f),o=new Array(f),u=new Array(f),s=0;s<f;++s){var l=i[s],h=a[s],d=h.length,b=t.call(l,l&&l.__data__,s,i),p=b.length,_=o[s]=new Array(p),y=c[s]=new Array(p);r(l,h,_,y,u[s]=new Array(d),b,e);for(var g,v,m=0,x=0;m<p;++m)if(g=_[m]){for(m>=x&&(x=m+1);!(v=y[x])&&++x<p;);g._next=v||null}}return(c=new St(c,i))._enter=o,c._exit=u,c},enter:function(){return new St(this._enter||this._groups.map(K),this._parents)},exit:function(){return new St(this._exit||this._groups.map(K),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),f=new Array(r),c=0;c<a;++c)for(var o,u=e[c],s=n[c],l=u.length,h=f[c]=new Array(l),d=0;d<l;++d)(o=u[d]||s[d])&&(h[d]=o);for(;c<r;++c)f[c]=e[c];return new St(f,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,f=i[a];--a>=0;)(r=i[a])&&(f&&4^r.compareDocumentPosition(f)&&f.parentNode.insertBefore(r,f),f=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=it);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var f,c=n[a],o=c.length,u=i[a]=new Array(o),s=0;s<o;++s)(f=c[s])&&(u[s]=f);u.sort(e)}return new St(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var f=r[i];if(f)return f}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],f=0,c=a.length;f<c;++f)(i=a[f])&&t.call(i,i.__data__,f,a);return this},attr:function(t,e){var n=V(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):ft(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=ct(t+"");if(arguments.length<2){for(var r=ot(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?st:lt)(this,t)}}:e?function(t){return function(){st(this,t)}}:function(t){return function(){lt(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?ht:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?dt:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(bt)},lower:function(){return this.each(pt)},append:function(t){var e="function"==typeof t?t:G(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:G(t),r=null==e?_t:"function"==typeof e?e:Z(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(yt)},clone:function(t){return this.select(t?vt:gt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),f=a.length;if(!(arguments.length<2)){for(c=e?Tt:Mt,null==n&&(n=!1),r=0;r<f;++r)this.each(c(a[r],e,n));return this}var c=this.node().__on;if(c)for(var o,u=0,s=c.length;u<s;++u)for(r=0,o=c[u];r<f;++r)if((i=a[r]).type===o.type&&i.name===o.name)return o.value},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return At(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return At(this,t,e)}})(t,e))}};var Pt=0;function Dt(){return new Ut}function Ut(){this._="@"+(++Pt).toString(36)}function Ft(){for(var e,n=t.event;e=n.sourceEvent;)n=e;return n}function Yt(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}function Rt(t){var e=Ft();return e.changedTouches&&(e=e.changedTouches[0]),Yt(t,e)}function Ot(){t.event.preventDefault(),t.event.stopImmediatePropagation()}function qt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Lt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function zt(){}Ut.prototype=Dt.prototype={constructor:Ut,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Bt="\\s*([+-]?\\d+)\\s*",It="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jt=/^#([0-9a-f]{3})$/,Xt=/^#([0-9a-f]{6})$/,Vt=new RegExp("^rgb\\("+[Bt,Bt,Bt]+"\\)$"),Gt=new RegExp("^rgb\\("+[Ht,Ht,Ht]+"\\)$"),$t=new RegExp("^rgba\\("+[Bt,Bt,Bt,It]+"\\)$"),Zt=new RegExp("^rgba\\("+[Ht,Ht,Ht,It]+"\\)$"),Wt=new RegExp("^hsl\\("+[It,Ht,Ht]+"\\)$"),Qt=new RegExp("^hsla\\("+[It,Ht,Ht,It]+"\\)$"),Jt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Kt(t){var e;return t=(t+"").trim().toLowerCase(),(e=jt.exec(t))?new ie((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=Xt.exec(t))?te(parseInt(e[1],16)):(e=Vt.exec(t))?new ie(e[1],e[2],e[3],1):(e=Gt.exec(t))?new ie(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=$t.exec(t))?ee(e[1],e[2],e[3],e[4]):(e=Zt.exec(t))?ee(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Wt.exec(t))?fe(e[1],e[2]/100,e[3]/100,1):(e=Qt.exec(t))?fe(e[1],e[2]/100,e[3]/100,e[4]):Jt.hasOwnProperty(t)?te(Jt[t]):"transparent"===t?new ie(NaN,NaN,NaN,0):null}function te(t){return new ie(t>>16&255,t>>8&255,255&t,1)}function ee(t,e,n,r){return r<=0&&(t=e=n=NaN),new ie(t,e,n,r)}function ne(t){return t instanceof zt||(t=Kt(t)),t?new ie((t=t.rgb()).r,t.g,t.b,t.opacity):new ie}function re(t,e,n,r){return 1===arguments.length?ne(t):new ie(t,e,n,null==r?1:r)}function ie(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ae(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function fe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ce(t,e,n,r)}function ce(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function oe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}qt(zt,Kt,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),qt(ie,re,Lt(zt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ie(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ie(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+ae(this.r)+ae(this.g)+ae(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),qt(ce,function(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof ce)return new ce(t.h,t.s,t.l,t.opacity);if(t instanceof zt||(t=Kt(t)),!t)return new ce;if(t instanceof ce)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),f=NaN,c=a-i,o=(a+i)/2;return c?(f=e===a?(n-r)/c+6*(n<r):n===a?(r-e)/c+2:(e-n)/c+4,c/=o<.5?a+i:2-a-i,f*=60):c=o>0&&o<1?0:f,new ce(f,c,o,t.opacity)}(t):new ce(t,e,n,null==r?1:r)},Lt(zt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ce(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ce(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ie(oe(t>=240?t-240:t+120,i,r),oe(t,i,r),oe(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var ue=Math.PI/180,se=180/Math.PI,le=.96422,he=1,de=.82521,be=4/29,pe=6/29,_e=3*pe*pe,ye=pe*pe*pe;function ge(t){if(t instanceof ve)return new ve(t.l,t.a,t.b,t.opacity);if(t instanceof Te){if(isNaN(t.h))return new ve(t.l,0,0,t.opacity);var e=t.h*ue;return new ve(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof ie||(t=ne(t));var n,r,i=Me(t.r),a=Me(t.g),f=Me(t.b),c=me((.2225045*i+.7168786*a+.0606169*f)/he);return i===a&&a===f?n=r=c:(n=me((.4360747*i+.3850649*a+.1430804*f)/le),r=me((.0139322*i+.0971045*a+.7141733*f)/de)),new ve(116*c-16,500*(n-c),200*(c-r),t.opacity)}function ve(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function me(t){return t>ye?Math.pow(t,1/3):t/_e+be}function xe(t){return t>pe?t*t*t:_e*(t-be)}function we(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Te(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}qt(ve,function(t,e,n,r){return 1===arguments.length?ge(t):new ve(t,e,n,null==r?1:r)},Lt(zt,{brighter:function(t){return new ve(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new ve(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new ie(we(3.1338561*(e=le*xe(e))-1.6168667*(t=he*xe(t))-.4906146*(n=de*xe(n))),we(-.9787684*e+1.9161415*t+.033454*n),we(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),qt(Te,function(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Te)return new Te(t.h,t.c,t.l,t.opacity);if(t instanceof ve||(t=ge(t)),0===t.a&&0===t.b)return new Te(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*se;return new Te(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Te(t,e,n,null==r?1:r)},Lt(zt,{brighter:function(t){return new Te(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Te(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ge(this).rgb()}}));var ke=-.14861,Ae=1.78277,Ne=-.29227,Se=-.90649,Ce=1.97294,Ee=Ce*Se,Pe=Ce*Ae,De=Ae*Ne-Se*ke;function Ue(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Fe)return new Fe(t.h,t.s,t.l,t.opacity);t instanceof ie||(t=ne(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(De*r+Ee*e-Pe*n)/(De+Ee-Pe),a=r-i,f=(Ce*(n-i)-Ne*a)/Se,c=Math.sqrt(f*f+a*a)/(Ce*i*(1-i)),o=c?Math.atan2(f,a)*se-120:NaN;return new Fe(o<0?o+360:o,c,i,t.opacity)}(t):new Fe(t,e,n,null==r?1:r)}function Fe(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ye(t){return function(){return t}}function Re(t,e){return function(n){return t+n*e}}function Oe(t){return 1==(t=+t)?qe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ye(isNaN(e)?n:e)}}function qe(t,e){var n=e-t;return n?Re(t,n):Ye(isNaN(t)?e:t)}qt(Fe,Ue,Lt(zt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Fe(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Fe(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*ue,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new ie(255*(e+n*(ke*r+Ae*i)),255*(e+n*(Ne*r+Se*i)),255*(e+n*(Ce*r)),this.opacity)}}));var Le=function t(e){var n=Oe(e);function r(t,e){var r=n((t=re(t)).r,(e=re(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),f=qe(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=f(e),t+""}}return r.gamma=t,r}(1);var ze,Be=(ze=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],f=r>0?t[r-1]:2*i-a,c=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,f=a*t;return((1-3*t+3*a-f)*e+(4-6*a+3*f)*n+(1+3*t+3*a-3*f)*r+f*i)/6}((n-r/e)*e,f,i,a,c)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),f=new Array(r);for(e=0;e<r;++e)n=re(t[e]),i[e]=n.r||0,a[e]=n.g||0,f[e]=n.b||0;return i=ze(i),a=ze(a),f=ze(f),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=f(t),n+""}});function Ie(t,e){return e-=t=+t,function(n){return t+e*n}}var He=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,je=new RegExp(He.source,"g");function Xe(t,e){var n,r,i,a=He.lastIndex=je.lastIndex=0,f=-1,c=[],o=[];for(t+="",e+="";(n=He.exec(t))&&(r=je.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),c[f]?c[f]+=i:c[++f]=i),(n=n[0])===(r=r[0])?c[f]?c[f]+=r:c[++f]=r:(c[++f]=null,o.push({i:f,x:Ie(n,r)})),a=je.lastIndex;return a<e.length&&(i=e.slice(a),c[f]?c[f]+=i:c[++f]=i),c.length<2?o[0]?function(t){return function(e){return t(e)+""}}(o[0].x):function(t){return function(){return t}}(e):(e=o.length,function(t){for(var n,r=0;r<e;++r)c[(n=o[r]).i]=n.x(t);return c.join("")})}function Ve(t,e){var n,r=typeof e;return null==e||"boolean"===r?Ye(e):("number"===r?Ie:"string"===r?(n=Kt(e))?(e=n,Le):Xe:e instanceof Kt?Le:e instanceof Date?function(t,e){var n=new Date;return e-=t=+t,function(r){return n.setTime(t+e*r),n}}:Array.isArray(e)?function(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),f=new Array(r);for(n=0;n<i;++n)a[n]=Ve(t[n],e[n]);for(;n<r;++n)f[n]=e[n];return function(t){for(n=0;n<i;++n)f[n]=a[n](t);return f}}:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Ve(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}:Ie)(t,e)}function Ge(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}}var $e,Ze,We,Qe,Je=180/Math.PI,Ke={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tn(t,e,n,r,i,a){var f,c,o;return(f=Math.sqrt(t*t+e*e))&&(t/=f,e/=f),(o=t*n+e*r)&&(n-=t*o,r-=e*o),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,o/=c),t*r<e*n&&(t=-t,e=-e,o=-o,f=-f),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Je,skewX:Math.atan(o)*Je,scaleX:f,scaleY:c}}function en(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,f){var c=[],o=[];return a=t(a),f=t(f),function(t,r,i,a,f,c){if(t!==i||r!==a){var o=f.push("translate(",null,e,null,n);c.push({i:o-4,x:Ie(t,i)},{i:o-2,x:Ie(r,a)})}else(i||a)&&f.push("translate("+i+e+a+n)}(a.translateX,a.translateY,f.translateX,f.translateY,c,o),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Ie(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,f.rotate,c,o),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Ie(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,f.skewX,c,o),function(t,e,n,r,a,f){if(t!==n||e!==r){var c=a.push(i(a)+"scale(",null,",",null,")");f.push({i:c-4,x:Ie(t,n)},{i:c-2,x:Ie(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,f.scaleX,f.scaleY,c,o),a=f=null,function(t){for(var e,n=-1,r=o.length;++n<r;)c[(e=o[n]).i]=e.x(t);return c.join("")}}}var nn=en(function(t){return"none"===t?Ke:($e||($e=document.createElement("DIV"),Ze=document.documentElement,We=document.defaultView),$e.style.transform=t,t=We.getComputedStyle(Ze.appendChild($e),null).getPropertyValue("transform"),Ze.removeChild($e),tn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),rn=en(function(t){return null==t?Ke:(Qe||(Qe=document.createElementNS("http://www.w3.org/2000/svg","g")),Qe.setAttribute("transform",t),(t=Qe.transform.baseVal.consolidate())?tn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ke)},", ",")",")");Math.SQRT2;function an(t){return function e(n){function r(e,r){var i=t((e=Ue(e)).h,(r=Ue(r)).h),a=qe(e.s,r.s),f=qe(e.l,r.l),c=qe(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=f(Math.pow(t,n)),e.opacity=c(t),e+""}}return n=+n,r.gamma=e,r}(1)}an(function(t,e){var n=e-t;return n?Re(t,n>180||n<-180?n-360*Math.round(n/360):n):Ye(isNaN(t)?e:t)});var fn,cn,on=an(qe),un=0,sn=0,ln=0,hn=1e3,dn=0,bn=0,pn=0,_n="object"==typeof performance&&performance.now?performance:Date,yn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function gn(){return bn||(yn(vn),bn=_n.now()+pn)}function vn(){bn=0}function mn(){this._call=this._time=this._next=null}function xn(t,e,n){var r=new mn;return r.restart(t,e,n),r}function wn(){bn=(dn=_n.now())+pn,un=sn=0;try{!function(){gn(),++un;for(var t,e=fn;e;)(t=bn-e._time)>=0&&e._call.call(null,t),e=e._next;--un}()}finally{un=0,function(){var t,e,n=fn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:fn=e);cn=t,Tn(r)}(),bn=0}}function Mn(){var t=_n.now(),e=t-dn;e>hn&&(pn-=e,dn=t)}function Tn(t){un||(sn&&(sn=clearTimeout(sn)),t-bn>24?(t<1/0&&(sn=setTimeout(wn,t-_n.now()-pn)),ln&&(ln=clearInterval(ln))):(ln||(dn=_n.now(),ln=setInterval(Mn,hn)),un=1,yn(wn)))}function kn(t,e,n){var r=new mn;return e=null==e?0:+e,r.restart(function(n){r.stop(),t(n+e)},e,n),r}mn.prototype=xn.prototype={constructor:mn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?gn():+n)+(null==e?0:+e),this._next||cn===this||(cn?cn._next=this:fn=this,cn=this),this._call=t,this._time=n,Tn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tn())}};var An=z("start","end","cancel","interrupt"),Nn=[],Sn=0,Cn=1,En=2,Pn=3,Dn=4,Un=5,Fn=6;function Yn(t,e,n,r,i,a){var f=t.__transition;if(f){if(n in f)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(o){var u,s,l,h;if(n.state!==Cn)return c();for(u in i)if((h=i[u]).name===n.name){if(h.state===Pn)return kn(a);h.state===Dn?(h.state=Fn,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[u]):+u<e&&(h.state=Fn,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[u])}if(kn(function(){n.state===Pn&&(n.state=Dn,n.timer.restart(f,n.delay,n.time),f(o))}),n.state=En,n.on.call("start",t,t.__data__,n.index,n.group),n.state===En){for(n.state=Pn,r=new Array(l=n.tween.length),u=0,s=-1;u<l;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++s]=h);r.length=s+1}}function f(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(c),n.state=Un,1),a=-1,f=r.length;++a<f;)r[a].call(t,i);n.state===Un&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){for(var r in n.state=Fn,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=xn(function(t){n.state=Cn,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)},0,n.time)}(t,n,{name:e,index:r,group:i,on:An,tween:Nn,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Sn})}function Rn(t,e){var n=qn(t,e);if(n.state>Sn)throw new Error("too late; already scheduled");return n}function On(t,e){var n=qn(t,e);if(n.state>Pn)throw new Error("too late; already running");return n}function qn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ln(t,e){var n,r,i,a=t.__transition,f=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>En&&n.state<Un,n.state=Fn,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):f=!1;f&&delete t.__transition}}function zn(t,e,n){var r=t._id;return t.each(function(){var t=On(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return qn(t,r).value[e]}}function Bn(t,e){var n;return("number"==typeof e?Ie:e instanceof Kt?Le:(n=Kt(e))?(e=n,Le):Xe)(t,e)}var In=Ct.prototype.constructor;function Hn(t){return function(){this.style.removeProperty(t)}}var jn=0;function Xn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Vn(){return++jn}var Gn=Ct.prototype;Xn.prototype=function(t){return Ct().transition(t)}.prototype={constructor:Xn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Z(t));for(var r=this._groups,i=r.length,a=new Array(i),f=0;f<i;++f)for(var c,o,u=r[f],s=u.length,l=a[f]=new Array(s),h=0;h<s;++h)(c=u[h])&&(o=t.call(c,c.__data__,h,u))&&("__data__"in c&&(o.__data__=c.__data__),l[h]=o,Yn(l[h],e,n,h,l,qn(c,n)));return new Xn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Q(t));for(var r=this._groups,i=r.length,a=[],f=[],c=0;c<i;++c)for(var o,u=r[c],s=u.length,l=0;l<s;++l)if(o=u[l]){for(var h,d=t.call(o,o.__data__,l,u),b=qn(o,n),p=0,_=d.length;p<_;++p)(h=d[p])&&Yn(h,e,n,p,d,b);a.push(d),f.push(o)}return new Xn(a,f,e,n)},filter:function(t){"function"!=typeof t&&(t=J(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,f=e[i],c=f.length,o=r[i]=[],u=0;u<c;++u)(a=f[u])&&t.call(a,a.__data__,u,f)&&o.push(a);return new Xn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),f=new Array(r),c=0;c<a;++c)for(var o,u=e[c],s=n[c],l=u.length,h=f[c]=new Array(l),d=0;d<l;++d)(o=u[d]||s[d])&&(h[d]=o);for(;c<r;++c)f[c]=e[c];return new Xn(f,this._parents,this._name,this._id)},selection:function(){return new In(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Vn(),r=this._groups,i=r.length,a=0;a<i;++a)for(var f,c=r[a],o=c.length,u=0;u<o;++u)if(f=c[u]){var s=qn(f,e);Yn(f,t,n,u,c,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Xn(r,this._parents,t,n)},call:Gn.call,nodes:Gn.nodes,node:Gn.node,size:Gn.size,empty:Gn.empty,each:Gn.each,on:function(t,e){var n=this._id;return arguments.length<2?qn(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,a=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?Rn:On;return function(){var f=a(this,t),c=f.on;c!==r&&(i=(r=c).copy()).on(e,n),f.on=i}}(n,t,e))},attr:function(t,e){var n=V(t),r="transform"===n?rn:Bn;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,a;return function(){var f,c,o=n(this);if(null!=o)return(f=this.getAttributeNS(t.space,t.local))===(c=o+"")?null:f===r&&c===i?a:(i=c,a=e(r=f,o));this.removeAttributeNS(t.space,t.local)}}:function(t,e,n){var r,i,a;return function(){var f,c,o=n(this);if(null!=o)return(f=this.getAttribute(t))===(c=o+"")?null:f===r&&c===i?a:(i=c,a=e(r=f,o));this.removeAttribute(t)}})(n,r,zn(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,a=n+"";return function(){var f=this.getAttributeNS(t.space,t.local);return f===a?null:f===r?i:i=e(r=f,n)}}:function(t,e,n){var r,i,a=n+"";return function(){var f=this.getAttribute(t);return f===a?null:f===r?i:i=e(r=f,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=V(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,i)),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,i)),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r="transform"==(t+="")?nn:Bn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=ft(this,t),f=(this.style.removeProperty(t),ft(this,t));return a===f?null:a===n&&f===r?i:i=e(n=a,r=f)}}(t,r)).on("end.style."+t,Hn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var f=ft(this,t),c=n(this),o=c+"";return null==c&&(this.style.removeProperty(t),o=c=ft(this,t)),f===o?null:f===r&&o===i?a:(i=o,a=e(r=f,c))}}(t,r,zn(this,"style."+t,e))).each(function(t,e){var n,r,i,a,f="style."+e,c="end."+f;return function(){var o=On(this,t),u=o.on,s=null==o.value[f]?a||(a=Hn(e)):void 0;u===n&&i===s||(r=(n=u).copy()).on(c,i=s),o.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var f=ft(this,t);return f===a?null:f===r?i:i=e(r=f,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}(t,a,n)),r}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(zn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=qn(this.node(),n).tween,a=0,f=i.length;a<f;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?function(t,e){var n,r;return function(){var i=On(this,t),a=i.tween;if(a!==n)for(var f=0,c=(r=n=a).length;f<c;++f)if(r[f].name===e){(r=r.slice()).splice(f,1);break}i.tween=r}}:function(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=On(this,t),f=a.tween;if(f!==r){i=(r=f).slice();for(var c={name:e,value:n},o=0,u=i.length;o<u;++o)if(i[o].name===e){i[o]=c;break}o===u&&i.push(c)}a.tween=i}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){Rn(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){Rn(this,t).delay=e}})(e,t)):qn(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){On(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){On(this,t).duration=e}})(e,t)):qn(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){On(this,t).ease=e}}(e,t)):qn(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,f){var c={value:f},o={value:function(){0==--i&&a()}};n.each(function(){var n=On(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(c),e._.interrupt.push(c),e._.end.push(o)),n.on=e})})}};Math.PI,Math.PI;var $n={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Zn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return $n.time=gn(),$n;return n}function Wn(t){return function(){return t}}function Qn(t,e,n){this.target=t,this.type=e,this.selection=n}function Jn(){t.event.stopImmediatePropagation()}function Kn(){t.event.preventDefault(),t.event.stopImmediatePropagation()}Ct.prototype.interrupt=function(t){return this.each(function(){Ln(this,t)})},Ct.prototype.transition=function(t){var e,n;t instanceof Xn?(e=t._id,t=t._name):(e=Vn(),(n=$n).time=gn(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var f,c=r[a],o=c.length,u=0;u<o;++u)(f=c[u])&&Yn(f,t,e,u,c,n||Zn(f,e));return new Xn(r,this._parents,t,e)};var tr={name:"drag"},er={name:"space"},nr={name:"handle"},rr={name:"center"},ir={name:"x",handles:["e","w"].map(hr),input:function(t,e){return t&&[[t[0],e[0][1]],[t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ar={name:"y",handles:["n","s"].map(hr),input:function(t,e){return t&&[[e[0][0],t[0]],[e[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},fr={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(hr),input:function(t){return t},output:function(t){return t}},cr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},or={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},ur={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},sr={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},lr={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function hr(t){return{type:t}}function dr(){return!t.event.button}function br(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function pr(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function _r(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function yr(e){var n,r=br,i=dr,a=z(c,"start","brush","end"),f=6;function c(t){var n=t.property("__brush",h).selectAll(".overlay").data([hr("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",cr.overlay).merge(n).each(function(){var t=pr(this).extent;Et(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([hr("selection")]).enter().append("rect").attr("class","selection").attr("cursor",cr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=t.selectAll(".handle").data(e.handles,function(t){return t.type});r.exit().remove(),r.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return cr[t.type]}),t.each(o).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",l)}function o(){var t=Et(this),e=pr(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-f/2:e[0][0]-f/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-f/2:e[0][1]-f/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+f:f}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+f:f})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,e){return t.__brush.emitter||new s(t,e)}function s(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function l(){if(t.event.touches){if(t.event.changedTouches.length<t.event.touches.length)return Kn()}else if(n)return;if(i.apply(this,arguments)){var r,a,f,c,s,l,h,d,b,p,_,y,g,v=this,m=t.event.target.__data__.type,x="selection"===(t.event.metaKey?m="overlay":m)?tr:t.event.altKey?rr:nr,w=e===ar?null:sr[m],M=e===ir?null:lr[m],T=pr(v),k=T.extent,A=T.selection,N=k[0][0],S=k[0][1],C=k[1][0],E=k[1][1],P=w&&M&&t.event.shiftKey,D=Rt(v),U=D,F=u(v,arguments).beforestart();"overlay"===m?T.selection=A=[[r=e===ar?N:D[0],f=e===ir?S:D[1]],[s=e===ar?C:r,h=e===ir?E:f]]:(r=A[0][0],f=A[0][1],s=A[1][0],h=A[1][1]),a=r,c=f,l=s,d=h;var Y=Et(v).attr("pointer-events","none"),R=Y.selectAll(".overlay").attr("cursor",cr[m]);if(t.event.touches)Y.on("touchmove.brush",q,!0).on("touchend.brush touchcancel.brush",z,!0);else{var O=Et(t.event.view).on("keydown.brush",function(){switch(t.event.keyCode){case 16:P=w&&M;break;case 18:x===nr&&(w&&(s=l-b*w,r=a+b*w),M&&(h=d-p*M,f=c+p*M),x=rr,L());break;case 32:x!==nr&&x!==rr||(w<0?s=l-b:w>0&&(r=a-b),M<0?h=d-p:M>0&&(f=c-p),x=er,R.attr("cursor",cr.selection),L());break;default:return}Kn()},!0).on("keyup.brush",function(){switch(t.event.keyCode){case 16:P&&(y=g=P=!1,L());break;case 18:x===rr&&(w<0?s=l:w>0&&(r=a),M<0?h=d:M>0&&(f=c),x=nr,L());break;case 32:x===er&&(t.event.altKey?(w&&(s=l-b*w,r=a+b*w),M&&(h=d-p*M,f=c+p*M),x=rr):(w<0?s=l:w>0&&(r=a),M<0?h=d:M>0&&(f=c),x=nr),R.attr("cursor",cr[m]),L());break;default:return}Kn()},!0).on("mousemove.brush",q,!0).on("mouseup.brush",z,!0);!function(t){var e=t.document.documentElement,n=Et(t).on("dragstart.drag",Ot,!0);"onselectstart"in e?n.on("selectstart.drag",Ot,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.event.view)}Jn(),Ln(v),o.call(v),F.start()}function q(){var t=Rt(v);!P||y||g||(Math.abs(t[0]-U[0])>Math.abs(t[1]-U[1])?g=!0:y=!0),U=t,_=!0,Kn(),L()}function L(){var t;switch(b=U[0]-D[0],p=U[1]-D[1],x){case er:case tr:w&&(b=Math.max(N-r,Math.min(C-s,b)),a=r+b,l=s+b),M&&(p=Math.max(S-f,Math.min(E-h,p)),c=f+p,d=h+p);break;case nr:w<0?(b=Math.max(N-r,Math.min(C-r,b)),a=r+b,l=s):w>0&&(b=Math.max(N-s,Math.min(C-s,b)),a=r,l=s+b),M<0?(p=Math.max(S-f,Math.min(E-f,p)),c=f+p,d=h):M>0&&(p=Math.max(S-h,Math.min(E-h,p)),c=f,d=h+p);break;case rr:w&&(a=Math.max(N,Math.min(C,r-b*w)),l=Math.max(N,Math.min(C,s+b*w))),M&&(c=Math.max(S,Math.min(E,f-p*M)),d=Math.max(S,Math.min(E,h+p*M)))}l<a&&(w*=-1,t=r,r=s,s=t,t=a,a=l,l=t,m in or&&R.attr("cursor",cr[m=or[m]])),d<c&&(M*=-1,t=f,f=h,h=t,t=c,c=d,d=t,m in ur&&R.attr("cursor",cr[m=ur[m]])),T.selection&&(A=T.selection),y&&(a=A[0][0],l=A[1][0]),g&&(c=A[0][1],d=A[1][1]),A[0][0]===a&&A[0][1]===c&&A[1][0]===l&&A[1][1]===d||(T.selection=[[a,c],[l,d]],o.call(v),F.brush())}function z(){if(Jn(),t.event.touches){if(t.event.touches.length)return;n&&clearTimeout(n),n=setTimeout(function(){n=null},500),Y.on("touchmove.brush touchend.brush touchcancel.brush",null)}else!function(t,e){var n=t.document.documentElement,r=Et(t).on("dragstart.drag",null);e&&(r.on("click.drag",Ot,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.event.view,_),O.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Y.attr("pointer-events","all"),R.attr("cursor",cr.overlay),T.selection&&(A=T.selection),_r(A)&&(T.selection=null,o.call(v)),F.end()}}function h(){var t=this.__brush||{selection:null};return t.extent=r.apply(this,arguments),t.dim=e,t}return c.move=function(t,n){t.selection?t.on("start.brush",function(){u(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){u(this,arguments).end()}).tween("brush",function(){var t=this,r=t.__brush,i=u(t,arguments),a=r.selection,f=e.input("function"==typeof n?n.apply(this,arguments):n,r.extent),c=Ve(a,f);function s(e){r.selection=1===e&&_r(f)?null:c(e),o.call(t),i.brush()}return a&&f?s:s(1)}):t.each(function(){var t=arguments,r=this.__brush,i=e.input("function"==typeof n?n.apply(this,t):n,r.extent),a=u(this,t).beforestart();Ln(this),r.selection=null==i||_r(i)?null:i,o.call(this),a.start().brush().end()})},s.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(t){kt(new Qn(c,t,e.output(this.state.selection)),a.apply,a,[t,this.that,this.args])}},c.extent=function(t){return arguments.length?(r="function"==typeof t?t:Wn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),c):r},c.filter=function(t){return arguments.length?(i="function"==typeof t?t:Wn(!!t),c):i},c.handleSize=function(t){return arguments.length?(f=+t,c):f},c.on=function(){var t=a.on.apply(a,arguments);return t===a?c:t},c}var gr={},vr={},mr=34,xr=10,wr=13;function Mr(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}")}function Tr(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var r in t)r in e||n.push(e[r]=r)}),n}function kr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Ar(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+kr(-e,6):e>9999?"+"+kr(e,6):kr(e,4))+"-"+kr(t.getUTCMonth()+1,2)+"-"+kr(t.getUTCDate(),2)+(a?"T"+kr(n,2)+":"+kr(r,2)+":"+kr(i,2)+"."+kr(a,3)+"Z":i?"T"+kr(n,2)+":"+kr(r,2)+":"+kr(i,2)+"Z":r||n?"T"+kr(n,2)+":"+kr(r,2)+"Z":"")}function Nr(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,f=0,c=0,o=a<=0,u=!1;function s(){if(o)return vr;if(u)return u=!1,gr;var e,r,i=f;if(t.charCodeAt(i)===mr){for(;f++<a&&t.charCodeAt(f)!==mr||t.charCodeAt(++f)===mr;);return(e=f)>=a?o=!0:(r=t.charCodeAt(f++))===xr?u=!0:r===wr&&(u=!0,t.charCodeAt(f)===xr&&++f),t.slice(i+1,e-1).replace(/""/g,'"')}for(;f<a;){if((r=t.charCodeAt(e=f++))===xr)u=!0;else if(r===wr)u=!0,t.charCodeAt(f)===xr&&++f;else if(r!==n)continue;return t.slice(i,e)}return o=!0,t.slice(i,a)}for(t.charCodeAt(a-1)===xr&&--a,t.charCodeAt(a-1)===wr&&--a;(r=s())!==vr;){for(var l=[];r!==gr&&r!==vr;)l.push(r),r=s();e&&null==(l=e(l,c++))||i.push(l)}return i}function i(e,n){return e.map(function(e){return n.map(function(t){return f(e[t])}).join(t)})}function a(e){return e.map(f).join(t)}function f(t){return null==t?"":t instanceof Date?Ar(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=Mr(t);return function(r,i){return e(n(r),i,t)}}(t,e):Mr(t)});return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=Tr(e)),[n.map(f).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Tr(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")}}}var Sr=Nr(","),Cr=Sr.parse,Er=Sr.parseRows,Pr=Sr.format,Dr=Sr.formatBody,Ur=Sr.formatRows,Fr=Nr("\t"),Yr=Fr.parse,Rr=Fr.parseRows,Or=Fr.format,qr=Fr.formatBody,Lr=Fr.formatRows;function zr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Br(t){return(t=zr(Math.abs(t)))?t[1]:NaN}var Ir,Hr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function jr(t){return new Xr(t)}function Xr(t){if(!(e=Hr.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}function Vr(t,e){var n=zr(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}jr.prototype=Xr.prototype,Xr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Gr={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Vr(100*t,e)},r:Vr,s:function(t,e){var n=zr(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Ir=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,f=r.length;return a===f?r:a>f?r+new Array(a-f+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+zr(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function $r(t){return t}var Zr,Wr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qr(t){var e,n,r=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,r){for(var i=t.length,a=[],f=0,c=e[0],o=0;i>0&&c>0&&(o+c+1>r&&(c=Math.max(1,r-o)),a.push(t.substring(i-=c,i+c)),!((o+=c+1)>r));)c=e[f=(f+1)%e.length];return a.reverse().join(n)}):$r,i=t.currency,a=t.decimal,f=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(t.numerals):$r,c=t.percent||"%";function o(t){var e=(t=jr(t)).fill,n=t.align,o=t.sign,u=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,b=t.trim,p=t.type;"n"===p?(h=!0,p="g"):Gr[p]||(null==d&&(d=12),b=!0,p="g"),(s||"0"===e&&"="===n)&&(s=!0,e="0",n="=");var _="$"===u?i[0]:"#"===u&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",y="$"===u?i[1]:/[%p]/.test(p)?c:"",g=Gr[p],v=/[defgprs%]/.test(p);function m(t){var i,c,u,m=_,x=y;if("c"===p)x=g(t)+x,t="";else{var w=(t=+t)<0;if(t=g(Math.abs(t),d),b&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&(w=!1),m=(w?"("===o?o:"-":"-"===o||"("===o?"":o)+m,x=("s"===p?Wr[8+Ir/3]:"")+x+(w&&"("===o?")":""),v)for(i=-1,c=t.length;++i<c;)if(48>(u=t.charCodeAt(i))||u>57){x=(46===u?a+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var M=m.length+t.length+x.length,T=M<l?new Array(l-M+1).join(e):"";switch(h&&s&&(t=r(T+t,T.length?l-x.length:1/0),T=""),n){case"<":t=m+t+x+T;break;case"=":t=m+T+t+x;break;case"^":t=T.slice(0,M=T.length>>1)+m+t+x+T.slice(M);break;default:t=T+m+t+x}return f(t)}return d=null==d?6:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:o,formatPrefix:function(t,e){var n=o(((t=jr(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Br(e)/3))),i=Math.pow(10,-r),a=Wr[8+r/3];return function(t){return n(i*t)+a}}}}function Jr(e){return Zr=Qr(e),t.format=Zr.format,t.formatPrefix=Zr.formatPrefix,Zr}function Kr(t){return Math.max(0,-Br(Math.abs(t)))}function ti(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Br(e)/3)))-Br(Math.abs(t)))}function ei(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Br(e)-Br(t))+1}function ni(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function ri(t,e){switch(arguments.length){case 0:break;case 1:this.interpolator(t);break;default:this.interpolator(e).domain(t)}return this}Jr({decimal:".",thousands:",",grouping:[3],currency:["$",""]});function ii(){}function ai(t,e){var n=new ii;if(t instanceof ii)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i<a;)n.set(i,t[i]);else for(;++i<a;)n.set(e(r=t[i],i,t),r)}else if(t)for(var f in t)n.set(f,t[f]);return n}function fi(){}ii.prototype=ai.prototype={constructor:ii,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var ci=ai.prototype;fi.prototype=function(t,e){var n=new fi;if(t instanceof fi)t.each(function(t){n.add(t)});else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}.prototype={constructor:fi,has:ci.has,add:function(t){return this["$"+(t+="")]=t,this},remove:ci.remove,clear:ci.clear,values:ci.keys,size:ci.size,empty:ci.empty,each:ci.each};var oi=Array.prototype,ui=oi.map,si=oi.slice,li={name:"implicit"};function hi(){var t=ai(),e=[],n=[],r=li;function i(i){var a=i+"",f=t.get(a);if(!f){if(r!==li)return r;t.set(a,f=e.push(i))}return n[(f-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=ai();for(var r,a,f=-1,c=n.length;++f<c;)t.has(a=(r=n[f])+"")||t.set(a,e.push(r));return i},i.range=function(t){return arguments.length?(n=si.call(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return hi(e,n).unknown(r)},ni.apply(i,arguments),i}function di(){var t,e,n=hi().unknown(void 0),r=n.domain,i=n.range,a=[0,1],f=!1,c=0,o=0,u=.5;function s(){var n=r().length,s=a[1]<a[0],l=a[s-0],h=a[1-s];t=(h-l)/Math.max(1,n-c+2*o),f&&(t=Math.floor(t)),l+=(h-l-t*(n-c))*u,e=t*(1-c),f&&(l=Math.round(l),e=Math.round(e));var d=_(n).map(function(e){return l+t*e});return i(s?d.reverse():d)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),s()):r()},n.range=function(t){return arguments.length?(a=[+t[0],+t[1]],s()):a.slice()},n.rangeRound=function(t){return a=[+t[0],+t[1]],f=!0,s()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(f=!!t,s()):f},n.padding=function(t){return arguments.length?(c=Math.min(1,o=+t),s()):c},n.paddingInner=function(t){return arguments.length?(c=Math.min(1,t),s()):c},n.paddingOuter=function(t){return arguments.length?(o=+t,s()):o},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s()):u},n.copy=function(){return di(r(),a).round(f).paddingInner(c).paddingOuter(o).align(u)},ni.apply(s(),arguments)}function bi(t){return+t}var pi=[0,1];function _i(t){return t}function yi(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function gi(t){var e,n=t[0],r=t[t.length-1];return n>r&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function vi(t,e,n){var r=t[0],i=t[1],a=e[0],f=e[1];return i<r?(r=yi(i,r),a=n(f,a)):(r=yi(r,i),a=n(a,f)),function(t){return a(r(t))}}function mi(t,e,n){var r=Math.min(t.length,e.length)-1,a=new Array(r),f=new Array(r),c=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++c<r;)a[c]=yi(t[c],t[c+1]),f[c]=n(e[c],e[c+1]);return function(e){var n=i(t,e,1,r)-1;return f[n](a[n](e))}}function xi(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function wi(){var t,e,n,r,i,a,f=pi,c=pi,o=Ve,u=_i;function s(){return r=Math.min(f.length,c.length)>2?mi:vi,i=a=null,l}function l(e){return isNaN(e=+e)?n:(i||(i=r(f.map(t),c,o)))(t(u(e)))}return l.invert=function(n){return u(e((a||(a=r(c,f.map(t),Ie)))(n)))},l.domain=function(t){return arguments.length?(f=ui.call(t,bi),u===_i||(u=gi(f)),s()):f.slice()},l.range=function(t){return arguments.length?(c=si.call(t),s()):c.slice()},l.rangeRound=function(t){return c=si.call(t),o=Ge,s()},l.clamp=function(t){return arguments.length?(u=t?gi(f):_i,l):u!==_i},l.interpolate=function(t){return arguments.length?(o=t,s()):o},l.unknown=function(t){return arguments.length?(n=t,l):n},function(n,r){return t=n,e=r,s()}}function Mi(t,e){return wi()(t,e)}function Ti(e,n,r,i){var a,f=w(e,n,r);switch((i=jr(null==i?",f":i)).type){case"s":var c=Math.max(Math.abs(e),Math.abs(n));return null!=i.precision||isNaN(a=ti(f,c))||(i.precision=a),t.formatPrefix(i,c);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(a=ei(f,Math.max(Math.abs(e),Math.abs(n))))||(i.precision=a-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(a=Kr(f))||(i.precision=a-2*("%"===i.type))}return t.format(i)}function ki(t){var e=t.domain;return t.ticks=function(t){var n=e();return m(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Ti(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,f=i.length-1,c=i[a],o=i[f];return o<c&&(r=c,c=o,o=r,r=a,a=f,f=r),(r=x(c,o,n))>0?r=x(c=Math.floor(c/r)*r,o=Math.ceil(o/r)*r,n):r<0&&(r=x(c=Math.ceil(c*r)/r,o=Math.floor(o*r)/r,n)),r>0?(i[a]=Math.floor(c/r)*r,i[f]=Math.ceil(o/r)*r,e(i)):r<0&&(i[a]=Math.ceil(c*r)/r,i[f]=Math.floor(o*r)/r,e(i)),t},t}function Ai(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],f=t[i];return f<a&&(n=r,r=i,i=n,n=a,a=f,f=n),t[r]=e.floor(a),t[i]=e.ceil(f),t}function Ni(t){return Math.log(t)}function Si(t){return Math.exp(t)}function Ci(t){return-Math.log(-t)}function Ei(t){return-Math.exp(-t)}function Pi(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Di(t){return function(e){return-t(-e)}}function Ui(e){var n,r,i=e(Ni,Si),a=i.domain,f=10;function c(){return n=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(f),r=function(t){return 10===t?Pi:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(f),a()[0]<0?(n=Di(n),r=Di(r),e(Ci,Ei)):e(Ni,Si),i}return i.base=function(t){return arguments.length?(f=+t,c()):f},i.domain=function(t){return arguments.length?(a(t),c()):a()},i.ticks=function(t){var e,i=a(),c=i[0],o=i[i.length-1];(e=o<c)&&(h=c,c=o,o=h);var u,s,l,h=n(c),d=n(o),b=null==t?10:+t,p=[];if(!(f%1)&&d-h<b){if(h=Math.round(h)-1,d=Math.round(d)+1,c>0){for(;h<d;++h)for(s=1,u=r(h);s<f;++s)if(!((l=u*s)<c)){if(l>o)break;p.push(l)}}else for(;h<d;++h)for(s=f-1,u=r(h);s>=1;--s)if(!((l=u*s)<c)){if(l>o)break;p.push(l)}}else p=m(h,d,Math.min(d-h,b)).map(r);return e?p.reverse():p},i.tickFormat=function(e,a){if(null==a&&(a=10===f?".0e":","),"function"!=typeof a&&(a=t.format(a)),e===1/0)return a;null==e&&(e=10);var c=Math.max(1,f*e/i.ticks().length);return function(t){var e=t/r(Math.round(n(t)));return e*f<f-.5&&(e*=f),e<=c?a(t):""}},i.nice=function(){return a(Ai(a(),{floor:function(t){return r(Math.floor(n(t)))},ceil:function(t){return r(Math.ceil(n(t)))}}))},i}function Fi(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Yi(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Ri(t){var e=1,n=t(Fi(e),Yi(e));return n.constant=function(n){return arguments.length?t(Fi(e=+n),Yi(e)):e},ki(n)}function Oi(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function qi(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Li(t){return t<0?-t*t:t*t}function zi(t){var e=t(_i,_i),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(_i,_i):.5===n?t(qi,Li):t(Oi(n),Oi(1/n)):n},ki(e)}function Bi(){var t=zi(wi());return t.copy=function(){return xi(t,Bi()).exponent(t.exponent())},ni.apply(t,arguments),t}var Ii=new Date,Hi=new Date;function ji(t,e,n,r){function i(e){return t(e=new Date(+e)),e}return i.floor=i,i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,a){var f,c=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return c;do{c.push(f=new Date(+n)),e(n,a),t(n)}while(f<n&&n<r);return c},i.filter=function(n){return ji(function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})},n&&(i.count=function(e,r){return Ii.setTime(+e),Hi.setTime(+r),t(Ii),t(Hi),Math.floor(n(Ii,Hi))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Xi=ji(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});Xi.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?ji(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):Xi:null};Xi.range;var Vi=6e4,Gi=6048e5,$i=ji(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3},function(t){return t.getUTCSeconds()}),Zi=($i.range,ji(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,e){t.setTime(+t+e*Vi)},function(t,e){return(e-t)/Vi},function(t){return t.getMinutes()})),Wi=(Zi.range,ji(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*Vi)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getHours()})),Qi=(Wi.range,ji(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vi)/864e5},function(t){return t.getDate()-1}));Qi.range;function Ji(t){return ji(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vi)/Gi})}var Ki=Ji(0),ta=Ji(1),ea=(Ji(2),Ji(3),Ji(4)),na=(Ji(5),Ji(6),Ki.range,ta.range,ea.range,ji(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),ra=(na.range,ji(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));ra.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ji(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};ra.range;var ia=ji(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*Vi)},function(t,e){return(e-t)/Vi},function(t){return t.getUTCMinutes()}),aa=(ia.range,ji(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getUTCHours()})),fa=(aa.range,ji(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5},function(t){return t.getUTCDate()-1}));fa.range;function ca(t){return ji(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/Gi})}var oa=ca(0),ua=ca(1),sa=(ca(2),ca(3),ca(4)),la=(ca(5),ca(6),oa.range,ua.range,sa.range,ji(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),ha=(la.range,ji(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));ha.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ji(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};ha.range;function da(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ba(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function pa(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function _a(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,f=t.shortDays,c=t.months,o=t.shortMonths,u=Ta(i),s=ka(i),l=Ta(a),h=ka(a),d=Ta(f),b=ka(f),p=Ta(c),_=ka(c),y=Ta(o),g=ka(o),v={a:function(t){return f[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return o[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:null,d:Xa,e:Xa,f:Wa,H:Va,I:Ga,j:$a,L:Za,m:Qa,M:Ja,p:function(t){return i[+(t.getHours()>=12)]},Q:Nf,s:Sf,S:Ka,u:tf,U:ef,V:nf,w:rf,W:af,x:null,X:null,y:ff,Y:cf,Z:of,"%":Af},m={a:function(t){return f[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return o[t.getUTCMonth()]},B:function(t){return c[t.getUTCMonth()]},c:null,d:uf,e:uf,f:bf,H:sf,I:lf,j:hf,L:df,m:pf,M:_f,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Nf,s:Sf,S:yf,u:gf,U:vf,V:mf,w:xf,W:wf,x:null,X:null,y:Mf,Y:Tf,Z:kf,"%":Af},x={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=b[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.m=_[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return T(t,e,n,r)},d:Ya,e:Ya,f:Ba,H:Oa,I:Oa,j:Ra,L:za,m:Fa,M:qa,p:function(t,e,n){var r=u.exec(e.slice(n));return r?(t.p=s[r[0].toLowerCase()],n+r[0].length):-1},Q:Ha,s:ja,S:La,u:Na,U:Sa,V:Ca,w:Aa,W:Ea,x:function(t,e,r){return T(t,n,e,r)},X:function(t,e,n){return T(t,r,e,n)},y:Da,Y:Pa,Z:Ua,"%":Ia};function w(t,e){return function(n){var r,i,a,f=[],c=-1,o=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++c<u;)37===t.charCodeAt(c)&&(f.push(t.slice(o,c)),null!=(i=ga[r=t.charAt(++c)])?r=t.charAt(++c):i="e"===r?" ":"0",(a=e[r])&&(r=a(n,i)),f.push(r),o=c+1);return f.push(t.slice(o,c)),f.join("")}}function M(t,e){return function(n){var r,i,a=pa(1900);if(T(a,t,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("p"in a&&(a.H=a.H%12+12*a.p),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=ba(pa(a.y))).getUTCDay(),r=i>4||0===i?ua.ceil(r):ua(r),r=fa.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=e(pa(a.y))).getDay(),r=i>4||0===i?ta.ceil(r):ta(r),r=Qi.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?ba(pa(a.y)).getUTCDay():e(pa(a.y)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,ba(a)):e(a)}}function T(t,e,n,r){for(var i,a,f=0,c=e.length,o=n.length;f<c;){if(r>=o)return-1;if(37===(i=e.charCodeAt(f++))){if(i=e.charAt(f++),!(a=x[i in ga?e.charAt(f++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=w(n,v),v.X=w(r,v),v.c=w(e,v),m.x=w(n,m),m.X=w(r,m),m.c=w(e,m),{format:function(t){var e=w(t+="",v);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",da);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",m);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t,ba);return e.toString=function(){return t},e}}}var ya,ga={"-":"",_:" ",0:"0"},va=/^\s*\d+/,ma=/^%/,xa=/[\\^$*+?|[\]().{}]/g;function wa(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function Ma(t){return t.replace(xa,"\\$&")}function Ta(t){return new RegExp("^(?:"+t.map(Ma).join("|")+")","i")}function ka(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function Aa(t,e,n){var r=va.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Na(t,e,n){var r=va.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Sa(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ca(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Ea(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Pa(t,e,n){var r=va.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Da(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ua(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Fa(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Ya(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Ra(t,e,n){var r=va.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Oa(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function qa(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function La(t,e,n){var r=va.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function za(t,e,n){var r=va.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Ba(t,e,n){var r=va.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ia(t,e,n){var r=ma.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Ha(t,e,n){var r=va.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function ja(t,e,n){var r=va.exec(e.slice(n));return r?(t.Q=1e3*+r[0],n+r[0].length):-1}function Xa(t,e){return wa(t.getDate(),e,2)}function Va(t,e){return wa(t.getHours(),e,2)}function Ga(t,e){return wa(t.getHours()%12||12,e,2)}function $a(t,e){return wa(1+Qi.count(ra(t),t),e,3)}function Za(t,e){return wa(t.getMilliseconds(),e,3)}function Wa(t,e){return Za(t,e)+"000"}function Qa(t,e){return wa(t.getMonth()+1,e,2)}function Ja(t,e){return wa(t.getMinutes(),e,2)}function Ka(t,e){return wa(t.getSeconds(),e,2)}function tf(t){var e=t.getDay();return 0===e?7:e}function ef(t,e){return wa(Ki.count(ra(t),t),e,2)}function nf(t,e){var n=t.getDay();return t=n>=4||0===n?ea(t):ea.ceil(t),wa(ea.count(ra(t),t)+(4===ra(t).getDay()),e,2)}function rf(t){return t.getDay()}function af(t,e){return wa(ta.count(ra(t),t),e,2)}function ff(t,e){return wa(t.getFullYear()%100,e,2)}function cf(t,e){return wa(t.getFullYear()%1e4,e,4)}function of(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+wa(e/60|0,"0",2)+wa(e%60,"0",2)}function uf(t,e){return wa(t.getUTCDate(),e,2)}function sf(t,e){return wa(t.getUTCHours(),e,2)}function lf(t,e){return wa(t.getUTCHours()%12||12,e,2)}function hf(t,e){return wa(1+fa.count(ha(t),t),e,3)}function df(t,e){return wa(t.getUTCMilliseconds(),e,3)}function bf(t,e){return df(t,e)+"000"}function pf(t,e){return wa(t.getUTCMonth()+1,e,2)}function _f(t,e){return wa(t.getUTCMinutes(),e,2)}function yf(t,e){return wa(t.getUTCSeconds(),e,2)}function gf(t){var e=t.getUTCDay();return 0===e?7:e}function vf(t,e){return wa(oa.count(ha(t),t),e,2)}function mf(t,e){var n=t.getUTCDay();return t=n>=4||0===n?sa(t):sa.ceil(t),wa(sa.count(ha(t),t)+(4===ha(t).getUTCDay()),e,2)}function xf(t){return t.getUTCDay()}function wf(t,e){return wa(ua.count(ha(t),t),e,2)}function Mf(t,e){return wa(t.getUTCFullYear()%100,e,2)}function Tf(t,e){return wa(t.getUTCFullYear()%1e4,e,4)}function kf(){return"+0000"}function Af(){return"%"}function Nf(t){return+t}function Sf(t){return Math.floor(+t/1e3)}function Cf(e){return ya=_a(e),t.timeFormat=ya.format,t.timeParse=ya.parse,t.utcFormat=ya.utcFormat,t.utcParse=ya.utcParse,ya}Cf({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Ef=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var Pf=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),Df=1e3,Uf=60*Df,Ff=60*Uf,Yf=24*Ff,Rf=7*Yf,Of=30*Yf,qf=365*Yf;function Lf(t){return new Date(t)}function zf(t){return t instanceof Date?+t:+new Date(+t)}function Bf(t,e,r,i,a,f,c,o,u){var s=Mi(_i,_i),l=s.invert,h=s.domain,d=u(".%L"),b=u(":%S"),p=u("%I:%M"),_=u("%I %p"),y=u("%a %d"),g=u("%b %d"),v=u("%B"),m=u("%Y"),x=[[c,1,Df],[c,5,5*Df],[c,15,15*Df],[c,30,30*Df],[f,1,Uf],[f,5,5*Uf],[f,15,15*Uf],[f,30,30*Uf],[a,1,Ff],[a,3,3*Ff],[a,6,6*Ff],[a,12,12*Ff],[i,1,Yf],[i,2,2*Yf],[r,1,Rf],[e,1,Of],[e,3,3*Of],[t,1,qf]];function M(n){return(c(n)<n?d:f(n)<n?b:a(n)<n?p:i(n)<n?_:e(n)<n?r(n)<n?y:g:t(n)<n?v:m)(n)}function T(e,r,i,a){if(null==e&&(e=10),"number"==typeof e){var f=Math.abs(i-r)/e,c=n(function(t){return t[2]}).right(x,f);c===x.length?(a=w(r/qf,i/qf,e),e=t):c?(a=(c=x[f/x[c-1][2]<x[c][2]/f?c-1:c])[1],e=c[0]):(a=Math.max(w(r,i,e),1),e=o)}return null==a?e:e.every(a)}return s.invert=function(t){return new Date(l(t))},s.domain=function(t){return arguments.length?h(ui.call(t,zf)):h().map(Lf)},s.ticks=function(t,e){var n,r=h(),i=r[0],a=r[r.length-1],f=a<i;return f&&(n=i,i=a,a=n),n=(n=T(t,i,a,e))?n.range(i,a+1):[],f?n.reverse():n},s.tickFormat=function(t,e){return null==e?M:u(e)},s.nice=function(t,e){var n=h();return(t=T(t,n[0],n[n.length-1],e))?h(Ai(n,t)):s},s.copy=function(){return xi(s,Bf(t,e,r,i,a,f,c,o,u))},s}function If(){var t,e,n,r,i,a=0,f=1,c=_i,o=!1;function u(e){return isNaN(e=+e)?i:c(0===n?.5:(e=(r(e)-t)*n,o?Math.max(0,Math.min(1,e)):e))}return u.domain=function(i){return arguments.length?(t=r(a=+i[0]),e=r(f=+i[1]),n=t===e?0:1/(e-t),u):[a,f]},u.clamp=function(t){return arguments.length?(o=!!t,u):o},u.interpolator=function(t){return arguments.length?(c=t,u):c},u.unknown=function(t){return arguments.length?(i=t,u):i},function(i){return r=i,t=i(a),e=i(f),n=t===e?0:1/(e-t),u}}function Hf(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function jf(){var t=zi(If());return t.copy=function(){return Hf(t,jf()).exponent(t.exponent())},ri.apply(t,arguments)}function Xf(){var t,e,n,r,i,a,f,c=0,o=.5,u=1,s=_i,l=!1;function h(t){return isNaN(t=+t)?f:(t=.5+((t=+a(t))-e)*(t<e?r:i),s(l?Math.max(0,Math.min(1,t)):t))}return h.domain=function(f){return arguments.length?(t=a(c=+f[0]),e=a(o=+f[1]),n=a(u=+f[2]),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),h):[c,o,u]},h.clamp=function(t){return arguments.length?(l=!!t,h):l},h.interpolator=function(t){return arguments.length?(s=t,h):s},h.unknown=function(t){return arguments.length?(f=t,h):f},function(f){return a=f,t=f(c),e=f(o),n=f(u),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),h}}function Vf(){var t=zi(Xf());return t.copy=function(){return Hf(t,Vf()).exponent(t.exponent())},ri.apply(t,arguments)}function Gf(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}var $f=Gf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Zf=Gf("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Wf=Gf("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Qf=Gf("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Jf=Gf("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Kf=Gf("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),tc=Gf("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ec=Gf("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),nc=Gf("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function rc(t){return Be(t[t.length-1])}var ic=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Gf),ac=rc(ic),fc=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Gf),cc=rc(fc),oc=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Gf),uc=rc(oc),sc=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Gf),lc=rc(sc),hc=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Gf),dc=rc(hc),bc=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Gf),pc=rc(bc),_c=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Gf),yc=rc(_c),gc=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Gf),vc=rc(gc),mc=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Gf),xc=rc(mc),wc=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Gf),Mc=rc(wc),Tc=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Gf),kc=rc(Tc),Ac=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Gf),Nc=rc(Ac),Sc=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Gf),Cc=rc(Sc),Ec=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Gf),Pc=rc(Ec),Dc=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Gf),Uc=rc(Dc),Fc=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Gf),Yc=rc(Fc),Rc=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Gf),Oc=rc(Rc),qc=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Gf),Lc=rc(qc),zc=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Gf),Bc=rc(zc),Ic=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Gf),Hc=rc(Ic),jc=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Gf),Xc=rc(jc),Vc=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Gf),Gc=rc(Vc),$c=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Gf),Zc=rc($c),Wc=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Gf),Qc=rc(Wc),Jc=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Gf),Kc=rc(Jc),to=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Gf),eo=rc(to),no=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Gf),ro=rc(no),io=on(Ue(300,.5,0),Ue(-240,.5,1)),ao=on(Ue(-100,.75,.35),Ue(80,1.5,.8)),fo=on(Ue(260,.75,.35),Ue(80,1.5,.8)),co=Ue();var oo=re(),uo=Math.PI/3,so=2*Math.PI/3;function lo(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var ho=lo(Gf("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),bo=lo(Gf("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),po=lo(Gf("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),_o=lo(Gf("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),yo=Math.PI,go=2*yo,vo=go-1e-6;function mo(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function xo(){return new mo}function wo(t){return function(){return t}}mo.prototype=xo.prototype={constructor:mo,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var a=this._x1,f=this._y1,c=n-t,o=r-e,u=a-t,s=f-e,l=u*u+s*s;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(l>1e-6)if(Math.abs(s*c-o*u)>1e-6&&i){var h=n-a,d=r-f,b=c*c+o*o,p=h*h+d*d,_=Math.sqrt(b),y=Math.sqrt(l),g=i*Math.tan((yo-Math.acos((b+l-p)/(2*_*y)))/2),v=g/y,m=g/_;Math.abs(v-1)>1e-6&&(this._+="L"+(t+v*u)+","+(e+v*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>u*d)+","+(this._x1=t+m*c)+","+(this._y1=e+m*o)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,a){t=+t,e=+e;var f=(n=+n)*Math.cos(r),c=n*Math.sin(r),o=t+f,u=e+c,s=1^a,l=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+o+","+u:(Math.abs(this._x1-o)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+o+","+u),n&&(l<0&&(l=l%go+go),l>vo?this._+="A"+n+","+n+",0,1,"+s+","+(t-f)+","+(e-c)+"A"+n+","+n+",0,1,"+s+","+(this._x1=o)+","+(this._y1=u):l>1e-6&&(this._+="A"+n+","+n+",0,"+ +(l>=yo)+","+s+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Mo=Math.abs,To=Math.atan2,ko=Math.cos,Ao=Math.max,No=Math.min,So=Math.sin,Co=Math.sqrt,Eo=1e-12,Po=Math.PI,Do=Po/2,Uo=2*Po;function Fo(t){return t>=1?Do:t<=-1?-Do:Math.asin(t)}function Yo(t){return t.innerRadius}function Ro(t){return t.outerRadius}function Oo(t){return t.startAngle}function qo(t){return t.endAngle}function Lo(t){return t&&t.padAngle}function zo(t,e,n,r,i,a,f){var c=t-n,o=e-r,u=(f?a:-a)/Co(c*c+o*o),s=u*o,l=-u*c,h=t+s,d=e+l,b=n+s,p=r+l,_=(h+b)/2,y=(d+p)/2,g=b-h,v=p-d,m=g*g+v*v,x=i-a,w=h*p-b*d,M=(v<0?-1:1)*Co(Ao(0,x*x*m-w*w)),T=(w*v-g*M)/m,k=(-w*g-v*M)/m,A=(w*v+g*M)/m,N=(-w*g+v*M)/m,S=T-_,C=k-y,E=A-_,P=N-y;return S*S+C*C>E*E+P*P&&(T=A,k=N),{cx:T,cy:k,x01:-s,y01:-l,x11:T*(i/x-1),y11:k*(i/x-1)}}function Bo(t){this._context=t}function Io(t){return new Bo(t)}function Ho(t){return t[0]}function jo(t){return t[1]}function Xo(){var t=Ho,e=jo,n=wo(!0),r=null,i=Io,a=null;function f(f){var c,o,u,s=f.length,l=!1;for(null==r&&(a=i(u=xo())),c=0;c<=s;++c)!(c<s&&n(o=f[c],c,f))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+t(o,c,f),+e(o,c,f));if(u)return a=null,u+""||null}return f.x=function(e){return arguments.length?(t="function"==typeof e?e:wo(+e),f):t},f.y=function(t){return arguments.length?(e="function"==typeof t?t:wo(+t),f):e},f.defined=function(t){return arguments.length?(n="function"==typeof t?t:wo(!!t),f):n},f.curve=function(t){return arguments.length?(i=t,null!=r&&(a=i(r)),f):i},f.context=function(t){return arguments.length?(null==t?r=a=null:a=i(r=t),f):r},f}function Vo(){var t=Ho,e=null,n=wo(0),r=jo,i=wo(!0),a=null,f=Io,c=null;function o(o){var u,s,l,h,d,b=o.length,p=!1,_=new Array(b),y=new Array(b);for(null==a&&(c=f(d=xo())),u=0;u<=b;++u){if(!(u<b&&i(h=o[u],u,o))===p)if(p=!p)s=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),l=u-1;l>=s;--l)c.point(_[l],y[l]);c.lineEnd(),c.areaEnd()}p&&(_[u]=+t(h,u,o),y[u]=+n(h,u,o),c.point(e?+e(h,u,o):_[u],r?+r(h,u,o):y[u]))}if(d)return c=null,d+""||null}function u(){return Xo().defined(i).curve(f).context(a)}return o.x=function(n){return arguments.length?(t="function"==typeof n?n:wo(+n),e=null,o):t},o.x0=function(e){return arguments.length?(t="function"==typeof e?e:wo(+e),o):t},o.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:wo(+t),o):e},o.y=function(t){return arguments.length?(n="function"==typeof t?t:wo(+t),r=null,o):n},o.y0=function(t){return arguments.length?(n="function"==typeof t?t:wo(+t),o):n},o.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:wo(+t),o):r},o.lineX0=o.lineY0=function(){return u().x(t).y(n)},o.lineY1=function(){return u().x(t).y(r)},o.lineX1=function(){return u().x(e).y(n)},o.defined=function(t){return arguments.length?(i="function"==typeof t?t:wo(!!t),o):i},o.curve=function(t){return arguments.length?(f=t,null!=a&&(c=f(a)),o):f},o.context=function(t){return arguments.length?(null==t?a=c=null:c=f(a=t),o):a},o}function Go(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function $o(t){return t}Bo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Zo=Qo(Io);function Wo(t){this._curve=t}function Qo(t){function e(e){return new Wo(t(e))}return e._curve=t,e}function Jo(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Qo(t)):e()._curve},t}function Ko(){return Jo(Xo().curve(Zo))}function tu(){var t=Vo().curve(Zo),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Jo(n())},delete t.lineX0,t.lineEndAngle=function(){return Jo(r())},delete t.lineX1,t.lineInnerRadius=function(){return Jo(i())},delete t.lineY0,t.lineOuterRadius=function(){return Jo(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Qo(t)):e()._curve},t}function eu(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}Wo.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var nu=Array.prototype.slice;function ru(t){return t.source}function iu(t){return t.target}function au(t){var e=ru,n=iu,r=Ho,i=jo,a=null;function f(){var f,c=nu.call(arguments),o=e.apply(this,c),u=n.apply(this,c);if(a||(a=f=xo()),t(a,+r.apply(this,(c[0]=o,c)),+i.apply(this,c),+r.apply(this,(c[0]=u,c)),+i.apply(this,c)),f)return a=null,f+""||null}return f.source=function(t){return arguments.length?(e=t,f):e},f.target=function(t){return arguments.length?(n=t,f):n},f.x=function(t){return arguments.length?(r="function"==typeof t?t:wo(+t),f):r},f.y=function(t){return arguments.length?(i="function"==typeof t?t:wo(+t),f):i},f.context=function(t){return arguments.length?(a=null==t?null:t,f):a},f}function fu(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function cu(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function ou(t,e,n,r,i){var a=eu(e,n),f=eu(e,n=(n+i)/2),c=eu(r,n),o=eu(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(f[0],f[1],c[0],c[1],o[0],o[1])}var uu={draw:function(t,e){var n=Math.sqrt(e/Po);t.moveTo(n,0),t.arc(0,0,n,0,Uo)}},su={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},lu=Math.sqrt(1/3),hu=2*lu,du={draw:function(t,e){var n=Math.sqrt(e/hu),r=n*lu;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},bu=Math.sin(Po/10)/Math.sin(7*Po/10),pu=Math.sin(Uo/10)*bu,_u=-Math.cos(Uo/10)*bu,yu={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=pu*n,i=_u*n;t.moveTo(0,-n),t.lineTo(r,i);for(var a=1;a<5;++a){var f=Uo*a/5,c=Math.cos(f),o=Math.sin(f);t.lineTo(o*n,-c*n),t.lineTo(c*r-o*i,o*r+c*i)}t.closePath()}},gu={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},vu=Math.sqrt(3),mu={draw:function(t,e){var n=-Math.sqrt(e/(3*vu));t.moveTo(0,2*n),t.lineTo(-vu*n,-n),t.lineTo(vu*n,-n),t.closePath()}},xu=Math.sqrt(3)/2,wu=1/Math.sqrt(12),Mu=3*(wu/2+1),Tu={draw:function(t,e){var n=Math.sqrt(e/Mu),r=n/2,i=n*wu,a=r,f=n*wu+n,c=-a,o=f;t.moveTo(r,i),t.lineTo(a,f),t.lineTo(c,o),t.lineTo(-.5*r-xu*i,xu*r+-.5*i),t.lineTo(-.5*a-xu*f,xu*a+-.5*f),t.lineTo(-.5*c-xu*o,xu*c+-.5*o),t.lineTo(-.5*r+xu*i,-.5*i-xu*r),t.lineTo(-.5*a+xu*f,-.5*f-xu*a),t.lineTo(-.5*c+xu*o,-.5*o-xu*c),t.closePath()}},ku=[uu,su,du,gu,yu,mu,Tu];function Au(){}function Nu(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Su(t){this._context=t}function Cu(t){this._context=t}function Eu(t){this._context=t}function Pu(t,e){this._basis=new Su(t),this._beta=e}Su.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Nu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Cu.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Eu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Nu(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Pu.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],f=t[n]-i,c=e[n]-a,o=-1;++o<=n;)r=o/n,this._basis.point(this._beta*t[o]+(1-this._beta)*(i+r*f),this._beta*e[o]+(1-this._beta)*(a+r*c));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Du=function t(e){function n(t){return 1===e?new Su(t):new Pu(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Uu(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Fu(t,e){this._context=t,this._k=(1-e)/6}Fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Uu(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Uu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Yu=function t(e){function n(t){return new Fu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ru(t,e){this._context=t,this._k=(1-e)/6}Ru.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Uu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ou=function t(e){function n(t){return new Ru(t,e)}return n.tension=function(e){return t(+e)},n}(0);function qu(t,e){this._context=t,this._k=(1-e)/6}qu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Uu(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Lu=function t(e){function n(t){return new qu(t,e)}return n.tension=function(e){return t(+e)},n}(0);function zu(t,e,n){var r=t._x1,i=t._y1,a=t._x2,f=t._y2;if(t._l01_a>Eo){var c=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,o=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*c-t._x0*t._l12_2a+t._x2*t._l01_2a)/o,i=(i*c-t._y0*t._l12_2a+t._y2*t._l01_2a)/o}if(t._l23_a>Eo){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/s,f=(f*u+t._y1*t._l23_2a-n*t._l12_2a)/s}t._context.bezierCurveTo(r,i,a,f,t._x2,t._y2)}function Bu(t,e){this._context=t,this._alpha=e}Bu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:zu(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Iu=function t(e){function n(t){return e?new Bu(t,e):new Fu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Hu(t,e){this._context=t,this._alpha=e}Hu.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:zu(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ju=function t(e){function n(t){return e?new Hu(t,e):new Ru(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Xu(t,e){this._context=t,this._alpha=e}Xu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:zu(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vu=function t(e){function n(t){return e?new Xu(t,e):new qu(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gu(t){this._context=t}function $u(t){return t<0?-1:1}function Zu(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),f=(n-t._y1)/(i||r<0&&-0),c=(a*i+f*r)/(r+i);return($u(a)+$u(f))*Math.min(Math.abs(a),Math.abs(f),.5*Math.abs(c))||0}function Wu(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Qu(t,e,n){var r=t._x0,i=t._y0,a=t._x1,f=t._y1,c=(a-r)/3;t._context.bezierCurveTo(r+c,i+c*e,a-c,f-c*n,a,f)}function Ju(t){this._context=t}function Ku(t){this._context=new ts(t)}function ts(t){this._context=t}function es(t){this._context=t}function ns(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),f=new Array(r);for(i[0]=0,a[0]=2,f[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,f[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,f[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,f[e]-=n*f[e-1];for(i[r-1]=f[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(f[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function rs(t,e){this._context=t,this._t=e}function is(t,e){if((i=t.length)>1)for(var n,r,i,a=1,f=t[e[0]],c=f.length;a<i;++a)for(r=f,f=t[e[a]],n=0;n<c;++n)f[n][1]+=f[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function as(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function fs(t,e){return t[e]}function cs(t){var e=t.map(os);return as(t).sort(function(t,n){return e[t]-e[n]})}function os(t){for(var e,n=-1,r=0,i=t.length,a=-1/0;++n<i;)(e=+t[n][1])>a&&(a=e,r=n);return r}function us(t){var e=t.map(ss);return as(t).sort(function(t,n){return e[t]-e[n]})}function ss(t){for(var e,n=0,r=-1,i=t.length;++r<i;)(e=+t[r][1])&&(n+=e);return n}Gu.prototype={areaStart:Au,areaEnd:Au,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Ju.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Qu(this,this._t0,Wu(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Qu(this,Wu(this,n=Zu(this,t,e)),n);break;default:Qu(this,this._t0,n=Zu(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Ku.prototype=Object.create(Ju.prototype)).point=function(t,e){Ju.prototype.point.call(this,e,t)},ts.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}},es.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=ns(t),i=ns(e),a=0,f=1;f<n;++a,++f)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],t[f],e[f]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},rs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}},t.bisect=i,t.bisectRight=i,t.bisectLeft=a,t.ascending=e,t.bisector=n,t.cross=function(t,e,n){var r,i,a,c,o=t.length,u=e.length,s=new Array(o*u);for(null==n&&(n=f),r=a=0;r<o;++r)for(c=t[r],i=0;i<u;++i,++a)s[a]=n(c,e[i]);return s},t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=u,t.extent=s,t.histogram=function(){var t=p,e=s,n=M;function r(r){var a,f,c=r.length,o=new Array(c);for(a=0;a<c;++a)o[a]=t(r[a],a,r);var u=e(o),s=u[0],l=u[1],h=n(o,s,l);Array.isArray(h)||(h=w(s,l,h),h=_(Math.ceil(s/h)*h,l,h));for(var d=h.length;h[0]<=s;)h.shift(),--d;for(;h[d-1]>l;)h.pop(),--d;var b,p=new Array(d+1);for(a=0;a<=d;++a)(b=p[a]=[]).x0=a>0?h[a-1]:s,b.x1=a<d?h[a]:l;for(a=0;a<c;++a)s<=(f=o[a])&&f<=l&&p[i(h,f,0,d)].push(r[a]);return p}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:b(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:b([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?b(h.call(t)):b(t),r):n},r},t.thresholdFreedmanDiaconis=function(t,n,r){return t=d.call(t,c).sort(e),Math.ceil((r-n)/(2*(T(t,.75)-T(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,e,n){return Math.ceil((n-e)/(3.5*u(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=M,t.max=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(n=t[a])&&n>=n)for(r=n;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else for(;++a<i;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=n;++a<i;)null!=(n=e(t[a],a,t))&&n>r&&(r=n);return r},t.mean=function(t,e){var n,r=t.length,i=r,a=-1,f=0;if(null==e)for(;++a<r;)isNaN(n=c(t[a]))?--i:f+=n;else for(;++a<r;)isNaN(n=c(e(t[a],a,t)))?--i:f+=n;if(i)return f/i},t.median=function(t,n){var r,i=t.length,a=-1,f=[];if(null==n)for(;++a<i;)isNaN(r=c(t[a]))||f.push(r);else for(;++a<i;)isNaN(r=c(n(t[a],a,t)))||f.push(r);return T(f.sort(e),.5)},t.merge=function(t){for(var e,n,r,i=t.length,a=-1,f=0;++a<i;)f+=t[a].length;for(n=new Array(f);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--f]=r[e];return n},t.min=k,t.pairs=function(t,e){null==e&&(e=f);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return a},t.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},t.quantile=T,t.range=_,t.scan=function(t,n){if(r=t.length){var r,i,a=0,f=0,c=t[f];for(null==n&&(n=e);++a<r;)(n(i=t[a],c)<0||0!==n(c,c))&&(c=i,f=a);return 0===n(c,c)?f:void 0}},t.shuffle=function(t,e,n){for(var r,i,a=(null==n?t.length:n)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,r=t[a+e],t[a+e]=t[i+e],t[i+e]=r;return t},t.sum=function(t,e){var n,r=t.length,i=-1,a=0;if(null==e)for(;++i<r;)(n=+t[i])&&(a+=n);else for(;++i<r;)(n=+e(t[i],i,t))&&(a+=n);return a},t.ticks=m,t.tickIncrement=x,t.tickStep=w,t.transpose=A,t.variance=o,t.zip=function(){return A(arguments)},t.axisTop=function(t){return q(E,t)},t.axisRight=function(t){return q(P,t)},t.axisBottom=function(t){return q(D,t)},t.axisLeft=function(t){return q(U,t)},t.brush=function(){return yr(fr)},t.brushX=function(){return yr(ir)},t.brushY=function(){return yr(ar)},t.brushSelection=function(t){var e=t.__brush;return e?e.dim.output(e.selection):null},t.dsvFormat=Nr,t.csvParse=Cr,t.csvParseRows=Er,t.csvFormat=Pr,t.csvFormatBody=Dr,t.csvFormatRows=Ur,t.tsvParse=Yr,t.tsvParseRows=Rr,t.tsvFormat=Or,t.tsvFormatBody=qr,t.tsvFormatRows=Lr,t.autoType=function(t){for(var e in t){var n,r=t[e].trim();if(r)if("true"===r)r=!0;else if("false"===r)r=!1;else if("NaN"===r)r=NaN;else if(isNaN(n=+r)){if(!/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/.test(r))continue;r=new Date(r)}else r=n;else r=null;t[e]=r}return t},t.formatDefaultLocale=Jr,t.formatLocale=Qr,t.formatSpecifier=jr,t.precisionFixed=Kr,t.precisionPrefix=ti,t.precisionRound=ei,t.scaleBand=di,t.scalePoint=function(){return function t(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return t(n())},e}(di.apply(null,arguments).paddingInner(1))},t.scaleIdentity=function t(e){var n;function r(t){return isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=ui.call(t,bi),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?ui.call(e,bi):[0,1],ki(r)},t.scaleLinear=function t(){var e=Mi(_i,_i);return e.copy=function(){return xi(e,t())},ni.apply(e,arguments),ki(e)},t.scaleLog=function t(){var e=Ui(wi()).domain([1,10]);return e.copy=function(){return xi(e,t()).base(e.base())},ni.apply(e,arguments),e},t.scaleSymlog=function t(){var e=Ri(wi());return e.copy=function(){return xi(e,t()).constant(e.constant())},ni.apply(e,arguments)},t.scaleOrdinal=hi,t.scaleImplicit=li,t.scalePow=Bi,t.scaleSqrt=function(){return Bi.apply(null,arguments).exponent(.5)},t.scaleQuantile=function t(){var n,r=[],a=[],f=[];function c(){var t=0,e=Math.max(1,a.length);for(f=new Array(e-1);++t<e;)f[t-1]=T(r,t/e);return o}function o(t){return isNaN(t=+t)?n:a[i(f,t)]}return o.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:[e>0?f[e-1]:r[0],e<f.length?f[e]:r[r.length-1]]},o.domain=function(t){if(!arguments.length)return r.slice();r=[];for(var n,i=0,a=t.length;i<a;++i)null==(n=t[i])||isNaN(n=+n)||r.push(n);return r.sort(e),c()},o.range=function(t){return arguments.length?(a=si.call(t),c()):a.slice()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.quantiles=function(){return f.slice()},o.copy=function(){return t().domain(r).range(a).unknown(n)},ni.apply(o,arguments)},t.scaleQuantize=function t(){var e,n=0,r=1,a=1,f=[.5],c=[0,1];function o(t){return t<=t?c[i(f,t,0,a)]:e}function u(){var t=-1;for(f=new Array(a);++t<a;)f[t]=((t+1)*r-(t-a)*n)/(a+1);return o}return o.domain=function(t){return arguments.length?(n=+t[0],r=+t[1],u()):[n,r]},o.range=function(t){return arguments.length?(a=(c=si.call(t)).length-1,u()):c.slice()},o.invertExtent=function(t){var e=c.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,f[0]]:e>=a?[f[a-1],r]:[f[e-1],f[e]]},o.unknown=function(t){return arguments.length?(e=t,o):o},o.thresholds=function(){return f.slice()},o.copy=function(){return t().domain([n,r]).range(c).unknown(e)},ni.apply(ki(o),arguments)},t.scaleThreshold=function t(){var e,n=[.5],r=[0,1],a=1;function f(t){return t<=t?r[i(n,t,0,a)]:e}return f.domain=function(t){return arguments.length?(n=si.call(t),a=Math.min(n.length,r.length-1),f):n.slice()},f.range=function(t){return arguments.length?(r=si.call(t),a=Math.min(n.length,r.length-1),f):r.slice()},f.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},f.unknown=function(t){return arguments.length?(e=t,f):e},f.copy=function(){return t().domain(n).range(r).unknown(e)},ni.apply(f,arguments)},t.scaleTime=function(){return ni.apply(Bf(ra,na,Ki,Qi,Wi,Zi,$i,Xi,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return ni.apply(Bf(ha,la,oa,fa,aa,ia,$i,Xi,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scaleSequential=function t(){var e=ki(If()(_i));return e.copy=function(){return Hf(e,t())},ri.apply(e,arguments)},t.scaleSequentialLog=function t(){var e=Ui(If()).domain([1,10]);return e.copy=function(){return Hf(e,t()).base(e.base())},ri.apply(e,arguments)},t.scaleSequentialPow=jf,t.scaleSequentialSqrt=function(){return jf.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var e=Ri(If());return e.copy=function(){return Hf(e,t()).constant(e.constant())},ri.apply(e,arguments)},t.scaleSequentialQuantile=function t(){var n=[],r=_i;function a(t){if(!isNaN(t=+t))return r((i(n,t)-1)/(n.length-1))}return a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(var r,i=0,f=t.length;i<f;++i)null==(r=t[i])||isNaN(r=+r)||n.push(r);return n.sort(e),a},a.interpolator=function(t){return arguments.length?(r=t,a):r},a.copy=function(){return t(r).domain(n)},ri.apply(a,arguments)},t.scaleDiverging=function t(){var e=ki(Xf()(_i));return e.copy=function(){return Hf(e,t())},ri.apply(e,arguments)},t.scaleDivergingLog=function t(){var e=Ui(Xf()).domain([.1,1,10]);return e.copy=function(){return Hf(e,t()).base(e.base())},ri.apply(e,arguments)},t.scaleDivergingPow=Vf,t.scaleDivergingSqrt=function(){return Vf.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var e=Ri(Xf());return e.copy=function(){return Hf(e,t()).constant(e.constant())},ri.apply(e,arguments)},t.tickFormat=Ti,t.schemeCategory10=$f,t.schemeAccent=Zf,t.schemeDark2=Wf,t.schemePaired=Qf,t.schemePastel1=Jf,t.schemePastel2=Kf,t.schemeSet1=tc,t.schemeSet2=ec,t.schemeSet3=nc,t.interpolateBrBG=ac,t.schemeBrBG=ic,t.interpolatePRGn=cc,t.schemePRGn=fc,t.interpolatePiYG=uc,t.schemePiYG=oc,t.interpolatePuOr=lc,t.schemePuOr=sc,t.interpolateRdBu=dc,t.schemeRdBu=hc,t.interpolateRdGy=pc,t.schemeRdGy=bc,t.interpolateRdYlBu=yc,t.schemeRdYlBu=_c,t.interpolateRdYlGn=vc,t.schemeRdYlGn=gc,t.interpolateSpectral=xc,t.schemeSpectral=mc,t.interpolateBuGn=Mc,t.schemeBuGn=wc,t.interpolateBuPu=kc,t.schemeBuPu=Tc,t.interpolateGnBu=Nc,t.schemeGnBu=Ac,t.interpolateOrRd=Cc,t.schemeOrRd=Sc,t.interpolatePuBuGn=Pc,t.schemePuBuGn=Ec,t.interpolatePuBu=Uc,t.schemePuBu=Dc,t.interpolatePuRd=Yc,t.schemePuRd=Fc,t.interpolateRdPu=Oc,t.schemeRdPu=Rc,t.interpolateYlGnBu=Lc,t.schemeYlGnBu=qc,t.interpolateYlGn=Bc,t.schemeYlGn=zc,t.interpolateYlOrBr=Hc,t.schemeYlOrBr=Ic,t.interpolateYlOrRd=Xc,t.schemeYlOrRd=jc,t.interpolateBlues=Gc,t.schemeBlues=Vc,t.interpolateGreens=Zc,t.schemeGreens=$c,t.interpolateGreys=Qc,t.schemeGreys=Wc,t.interpolatePurples=Kc,t.schemePurples=Jc,t.interpolateReds=eo,t.schemeReds=to,t.interpolateOranges=ro,t.schemeOranges=no,t.interpolateCubehelixDefault=io,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return co.h=360*t-100,co.s=1.5-1.5*e,co.l=.8-.9*e,co+""},t.interpolateWarm=ao,t.interpolateCool=fo,t.interpolateSinebow=function(t){var e;return t=(.5-t)*Math.PI,oo.r=255*(e=Math.sin(t))*e,oo.g=255*(e=Math.sin(t+uo))*e,oo.b=255*(e=Math.sin(t+so))*e,oo+""},t.interpolateViridis=ho,t.interpolateMagma=bo,t.interpolateInferno=po,t.interpolatePlasma=_o,t.create=function(t){return Et(G(t).call(document.documentElement))},t.creator=G,t.local=Dt,t.matcher=J,t.mouse=Rt,t.namespace=V,t.namespaces=X,t.clientPoint=Yt,t.select=Et,t.selectAll=function(t){return"string"==typeof t?new St([document.querySelectorAll(t)],[document.documentElement]):new St([null==t?[]:t],Nt)},t.selection=Ct,t.selector=Z,t.selectorAll=Q,t.style=ft,t.touch=function(t,e,n){arguments.length<3&&(n=e,e=Ft().changedTouches);for(var r,i=0,a=e?e.length:0;i<a;++i)if((r=e[i]).identifier===n)return Yt(t,r);return null},t.touches=function(t,e){null==e&&(e=Ft().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n<r;++n)i[n]=Yt(t,e[n]);return i},t.window=at,t.customEvent=kt,t.arc=function(){var t=Yo,e=Ro,n=wo(0),r=null,i=Oo,a=qo,f=Lo,c=null;function o(){var o,u,s,l=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Do,b=a.apply(this,arguments)-Do,p=Mo(b-d),_=b>d;if(c||(c=o=xo()),h<l&&(u=h,h=l,l=u),h>Eo)if(p>Uo-Eo)c.moveTo(h*ko(d),h*So(d)),c.arc(0,0,h,d,b,!_),l>Eo&&(c.moveTo(l*ko(b),l*So(b)),c.arc(0,0,l,b,d,_));else{var y,g,v=d,m=b,x=d,w=b,M=p,T=p,k=f.apply(this,arguments)/2,A=k>Eo&&(r?+r.apply(this,arguments):Co(l*l+h*h)),N=No(Mo(h-l)/2,+n.apply(this,arguments)),S=N,C=N;if(A>Eo){var E=Fo(A/l*So(k)),P=Fo(A/h*So(k));(M-=2*E)>Eo?(x+=E*=_?1:-1,w-=E):(M=0,x=w=(d+b)/2),(T-=2*P)>Eo?(v+=P*=_?1:-1,m-=P):(T=0,v=m=(d+b)/2)}var D=h*ko(v),U=h*So(v),F=l*ko(w),Y=l*So(w);if(N>Eo){var R,O=h*ko(m),q=h*So(m),L=l*ko(x),z=l*So(x);if(p<Po&&(R=function(t,e,n,r,i,a,f,c){var o=n-t,u=r-e,s=f-i,l=c-a,h=l*o-s*u;if(!(h*h<Eo))return[t+(h=(s*(e-a)-l*(t-i))/h)*o,e+h*u]}(D,U,L,z,O,q,F,Y))){var B=D-R[0],I=U-R[1],H=O-R[0],j=q-R[1],X=1/So(((s=(B*H+I*j)/(Co(B*B+I*I)*Co(H*H+j*j)))>1?0:s<-1?Po:Math.acos(s))/2),V=Co(R[0]*R[0]+R[1]*R[1]);S=No(N,(l-V)/(X-1)),C=No(N,(h-V)/(X+1))}}T>Eo?C>Eo?(y=zo(L,z,D,U,h,C,_),g=zo(O,q,F,Y,h,C,_),c.moveTo(y.cx+y.x01,y.cy+y.y01),C<N?c.arc(y.cx,y.cy,C,To(y.y01,y.x01),To(g.y01,g.x01),!_):(c.arc(y.cx,y.cy,C,To(y.y01,y.x01),To(y.y11,y.x11),!_),c.arc(0,0,h,To(y.cy+y.y11,y.cx+y.x11),To(g.cy+g.y11,g.cx+g.x11),!_),c.arc(g.cx,g.cy,C,To(g.y11,g.x11),To(g.y01,g.x01),!_))):(c.moveTo(D,U),c.arc(0,0,h,v,m,!_)):c.moveTo(D,U),l>Eo&&M>Eo?S>Eo?(y=zo(F,Y,O,q,l,-S,_),g=zo(D,U,L,z,l,-S,_),c.lineTo(y.cx+y.x01,y.cy+y.y01),S<N?c.arc(y.cx,y.cy,S,To(y.y01,y.x01),To(g.y01,g.x01),!_):(c.arc(y.cx,y.cy,S,To(y.y01,y.x01),To(y.y11,y.x11),!_),c.arc(0,0,l,To(y.cy+y.y11,y.cx+y.x11),To(g.cy+g.y11,g.cx+g.x11),_),c.arc(g.cx,g.cy,S,To(g.y11,g.x11),To(g.y01,g.x01),!_))):c.arc(0,0,l,w,x,_):c.lineTo(F,Y)}else c.moveTo(0,0);if(c.closePath(),o)return c=null,o+""||null}return o.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Po/2;return[ko(r)*n,So(r)*n]},o.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:wo(+e),o):t},o.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:wo(+t),o):e},o.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:wo(+t),o):n},o.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:wo(+t),o):r},o.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:wo(+t),o):i},o.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:wo(+t),o):a},o.padAngle=function(t){return arguments.length?(f="function"==typeof t?t:wo(+t),o):f},o.context=function(t){return arguments.length?(c=null==t?null:t,o):c},o},t.area=Vo,t.line=Xo,t.pie=function(){var t=$o,e=Go,n=null,r=wo(0),i=wo(Uo),a=wo(0);function f(f){var c,o,u,s,l,h=f.length,d=0,b=new Array(h),p=new Array(h),_=+r.apply(this,arguments),y=Math.min(Uo,Math.max(-Uo,i.apply(this,arguments)-_)),g=Math.min(Math.abs(y)/h,a.apply(this,arguments)),v=g*(y<0?-1:1);for(c=0;c<h;++c)(l=p[b[c]=c]=+t(f[c],c,f))>0&&(d+=l);for(null!=e?b.sort(function(t,n){return e(p[t],p[n])}):null!=n&&b.sort(function(t,e){return n(f[t],f[e])}),c=0,u=d?(y-h*v)/d:0;c<h;++c,_=s)o=b[c],s=_+((l=p[o])>0?l*u:0)+v,p[o]={data:f[o],index:c,value:l,startAngle:_,endAngle:s,padAngle:g};return p}return f.value=function(e){return arguments.length?(t="function"==typeof e?e:wo(+e),f):t},f.sortValues=function(t){return arguments.length?(e=t,n=null,f):e},f.sort=function(t){return arguments.length?(n=t,e=null,f):n},f.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:wo(+t),f):r},f.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:wo(+t),f):i},f.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:wo(+t),f):a},f},t.areaRadial=tu,t.radialArea=tu,t.lineRadial=Ko,t.radialLine=Ko,t.pointRadial=eu,t.linkHorizontal=function(){return au(fu)},t.linkVertical=function(){return au(cu)},t.linkRadial=function(){var t=au(ou);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=wo(uu),e=wo(64),n=null;function r(){var r;if(n||(n=r=xo()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:wo(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:wo(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r},t.symbols=ku,t.symbolCircle=uu,t.symbolCross=su,t.symbolDiamond=du,t.symbolSquare=gu,t.symbolStar=yu,t.symbolTriangle=mu,t.symbolWye=Tu,t.curveBasisClosed=function(t){return new Cu(t)},t.curveBasisOpen=function(t){return new Eu(t)},t.curveBasis=function(t){return new Su(t)},t.curveBundle=Du,t.curveCardinalClosed=Ou,t.curveCardinalOpen=Lu,t.curveCardinal=Yu,t.curveCatmullRomClosed=ju,t.curveCatmullRomOpen=Vu,t.curveCatmullRom=Iu,t.curveLinearClosed=function(t){return new Gu(t)},t.curveLinear=Io,t.curveMonotoneX=function(t){return new Ju(t)},t.curveMonotoneY=function(t){return new Ku(t)},t.curveNatural=function(t){return new es(t)},t.curveStep=function(t){return new rs(t,.5)},t.curveStepAfter=function(t){return new rs(t,1)},t.curveStepBefore=function(t){return new rs(t,0)},t.stack=function(){var t=wo([]),e=as,n=is,r=fs;function i(i){var a,f,c=t.apply(this,arguments),o=i.length,u=c.length,s=new Array(u);for(a=0;a<u;++a){for(var l,h=c[a],d=s[a]=new Array(o),b=0;b<o;++b)d[b]=l=[0,+r(i[b],h,b,i)],l.data=i[b];d.key=h}for(a=0,f=e(s);a<u;++a)s[f[a]].index=a;return n(s,f),s}return i.keys=function(e){return arguments.length?(t="function"==typeof e?e:wo(nu.call(e)),i):t},i.value=function(t){return arguments.length?(r="function"==typeof t?t:wo(+t),i):r},i.order=function(t){return arguments.length?(e=null==t?as:"function"==typeof t?t:wo(nu.call(t)),i):e},i.offset=function(t){return arguments.length?(n=null==t?is:t,i):n},i},t.stackOffsetExpand=function(t,e){if((r=t.length)>0){for(var n,r,i,a=0,f=t[0].length;a<f;++a){for(i=n=0;n<r;++n)i+=t[n][a][1]||0;if(i)for(n=0;n<r;++n)t[n][a][1]/=i}is(t,e)}},t.stackOffsetDiverging=function(t,e){if((c=t.length)>0)for(var n,r,i,a,f,c,o=0,u=t[e[0]].length;o<u;++o)for(a=f=0,n=0;n<c;++n)(i=(r=t[e[n]][o])[1]-r[0])>=0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=f,r[0]=f+=i):r[0]=a},t.stackOffsetNone=is,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],a=i.length;r<a;++r){for(var f=0,c=0;f<n;++f)c+=t[f][r][1]||0;i[r][1]+=i[r][0]=-c/2}is(t,e)}},t.stackOffsetWiggle=function(t,e){if((i=t.length)>0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,a=0,f=1;f<r;++f){for(var c=0,o=0,u=0;c<i;++c){for(var s=t[e[c]],l=s[f][1]||0,h=(l-(s[f-1][1]||0))/2,d=0;d<c;++d){var b=t[e[d]];h+=(b[f][1]||0)-(b[f-1][1]||0)}o+=l,u+=h*l}n[f-1][1]+=n[f-1][0]=a,o&&(a-=u/o)}n[f-1][1]+=n[f-1][0]=a,is(t,e)}},t.stackOrderAppearance=cs,t.stackOrderAscending=us,t.stackOrderDescending=function(t){return us(t).reverse()},t.stackOrderInsideOut=function(t){var e,n,r=t.length,i=t.map(ss),a=cs(t),f=0,c=0,o=[],u=[];for(e=0;e<r;++e)n=a[e],f<c?(f+=i[n],o.push(n)):(c+=i[n],u.push(n));return u.reverse().concat(o)},t.stackOrderNone=as,t.stackOrderReverse=function(t){return as(t).reverse()},t.timeFormatDefaultLocale=Cf,t.timeFormatLocale=_a,t.isoFormat=Ef,t.isoParse=Pf,Object.defineProperty(t,"__esModule",{value:!0})});
</script>
</body>
</html>