Skip to content

Commit 6b4cb73

Browse files
committed
Added a ‘Journey’ sample diagram
1 parent 2f0f804 commit 6b4cb73

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

build/constants.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ labels relativesize 100
212212
name: 'Basic Budget',
213213
flows: "// Enter Flows between Nodes, like this:\n// Source [AMOUNT] Target\n\nWages [1500] Budget\nOther [250] Budget\n\nBudget [450] Taxes\nBudget [420] Housing\nBudget [400] Food\nBudget [295] Transportation\nBudget [25] Savings\n\n// You can set a Node's color, like this:\n:Budget #708090\n// ...or a color for a single Flow:\nBudget [160] Other Necessities #0F0\n\n// Use the controls below to customize\n// your diagram's appearance...",
214214
settings: {
215+
size_h: 600,
215216
size_w: 600,
216217
node_w: 12,
217218
node_h: 50,
@@ -228,6 +229,7 @@ labels relativesize 100
228229
labels_highlight: 0.8,
229230
labels_magnify: 100,
230231
labels_relativesize: 110,
232+
labelvalue_appears: 'y',
231233
labelvalue_position: 'below',
232234
themeoffset_a: 9,
233235
value_prefix: '',
@@ -237,8 +239,9 @@ labels relativesize 100
237239
// Ranked-choice election:
238240
['election', {
239241
name: 'Ranked Election',
240-
flows: '// Sample Ranked Election diagram\n\nGH\\nRound 1 [300000] GH\\nRound 2\nEF\\nRound 1 [220000] EF\\nRound 2\nCD\\nRound 1 [200000] CD\\nRound 2\nAB\\nRound 1 [10000] GH\\nRound 2\nAB\\nRound 1 [25000] EF\\nRound 2\nAB\\nRound 1 [20000] CD\\nRound 2\n\nGH\\nRound 2 [310000] GH\\nRound 3\\nProjected Winner\nEF\\nRound 2 [245000] EF\\nRound 3\nCD\\nRound 2 [50000] GH\\nRound 3\\nProjected Winner\nCD\\nRound 2 [95000] EF\\nRound 3\n\n// This line sets a custom gray color:\n:No further votes #555 <<\nAB\\nRound 1 [20000] No further votes\nCD\\nRound 2 [75000] No further votes',
242+
flows: '// Sample Ranked Election diagram\n\nGH\\nRound 1 [300000] GH\\nRound 2\nEF\\nRound 1 [220000] EF\\nRound 2\nCD\\nRound 1 [200000] CD\\nRound 2\nAB\\nRound 1 [10000] GH\\nRound 2\nAB\\nRound 1 [25000] EF\\nRound 2\nAB\\nRound 1 [20000] CD\\nRound 2\n\nGH\\nRound 2 [310000] GH\\nRound 3\\nProjected Winner\nEF\\nRound 2 [245000] EF\\nRound 3\nCD\\nRound 2 [50000] GH\\nRound 3\\nProjected Winner\nCD\\nRound 2 [95000] EF\\nRound 3\n\n// This line sets a custom gray color:\n:No further votes #555 <<\nCD\\nRound 2 [75000] No further votes\nAB\\nRound 1 [20000] No further votes',
241243
settings: {
244+
size_h: 600,
242245
size_w: 700,
243246
node_w: 10,
244247
node_h: 76,
@@ -255,6 +258,7 @@ labels relativesize 100
255258
labels_highlight: 0.8,
256259
labels_magnify: 105,
257260
labels_relativesize: 110,
261+
labelvalue_appears: 'y',
258262
labelvalue_position: 'below',
259263
themeoffset_a: 9,
260264
value_prefix: '',
@@ -266,6 +270,7 @@ labels relativesize 100
266270
name: 'Job Search',
267271
flows: '// Sample Job Search diagram:\n\nApplications [4] 1st Interviews\nApplications [9] Rejected\nApplications [4] No Answer\n\n1st Interviews [2] 2nd Interviews\n1st Interviews [2] No Offer\n\n2nd Interviews [2] Offers\n\nOffers [1] Accepted\nOffers [1] Declined',
268272
settings: {
273+
size_h: 600,
269274
size_w: 700,
270275
node_w: 8,
271276
node_h: 60,
@@ -282,6 +287,7 @@ labels relativesize 100
282287
labels_highlight: 0.55,
283288
labels_magnify: 95,
284289
labels_relativesize: 120,
290+
labelvalue_appears: 'y',
285291
labelvalue_position: 'above',
286292
themeoffset_a: 6,
287293
value_prefix: '',
@@ -293,6 +299,7 @@ labels relativesize 100
293299
name: 'Financial Results',
294300
flows: '// Sample Financial Results diagram:\n\nDivisionA [900] Revenue\nDivisionB [750] Revenue\nDivisionC [150] Revenue\n\nRevenue [800] Cost of Sales\nRevenue [1000] Gross Profit\n\nGross Profit [10] Amortization\nGross Profit [640] Selling, General &\\nAdministration\nGross Profit [350] Operating Profit\n\nOperating Profit [90] Tax\nOperating Profit [260] Net Profit\n\n// Profit - blue\n:Gross Profit #48e <<\n:Operating Profit #48e <<\n:Net Profit #48e <<\n\n// Expenses - rust\n:Tax #d97 <<\n:Selling, General &\\nAdministration #d97 <<\n:Amortization #d97 <<\n\n// Cost - gray\n:Cost of Sales #bbb <<\n\n// main Revenue node: dark grey\n:Revenue #555',
295301
settings: {
302+
size_h: 600,
296303
size_w: 900,
297304
node_w: 20,
298305
node_h: 75,
@@ -309,6 +316,7 @@ labels relativesize 100
309316
labels_highlight: 0.8,
310317
labels_magnify: 113,
311318
labels_relativesize: 116,
319+
labelvalue_appears: 'y',
312320
labelvalue_position: 'below',
313321
themeoffset_b: 3,
314322
value_prefix: '$',
@@ -320,6 +328,7 @@ labels relativesize 100
320328
name: 'Start Simple',
321329
flows: 'a [1] b\na [1] c',
322330
settings: {
331+
size_h: 600,
323332
size_w: 600,
324333
node_w: 12,
325334
node_h: 50,
@@ -336,11 +345,42 @@ labels relativesize 100
336345
labels_highlight: 0.75,
337346
labels_magnify: 100,
338347
labels_relativesize: 100,
348+
labelvalue_appears: 'y',
339349
labelvalue_position: 'after',
340350
value_prefix: '',
341351
},
342352
}],
343353

354+
// Stable, traceable journey:
355+
['journey', {
356+
name: 'Journey',
357+
flows: '// List each player\'s moves all at once\n// Use one color for each player\n// Use an amount of 1 for each move\n// Check "Using the exact input order" below\n\n// Experiment with reordering players!\n\n:Player 1: #76a\nPlayer 1: [1] 1A #76a\n1A [1] 2C #76a\n2C [1] 3E #76a\n3E [1] Player 1 #76a\n:Player 1 #76a\n\n:Player 2: #e37\nPlayer 2: [1] 1B #e37\n1B [1] 2D #e37\n2D [1] 3E #e37\n3E [1] Player 2 #e37\n:Player 2 #e37\n\n:Player 3: #bb2\nPlayer 3: [1] 1A #bb2\n1A [1] 2D #bb2\n2D [1] 3E #bb2\n3E [1] Player 3 #bb2\n:Player 3 #bb2\n',
358+
settings: {
359+
size_h: 400,
360+
size_w: 600,
361+
node_w: 12,
362+
node_h: 23,
363+
node_spacing: 46,
364+
node_border: 0,
365+
node_theme: 'none',
366+
node_color: '#777777',
367+
flow_inheritfrom: 'outside-in',
368+
layout_justifyends: 'y',
369+
layout_order: 'exact',
370+
labelname_size: 16,
371+
labelname_weight: 400,
372+
labelposition_scheme: 'auto',
373+
labelposition_autoalign: 0,
374+
labels_highlight: 0.75,
375+
labels_magnify: 100,
376+
labels_relativesize: 100,
377+
labelvalue_appears: 'n',
378+
labelvalue_position: 'below',
379+
themeoffset_a: 9,
380+
value_prefix: '',
381+
},
382+
}],
383+
344384
// A variation of the inputs for the original d3 energy diagram, now found
345385
// at https://observablehq.com/@d3/sankey:
346386
// (This will become another button at some point.)

build/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ <h4>Sample Diagrams &amp; Starting Points:
5050
<button type="button" id="load_example_job_search" onclick="replaceGraph('job_search'); return false;">Job Search</button>
5151
<button type="button" id="load_example_election" onclick="replaceGraph('election'); return false;">Ranked Election</button>
5252
<!-- <button type="button" id="load_example_energy_all" onclick="replaceGraph('energy_flows_all'); return false;">Energy Flows</button> &nbsp; -->
53-
<button type="button" id="load_example_basic_budget" onclick="replaceGraph('default_budget'); return false;">Budget (Default)</button>
53+
<button type="button" id="load_example_journey" onclick="replaceGraph('journey'); return false;">Journey</button>
54+
<button type="button" id="load_example_basic_budget" onclick="replaceGraph('default_budget'); return false;">Budget</button>
5455
</h4>
5556

5657
<p id="replace_graph_warning" style="display: none;">

0 commit comments

Comments
 (0)