Public
Edited
May 27, 2023
Insert cell
Insert cell
Insert cell
Insert cell
import {data_standardized} from "94b66f8b4f3afc17"
Insert cell
viewof table = Inputs.table(data_standardized)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {interval} from '@mootari/range-slider@1786'
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Slider_TR
Insert cell
Insert cell
Insert cell
Insert cell
earliestYear_slider=Slider_TR[0]
Insert cell
Insert cell
latestYear_slider=Slider_TR[1]
Insert cell
Insert cell
Insert cell
Insert cell
earliestYear_slider_asTime = new Date(earliestYear_slider, 1).getTime()
Insert cell
Insert cell
latestYear_slider_asTime = new Date(latestYear_slider, 1).getTime()
Insert cell
Insert cell
Insert cell
import {Wrangler, op} from "@observablehq/data-wrangler"
Insert cell
Insert cell
data_standardized_filter = aq.from(data_standardized)
.filter(aq.escape(d => d["Date"] > earliestYear_slider_asTime))
.filter(aq.escape(d => d["Date"] < latestYear_slider_asTime))
.objects()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
x: {grid:true , nice: true}, y: {grid:true, nice : true , label: "Z-score"},
marks: [
Plot.lineY(data_standardized_filter, {
x: "Date",
y: "CloseStandardized",
stroke: "red"}),
Plot.lineY(data_standardized_filter, {
x: "Date",
y: d => d["VolumeStandardized"],
curve: "step",
stroke: "dodgerblue"})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"
Insert cell
Insert cell
Insert cell
Plot.plot({
x: {grid:true, nice:true},
y: {grid:true, nice:true , label: "Z-score"},
marks: [
Plot.lineY(data_standardized_filter, {
x: "Date",
y: "CloseStandardized",
stroke: "red",
title: "X"}),
Plot.lineY(data_standardized_filter, {
x: "Date",
y: d => d["VolumeStandardized"],
curve: "step",
stroke: "dodgerblue",
title: d => d3.format (" .4s")(d["Volume"]), }),
Plot.dot(data_standardized_filter, {
x: "Date",
y: "CloseStandardized",
fill: "red",
title: d => d3.format (" .6s")(d["Close"]) ,
r: 2
}),
Plot.dot(data_standardized_filter, {
x: "Date",
y: d => d["VolumeStandardized"],
fill: "dodgherblue",
title: d => d3.format (" .4s")(d["Volume"]),
r: 2
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
x: {grid:true , nice:true},
y: {grid:true, nice:true , label: "Z-score"},
marks: [
Plot.lineY(data_standardized_filter, {
x: "Date",
y: "CloseStandardized",
stroke: "salmon",}),
Plot.lineY(data_standardized_filter, {
x: "Date",
y: d => d["VolumeStandardized"],
curve: "step",
stroke: "dodgerblue", }),
Plot.dot(data_standardized_filter, {
x: "Date",
y: "CloseStandardized",
fill: "salmon",
title: d => d3.format(" .3s")(d["Close"]) + " USD" ,
r: 1.5,
}),
Plot.dot(data_standardized_filter, {
x: "Date",
y: d => d["VolumeStandardized"],
fill: "dodgerblue",
title: d => (d3.format(" .3s")(d["Volume"] / 1_000_000_000)) + " Billions USD",
r: 1.5,
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {imageToDo} from "@clokman/student-blocks"
Insert cell
imageToDo
Insert cell
import {howTo} from "@clokman/howto"
Insert cell
import {showMe} from "@observablehq/show-me"
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.
Learn more