Skip to content
Dan Ellis edited this page Nov 17, 2022 · 1 revision

Build Route

This route extracts the relevant tables from Nomis, and compiles the url string needed for the embed route.

Structure

 4.0K   │ │ ┌── gettable.js      │                   ░░▒▒▒█ │   1%
  12K   │ │ ├── +page.svelte     │                   ░░▒▒▒█ │   2%
  72K   │ │ ├── newtables.json   │                   ░░▒███ │  10%
 100K   │ ├─┴ build   

gettable.js

Functions that are used to download the Nomis tables selected for our dataset.

newtables.json

Config file for each table

+page.svelete

The main page file

init

The main function called after all svelte components have been mounted

Contains:

  • hash processing functions
  • set geography
  • compressed strings, and assign properties from localstorage

get_data

A function to check if we already have a table, and if not, download it.

update_profile

  • update the local storage str
  • generate the codes
  • create embeddable cache string
  • update the embed iframe

makeEmbed

Triggers a reload/redirect of the embed iframe

Clone this wiki locally