This repo houses the scripts, assets and source files for Disaggregated Accounts.
- Clone the repo:
git clone https://github.com/jasonjiajs/disaggregated_accounts.git
.
- Put the updated data in the corresponding subfolder in
process_data_for_tableau/data/[subfolder]
. The file name should be the same.process_data_for_tableau/data/overview/Flows in DK_v2_overview.xlsx
provides more information. - Run
process_data_for_tableau/code/process_data_for_tableau.ipynb
to get the processed csv files that will be inputs to Tableau workbooks for public viewing.- The csv files are saved in
process_data_for_tableau/output_csv
.
- The csv files are saved in
- Run
process_data_for_tableau/code/process_data_for_public_download.ipynb
to get the processed csv and dta files that will be published on the website and are available for public download.- The csv files are saved in
src/assets/data/csv
. - The dta files are saved in
src/assets/data/dta
.
- The csv files are saved in
- Update the Tableau notebooks in
process_data_for_tableau/output_tableau
using the new csv files fromprocess_data_for_tableau/output_csv
.- If a data extract used to exist but is no longer found ('Extract Not Found'), click 'Remove the extract'. The notebook will then automatically load the updated csv file, as the csv file name is unchanged.
- Extract the data and use the data extract: Data → [Name of dataset, last option] → Extract Data → Extract → Save (default location is fine) -> Yes (replace it if it already exists).
- Publish the updated Tableau notebooks to Tableau Public: Server → Publish Workbook → Connect → Sign in → Save → Yes (overwrite existing data).
- Download and install Node.js, which will also install npm.
- Check that you have Node.js and npm installed:
node -v
,npm -v
. cd
into the repo's root directory (which containspackage.json
andpackage-lock.json
).- Run
npm install
. This should install modules in a new folder/node_modules
. - Run
npm start
. This should open up a preview of the website in your default browser. It will also automatically watch for changes to core files, and live reload the browser when changes are saved. - Place the relevant images in
src/assets/img
and the latest version of the paper insrc/assets/paper
. The processed data files should already be insrc/assets/data
. - Edit the PUG files in
src/pug
and the SCSS files insrc/scss
. The JS files insrc/js
andscripts
can be ignored. - These edits will change the final outputs: the assets, HTML files and CSS files in
dist
. - View changes in your browser and iterate accordingly. Note that you can preview changes by opening the corresponding HTML files.
- Once you have finished making changes, push your changes to the repo. Netlify will recognize a new commit and automatically rebuild the website in a few minutes.
You can view the package.json
file to see which scripts are included.
npm run build
builds the project - this builds assets, HTML, JS, and CSS intodist
npm run build:assets
copies the files in thesrc/assets/
directory intodist
npm run build:pug
compiles the Pug located in thesrc/pug/
directory intodist
npm run build:scripts
brings thesrc/js/scripts.js
file intodist
npm run build:scss
compiles the SCSS files located in thesrc/scss/
directory intodist
npm run clean
deletes thedist
directory to prepare for rebuilding the projectnpm run start:debug
runs the project in debug modenpm start
ornpm run start
runs the project, launches a live preview in your default browser, and watches for changes made to files insrc
If you only want to update the research paper, you can do the following:
- Go to
src/assets/paper
. - Click 'Add file' -> 'Upload files'
- Upload a new copy of
DEA.pdf
(the name needs to be the same; otherwise, the HTML code also needs to change to reflect the new file name). - Click 'Commit changes'. The new file will override the old file.
- Wait for a few minutes. The website should be updated with the new file.
This website is adapted from Start Bootstrap - Creative.
Copyright © 2023 - Disaggregated Accounts. All rights reserved.
Code released under the MIT license.