Public
Edited
Feb 11, 2024
43 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
FHV_data = {
const scsv = d3.dsvFormat(",") // Important to define the separator of your CSV file
return scsv.parse(await FileAttachment("FHV_Base_Aggregate_Report_20240205.csv").text())
}
Insert cell
Insert cell
top5_companies = //TO DO
Insert cell
Insert cell
Insert cell
top5_company_dispatches = //TO DO
Insert cell
Insert cell
margin = //TO DO
Insert cell
visWidth = //TO DO
Insert cell
visHeight = //TO DO
Insert cell
Insert cell
//TO DO Scale 1

//TO DO Scale 2

//TO DO Scale 3
Insert cell
Insert cell
{

//TO DO

//create SVG, add any axes, draw any marks, etc
return svg.node();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
margin2 = //TO DO
Insert cell
width2 = //TO DO
Insert cell
height2 = //TO DO
Insert cell
margin3 = //TO DO
Insert cell
width3 = //TO DO
Insert cell
height3 = //TO DO
Insert cell
Insert cell
//TO DO Scale 1

//TO DO Scale 2

//TO DO Scale 3
Insert cell
Insert cell
function leftVisualization() {

// the value for when there is no brush
const initialValue = //TO DO

//create SVG, add any axes, draw any marks, etc

//create brush

//handle brush events

return svg.node();
}
Insert cell
Insert cell
function rightVisualization() {
//create SVG, add any axes, draw any marks, etc for initial view

//update view based on leftVisualiztion selection
function update(data) {

}
return Object.assign(svg.node(), { update });;
}
Insert cell
Insert cell
{
const vis_left = leftVisualization();
const vis_right = rightVisualization();

// update the visualization on the right when the visualization on the left
// selection changes
d3.select(vis_left).on('input', () => {
vis_right.update(vis_left.value);
});

// intial state of visualization on the right
vis_right.update(vis_left.value);

// use HTML to place the two charts next to each other
return html`<div style="display: flex">${vis_left}${vis_right}</div>`;
}
Insert cell
Insert cell
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.
Learn more