Skip to content

Commit

Permalink
Add option to show/hide diary categories
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreenbury committed Jun 19, 2024
1 parent befe7a2 commit af0e260
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/components/Diaries.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// State
export let show = false;
export let show_schools = true;
export let show_retail = true;
let hoverId;
let modalContents;
let showModal = false;
Expand Down Expand Up @@ -191,7 +193,7 @@
}
// Shop?
if (diary.pshop > 0.0) {
if (diary.pshop > 0.0 & show_retail) {
// Pick a different venue every day
let pt = pickVenueForActivity(person, synthpop.Activity.RETAIL);
gj.features.push({
Expand All @@ -208,7 +210,7 @@
}
// Go to school?
if (diary.pschool > 0.0) {
if (diary.pschool > 0.0 & show_schools) {
let pt = schoolsPerPerson[index];
if (pt != null) {
gj.features.push({
Expand Down Expand Up @@ -357,6 +359,8 @@
<div class="legend" style:top={show ? "120px" : "382px"}>
<div><input type="checkbox" bind:checked={show} />Daily diaries</div>
{#if show}
<div><input type="checkbox" bind:checked={show_schools} />Show schools</div>
<div><input type="checkbox" bind:checked={show_retail} />Show retail</div>
<div>
Number of people: {sample_size}
<input type="range" bind:value={sample_size} min="1" max="100" />
Expand Down

0 comments on commit af0e260

Please sign in to comment.