-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
650 lines (562 loc) · 38.2 KB
/
index.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
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1">
<title>Sankey Diagram Creator</title>
<link rel="stylesheet" href="build.css">
<script defer src="https://cdn.jsdelivr.net/npm/d3@7/dist/d3.min.js" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/canvg@3/lib/umd.js" crossorigin="anonymous"></script>
<script defer src="constants.js"></script>
<script defer src="sankey.js"></script>
<script defer src="lz-string.min.js"></script>
<script defer src="sankeymatic.js"></script>
<meta name="description" content="Make beautiful Sankey diagrams. Export them as images or SVG with this free data visualization tool." />
<meta property="og:title" content="SankeyMATIC: Build a Sankey Diagram" />
<meta property="og:type" content="website" />
<meta property="og:description" content="Make beautiful flow diagrams. Export them as images or SVG." />
<meta property="og:locale" content="en_US" />
<meta property="og:image" content="https://sankeymatic.com/build/i/2024-01-04-card-image.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="2700" />
<meta property="og:image:height" content="1350" />
<meta property="og:image:alt" content="Screenshot of the SankeyMATIC diagram-building interface" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@SankeyMATIC" />
<meta name="twitter:creator" content="@nowthis" />
</head>
<body>
<header class="header vs f-middle">
<nav class="header__nav hs-sm-vs space-between">
<a href="/" title="SankeyMATIC home page" class="header__logo hs f-middle align-center"><img alt="SankeyMATIC logo" src="i/SKM-trsp-300.png" height="27" width="27" class="skm_logo_small" /> Dglobal Sankey Diagram Creator</a>
</nav>
</header>
<div class="callout-container pad-small">Remember that if you wish to share the diagram via a link the recipient must be within Dglobal's internal network, otherwise they will not be able to access the resource.</div>
<main>
<div id="example_diagrams" class="text_center">
<h4>Sample Diagrams & Starting Points:
<button type="button" id="load_example_simple" onclick="replaceGraph('simple_start'); return false;">Start Simple</button>
<button type="button" id="load_example_financial_results" onclick="replaceGraph('financial_results'); return false;">Financial Results</button>
<button type="button" id="load_example_job_search" onclick="replaceGraph('job_search'); return false;">Job Search</button>
<button type="button" id="load_example_election" onclick="replaceGraph('election'); return false;">Ranked Election</button>
<!-- <button type="button" id="load_example_energy_all" onclick="replaceGraph('energy_flows_all'); return false;">Energy Flows</button> -->
<button type="button" id="load_example_journey" onclick="replaceGraph('journey'); return false;">Journey</button>
<button type="button" id="load_example_basic_budget" onclick="replaceGraph('default_budget'); return false;">Budget</button>
</h4>
<p id="replace_graph_warning" style="display: none;">
<em>This will <strong>erase</strong> your changes. Are you sure?</em><br />
<input type="hidden" id="demo_graph_chosen" value="" />
<button type="button" id="replace_graph_yes" onclick="replaceGraphConfirmed(); return false;">Yes, replace the diagram</button>
<button type="button" id="replace_graph_no" onclick="hideReplaceGraphWarning(); return false;">Cancel</button>
</p>
</div>
<div class="center_basic">
<form id="skm_form" onsubmit="process_sankey(); return false;">
<table><tr><td>
<table class="center_basic">
<tr>
<td id="other_entry">
<h2 class="ui_head" onclick="togglePanel('input_options');">
<span id="input_options_indicator" class="indicator">–</span>
Inputs<span id="input_options_hint">:</span></h2>
<div id="input_options" class="text_center grid_sidebar_right">
<div>
<textarea id="flows_in" title="Diagram Inputs" rows="19" cols="40" class="font_sans" onchange="process_sankey();" onkeyup="debounced_process_sankey();">// Enter Flows between Nodes, like this:
// Source [AMOUNT] Target
Wages [1500] Budget
Other [250] Budget
Budget [450] Taxes
Budget [420] Housing
Budget [400] Food
Budget [295] Transportation
Budget [25] Savings
// You can set a Node's color, like this:
:Budget #708090
// ...or a color for a single Flow:
Budget [160] Other Necessities #0F0
// Use the controls below to customize
// your diagram's appearance...</textarea>
</div>
<div class="separated_stack">
<div class="top_center_self"><button id="preview_graph" type="submit">Show ></button></div>
<div class="bottom_center_self">
<button id="save_my_work_button" type="submit" class="loadsave_button"
onclick="saveDiagramToFile(); return false;"
title="Save the current diagram and settings to a local text file">Save my<br />work <strong>↘</strong></button>
<p>
<input type="file" id="load_diagram_from_file"
accept=".txt,.text,.skm,text/plain"
class="hidden_under"
onchange="loadDiagramFile(); return null;" />
<label id="load_diagram_button" for="load_diagram_from_file" role="button"
class="label_as_button loadsave_button"
title="Load a diagram definition from a text file"><strong>↖</strong> Load<br />from file</label></p>
</div>
</div>
<p class="form_elements3 grid_entire_row">
<strong>Arrange the diagram:</strong><br />
<span><input name="layout_order" id="layout_order_automatic" value="automatic" type="radio" onchange="process_sankey();" checked="checked" /><label for="layout_order_automatic" class="ropt">Automatically</label></span>
<span><input name="layout_order" id="layout_order_exact" value="exact" type="radio" onchange="process_sankey();" class="spaced_checkbox" /><label for="layout_order_exact" class="ropt">Using the exact input order</label></span>
</p>
</div>
<!-- LABELS -->
<datalist id="tick100"><option value="100"></option></datalist>
<datalist id="tick400"><option value="400"></option></datalist>
<datalist id="tick-align">
<option value="-1">Before</option>
<option value="0">Centered</option>
<option value="1">After</option>
</datalist>
<datalist id="tick-stages">
<option value="2"></option><option value="3"></option>
<option value="4"></option><option value="5"></option>
<option value="6"></option><option value="7"></option>
<option value="8"></option><option value="9"></option>
<option value="10"></option><option value="11"></option>
<option value="12"></option><option value="13"></option>
<option value="14"></option><option value="15"></option>
</datalist>
<h2 class="ui_head" onclick="togglePanel('label_options');">
<span id="label_options_indicator" class="indicator">+</span>
Labels<span id="label_options_hint">...</span></h2>
<div id="label_options" class="form_chunk" style="display: none;">
<div class="vs b-pad indented">
<div class="hs align-baseline gap-medium">
<span><input type="checkbox" id="labelname_appears" value="1" onchange="process_sankey();" checked="checked">
<label for="labelname_appears" class="ropt">Show <strong>Names</strong></label></span>
<span class="no_wrap" onmouseover="revealVal('labelname_weight');" onmouseout="fadeVal('labelname_weight');"><label for="labelname_weight" class="sr-only">Style for Node Names</label>
<span class="smalllabel font_light">Light</span><span class="output_container"><input id="labelname_weight" class="slider_xsmall" type="range" min="100" max="700" step="300" value="400" list="tick400" onfocus="revealVal('labelname_weight');" onblur="fadeVal('labelname_weight');" oninput="updateOutput('labelname_weight'); process_sankey();" onchange="process_sankey();"><output id="labelname_weight_val" for="labelname_weight" class="fade-init output_6">-</output></span><span class="smalllabel font_bolder">Bold</span></span>
</div>
<div class="hs align-baseline gap-medium">
<span><input type="checkbox" id="labelvalue_appears" value="1" onchange="process_sankey();" checked="checked">
<label for="labelvalue_appears" class="ropt">Show <strong>Values</strong></label></span>
<span class="no_wrap" onmouseover="revealVal('labelvalue_weight');" onmouseout="fadeVal('labelvalue_weight');"><label for="labelvalue_weight" class="sr-only">Style for Node Values</label>
<span class="smalllabel font_light">Light</span><span class="output_container"><input id="labelvalue_weight" class="slider_xsmall" type="range" min="100" max="700" step="300" value="400" list="tick400" onfocus="revealVal('labelvalue_weight');" onblur="fadeVal('labelvalue_weight');" oninput="updateOutput('labelvalue_weight'); process_sankey();" onchange="process_sankey();"><output id="labelvalue_weight_val" for="labelvalue_weight" class="fade-init output_6">-</output></span><span class="smalllabel font_bolder">Bold</span></span>
</div>
</div>
<div class="hs gap-medium indented align-baseline b-pad">
<span>
<strong>Font:</strong>
<span class="no_wrap"><input name="labels_fontface" type="radio" id="sans_serif" value="sans-serif" checked="checked" onchange="process_sankey();" /><label for="sans_serif" class="ropt font_sans">sans</label></span>
<span class="no_wrap"><input name="labels_fontface" type="radio" id="serif" value="serif" onchange="process_sankey();" /><label for="serif" class="ropt font_serif">serif</label></span>
<span class="no_wrap"><input name="labels_fontface" type="radio" id="monospace" value="monospace" onchange="process_sankey();" /><label for="monospace" class="ropt font_mono">mono</label></span>
</span>
<span><label for="labels_color"><strong>Color:</strong></label> <input type="color" id="labels_color" size="7" maxlength="7" value="#000000" onchange="process_sankey();"></span>
</div>
<details open><summary><strong>Sizes</strong></summary>
<div class="vs gap-small align-center">
<div class="hs align-center justify-center gap-large b-divider">
<div class="vs align-center">
<label for="labelname_size"><strong>Base Size:</strong></label>
<input id="labelname_size" type="number" class="number_100s" min="6" step="0.5" value="16" onchange="process_sankey();"></div>
<div class="vs align-center text_center" onmouseover="revealVal('labels_relativesize');" onmouseout="fadeVal('labels_relativesize');">
<label for="labels_relativesize" title="Set relative size of Names and Values">Magnify:</label>
<div class="hs align-center gap-small no_wrap">
<div class="align-center"><strong>Names</strong></div>
<span class="output_container"><input id="labels_relativesize" class="slider_small" type="range" min="50" max="150" value="110" list="tick100" onfocus="revealVal('labels_relativesize');" onblur="fadeVal('labels_relativesize');" oninput="updateOutput('labels_relativesize'); process_sankey();" onchange="process_sankey();"><output id="labels_relativesize_val" for="labels_relativesize" class="fade-init output_12">-</output></span>
<div class="align-center"><strong>Values</strong></div>
</div>
</div>
</div>
<div class="vs align-center justify-center text_center b-divider" onmouseover="revealVal('labels_magnify');" onmouseout="fadeVal('labels_magnify');">
<label for="labels_magnify">Show larger labels for:</label>
<div class="hs justify-center gap-small no_wrap">
<div class="align-center"><strong>Small</strong><br />Amounts</div>
<span class="output_container"><input id="labels_magnify" class="slider_medium" type="range" min="50" max="150" value="100" list="tick100" onfocus="revealVal('labels_magnify');" onblur="fadeVal('labels_magnify');" oninput="updateOutput('labels_magnify'); process_sankey();" onchange="process_sankey();"><output id="labels_magnify_val" for="labels_magnify" class="fade-init output_12">-</output></span>
<div class="align-center"><strong>Large</strong><br />Amounts</div>
</div>
</div>
<div class="hs gap-small" onmouseover="revealVal('labels_linespacing');" onmouseout="fadeVal('labels_linespacing');">
<label for="labels_linespacing" id="spacing_fld_label"><strong>Line Spacing:</strong></label>
<span class="nowrap">
<span class="smalllabel">Min</span>
<span class="output_container"><input id="labels_linespacing" class="slider_medium" type="range" min="0.0" max="1.0" step="0.05" value="0.2" onfocus="revealVal('labels_linespacing');" onblur="fadeVal('labels_linespacing');" oninput="updateOutput('labels_linespacing'); process_sankey();" onchange="process_sankey();"><output id="labels_linespacing_val" for="labels_linespacing" class="fade-init output_3">-</output></span>
<span class="smalllabel">Max</span>
</span>
</div>
<div class="text_center">Add line breaks inside labels using <code>\n</code></div>
</div>
</details><!-- End Sizes -->
<details><summary><strong>Placement</strong></summary>
<div>
<div class="vs align-center">
<div class="vs gap-small">
<fieldset class="simple">
<span class="no_wrap"><input name="labelposition_scheme" type="radio" id="label_scheme_auto" value="auto" onchange="process_sankey();" checked="checked" /><label for="label_scheme_auto" class="ropt"><strong>Automatic</strong></label></span>
<div class="hs align-center justify-center gap-small l-pad">
<div class="indented l-pad" style="max-width: 20em;">
When a Node has an <strong>empty side</strong>, place its label there.
<div class="vs align-center justify-center text_center" onmouseover="revealVal('labelposition_autoalign');" onmouseout="fadeVal('labelposition_autoalign');">
<label for="labelposition_autoalign" style="line-height: 2;">When neither side is empty, place labels:</label>
<div class="hs align-center justify-center gap-small">
<div class="align-center no_wrap"><strong>Before</strong><br />the Node</div>
<span class="output_container"><input id="labelposition_autoalign" class="slider_medium" type="range" min="-1" max="1" step="1" value="0" onfocus="revealVal('labelposition_autoalign');" onblur="fadeVal('labelposition_autoalign');" oninput="updateOutput('labelposition_autoalign'); checkRadio('label_scheme_auto'); process_sankey();" onchange="checkRadio('label_scheme_auto'); process_sankey();" list="tick-align"><output id="labelposition_autoalign_val" for="labelposition_autoalign" class="fade-init output_6">-</output></span>
<div class="align-center no_wrap"><strong>After</strong><br />the Node</div>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset class="simple">
<span class="no_wrap"><input name="labelposition_scheme" type="radio" id="label_scheme_perstage" value="per_stage" onchange="process_sankey();" /><label for="label_scheme_perstage" class="ropt"><strong>Per Stage</strong></label></span>
<div class="hs align-center justify-center gap-small t-pad b-divider">
<span class="text_right">Place labels for<br /> the <strong>first stage</strong>:</span>
<div class="vs">
<span class="no_wrap"><input name="labelposition_first" type="radio" id="label_first_before" value="before" onchange="checkRadio('label_scheme_perstage'); process_sankey();" checked="checked" /><label for="label_first_before" class="ropt">Before the Nodes</label></span>
<span class="no_wrap"><input name="labelposition_first" type="radio" id="label_first_after" value="after" onchange="checkRadio('label_scheme_perstage'); process_sankey();" /><label for="label_first_after" class="ropt">After the Nodes</label></span>
</div>
</div>
<div class="vs align-center justify-center text_center" onmouseover="revealVal('labelposition_breakpoint');" onmouseout="fadeVal('labelposition_breakpoint');">
<label for="labelposition_breakpoint" style="line-height: 2;">Place labels on the <strong>opposite side</strong> starting at:</label>
<div class="hs align-center justify-center gap-small">
<span class="no_wrap">Stage <strong>2</strong></span><span class="output_container"><input id="labelposition_breakpoint" class="slider_medium" type="range" min="2" max="4" step="1" value="4" onfocus="revealVal('labelposition_breakpoint');" onblur="fadeVal('labelposition_breakpoint');" oninput="updateOutput('labelposition_breakpoint'); checkRadio('label_scheme_perstage'); process_sankey();" onchange="checkRadio('label_scheme_perstage'); process_sankey();" list="tick-stages"><output id="labelposition_breakpoint_val" for="labelposition_breakpoint" class="fade-init output_12">-</output></span><span>(Never)</span>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</details> <!-- End Placement -->
<details><summary><strong>Arrange Names & Values</strong></summary>
<div class="vs justify-center align-center gap-small">
<div class="hs justify-center align-center gap-small b-pad">
<div class="hs align-center gap-small">
<div class="vs gap-small">
<div class="hs align-center">
<input name="labelvalue_position" type="radio" id="labelvalue_after" value="after" onchange="process_sankey();" /><label for="labelvalue_after" class="ropt rrect arr-option">Examples: 100</label>
</div>
<div class="hs align-center">
<input name="labelvalue_position" type="radio" id="labelvalue_below" value="below" onchange="process_sankey();" checked="checked" /><label for="labelvalue_below" class="ropt rrect arr-option">Examples<br />100</label>
</div>
</div>
<div class="vs gap-small">
<div class="hs align-center">
<input name="labelvalue_position" type="radio" id="labelvalue_before" value="before" onchange="process_sankey();" /><label for="labelvalue_before" class="ropt rrect arr-option">100 Examples</label>
</div>
<div class="hs align-center">
<input name="labelvalue_position" type="radio" id="labelvalue_above" value="above" onchange="process_sankey();" /><label for="labelvalue_above" class="ropt rrect arr-option">100<br />Examples</label>
</div>
</div>
</div>
</div>
<div class="hs gap-medium space-around align-center bg-darker pad-medium" onmouseover="revealVal('labels_highlight');" onmouseout="fadeVal('labels_highlight');">
<label for="labels_highlight" class="highlight_fld_label"><strong>Highlights:</strong></label>
<div><span class="smalllabel">0</span><span class="output_container"><input id="labels_highlight" class="slider_small" type="range" min="0" max="0.9" step="0.05" value="0.75" onfocus="revealVal('labels_highlight');" onblur="fadeVal('labels_highlight');" oninput="updateOutput('labels_highlight'); process_sankey();" onchange="process_sankey();"><output id="labels_highlight_val" for="labels_highlight" class="fade-init output_3">-</output></span><span class="smalllabel highlight_fld_label">Max</span>
</div>
</div>
<span><input type="checkbox" id="labels_hide" value="1" onchange="process_sankey();"><label for="labels_hide" class="ropt">Temporarily Hide Labels</label></span>
</div>
</details> <!-- End Arrange Names & Values -->
<details><summary><strong>Number Format</strong></summary>
<div class="hs align-center gap-small space-around">
<div class="vs gap-small">
<span><label for="value_prefix">Prefix:</label> <input type="text" id="value_prefix" size="4" maxlength="10" onchange="process_sankey();"></span>
<span><label for="value_suffix">Suffix:</label> <input type="text" id="value_suffix" size="4" maxlength="10" onchange="process_sankey();"></span>
</div>
<div class="text_center">
<label for="value_format">Format:</label>
<select id="value_format" onchange="process_sankey();">
<option value=",." selected="selected">1,000,000.00</option>
<option value=".,">1.000.000,00</option>
<option value=" .">1 000 000.00</option>
<option value=" ,">1 000 000,00</option>
<option value="X.">1000000.00</option>
<option value="X,">1000000,00</option>
</select>
<br />
<span><input type="checkbox" id="labelvalue_fullprecision" value="1" onchange="process_sankey();" checked="checked">
<label for="labelvalue_fullprecision" class="ropt">Show trailing 0s <small>(best for currency)</small></label></span>
</div>
</div>
</details> <!-- End Number Format -->
</div> <!-- End LABELS -->
<!-- NODES -->
<h2 class="ui_head" onclick="togglePanel('node_options');">
<span id="node_options_indicator" class="indicator">–</span>
Nodes<span id="node_options_hint">:</span></h2>
<!-- tabindex="0" -->
<div id="node_options" class="form_chunk">
<p class="form_elements1">
<span class="no_wrap" onmouseover="revealVal('node_h');" onmouseout="fadeVal('node_h');">
<label for="node_h"><strong>Height:</strong></label>
.<span class="output_container"><input id="node_h" class="slider_small" type="range" min="0" max="100" step="0.5" value="50" onfocus="revealVal('node_h');" onblur="fadeVal('node_h');" oninput="updateOutput('node_h'); process_sankey();" onchange="process_sankey();"><output id="node_h_val" for="node_h" class="fade-init output_6">-</output></span>|</span>
<span class="no_wrap" onmouseover="revealVal('node_spacing');" onmouseout="fadeVal('node_spacing');">
<label for="node_spacing" class="spaced_label"><strong>Spacing:</strong></label>
<span class="smalllabel">0</span><span class="output_container"><input id="node_spacing" class="slider_small" type="range" min="0" max="100" step="0.5" value="75" onfocus="revealVal('node_spacing');" onblur="fadeVal('node_spacing');" oninput="updateOutput('node_spacing'); process_sankey();" onchange="process_sankey();"><output id="node_spacing_val" for="node_spacing" class="fade-init output_6">-</output></span><span class="smalllabel">Max</span></span>
</p>
<p class="form_elements2">
<span class="no_wrap"><label for="node_w"><strong>Width:</strong></label>
<input id="node_w" type="number" class="number_100s" min="0" value="12" step="1" onchange="process_sankey();"></span>
<span class="no_wrap"><label for="node_border" class="spaced_label"><strong>Border:</strong></label>
<input id="node_border" type="number" class="number_10s" min="0" value="0" step="1" onchange="process_sankey();"></span>
<span class="no_wrap" onmouseover="revealVal('node_opacity');" onmouseout="fadeVal('node_opacity');">
<label for="node_opacity" class="spaced_label"><strong>Opacity:</strong></label>
<span class="smalllabel">0</span><span class="output_container"><input id="node_opacity" class="slider_xxsmall" type="range" min="0" max="1" step="0.05" value="1.0" onfocus="revealVal('node_opacity');" onblur="fadeVal('node_opacity');" oninput="updateOutput('node_opacity'); process_sankey();" onchange="process_sankey();"><output id="node_opacity_val" for="node_opacity" class="fade-init output_3">-</output></span><span class="smalllabel">1</span></span>
</p>
<fieldset class="form_elements1">
<legend>Default Node Colors</legend>
<div class="fieldset_contents">
Use <input name="node_theme" type="radio" id="node_theme_none" value="none" onchange="process_sankey();" /><label for="node_theme_none" class="ropt">one color:</label>
<input type="color" id="node_color" title="Single Node Color" size="7" maxlength="7" value="#888888" onchange="checkRadio('node_theme_none'); process_sankey();"> or a Theme:<br />
<table id="color_themes">
<tr>
<td>
<span id="theme_a" class="theme_container">
<input name="node_theme" type="radio" id="theme_a_radio" value="a" onchange="process_sankey();" checked="checked" /><label id="theme_a_label" for="theme_a_radio" class="ropt"></label>
</span>
</td>
<td>
<span class="no_wrap">
<button id="theme_a_rotate_left" type="submit" title="Rotate theme colors left" onclick="nudgeColorTheme('a',1); return false;"><</button>
<span id="theme_a_guide"></span><input type="hidden" id="themeoffset_a" value="9">
<button id="theme_a_rotate_right" type="submit" title="Rotate theme colors right" onclick="nudgeColorTheme('a',-1); return false;">></button>
</span>
</td>
</tr>
<tr>
<td>
<span id="theme_b" class="theme_container">
<input name="node_theme" type="radio" id="theme_b_radio" value="b" onchange="process_sankey();" /><label id="theme_b_label" for="theme_b_radio" class="ropt"></label>
</span>
</td>
<td>
<span class="no_wrap">
<button id="theme_b_rotate_left" type="submit" title="Rotate theme colors left" onclick="nudgeColorTheme('b',1); return false;"><</button>
<span id="theme_b_guide"></span><input type="hidden" id="themeoffset_b" value="0">
<button id="theme_b_rotate_right" type="submit" title="Rotate theme colors right" onclick="nudgeColorTheme('b',-1); return false;">></button>
</span>
</td>
</tr>
<tr>
<td>
<span id="theme_c" class="theme_container">
<input name="node_theme" type="radio" id="theme_c_radio" value="c" onchange="process_sankey();" /><label id="theme_c_label" for="theme_c_radio" class="ropt"></label>
</span>
</td>
<td>
<span class="no_wrap">
<button id="theme_c_rotate_left" type="submit" title="Rotate theme colors left" onclick="nudgeColorTheme('c',1); return false;"><</button>
<span id="theme_c_guide"></span><input type="hidden" id="themeoffset_c" value="0">
<button id="theme_c_rotate_right" type="submit" title="Rotate theme colors right" onclick="nudgeColorTheme('c',-1); return false;">></button>
</span>
</td>
</tr>
<tr>
<td>
<span id="theme_d" class="theme_container">
<input name="node_theme" type="radio" id="theme_d_radio" value="d" onchange="process_sankey();" /><label id="theme_d_label" for="theme_d_radio" class="ropt"></label>
</span>
</td>
<td>
<span class="no_wrap">
<button id="theme_d_rotate_left" type="submit" title="Rotate theme colors left" onclick="nudgeColorTheme('d',1); return false;"><</button>
<span id="theme_d_guide"></span><input type="hidden" id="themeoffset_d" value="0">
<button id="theme_d_rotate_right" type="submit" title="Rotate theme colors right" onclick="nudgeColorTheme('d',-1); return false;">></button>
</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div> <!-- End NODES -->
<!-- FLOWS -->
<h2 class="ui_head" onclick="togglePanel('flow_options');">
<span id="flow_options_indicator" class="indicator">–</span>
Flows<span id="flow_options_hint">:</span></h2>
<div id="flow_options" class="form_chunk">
<p class="form_elements1">
<span class="no_wrap" onmouseover="revealVal('flow_opacity');" onmouseout="fadeVal('flow_opacity');">
<label for="flow_opacity"><strong>Opacity:</strong></label>
<span class="smalllabel">0</span><span class="output_container"><input id="flow_opacity" class="slider_xsmall" type="range" min="0" max="1" step="0.05" value="0.45" onfocus="revealVal('flow_opacity');" onblur="fadeVal('flow_opacity');" oninput="updateOutput('flow_opacity'); process_sankey();" onchange="process_sankey();"><output id="flow_opacity_val" for="flow_opacity" class="fade-init output_3">-</output></span><span class="smalllabel">1</span></span>
<span class="no_wrap" onmouseover="revealVal('flow_curvature');" onmouseout="fadeVal('flow_curvature');">
<label for="flow_curvature" class="spaced_label"><strong>Curviness:</strong></label>
|<span class="output_container"><input id="flow_curvature" class="slider_small" type="range" min="0.1" max="0.9" step="0.04" value="0.5" onfocus="revealVal('flow_curvature');" onblur="fadeVal('flow_curvature');" oninput="updateOutput('flow_curvature'); process_sankey();" onchange="process_sankey();"><output id="flow_curvature_val" for="flow_curvature" class="fade-init output_3">-</output></span>(</span>
</p>
<fieldset class="form_elements2">
<legend>Default Flow Colors</legend>
<div class="fieldset_contents">
Use <input name="flow_inheritfrom" type="radio" id="flow_inherit_none" value="none" onchange="process_sankey();" /><label for="flow_inherit_none" class="ropt">one color:</label>
<input type="color" id="flow_color" title="Single Flow Color" size="7" maxlength="7" value="#999999" onchange="checkRadio('flow_inherit_none'); process_sankey();" /> or colors from:<br />
<span class="no_wrap"><input name="flow_inheritfrom" type="radio" id="flow_inherit_from_source" value="source" onchange="process_sankey();" /><label class="ropt" for="flow_inherit_from_source">each flow's Source</label></span>
<span class="no_wrap"><input name="flow_inheritfrom" type="radio" id="flow_inherit_from_target" value="target" onchange="process_sankey();" /><label class="ropt" for="flow_inherit_from_target">each flow's Target</label></span>
<br />
<span class="no_wrap"><input name="flow_inheritfrom" type="radio" id="flow_inherit_outside_in" value="outside-in" onchange="process_sankey();" checked="checked" /><label class="ropt" for="flow_inherit_outside_in">the outermost nodes (flowing in)</label></span>
</div>
</fieldset>
</div> <!-- End FLOWS -->
<!-- LAYOUT OPTIONS -->
<h2 class="ui_head" onclick="togglePanel('layout_options');" id="layout_options_section">
<span id="layout_options_indicator" class="indicator">+</span>
Layout Options<span id="layout_options_hint">...</span></h2>
<div id="layout_options" class="form_chunk" style="display: none;">
<div class="form_elements1 text_center">
<small>Note: these options only apply to diagrams<br /> with 3 or more columns of nodes:</small>
<table style="width: 100%;"><tr>
<td>
<input type="checkbox" id="layout_justifyorigins" value="1" onchange="process_sankey();"><br />
<label for="layout_justifyorigins" class="ropt">Place all<br /> flow <strong>origins</strong><br /> at the <strong>left</strong> edge</label>
</td>
<td class="text_right">
<input type="checkbox" id="layout_justifyends" value="1" onchange="process_sankey();"><br />
<label for="layout_justifyends" class="spaced_label ropt">Place all<br /> flow <strong>endpoints</strong><br /> at the <strong>right</strong> edge</label>
</td>
</tr></table>
</div>
<p class="form_elements2 text_center">
<input type="checkbox" id="layout_reversegraph" value="1" onchange="process_sankey();">
<label for="layout_reversegraph" class="ropt"><strong>Reverse the graph</strong> (flow right-to-left)</label>
</p>
<p class="form_elements1 text_center">
<strong>Diagram Scale</strong> = <span id="scale_figures"></span><br />
For fair comparisons <em>between</em> diagrams:<br />
1) Use the same units for each, and 2) Make their<br />
Diagram Scales match as closely as possible.
</p>
<h3 class="ui_head" onclick="togglePanel('debug_options');"><span id="debug_options_indicator" class="indicator">+</span>Tools for Debugging<span id="debug_options_hint">...</span></h3>
<div id="debug_options" class="form_chunk" style="display: none;">
<div class="form_elements1">
<span class="no_wrap" onmouseover="revealVal('internal_iterations');" onmouseout="fadeVal('internal_iterations');">
<label for="internal_iterations" class="spaced_label"><strong># of Layout Iterations:</strong></label>
<span class="smalllabel">0</span>
<span class="output_container"><input id="internal_iterations" class="slider_small" type="range" min="0" max="30" step="1" value="25" onfocus="revealVal('internal_iterations');" onblur="fadeVal('internal_iterations');" oninput="updateOutput('internal_iterations'); process_sankey();" onchange="process_sankey();"><output id="internal_iterations_val" for="internal_iterations" class="fade-init output_3">-</output></span>
<span class="smalllabel">30</span>
</span>
</div>
<div class="form_elements2">
<input type="checkbox" id="internal_revealshadows" value="1" onchange="process_sankey();" class="spaced_checkbox"><label for="internal_revealshadows" class="ropt">Reveal Shadow Nodes</label>
</div>
</div>
</div> <!-- End LAYOUT -->
</td>
</tr>
</table> <!-- End Left Column -->
</td><td id="grapharea">
<!-- EXPORT -->
<div class="expandable_box">
<p id="download_central" class="share-box">
<strong class="padded-inline">Share:</strong>
<button id="share_button" type="submit" onclick="openGetLinkDialog(); return false;" title="See options for generating a link to this diagram" class="padded-inline"><strong>Get a public link...</strong></button>
<span class="padded-inline">or</span>
<button id="save_as_png_2x" type="submit" title="PNG image file: 1200 x 1200" onclick="saveDiagramAsPNG(2); return false;"><strong>Save as a .PNG image</strong></button>
<span class="toggleable" onclick="togglePanel('png_size_options');" title="Select to choose another resolution">
<span id="png_size_options_indicator" class="indicator1">+</span>
<small>more</small><span id="png_size_options_hint">...</span></span>
<span id="png_size_options" style="display: none;">
<button id="save_as_png_4x" type="submit" title="PNG image file: 2400 x 2400" onclick="saveDiagramAsPNG(4); return false;"><strong>Large</strong> (4x)</button>
<button id="save_as_png_6x" type="submit" title="PNG image file: 3600 x 3600" onclick="saveDiagramAsPNG(6); return false;"><strong>Huge</strong> (6x)</button>
<button id="save_as_png_1x" type="submit" title="PNG image file: 600 x 600" onclick="saveDiagramAsPNG(1); return false;"><strong>Tiny</strong> (1x)</button>
</span>
<span class="padded-inline">or</span>
<button id="save_as_svg" type="submit" title="Save this diagram as a Scalable Vector Graphics file" onclick="saveDiagramAsSVG(); return false;"><strong>Download .SVG</strong></button>
</p>
<dialog id="getLinkDialog">
<header>
<h3>Get a public link to this SankeyMATIC diagram</h3>
<button onclick="closeDialog('getLink');" id="closeDialogHeader">✕</button>
</header>
<section class="text_center">
<div class="center_basic">
<div class="warning-note">
<p class="text_left"><strong>Please note:</strong> If your diagram contains <strong>sensitive or private data</strong>, we recommend that you <em><strong>DO NOT USE</strong></em> this public-linking feature to save or share your work.</p>
<details class="indented">
<summary><em><u>Learn more...</u></em></summary>
<p class="text_left">Visiting the link below will potentially expose the data you have entered to <strong>any observer</strong> who can see your Internet traffic, up to and including the SankeyMATIC server itself (which, like all web servers, keeps a record of every visited link).</p>
<p class="text_left">Instead, you can use the "<strong>Save my work</strong>" and "<strong>Load from file</strong>" buttons to save & reload a diagram in progress <em>without</em> sending a copy of your data beyond your own web browser.</p>
</details>
</div>
</div>
<div class="vspace">
<p class="text_left"><strong>Your diagram's public link:</strong></p>
<div id="generatedLink" class="long-link-area text_left" contenteditable="true">(generating link...)</div>
<div class="hs align-start space-around">
<p style="max-width: 25em;">Visiting this link will take anyone to the 'Build' interface and fill in the same data and settings you have now.</p>
<p class="text_center"><button id="copyLinkButton" class="loadsave_button" onclick="copyGeneratedLink(); return false;">⧉ Copy Public Link</button><br /><span id="copiedMsg"></span></p>
</div>
</div>
</section>
<footer>
<button onclick="closeDialog('getLink');" id="closeDialogFooter">Close</button>
</footer>
</dialog>
</div>
<!-- SIZE & SPACING & BACKGROUND -->
<div class="expandable_box">
<h2 class="ui_head" onclick="togglePanel('diagram_options');">
<span id="diagram_options_indicator" class="indicator">–</span>
Diagram Size & Background<span id="diagram_options_hint">:</span></h2>
<div id="diagram_options" class="form_chunk">
<p class="form_elements1">
<span class="no_wrap"><label for="size_w" title="Diagram Width in pixels"><strong>Width:</strong></label>
<input id="size_w" type="number" class="number_10000s" min="40" value="600" step="2" onchange="process_sankey();"></span>
<span class="no_wrap"><label for="size_h" class="spaced_label" title="Diagram Height in pixels"><strong>Height:</strong></label>
<input id="size_h" type="number" class="number_10000s" min="40" value="600" step="2" onchange="process_sankey();"></span>
<label for="bg_color" class="spaced_label"><strong>Background Color:</strong></label>
<input type="color" id="bg_color" size="7" maxlength="7" value="#FFFFFF" onchange="process_sankey();">
<input type="checkbox" id="bg_transparent" value="1" onchange="process_sankey();" class="spaced_checkbox"><label for="bg_transparent" class="ropt">Transparent</label><br />
</p>
<p class="form_elements2">
<strong>Margins:</strong>
<span class="no_wrap"><label for="margin_l" class="spaced_label">Left</label>
<input id="margin_l" type="number" class="number_100s" min="0" value="12" step="1" onchange="process_sankey();">
<label for="margin_r">Right</label>
<input id="margin_r" type="number" class="number_100s" min="0" value="12" step="1" onchange="process_sankey();"></span>
<span class="no_wrap"><label for="margin_t" class="spaced_label">Top</label>
<input id="margin_t" type="number" class="number_100s" min="0" value="18" step="1" onchange="process_sankey();">
<label for="margin_b">Bot</label>
<input id="margin_b" type="number" class="number_100s" min="0" value="20" step="1" onchange="process_sankey();"></span>
</p>
</div>
</div>
<!-- MOVING NODES -->
<p id="reset_moves_area" class="form_elements1">
Move Nodes by <em>dragging</em>. Double-click a Node to reset, or: <button type="button" id="reset_all_moved_nodes" onclick="resetMovesAndRender(); return false;">Reset all moved Nodes</button>
</p>
<div id="top_messages_container">
<div id="info_messages"></div>
<div id="issue_messages"></div>
</div>
<p id="chart">
<svg id="svg_scratch" height="600" width="600" xmlns="http://www.w3.org/2000/svg" class="hidden_under"></svg>
<svg id="sankey_svg" height="600" width="600" xmlns="http://www.w3.org/2000/svg"></svg>
</p>
<canvas id="png_preview" height="600" width="600" style="background-color: transparent; display: none;"></canvas>
<div id="chartfooter">
<p class="form_elements1 text_center">
<input type="checkbox" id="meta_mentionsankeymatic" value="1" onchange="process_sankey();" checked>
<label class="smalllabel ropt" for="meta_mentionsankeymatic">Include the copyright label</label>
</p>
</div>
<table id="messages" class="expandable_box">
<tr><td>
<div id="messages_area">
<h4>About this diagram</h4>
<div id="totals_area"></div>
</div>
</td></tr>
<tr><td id="imbalances_area">
<div id="imbalance_control">
<span class="underline"><strong><em>When Total Inputs ≠ Total Outputs:</em></strong></span><br>
<p class="form_elements3">
Attach incomplete flow groups to:<br>
<span><input name="layout_attachincompletesto" id="layout_attachto_leading" value="leading" type="radio" onchange="process_sankey();" /><label for="layout_attachto_leading" class="ropt">The leading edge of the Node</label></span><br>
<span><input name="layout_attachincompletesto" id="layout_attachto_trailing" value="trailing" type="radio" onchange="process_sankey();" /><label for="layout_attachto_trailing" class="ropt">The trailing edge of the Node</label></span><br>
<span><input name="layout_attachincompletesto" id="layout_attachto_nearest" value="nearest" type="radio" onchange="process_sankey();" checked="checked" /><label for="layout_attachto_nearest" class="ropt">The edge nearest to the flow group's center</label></span>
</p>
<p class="lastrow">
<input type="checkbox" id="meta_listimbalances" value="1" onchange="process_sankey();" checked="checked" />
<label class="ropt" for="meta_listimbalances">List all imbalanced Nodes</label>
</p>
<div id="imbalance_messages"></div>
</div>
</td></tr>
</table>
</td></tr></table> <!-- End SKM Form -->
</form>
</div>
<!-- ====================== Bottom Matter ====================== -->
</main>
<hr class="ad_divider" />
<div class="ad_center">
</div>
</body>
</html>