Published
Edited
Jun 17, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
DOM.download(serialize(sortedLenderTotal), null, "Download CSV")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// pppUrlWorking = "https://cors-anywhere.herokuapp.com/https://docs.google.com/spreadsheets/d/e/2PACX-1vRZYyhIBZXdzkTv19dhbZTUmb2z9ZMplOrp9S7IhthMGUqtg8gjy25wnJTIptQSrzP0CAKR_lNXZZel/pub?gid=1271870510&single=true&output=tsv"
Insert cell
// pppDataWorking = {
// let objects = [];
// const spreadsheet = await d3
// .tsv(pppAttachedFile)
// .then(data => data.forEach(d => objects.push(d)));
// let popped = objects.slice(0, -3);
// return popped;
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {serialize} from "@palewire/saving-csv"
Insert cell
Insert cell
Insert cell
import { SummaryTable } from "@observablehq/summary-table"
Insert cell
// countByLender = vl({
// data: {
// values: pppDataWorking
// },
// title: {
// text: 'Count of PPP loans approved for New Mexico industry groups',
// orient: 'top',
// anchor: 'start',
// font: chartFonts.headlineFont,
// fontSize: chartFonts.headlineSize,
// color: chartFonts.headlineColor,
// subtitle: ['\n', 'Source: Small Business Administration', '\n'],
// subtitleFont: chartFonts.subtitleFont,
// subtitleFontSize: chartFonts.subtitleFontSize,
// subtitlePadding: chartFonts.subtitlePadding,
// subtitleColor: chartFonts.subtitleColor,
// subtitleFontWeight: chartFonts.FontWeight
// },
// encoding: {
// // tooltip: {
// // aggregate: 'count',
// // field: 'naics_group'
// // },
// x: {
// title: 'Number of loans approved',
// field: 'lender',
// type: 'nominal',
// aggregate: 'count'
// },
// y: {
// title: 'PPP lender',
// field: 'lender',
// // type: 'nominal',
// sort: {
// op: 'count',
// field: 'lender',
// order: 'descending'
// }
// }
// },
// layer: [
// {
// mark: 'bar'
// },
// {
// mark: {
// type: 'text',
// align: 'left',
// baseline: 'middle',
// stroke: 'black',
// fontSize: 14,
// dx: 5
// },
// encoding: {
// text: { field: 'lender', aggregate: 'count' }
// }
// }
// ],
// width: 600,
// height: 5000,
// config: {
// axis: {
// labelFont: chartFonts.labelFont,
// labelFontSize: chartFonts.labelFontSize,
// labelFontWeight: chartFonts.labelFontWeight,
// titleFont: chartFonts.titleFont,
// titleFontSize: chartFonts.titleFontSize,
// titleFontWeight: chartFonts.titleFontWeight
// }
// }
// })
Insert cell
// lenderTotalFacet = {
// const output = [];
// sortedLenderTotal.map(function(d, i) {
// output.push(d.key);
// });
// const includeList = output.slice(0, 12);
// const theseLenders = pppDataWorking.filter(function(d) {
// if (includeList.indexOf(d.lender) !== -1) {
// return d;
// }
// });
// return theseLenders;
// }
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