Platform
Resources
Pricing
Sign in
Get started
Athan
Node.js and JavaScript. Currently working on a JavaScript standard library for numerical and scientific computing. https://www.patreon.com/athan
Workspace
Fork
Published
stdlib
By
Athan
Edited
May 6, 2018
4 stars
stdlib
Real-time k-means clustering
Simulating Noisy Time Series Using Discrete-time Markov Chains
Help Text
Unicode Sparkline Column Chart
Beta Distribution Probability Density Function
Functions for Bifurcating a Collection
JSON Serialization and Deserialization of Exotic Data Types
Writing Benchmarks
stdlib
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
stdlib_flat_help
=
require
(
"https://unpkg.com/@stdlib/stdlib@0.0.38/dist/stdlib-flat-help.min.js"
)
Insert cell
Insert cell
Insert cell
HELP
=
stdlib_flat_help
.
help
(
)
Insert cell
Insert cell
function
help
(
alias
)
{
var
txt
;
if
(
HELP
.
hasOwnProperty
(
alias
)
)
{
txt
=
HELP
[
alias
]
;
}
else
{
txt
=
'Error: unrecognized alias. Ensure that the provided alias is spelled correctly, including capitalization.'
;
}
return
md
`\`\`\`${
txt
}\`\`\``
;
}
Insert cell
Insert cell
help
(
'base.sin'
)
Insert cell
Insert cell
Insert cell
aliases
=
Object
.
keys
(
HELP
)
Insert cell
Insert cell
function
randomHelpText
(
)
{
var
idx
=
Math
.
floor
(
Math
.
random
(
)
*
aliases
.
length
)
;
// Not perfectly uniform, but close enough...
return
help
(
aliases
[
idx
]
)
;
}
Insert cell
Insert cell
PAUSE
=
true
Insert cell
Insert cell
function
*
simulation
(
delay
)
{
delay
*=
1000
;
// convert seconds to milliseconds
while
(
true
)
{
yield
new
Promise
(
onResolve
)
;
}
;
function
onResolve
(
resolve
)
{
setTimeout
(
onTimeout
,
delay
)
;
function
onTimeout
(
)
{
// In the "paused" state, we never resolve the promise...
if
(
!
PAUSE
)
{
resolve
(
randomHelpText
(
)
)
;
}
}
}
}
Insert cell
simulation
(
10
)
Insert cell
Insert cell
viewof
helpIndex
=
html
`<input type="range" min=0 max=${
aliases
.
length
-
1
} value=0>`
Insert cell
Insert cell
help
(
aliases
[
helpIndex
]
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
stdlib_flat_help
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
HELP
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
help
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
aliases
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
randomHelpText
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
PAUSE
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
simulation
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
helpIndex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML