Skip to content

Instantly share code, notes, and snippets.

View janwillemtulp's full-sized avatar
😄

Jan Willem Tulp janwillemtulp

😄
View GitHub Profile
@janwillemtulp
janwillemtulp / +layout.svelte
Created March 15, 2023 08:10
AXPO workshop COMMON GROUND
<h1>This is the layout</h1>
<slot />
<footer>This is the footer</footer>
@janwillemtulp
janwillemtulp / +layout.svelte
Last active March 15, 2023 07:39
Axpo UXM Dataviz Workshop
<h1>This is the layout</h1>
<slot />
<footer>This is the footer</footer>
@janwillemtulp
janwillemtulp / singlePropertyStack.js
Created October 6, 2022 14:31
Single property stack
/**
* D3 js has a stack function: https://github.com/d3/d3-shape#stack
* But this function builds a stack of several properties (using the keys function) per row in the array.
* Often you may want to create a single stack for a full array based on 1 of its properties.
* That's what this function does.
* It will subdivide the available space (height) which you can set proportionally based on the values of the key that you provide.
* You can also set the padding which will be the spacing between.
*
* So, here's an example of how to call it:
* import { singlePropertyStack } from './singlePropertyStack.js';
@janwillemtulp
janwillemtulp / simple-password-protection.svelte
Created May 20, 2020 12:45
Svelte simple static page password protection
<script>
let password = ''
const hash = s =>
s.split('').reduce((a, b) => {
a = (a << 5) - a + b.charCodeAt(0)
return a & a
}, 0)
$: console.log(password, hash(password))
@janwillemtulp
janwillemtulp / .block
Last active February 6, 2018 23:30
Intro D3 Workshop
license: mit
@janwillemtulp
janwillemtulp / .block
Last active February 6, 2018 21:53
Aardbevingen NL - DatavizFest
license: mit
@janwillemtulp
janwillemtulp / .block
Last active October 17, 2023 03:36
Storm in NL, January 18, 2018
license: mit
height: 1000