Skip to content

Commit

Permalink
Path check
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Apr 8, 2024
1 parent 84125f1 commit f9ddf35
Show file tree
Hide file tree
Showing 36 changed files with 866 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/route_check/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</a>
</li>

<li>Path Check</li>
<li><a href="{base}/route_check/path_check">Path Check</a></li>
<li>Path Placemaking Check</li>

<li>JAT Check</li>
Expand Down
14 changes: 14 additions & 0 deletions src/routes/route_check/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ export interface State {
existingScoreNotes: string[];
proposedScoreNotes: string[];
};

pathCheck: {
// 30 entries
existingScores: string[];
proposedScores: string[];
existingScoreNotes: string[];
proposedScoreNotes: string[];
};
}

export let state = writable(loadState());
Expand Down Expand Up @@ -110,5 +118,11 @@ export function emptyState(): State {
existingScoreNotes: Array(26).fill(""),
proposedScoreNotes: Array(26).fill(""),
},
pathCheck: {
existingScores: Array(30).fill(""),
proposedScores: Array(30).fill(""),
existingScoreNotes: Array(30).fill(""),
proposedScoreNotes: Array(30).fill(""),
},
};
}
18 changes: 18 additions & 0 deletions src/routes/route_check/path_check/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts">
import { Breadcrumbs } from "$lib";
import Progress from "./Progress.svelte";
</script>

<div class="govuk-prose">
<Breadcrumbs
links={[
["Tools", "/"],
["Route check tool", "/route_check"],
]}
current="Path Check"
/>

<p>TODO: Special horse question</p>

<Progress currentIdx={-1} />
</div>
80 changes: 80 additions & 0 deletions src/routes/route_check/path_check/Progress.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<script lang="ts">
import { state, type State } from "../data";
import { base } from "$app/paths";
export let currentIdx: number;
let startIdx = 17;
let questions = [
//"ACCESSIBILITY",
"Barriers",
"Steps",
"Gradient",
"Tactile Information and Signal Equipment",
"Ability to Turn Around",
//"COMFORT",
"Width of Shared Use Spaces",
"Width of Walking and Wheeling Spaces",
"Width of Cycling Spaces",
"Width of Horse Riding Spaces",
"Shared Use Surface",
"Walking and Wheeling Surface",
"Cycling Surface",
"Horse Riding Surface",
"Suitability of Crossings",
"Accessibility of Access Points",
"Drainage",
//"DIRECTNESS",
"Deviation of Path Against Straight Line",
"Deviation of Path Against Nearest Alternative Route",
"Crossing Locations",
"Delay at Crossings",
//"ATTRACTIVENESS",
"Places to Rest",
"Places to Shelter",
"Lighting",
"Cycle Parking",
"Impact of Users on Each Other",
//"COHESION",
"Ease of Navigation",
"Wayfinding",
"Proximity to Destinations",
"Quality of Connections",
"Connectivity with Other Horse Riding Routes",
];
function formatIndex(idx: number): string {
return (idx + startIdx).toString().padStart(2, "0");
}
$: completed = getCompleted($state);
function getCompleted(_: State): boolean[] {
return Array.from(Array(questions.length).keys()).map(
(idx) =>
$state.pathCheck.existingScores[idx] != "" &&
$state.pathCheck.proposedScores[idx] != "",
);
}
</script>

<ol>
{#each questions as label, idx}
<li>
<div style="display: flex; justify-content: space-between">
{#if currentIdx - startIdx != idx}
<a href="{base}/route_check/path_check/pa{formatIndex(idx)}">
{label}
</a>
{:else}
{label}
{/if}
{#if completed[idx]}
<strong class="govuk-tag govuk-tag--green">Done</strong>
{:else}
<strong class="govuk-tag govuk-tag--red">Incomplete</strong>
{/if}
</div>
</li>
{/each}
</ol>
83 changes: 83 additions & 0 deletions src/routes/route_check/path_check/Question.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<script lang="ts">
import { Breadcrumbs, FancyRadio, PrevNext } from "$lib";
import Progress from "./Progress.svelte";
import { TextArea } from "govuk-svelte";
import { state } from "../data";
export let idx: number;
export let label: string;
export let cases: ["0" | "1" | "2", string][];
let colors = ["#b73d25", "#ffd833", "#006853"];
let choices: [string, string, string][] = cases.map(
([value, label], index) => [value.toString(), label, colors[index]],
);
</script>

<div class="govuk-prose">
<Breadcrumbs
links={[
["Tools", "/"],
["Route check tool", "/route_check"],
["Path Check", "/route_check/path_check"],
]}
current={label}
/>

<PrevNext
{idx}
total={30}
startIdx={17}
urlPath="route_check/path_check/pa"
/>
<h2>{label}</h2>
<slot />

<div class="three-columns">
<div>
<Progress currentIdx={idx} />
</div>

<div>
<FancyRadio
legend="Existing"
{choices}
bind:value={$state.pathCheck.existingScores[idx - 1]}
/>
<TextArea
label="Comments / assumptions"
bind:value={$state.pathCheck.existingScoreNotes[idx - 1]}
/>
</div>
<div>
<FancyRadio
legend="Proposed"
{choices}
bind:value={$state.pathCheck.proposedScores[idx - 1]}
/>
<TextArea
label="Comments / assumptions"
bind:value={$state.pathCheck.proposedScoreNotes[idx - 1]}
/>
</div>
</div>

<PrevNext
{idx}
total={30}
startIdx={17}
urlPath="route_check/path_check/pa"
/>
</div>

<style>
.three-columns {
display: flex;
column-gap: 2rem;
}
.three-columns > * {
width: calc((100% - 4rem) / 3);
}
</style>
1 change: 1 addition & 0 deletions src/routes/route_check/path_check/codegen.py
25 changes: 25 additions & 0 deletions src/routes/route_check/path_check/pa17/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={1}
label="Barriers"
cases={[
[
"0",
"Key public access points (e.g. interfaces with public highway) to the path are restricted by barriers that would inhibit legitimate users. Or, there are barriers along the path that inhibit legitimate users.",
],
[
"1",
"Key public access points (e.g. interfaces with public highway) do not have barriers, but other public access points have barriers that would inhibit legitimate users.",
],
[
"2",
"No public access points to the path have barriers that would inhibit legitimate users.",
],
]}
>
<p>Presence and accessibility of barriers.</p>
<p>Mode: All Active Modes</p>
</Question>
25 changes: 25 additions & 0 deletions src/routes/route_check/path_check/pa18/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={2}
label="Steps"
cases={[
[
"0",
"Steps are unavoidable at key public access points (e.g. interfaces with public highway). Or, there are unavoidable steps along the path.",
],
[
"1",
"A step-free route is possible at key public access points (e.g. interfaces with public highway) and along the path, but steps are present at other public access points.",
],
[
"2",
"A step-free route is possible at all public access points and along the path.",
],
]}
>
<p>Presence of steps.</p>
<p>Mode: All Active Modes</p>
</Question>
19 changes: 19 additions & 0 deletions src/routes/route_check/path_check/pa19/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={3}
label="Gradient"
cases={[
["0", ">5%."],
["1", "3-5%."],
["2", "<3%."],
]}
>
<p>
Steepest gradient due to underlying terrain. (For gradients at ramps,
dropped kerbs and cambers, see metrics SA14 and SA15).
</p>
<p>Mode: Walking / Wheeling / Cycling</p>
</Question>
29 changes: 29 additions & 0 deletions src/routes/route_check/path_check/pa20/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={4}
label="Tactile Information and Signal Equipment"
cases={[
[
"0",
"Guidance on tactile paving has not been considered. Or, there is signal equipment which is incorrectly situated, inaccessible or faulty (for example in terms of rotating cones).",
],
[
"1",
"Guidance on tactile paving has been considered, but the area is not fully legible.",
],
[
"2",
"Guidance on tactile paving has been considered and the area is fully legible.",
],
]}
>
<p>
Adherence of tactile paving to recommended layouts and colours in 'Guidance
on the Use of Tactile Paving Surfaces' and accessibility of signal
equipment.
</p>
<p>Mode: All Active Modes</p>
</Question>
25 changes: 25 additions & 0 deletions src/routes/route_check/path_check/pa21/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={5}
label="Ability to Turn Around"
cases={[
[
"0",
"There are no turning points. Or, turning points are over 1km apart or not provided between all public access points.",
],
["1", "Turning points are approximately 1km apart. "],
[
"2",
"The path is at least 4m wide. Or, turning points are less than 1km apart and provided between all public access points.",
],
]}
>
<p>
Presence and frequency of turning points (open and flat areas of at 4m x
4m).
</p>
<p>Mode: All Active Modes</p>
</Question>
25 changes: 25 additions & 0 deletions src/routes/route_check/path_check/pa22/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={6}
label="Width of Shared Use Spaces"
cases={[
[
"0",
"Where pedestrians and cyclists are in a shared facility without horses, the width requirements set out in Table 6-3 of LTN 1/20 are not met. Where horses are in a shared facility with pedestrians and/or cyclists, the width is less than 4m.",
],
[
"1",
"Where pedestrians and cyclists are in a shared facility without horses, the width requirements set out in Table 6-3 of LTN 1/20 are met. Where horses are in a shared facility with pedestrians and/or cyclists, the width is 4m.",
],
[
"2",
"Where pedestrians and cyclists are in a shared facility without horses, the width requirements set out in Table 6-3 of LTN 1/20 are exceeded. Where horses are in a shared facility with pedestrians and/or cyclists, the width is greater than 4m.",
],
]}
>
<p>Effective width of shared use spaces.</p>
<p>Mode: All Active Modes</p>
</Question>
16 changes: 16 additions & 0 deletions src/routes/route_check/path_check/pa23/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script lang="ts">
import Question from "../Question.svelte";
</script>

<Question
idx={7}
label="Width of Walking and Wheeling Spaces"
cases={[
["0", "<1.5m."],
["1", "1.5-2m."],
["2", ">2m."],
]}
>
<p>Effective width of dedicated walking/wheeling spaces.</p>
<p>Mode: Walking / Wheeling</p>
</Question>
Loading

0 comments on commit f9ddf35

Please sign in to comment.