Add "who's using it" #176

Merged
hughrun merged 1 commit from who-else into main 2024-02-11 14:23:18 +11:00
9 changed files with 213 additions and 31 deletions

View file

@ -14,7 +14,7 @@ See [sources](sources.md).
## Want to help? ## Want to help?
See [contributing](contributing.md), especially *[which files to update](https://github.com/hughrun/public_library_map/blob/master/contributing.md#which-files-to-update)*. See [contributing](https://librarymap.hugh.run/contributing/), especially *[which files to update](https://librarymap.hugh.run/contributing/#which-files-to-update)*.
## Contributors ## Contributors
@ -24,4 +24,4 @@ Contributors (whether via GitHub or another way) are listed at [contributors.txt
**/website/data**: [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) **/website/data**: [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)
**everything else**: [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.txt) **everything else**: [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.txt)

View file

@ -13,15 +13,15 @@
<section id="title"> <section id="title">
<a href="/"><img id="logo" src="/logo.svg"/></a> <a href="/"><img id="logo" src="/logo.svg"/></a>
<h2>About Library Map</h2> <h2>About Library Map</h2>
<p id="beta">Beta!</p>
</section> </section>
<nav> <nav>
<ul> <ul>
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="/who-else">Who else is using it?</a></li>
<li><a href="/fines">Fines</a></li> <li><a href="/fines">Fines</a></li>
<li class="active-tab">About</li> <li class="active-tab">About</li>
<li><a href="/sources">Acknowledgements</a></li> <li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">How you can help</a></li> <li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li> <li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
</ul> </ul>
</nav> </nav>

View file

@ -13,15 +13,15 @@
<section id="title"> <section id="title">
<a href="/"><img id="logo" src="/logo.svg"/></a> <a href="/"><img id="logo" src="/logo.svg"/></a>
<h2>Contributing to Library Map</h2> <h2>Contributing to Library Map</h2>
<p id="beta">Beta!</p>
</section> </section>
<nav> <nav>
<ul> <ul>
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="/who-else">Who else is using it?</a></li>
<li><a href="/fines">Fines</a></li> <li><a href="/fines">Fines</a></li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li> <li><a href="/sources">Acknowledgements</a></li>
<li class="active-tab">How you can help</li> <li class="active-tab">Contribute</li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li> <li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
</ul> </ul>
</nav> </nav>

3
website/d3.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -15,15 +15,15 @@
<section id="title"> <section id="title">
<a href="/"><img id="logo" src="/logo.svg" /></a> <a href="/"><img id="logo" src="/logo.svg" /></a>
<h2>About Library Map</h2> <h2>About Library Map</h2>
<p id="beta">Beta!</p>
</section> </section>
<nav> <nav>
<ul> <ul>
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="/who-else">Who else is using it?</a></li>
<li class="active-tab">Fines</li> <li class="active-tab">Fines</li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li> <li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">How you can help</a></li> <li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li> <li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
</ul> </ul>
</nav> </nav>
@ -52,7 +52,7 @@
<ul> <ul>
<li>Ayre, Lori Bowen (2019), <a href="https://digitalcommons.du.edu/collaborativelibrarianship/vol11/iss2/3/">Cents and Sensibility: Late fees do not belong in public libraries</a>, <em>Collaborative Librarianship</em>: Vol. 11 : Iss. 2;</li> <li>Ayre, Lori Bowen (2019), <a href="https://digitalcommons.du.edu/collaborativelibrarianship/vol11/iss2/3/">Cents and Sensibility: Late fees do not belong in public libraries</a>, <em>Collaborative Librarianship</em>: Vol. 11 : Iss. 2;</li>
<li>Unrein, Sabrina. (2020). <a href="https://ischool.syr.edu/wp-content/uploads/2020/06/Overdue-Fines-Advantages-Disadvantages-and-How-Eliminating-Them-Can-Benefit-Public-Libraries.pdf">Overdue Fines: Advantages, Disadvantages, and How Eliminating Them Can Benefit Public Libraries.</a> Syracuse, NY: iSchool Public Libraries Initiative at Syracuse University.</li> <li>Unrein, Sabrina. (2020). <a href="https://ischool.syr.edu/wp-content/uploads/2020/06/Overdue-Fines-Advantages-Disadvantages-and-How-Eliminating-Them-Can-Benefit-Public-Libraries.pdf">Overdue Fines: Advantages, Disadvantages, and How Eliminating Them Can Benefit Public Libraries.</a> Syracuse, NY: iSchool Public Libraries Initiative at Syracuse University.</li>
</ul> </ul>
</section> </section>
</main> </main>
<footer> <footer>

View file

@ -17,15 +17,15 @@
<section id="title"> <section id="title">
<img id="logo" src="/logo.svg"/> <img id="logo" src="/logo.svg"/>
<h2>Library Map</h2> <h2>Library Map</h2>
<p id="beta">Beta!</p>
</section> </section>
<nav> <nav>
<ul> <ul>
<li class="active-tab">Home</li> <li class="active-tab">Home</li>
<li><a href="/who-else">Who else is using it?</a></li>
<li><a href="/fines">Fines</a></li> <li><a href="/fines">Fines</a></li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li> <li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">How you can help</a></li> <li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li> <li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
</ul> </ul>
</nav> </nav>
@ -41,13 +41,13 @@
<script src="leaflet.geocsv.js" type="text/javascript"></script> <script src="leaflet.geocsv.js" type="text/javascript"></script>
<!-- leaflet fill patterns --> <!-- leaflet fill patterns -->
<script src="leaflet.pattern.js" type="text/javascript"></script> <script src="leaflet.pattern.js" type="text/javascript"></script>
<section class="intro"> <section class="intro">
<p>Made by <a href="https://www.hughrundle.net">Hugh Rundle</a> using open data. Play with the layers by using the layer control at the top right of the map.</p> <p>Made by <a href="https://www.hughrundle.net">Hugh Rundle</a> using open data. Play with the layers by using the layer control at the top right of the map.</p>
<p>Email <strong>librarymap@hugh.run</strong> if you have any tips or suggestions.</p> <p>Email <strong>librarymap@hugh.run</strong> if you have any tips or suggestions.</p>
<p>You need a <a href="https://caniuse.com/?search=fetch">modern browser</a> with JavaScript enabled to use Library Map. This site does not work in Internet Explorer.</p> <p>You need a <a href="https://caniuse.com/?search=fetch">modern browser</a> with JavaScript enabled to use Library Map. This site does not work in Internet Explorer.</p>
</section> </section>
<div id="mode-switch"> <div id="mode-switch">
<div></div> <div></div>
<button id="mode-button" name="mode-button" class="hidden"></button> <button id="mode-button" name="mode-button" class="hidden"></button>

View file

@ -13,15 +13,15 @@
<section id="title"> <section id="title">
<a href="/"><img id="logo" src="/logo.svg"></a> <a href="/"><img id="logo" src="/logo.svg"></a>
<h2>Sources &amp; Attributions</h2> <h2>Sources &amp; Attributions</h2>
<p id="beta">Beta!</p>
</section> </section>
<nav> <nav>
<ul> <ul>
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="/who-else">Who else is using it?</a></li>
<li><a href="/fines">Fines</a></li> <li><a href="/fines">Fines</a></li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
<li class="active-tab">Acknowledgements</li> <li class="active-tab">Acknowledgements</li>
<li><a href="/contributing">How you can help</a></li> <li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li> <li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
</ul> </ul>
</nav> </nav>

View file

@ -8,7 +8,7 @@ body {
grid-template-rows: auto 1fr auto; grid-template-rows: auto 1fr auto;
} }
html, html,
body { body {
font-family: "Calibri", Arial, Tahoma, sans-serif; font-family: "Calibri", Arial, Tahoma, sans-serif;
margin: 0; margin: 0;
@ -120,18 +120,6 @@ nav li a:hover {
margin: 0 1em; margin: 0 1em;
} }
#beta {
font-family: "Comic Sans", Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 1.4em;
margin-left: 1em;
transform: rotate(-35deg);
background-color: #fff;
color: #FF3961;
padding: 0.25em 0.5em;
border-radius: 5px;
}
/* loading */ /* loading */
/* ======= */ /* ======= */
#loading { #loading {
@ -144,7 +132,7 @@ nav li a:hover {
background-color: #FF3961; background-color: #FF3961;
} }
#mapid { #mapid {
height: 75vh; height: 75vh;
width: 90vw; width: 90vw;
margin: 0 auto 5em; margin: 0 auto 5em;
@ -213,7 +201,8 @@ footer {
} }
.info-page, .info-page,
.sources { .sources,
.who-else {
max-width: 36em; max-width: 36em;
margin: 2em auto; margin: 2em auto;
} }
@ -242,11 +231,45 @@ tbody td {
padding: 0.5em 1em; padding: 0.5em 1em;
} }
ul#libraries {
list-style-type: none;
margin-top: 2em;
}
ul#libraries li {
margin-top: 0.5em;
}
#form {
display: grid;
grid: auto, auto;
border-top: 1px solid #333;
border-bottom: 1px solid #333;
margin: 2em 0;
padding: 2em 0;
}
#form select,
#form button {
all: unset;
border: 2px solid #333;
padding: 0.5em;
margin: 0.5em;
cursor: pointer;
}
#form button {
margin-top:2em;
border: 4px solid #FF3961;
text-align: center;
}
/* when below max width of para */ /* when below max width of para */
@media only screen and (max-width: 54em) { @media only screen and (max-width: 54em) {
.info-page, .info-page,
.sources { .sources,
.who-else {
width: 95vw; width: 95vw;
padding: 0 2.5vw; padding: 0 2.5vw;
} }

156
website/who-else/index.html Normal file
View file

@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Who's using it - Library Map</title>
<link rel="shortcut icon" href="/logo.svg" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="/style.css">
</head>
<body>
<header>
<section id="title">
<a href="/"><img id="logo" src="/logo.svg"></a>
<h2>Who's using it?</h2>
</section>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li class="active-tab">Who's using it?</li>
<li><a href="/fines">Fines</a></li>
<li><a href="/about">About</a></li>
<li><a href="/sources">Acknowledgements</a></li>
<li><a href="/contributing">Contribute</a></li>
<li><a href="https://github.com/hughrun/public_library_map">Code</a></li>
</ul>
</nav>
</header>
<main>
<section class="who-else">
<h2>Who's using it?</h2>
<p>Maps are nice but sometimes you just want a list, right?</p>
<p>Search by ILS, Discovery Platform, or both together.</p>
<script src="/d3.js"></script>
<script type="module">
// load the data
const local = await d3.dsv( ',', '/data/library_services_information.csv', (d) => {
return {
name: d.long_name,
ils: d.ILS,
state: d.state.toUpperCase(),
url: d.website
}
});
const nsla = await d3.dsv(',', '/data/nsla_library_locations.csv', (d) => {
return {
name: d.town,
ils: d.ils,
}
});
const academic = await d3.dsv(',', '/data/academic_library_locations.csv', (d) => {
return {
name: d.town,
ils: d.ils,
discovery: d.discovery
}
});
const data = [...local, ...nsla, ...academic]
const ils_systems = []
const disc_systems = []
for (let d of data) {
ils_systems.push(d.ils)
disc_systems.push(d.discovery)
}
const values = new Set(ils_systems.sort())
ils = document.getElementById('ils')
for (let val of values) {
const option = document.createElement('option')
option.innerText = val
ils.appendChild(option)
}
const discoveries = new Set(disc_systems.sort())
discovery = document.getElementById('discovery')
for (let val of discoveries) {
if (val) {
const option = document.createElement('option')
option.innerText = val
discovery.appendChild(option)
}
}
// watch for a query
form = document.getElementById('form')
form.addEventListener('submit', (event) => {
event.preventDefault()
let listing = document.getElementById('libraries')
// clear
while (listing.firstChild) {
listing.removeChild(listing.firstChild);
}
let ils = event.target.ils.value == "---" ? null : event.target.ils.value
let discovery = event.target.discovery.value == "---" ? null : event.target.discovery.value
var libraries = []
if (ils && !discovery) {
console.log("ils only")
libraries = data.filter( (lib) => lib.ils == ils).sort( (a,b) => {
return (a.name < b.name) ? -1 : (a.name > b.name) ? 1 : 0;
})
} else if (discovery && !ils) {
console.log("discovery only")
libraries = data.filter( (lib) => lib.discovery == discovery).sort( (a,b) => {
return (a.name < b.name) ? -1 : (a.name > b.name) ? 1 : 0;
})
} else {
console.log("both")
let ils_libs = data.filter( (lib) => lib.ils == ils)
libraries = ils_libs.filter( (lib) => lib.discovery == discovery).sort( (a,b) => {
return (a.name < b.name) ? -1 : (a.name > b.name) ? 1 : 0;
})
}
// account for no disovery listed or neither
console.log(libraries)
for (let lib of libraries) {
const li = document.createElement('li')
if (lib.url) {
li.innerHTML = `<a href="${lib.url}">${lib.name}</a>`
} else {
li.innerText = lib.name
}
if (lib.state) {
li.innerHTML += ` (${lib.state})`
}
listing.appendChild(li)
}
})
</script>
<form id="form">
<label for="ils">Integrated Library System (ILS/LMS)</label>
<select name="ils" id="ils">
<option selected>---</option>
</select><br/>
<label for="ils">Discovery Platform</label>
<select name="discovery" id="discovery">
<option selected>---</option>
</select><br/>
<button>Find out who's using it!</button>
</form>
<ul id="libraries"></ul>
</section>
</main>
<footer>
<p>This website and the data it uses licensed <a href="https://creativecommons.org/licenses/by/4.0/">CC-BY-4.0</a></p>
</footer>
</body>
</html>