Platform
Resources
Pricing
Sign in
Contact us
Chris L Buie
Data Scientist at Warwick Investment Group. Passionate about science, predictive modeling, and data visualizations.
Workspace
Fork
Published
myCharts
By
Chris L Buie
Edited
Jun 30, 2019
Importers
2 stars
Insert cell
Insert cell
Insert cell
md
`Variables defined as below:
**size, margin, data, xScale, yScale, fillScale**`
Insert cell
// data.push({x:100,y:0.3})
Insert cell
data
=
Array
.
from
(
{
length
:
20
}
,
(
)
=>
(
{
x
:
Math
.
round
(
Math
.
random
(
)
*
40
,
2
)
,
y
:
0.3
}
)
)
Insert cell
size
=
(
{
width
:
Math
.
min
(
window
.
innerWidth
,
800
)
,
height
:
400
}
)
Insert cell
margin
=
(
{
top
:
12
,
right
:
10
,
bottom
:
26
,
left
:
26
}
)
Insert cell
xScale
=
d3
.
scaleLinear
(
)
.
domain
(
[
d3
.
min
(
data
,
d
=>
d
.
x
)
-
5
,
d3
.
max
(
data
,
d
=>
d
.
x
)
+
5
]
)
.
nice
(
)
.
range
(
[
margin
.
left
,
size
.
width
-
margin
.
right
]
)
Insert cell
yScale
=
d3
.
scaleLinear
(
)
.
domain
(
[
0
,
1
]
)
.
range
(
[
margin
.
left
,
size
.
width
-
margin
.
right
]
)
Insert cell
d3
=
require
(
"d3"
)
Insert cell
math
=
require
(
"https://cdnjs.cloudflare.com/ajax/libs/mathjs/5.10.3/math.min.js"
)
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
meanplot
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
size
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
margin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
xScale
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
yScale
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
math
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML