{"id":14036115,"url":"https://github.com/datamade/ny-budget","last_synced_at":"2025-04-10T18:51:06.259Z","repository":{"id":24932986,"uuid":"28350248","full_name":"datamade/ny-budget","owner":"datamade","description":" :bar_chart: an explorable budget vizualization for New York state","archived":false,"fork":false,"pushed_at":"2025-01-21T20:34:16.000Z","size":21482,"stargazers_count":29,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T16:37:31.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ny-budget.datamade.us","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datamade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-22T17:36:05.000Z","updated_at":"2025-02-19T17:20:09.000Z","dependencies_parsed_at":"2023-02-18T14:15:51.775Z","dependency_job_id":"63a389d9-fd7c-44b5-8315-f65d5b62839c","html_url":"https://github.com/datamade/ny-budget","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datamade%2Fny-budget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datamade%2Fny-budget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datamade%2Fny-budget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datamade%2Fny-budget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datamade","download_url":"https://codeload.github.com/datamade/ny-budget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248273908,"owners_count":21076259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-12T03:01:50.434Z","updated_at":"2025-04-10T18:51:06.239Z","avatar_url":"https://github.com/datamade.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"ny-budget\n=========\n\nAn explorable budget visualization for the state of New York\n\n![screen shot 2015-05-07 at 3 22 46 pm](https://cloud.githubusercontent.com/assets/1406537/7525268/948cd3a8-f4cd-11e4-9485-2ca92af248ac.png)\n\nThis is based on [Look at Cook](http://lookatcook.com) by Derek Eder and Nick Rougeux at [Open City](http://opencityapps.org), and can be easily re-deployed to visualize other budgets.\n\n#### Dependencies\n\n- [jQuery](http://jquery.com)\n- [D3](http://d3js.org) (for CSV manipulation)\n- [Backbone](http://backbonejs.org/) (javascript MVC framework)\n- [Highcharts](http://www.highcharts.com/) (charting library)\n- [Datatables](http://datatables.net) (sortable HTML tables)\n\n## How to update this New York visualization\n\n#### 1. Update Data\nThe csv inputs that may need to be updated going forward are:\n\n- the budget numbers (```data/budget_raw.csv```)\n- the budget descriptions (```data/descriptions.csv```)\n\nA `csv` and `xlsx` file are typically shared with the same data. I've found that the `csv` file sometimes has formatting issues, so I export the `xlsx` file as a new `budget_raw.csv`\n\n`cleanup.py` is a python script that requires pandas and xlrd. You can install them by running:\n\n```\npip install -r requirements.txt\n```\n\nWhen updating either of the above csvs, run the ```cleanup.py``` script to generate the finished budget, ```budget_finished.csv```:\n\n```\npython cleanup.py\n```\n\n#### 2. Update settings\nThe settings in ```js/settings.js``` that may need to be updated going forward are:\n- ```endYear``` (for example, if the last year in the budget is '2023-24', set the end year to 2024)\n- ```activeYear``` (typically set to the same as `endYear`)\n- ```projectionStartYear``` (for example, if the first year of estimates is '2023-24', set this to 2023)\n- ```plotBandBuffer``` (this determines the # months of padding for the beginning of the estimates plot band. if there are multiple years of estimates, set a small buffer like -1, otherwise set it to a larger negative number, e.g. -7, for more space)\n- ```inflation_idx``` (array of years and CPI values. typically we update the most recent years to track accurate inflation)\n- ```benchmark``` (set to the current year)\n\n#### 3. Preview\nTo preview changes locally:\n\n```\npython -m SimpleHTTPServer\n```\n\n#### 4. Share preview with client\nOpen a pull requst with the latest changes. This will create a deploy preview in netlify that you can share with the client for review.\n\n#### 4. Deploy\nThe site is hosted on Netlify, so deploy previews are available if you make a pull request.\n\nTo deploy to production, push the changes into the ```deploy``` branch:\n\n```bash\ngit push origin main\ngit push origin main:deploy\n```\n\nLive changes will be seen at https://ny-budget.datamade.us\n\n## How to adapt this to another budget\nThis code can be customized to visualize another data set.\n\n####Data Prepatation\nThe budget data must be a csv that adheres to a fixed format in order for the app to process it properly. Budget column headers include: Fund ID, Fund, Department ID, Department, Short Title, Link to Website, Department Description, and Control Officer. Values for estimates and actuals must be broken down into a separate column for each year.\n\nSee examples of prepped data:\n  - [New Orleans](https://docs.google.com/spreadsheet/ccc?key=0AswuyKhD7LxVdGlERGdEckpaRDc4Q1RCN0tjZ2tMMGc\u0026usp=sharing_eil#gid=0)\n  - [Cook County](https://www.google.com/fusiontables/DataSource?dsrcid=1227404)\n  - [Macoupin County](https://github.com/datamade/macoupin-budget/blob/master/data/macoupin-budget_1997-2014.csv)\n  - [A blank template to populate](https://docs.google.com/spreadsheets/d/1I6xZe8syHTiLguZ56l6J1KW0nAJVrUilvq0eP-BpE2A/edit?usp=sharing)\n\nIf you need to do any preparation on your raw data to get it into the finished format (e.g. formatting dollar amounts, removing whitespace, adding descriptions), do it in a script so that it will be repeatable in the future. See an example script in ```data/cleanup.py```.\n\n####Configuration\n1. Put your finished budget csv file in the ```data/``` folder\n  \n2. Next, set the configuration variables in ```js/settings.js```\n\n## Team\n\n* Cathy Deng, DataMade\n* Derek Eder, DataMade\n\n## Errors / bugs\n\nIf something is not behaving intuitively, it is a bug, and should be [reported as an issue](https://github.com/datamade/ny-budget/issues)\n\nYou can also email info@datamade.us or tweet @DataMadeCo.\n\n## Note on patches/pull requests\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Commit and send me a pull request. Bonus points for topic branches.\n\n## Copyright and Attribution\n\nCopyright (c) 2016 DataMade. Released under the [MIT License](https://github.com/datamade/ny-budget/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatamade%2Fny-budget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatamade%2Fny-budget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatamade%2Fny-budget/lists"}