Route planner: the solver's options and odds drawn on the valley map
- New "Route Planner" tab: pick a dragon colour, a goal (only this dragon / best odds this run) and a data sample. The solver runs in the browser from policy.json and walks the valley: every decision shows each option's chance of bonding the colour (with the best play afterwards) and of reaching an encounter alive; every roll shows its probabilities; deaths show where they happen; "stays best in N% of re-runs" and "no clear winner" flag noisy recommendations. Click any option on the map or in the list to explore another branch. - solver.js: values now carry P(reaching an encounter alive); advisor.step() gives the planner the next decision, roll or outcome at any history. - valley.js shares its painting with the planner. - Fix: route-map target chips no longer capture clicks on other chip rows. - Pages build gets a doctype and charset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d2ffb84b5e
commit
bdf66afabc
@@ -311,6 +311,42 @@ td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
|
||||
.stop .n { font-family: var(--font-display); font-weight: 400; color: var(--accent); }
|
||||
.journey { background: color-mix(in srgb, var(--surface) 85%, #000); }
|
||||
footer { border-top-color: var(--line); }
|
||||
|
||||
/* route planner */
|
||||
.planner-controls { align-items: end; }
|
||||
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
|
||||
.seg button { border: 0; border-radius: 0; background: transparent; padding: 7px 13px; color: var(--muted); font-size: 0.72rem; }
|
||||
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--raised)); color: var(--ink); }
|
||||
.pl-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
|
||||
.pl-close { color: var(--warn); margin: 0 0 4px; }
|
||||
.pl-kpi { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: grid; gap: 2px; align-content: start; }
|
||||
.pl-kpi b { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; color: var(--c, var(--ink)); line-height: 1.1; }
|
||||
.pl-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
|
||||
@media (max-width: 1050px) { .pl-grid { grid-template-columns: minmax(0, 1fr); } }
|
||||
.planner-shell { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--map-ground); --frame: var(--vt, var(--accent)); border-color: color-mix(in srgb, var(--frame) 60%, transparent); box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px color-mix(in srgb, var(--frame) 40%, transparent), 0 0 30px color-mix(in srgb, var(--frame) 15%, transparent); }
|
||||
#planner-map { display: block; width: 100%; min-width: 760px; height: auto; background: #d9b07a; }
|
||||
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
|
||||
.pl-legend b { display: inline-block; width: 22px; height: 6px; border-radius: 3px; vertical-align: 2px; margin-right: 4px; }
|
||||
.pl-legend .sw-route { background: var(--vt, var(--accent)); box-shadow: 0 0 0 3px #fff1c955; }
|
||||
.pl-legend .sw-opt { background: repeating-linear-gradient(90deg, var(--vt, var(--accent)) 0 5px, transparent 5px 10px); opacity: 0.7; }
|
||||
.pl-legend .sw-roll { background: repeating-linear-gradient(90deg, var(--muted) 0 2px, transparent 2px 8px); }
|
||||
.pl-legend .sw-risk { width: 12px; height: 12px; border-radius: 50%; background: var(--ember); vertical-align: -2px; }
|
||||
.pl-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; align-content: start; max-height: 920px; overflow: auto; }
|
||||
.pl-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
|
||||
.pl-step.chance { background: color-mix(in srgb, var(--surface) 82%, #000); border-style: dashed; }
|
||||
.pl-step.end { border-color: color-mix(in srgb, var(--vt, var(--accent)) 50%, var(--line)); }
|
||||
.pl-n { font-family: var(--font-display); color: var(--accent); font-size: 1.1rem; }
|
||||
.pl-step h4 { font-family: var(--font-display); font-weight: 400; font-size: 1.02rem; margin: 0 0 6px; }
|
||||
.pl-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(36px, 1fr) minmax(64px, auto); gap: 8px; align-items: center; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px; padding: 4px 6px; color: var(--ink); font-family: var(--font-body); font-size: var(--step--1); text-transform: none; letter-spacing: normal; }
|
||||
button.pl-row { cursor: pointer; }
|
||||
button.pl-row:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
|
||||
.pl-row.taken { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
|
||||
.pl-row i { display: block; height: 8px; border-radius: 3px; background: var(--c); width: var(--w); min-width: 2px; }
|
||||
.pl-row .m { text-align: right; display: grid; }
|
||||
.pl-row .m b { font-family: var(--font-data); font-weight: 600; }
|
||||
.pl-row .m small { color: var(--muted); font-family: var(--font-data); font-size: 10.5px; white-space: nowrap; }
|
||||
.pl-row .rec { font-style: normal; font-size: 9.5px; font-family: var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bg); background: var(--accent); border-radius: 999px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
|
||||
.pl-risk { color: var(--ember); margin: 0 0 4px; }
|
||||
</style>
|
||||
|
||||
<header class="hero">
|
||||
@@ -326,6 +362,7 @@ footer { border-top-color: var(--line); }
|
||||
</div>
|
||||
<nav class="tabs" role="tablist" aria-label="Atlas pages">
|
||||
<button class="tab" role="tab" id="tab-overview" aria-controls="panel-overview" aria-selected="true">The Threshing</button>
|
||||
<button class="tab" role="tab" id="tab-planner" aria-controls="panel-planner" aria-selected="false">Route Planner</button>
|
||||
<button class="tab" role="tab" id="tab-valley" aria-controls="panel-valley" aria-selected="false">Valley Map</button>
|
||||
<button class="tab" role="tab" id="tab-flow" aria-controls="panel-flow" aria-selected="false">Route Flow</button>
|
||||
<button class="tab" role="tab" id="tab-rare" aria-controls="panel-rare" aria-selected="false">Blue & Black</button>
|
||||
@@ -362,6 +399,38 @@ footer { border-top-color: var(--line); }
|
||||
<div class="cta"><button type="button" class="primary" data-go="valley">Walk the valley map</button><button type="button" data-go="rare">Chasing a Blue or Black?</button><button type="button" data-go="dragons">Meet the bonded dragons</button></div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="tabpanel" id="panel-planner" role="tabpanel" aria-labelledby="tab-planner" hidden>
|
||||
<section id="planner-sec" aria-labelledby="h-planner">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow">Interactive · the best route for each dragon, worked out from every logged run</span>
|
||||
<h2 id="h-planner">Plan your run</h2>
|
||||
<p class="muted small">Pick the dragon you want. The planner walks the valley with you: at every choice it shows each option's chance of bonding that dragon if you take it and then play the best route afterwards. At every roll of the dice it shows what can happen. Click any option, on the map or in the list, to see where another choice leads.</p>
|
||||
</div>
|
||||
<div class="controls planner-controls">
|
||||
<div class="target-group"><span class="lbl small muted">I want</span><div class="targets" id="planner-colours"></div></div>
|
||||
<div class="target-group"><span class="lbl small muted">Goal</span>
|
||||
<div class="seg" id="planner-obj" role="group" aria-label="Goal">
|
||||
<button type="button" data-o="eventually" aria-pressed="true" title="You will die on purpose and try again whenever the run goes wrong, so never risk ending on another dragon">Only this dragon, ever</button>
|
||||
<button type="button" data-o="thisAttempt" aria-pressed="false" title="Maximise the chance on this one run, even if that risks a different dragon">Best odds this run</button>
|
||||
</div></div>
|
||||
<div class="target-group"><span class="lbl small muted">Data</span>
|
||||
<div class="seg" id="planner-sample" role="group" aria-label="Data">
|
||||
<button type="button" data-s="all" aria-pressed="true" title="Every logged run">All runs</button>
|
||||
<button type="button" data-s="lowBias" aria-pressed="false" title="Only riders who logged every run, and riders not chasing a rare dragon (less selective reporting)">Low-bias</button>
|
||||
</div></div>
|
||||
<button type="button" id="planner-reset">Start again</button>
|
||||
</div>
|
||||
<div class="pl-head" id="planner-head"></div>
|
||||
<div class="pl-grid">
|
||||
<div class="planner-shell deco">
|
||||
<div class="valley-wrap"><svg id="planner-map" viewBox="0 0 1000 790" role="img" aria-label="Valley map with the recommended route and the chance attached to every option"></svg></div>
|
||||
<div class="legend small pl-legend"><span><b class="sw-route"></b> recommended route</span><span><b class="sw-opt"></b> other options, with the chance of your dragon if you take them</span><span><b class="sw-roll"></b> a roll of the dice</span><span><b class="sw-risk"></b> chance of being killed there</span></div>
|
||||
</div>
|
||||
<ol class="pl-steps" id="planner-steps" aria-label="Your run, step by step"></ol>
|
||||
</div>
|
||||
<p class="small muted">How this is worked out: every choice the community form records is a decision; which dragon appears, whether the shadow shows and who dies are rolls. Each roll's odds are allowed to depend on earlier choices, as much as the data support and no more (see Methods and <code>docs/POLICY.md</code>). "Alive" is the chance of reaching a bonding encounter at all. The bond chance inside each encounter is the community average, because the form does not record the answers given there.</p>
|
||||
</section>
|
||||
</div>
|
||||
<div class="tabpanel" id="panel-valley" role="tabpanel" aria-labelledby="tab-valley" hidden>
|
||||
<section id="valley-sec" aria-labelledby="h-valley">
|
||||
<div class="section-head">
|
||||
@@ -586,7 +655,9 @@ adjusted OR = exp(βⱼ), 95% CI = exp(βⱼ ± 1.96·SEⱼ)</div>
|
||||
<div id="tip" hidden></div>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
|
||||
<script src="engine.js"></script>
|
||||
<script src="solver.js"></script>
|
||||
<script src="register.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="valley.js"></script>
|
||||
<script src="planner.js"></script>
|
||||
<script src="ui.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user