Platform
Resources
Pricing
Sign in
Contact us
Harris Lapiroff
Principal Web Developer at Freedom of the Press Foundation
Workspace
Fork
Published
By
Harris Lapiroff
Edited
Feb 6, 2021
10 stars
Insert cell
1
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
numberToCistercian
(
5420
)
Insert cell
Insert cell
html
`<svg class="cistercian" width="108" height="64" viewbox="-1 -1 54 32">
${
numberToCistercianSvg
(
1940
)
}
<g transform="translate(31 0)">
${
numberToCistercianSvg
(
3021
)
}
</g>
</svg>`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
FIVE
=
ONE
+
FOUR
Insert cell
Insert cell
SEVEN
=
ONE
+
SIX
Insert cell
EIGHT
=
TWO
+
SIX
Insert cell
NINE
=
ONE
+
TWO
+
SIX
Insert cell
ONES
=
[
''
,
ONE
,
TWO
,
THREE
,
FOUR
,
FIVE
,
SIX
,
SEVEN
,
EIGHT
,
NINE
]
Insert cell
Insert cell
TENS
=
ONES
.
map
(
s
=>
`<g transform-origin="${
CHARACTER_WIDTH
/
2
} ${
CHARACTER_HEIGHT
/
2
}" style="transform: scale(-1, 1)">${
s
}</g>`
)
Insert cell
HUNDREDS
=
ONES
.
map
(
s
=>
`<g transform-origin="${
CHARACTER_WIDTH
/
2
} ${
CHARACTER_HEIGHT
/
2
}" style="transform: scale(1, -1)">${
s
}</g>`
)
Insert cell
THOUSANDS
=
ONES
.
map
(
s
=>
`<g transform-origin="${
CHARACTER_WIDTH
/
2
} ${
CHARACTER_HEIGHT
/
2
}" style="transform: scale(-1, -1)">${
s
}</g>`
)
Insert cell
COLUMNS
=
[
ONES
,
TENS
,
HUNDREDS
,
THOUSANDS
]
Insert cell
COLUMNS
[
0
]
[
1
]
Insert cell
numberToCistercian
=
n
=>
{
return
html
`
<svg
height=${
CHARACTER_HEIGHT
*
2
+
2
}
width=${
CHARACTER_WIDTH
*
2
+
2
}
viewbox="-1 -1 ${
CHARACTER_WIDTH
+
2
} ${
CHARACTER_HEIGHT
+
2
}"
class="cistercian"
>
${
numberToCistercianSvg
(
n
)
}
</svi>
`
}
Insert cell
numberToCistercianSvg
=
n
=>
{
if
(
n
>
9999
)
throw
(
'Number cannot be larger than 9999'
)
const
stringInt
=
n
.
toString
(
)
const
digits
=
Array
.
from
(
stringInt
)
return
svg
`
${
ZERO
}
${
digits
.
reverse
(
)
.
map
(
(
d
,
i
)
=>
COLUMNS
[
i
]
[
+
d
]
)
}
`
}
Insert cell
numberToCistercian
(
1993
)
Insert cell
Insert cell
LAYOUT
=
(
{
gutter
:
20
,
margin
:
20
,
}
)
Insert cell
DIMENSIONS
=
(
{
width
:
LAYOUT
.
margin
*
2
+
9
*
CHARACTER_WIDTH
+
8
*
LAYOUT
.
gutter
,
height
:
LAYOUT
.
margin
*
2
+
5
*
CHARACTER_HEIGHT
+
7
*
LAYOUT
.
gutter
,
}
)
Insert cell
Insert cell
html
`
<style type="text/css">
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@500&display=swap');
.cistercian line {
stroke: #000;
stroke-linecap: round;
}
.cistercian text {
fill: #000;
font-weight: 500;
font-family: Raleway, var(--sans-serif), sans-serif;
}
.cistercian--white line {
stroke: #FFF;
stroke-width: 2px;
stroke-linecap: round;
}
.cistercian--white text {
fill: #FFF;
}
</style>
`
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
Show 1 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
inputNumber
Edit
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
Edit
Add comment
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
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
CHARACTER_WIDTH
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
CHARACTER_HEIGHT
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ZERO
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ONE
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
TWO
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
THREE
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
FOUR
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
FIVE
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
SIX
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
SEVEN
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
EIGHT
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
NINE
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ONES
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
TENS
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
HUNDREDS
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
THOUSANDS
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
COLUMNS
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
numberToCistercian
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
numberToCistercianSvg
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
LAYOUT
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
DIMENSIONS
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML