Published
Edited
Jul 14, 2021
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `## UI Operations`
Insert cell
Insert cell
function resizer(element, dimension = "clientWidth") {
return Generators.observe(notify => {
let width = notify(element[dimension]);
const resized = () => {
let w = element[dimension];
if (w !== width) notify(width = w);
};
window.addEventListener("resize", resized);
return () => window.removeEventListener("resize", resized);
});
}
Insert cell
cellA = new Cell(grid.querySelector("[name=a]"))
Insert cell
cellB = new Cell(grid.querySelector("[name=b]"))
Insert cell
cellC = new Cell(grid.querySelector("[name=c]"))
Insert cell
cellD = new Cell(grid.querySelector("[name=d]"))
Insert cell
md `## UI Configuration `
Insert cell
widthA = cellA.width
Insert cell
widthB = cellB.width
Insert cell
widthC = cellC.width
Insert cell
widthD = cellD.width
Insert cell
heightA = cellA.height
Insert cell
heightB = cellB.height
Insert cell
heightC = cellC.height
Insert cell
heightD = cellD.height
Insert cell
md `## Import Charts`
Insert cell
import {plot as chart_returns} with {
widthC as width,
heightC as height,
filtered_data as cryptodata,
local_event_data as eventdata,
local_ticker_check as name
} from "@jeffrey-adams-ucb/returns-chart-v3"
Insert cell
import {plot as chart_returns_atr} with {
widthC as width,
heightC as height,
local_data as cryptodata,
local_event_data as eventdata,
local_ticker_check as name
} from "@jeffrey-adams-ucb/returns-v-atr"
Insert cell
import {events as chart_events} with {
widthC as width,
heightC as height,
local_data as cryptodata,
local_event_data as eventdata,
local_ticker_check as nametickers,
local_event_check as nametype
} from "@jeffrey-adams-ucb/events"
Insert cell
import {chart as chart_values} with {
widthC as width,
heightC as height,
local_data as ticker_data,
local_event_data as event_data,
local_ticker_check as ticker_check,
local_event_check as event_check
} from "@electroshock666/ticker-values-main-chart"
Insert cell
cellA.embed(chart_returns)
Insert cell
cellB.embed(chart_returns_atr)
Insert cell
cellC.embed(chart_events)
Insert cell
cellD.embed(chart_values)
Insert cell
md `## Data`
Insert cell
local_data = FileAttachment("tickers_full.csv").csv()
Insert cell
local_event_data = FileAttachment("events.csv").csv()
Insert cell
filtered_data = local_data
Insert cell
tickers = ['BTC-USD','ETH-USD', 'AAPL', 'TSLA', 'MSFT', 'NVDA', 'SQ', 'PYPL', 'MSTR', 'JPM', '^IXIC', '^DJI', '^GSPC', 'GC=F', "CL=F"]
Insert cell
type = ['BTC History', 'Global', 'Elon', 'Financial']
Insert cell
md `## Import Libraries `
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
embed = require("vega-embed@6")
Insert cell
import {slider,button,select,text,radio,checkbox,number} from "@jashkenas/inputs"
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