Platform
Resources
Pricing
Sign in
Get started
Tyoma Deev
Workspace
Fork
Published
By
Tyoma Deev
Edited
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mockRows
=
generateMockRows
(
3
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
amountYScale
=
d3
.
scaleLinear
(
)
.
domain
(
d3
.
extent
(
allAmounts
)
)
.
nice
(
)
.
range
(
[
335
,
1
]
)
// range([343, 1])
Insert cell
priceYScale
=
d3
.
scaleLinear
(
)
.
domain
(
d3
.
extent
(
allPrices
)
)
.
nice
(
)
.
range
(
[
335
,
1
]
)
// range([343, 1])
Insert cell
Insert cell
allDates
=
mockRows
.
rows
.
map
(
row
=>
parseTime
(
row
.
transactTime
)
)
.
sort
(
d3
.
ascending
)
Insert cell
mockRows
.
rows
.
map
(
row
=>
parseTime
(
row
.
transactTime
)
)
Insert cell
Insert cell
Insert cell
Insert cell
formatHour
=
d3
.
timeFormat
(
"%H:%M:%S"
)
Insert cell
Insert cell
Insert cell
Insert cell
generateGuidelines
=
(
lowerYCoord
=
312
,
gap
=
32
)
=>
Array
(
10
)
.
fill
(
lowerYCoord
)
.
map
(
(
_
,
i
)
=>
312
-
gap
*
i
)
.
map
(
yCoord
=>
{
console
.
log
(
`cosher guideline coord is ${
yCoord
}`
)
;
return
`<line y1=${
yCoord
} x2=${
dms
.
width
} y2=${
yCoord
} />`
}
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3
=
require
(
'd3@7'
)
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