decidables
Explorable Explanations of Decision Making
decidables is a collection of websites and supporting libraries for explorable explanations of quantitative approaches to human decision making.
decidables is implemented as a git monorepo on GitHub.
Sites
The sites are served from GitHub Pages at decidables.github.io.
- decidables
(source)
Explorable Explanations of Decision Making
The root site with overall info and links to the individual explorables - Draft available:
d′etectable (source)
An Explorable Explanation of Signal Detection Theory - In progress...
prospectαbλe (source)
An Explorable Explanation of Cumulative Prospect Theory - In progress...
diskountable (source)
An Explorable Explanation of Hyperbolic Temporal Discounting - In progress...
accumulable (source)
An Explorable Explanation of the Diffusion Decision Model
Libraries
The libraries are published to npm in the
@decidables
scope.
decidables-elements
(source)
Web components for UI elements used across all packagesdetectable-math
(source)
Provides a class with equations for calculating Signal Detection Theorydetectable-elements
(source)
Web components for exploring Signal Detection Theoryprospectable-math
(source)
Provides a class with equations for calculating Cumulative Prospect Theoryprospectable-elements
(source)
Web components for exploring Cumulative Prospect Theorydiscountable-math
(source)
Provides a class with equations for calculating Hyperbolic Temporal Discountingdiscountable-elements
(source)
Web components for exploring Hyperbolic Temporal Discountingaccumulable-math
(source)
Provides a class with equations for calculating the Diffusion Decision Modelaccumulable-elements
(source)
Web components for exploring the Diffusion Decision Model
Development
Dependencies updated February 6, 2025.
Compatibility Goals
In general, it should work with versions of any browsers using up-to-date WebKit/JavaScriptCore, Blink/V8, or Gecko/SpiderMonkey on desktop or mobile.
- Desktop (last 2 versions)
- Chrome
- Edge
- Firefox
- Safari
- Opera
- Mobile
- Chrome on Android
- Safari on iOS
Style Guide
- Within a page:
- Headings start at
H2
, only first letter is capitalized - Italics used for emphasis
- Using remark-citeproc:
:cite[]
citations::ref
insert reference list
- Using remark-glossary:
:term[]
terminology:entry[]
glossary entry:::glossary :::
glossary
- Using remark-div:
:::ui :::
user interface notes
- Using remark-span:
:page[]
link to another page:key[]
keywords:tool[]
development tool:button
UI button:prompt
UI prompt:slider
UI slider:switch
UI switch:toggle
UI toggle
- Headings start at
Global Tools
Note: If not on Windows, replace choco
with OS package manager of choice
Install
- Manually install chocolatey https://chocolatey.org/install (on Windows) or HomeBrew https://brew.sh/ (on MacOS)
choco install openjdk
orbrew install openjdk
choco install git
orbrew install git
choco install nodejs
orbrew install node
thenbrew install corepack
corepack enable
- This is currently needed to use yarn without a separate installation
Upgrade
choco outdated
orbrew outdated
choco upgrade all
orbrew update
thenbrew upgrade
yarn set version latest
Package Scripts
Install
yarn install
- Downloads and installs yarn dependencies & devDependencies to
node_modules/
- Downloads and installs yarn dependencies & devDependencies to
Lint
yarn lint
- Lints all libraries for markdown and scripts in
src/
- Lints all sites for markdown, scripts, and styles in
src/
, and compiled markup inlocal/
- Lints all libraries for markdown and scripts in
yarn workspace @decidables/<library|site> lint
- Lints a single library or site
yarn workspace @decidables/<library|site> gulp lint<type>
- Lints
Scripts
orStyles
in a single library - Lints
Markdown
,Markup
,Scripts
, orStyles
in a single site
- Lints
Test
yarn test
- Runs all tests for all libraries and reports coverage in
test/coverage/
- Runs all tests for all libraries and reports coverage in
yarn workspace @decidables/<library> test
- Runs all tests for a single library and reports coverage in
test/coverage/
- Runs all tests for a single library and reports coverage in
yarn workspace @decidables/<library> test --watch
yarn workspace @decidables/<library> test -w
- Runs all tests for a single library in watch mode and reports coverage in
test/coverage/
- Runs all tests for a single library in watch mode and reports coverage in
yarn workspace @decidables/<library> test <directory/filename>
- Runs tests for a single library for a single file and reports coverage in
test/coverage/
- Runs tests for a single library for a single file and reports coverage in
yarn workspace @decidables/<library> test <directory/filename> --watch
yarn workspace @decidables/<library> test <directory/filename> -w
- Runs tests for a single library for a single file in watch mode and reports coverage in
test/coverage/
- Runs tests for a single library for a single file in watch mode and reports coverage in
Compile
yarn compile
- Compiles all sites to browser-compatible scripts from
src/
tolocal/
- Compiles all sites to browser-compatible scripts from
yarn workspace @decidables/<site> compile
- Compiles a single site from
src/
tolocal/
- Compiles a single site from
yarn workspace @decidables/<site> gulp compile<type>
- Compiles
Favicons
,Fonts
,Markdown
,Scripts
, orStyles
in a single site fromsrc/
tolocal/
- Compiles
Watch
yarn watch
- Re-
compile
all sites on file changes insrc/
or local library dependencies
- Re-
yarn workspace @decidables/<site> watch
- Re-
compile
site on file changes insrc/
or local library dependencies
- Re-
yarn workspace @decidables/<site> gulp watch<type>
- Re-
compile
site onMarkdown
,Scripts
, orStyles
changes insrc/
or local library dependencies
- Re-
Build
yarn build
- Builds all libraries to browser-compatible optimized bundles from
src/
tolib/
- Builds all sites to browser-compatible optimized scripts from
local/
todist/
- Builds all libraries to browser-compatible optimized bundles from
yarn workspace @decidables/<library|site> build
- Builds a single library to browser-compatible optimized bundles from
src/
tolib/
- Builds a single site to browser-compatible optimized scripts from
local/
todist/
- Builds a single library to browser-compatible optimized bundles from
yarn workspace @decidables/<library|site> gulp build<type>
- Builds
Scripts
in a single library fromsrc/
tolib/
- Builds
Favicons
,Fonts
,Markup
,Scripts
, orStyles
in a single site fromlocal/
todist/
- Builds
Version
yarn changed
- Lists which libraries and sites will receive version bumps when
yarn versions
is run
- Lists which libraries and sites will receive version bumps when
yarn versions
- Note: requires a valid GitHub personal access token be set to GH_TOKEN environment variable
- Bumps version numbers of all libraries and sites as needed based on conventional commits
- Transitive dependencies updated in each
package.json
- Git tags added for new versions
- All of this is committed and pushed
Publish
yarn publish ######
- Note: you must be logged in to NPM with appropriate scope:
npm adduser <username> --scope=@decidables
- Note: to be run immediately after
yarn version
- Note:
######
should be replaced with an actual one time passcode - Publishes all new versions of public libraries to npm
- Note: you must be logged in to NPM with appropriate scope:
Deploy
yarn deploy
- Note: requires a valid GitHub personal access token be set to the repository secret API_TOKEN_GITHUB on @decidables/decidables
- Re-compile and build markdown (to grab new version) then copy files for all sites from
dist/
todecidables.github.io/
for GitHub Pages deployment
yarn workspace @decidables/<site> deploy
- Re-compile and build markdown (to grab new version) then copy files for a single site from
dist/
todecidables.github.io/
for GitHub Pages deployment
- Re-compile and build markdown (to grab new version) then copy files for a single site from
Serve
yarn serve
- Serves each site mounted on
local/
anddist/
, and all sites integrated ondeploy/
(e.g. http://localhost:8000/local/detectable, http://localhost:8000/dist/detectable, and http://localhost:8000/deploy/detectable)
- Serves each site mounted on
yarn workspace @decidables/<site> serve
- Serves
<site>/
(e.g. http://localhost:8000/local/ or http://localhost:8000/dist/)
- Serves
Upgrade
yarn outdated
- Check for outdated dependencies
yarn up
- Upgrade to latest dependencies, ignoring semver!
yarn upgrade-interactive
- Manual upgrade to newer dependencies, with option to ignore semver
yarn dlx update-browserslist-db@latest
- Update
caniuse-lite
so the browser data is up-to-date
- Update
File Organization
decidables/
.git/
(Repository for git) [autogenerated].github/
(Configuration for GitHub Actions).vscode/
(Editor configuration for VSCode).yarn/
(Repository for yarn) [autogenerated]decidables.github.io/
(Sites organized for deployment) [autogenerated]libraries/
(All libraries are found here)node_modules/
(dependencies & devDependencies installed byyarn install
) [autogenerated]scripts/
(gulp support scripts used for tooling)sites/
(All sites are found here).commitlint.json
(Commit linting configuration for commitlint).eslintrc.json
(Code linting configuration for eslint).gitattributes
(Version control configuration for git).gitignore
(Version control configuration for git).remarkrc.json
(Markdown linting configuration for remark-lint).stylelintrc.json
(Style linting configuration for stylelint).webtestrunner.js
(Testing configuration for web-test-runner).yarnrc.yml
(Package manager configuration for yarn)gulpfile.js
(Tasks for gulp)lerna.json
(Monorepo configuration for lerna)LICENSE.md
(Describes licenses for this project)package.json
(Overall configuration for monorepo)README.md
(This file)yarn.lock
(Proprietary file for tracking package installations by yarn) [autogenerated]
License
The content of this project is licensed under Creative Commons Attribution-ShareAlike 4.0 International License (CC-BY-SA-4.0) and the source code of this project is licensed under GNU General Public License v3.0 or any later version (GPL-3.0-or-later).