Giter Club home page Giter Club logo

districtr's Introduction

Districtr

Build Status Netlify Status Greenkeeper badge

Districtr is the open-source web app that empowers all people to draw districting plans.

Project values

  • User experience. Participating in the redistricting process should be easy and enjoyable.
  • Openness and transparency. The entire project is open-source, with permissive licenses. All of the data used in the app is freely available and well-documented. We explicitly declare where we get our data, how we've processed it, and what we think of its quality.
  • Responsiveness to the community. Different places have different values and priorities when it comes to drawing districts. We aim to highlight the specific concerns of the community in each place that we include in the app.

See also the Districtr Guiding Principles prepared by participants in MGGG's 2019 Voting Rights Data Institute.

Contributing

If you're interested in contributing, thank you! Send an email to [email protected] and we'll find a way that you can get involved.

Development

Here's how to get started.

  1. Install GitHub for Desktop (or just plain git), Node.js, and a helpful text editor. We recommend VS Code.
  2. Clone the repository using GitHub for Desktop, or by running git clone https://github.com/districtr/districtr from the command line.
  3. Install the dependencies by running npm install.
  4. To start the development server and make sure everything's set up, first run npm run develop. If you go to http://localhost:3000, you should see Districtr running. The development server will recompile the app's assets, JavaScript, HTML, and CSS as you edit the source files.

Districtr is built on Mapbox GL JS and lit-html. We also use Sass for authoring CSS.

We use Prettier for formatting JS source code and ESLint for linting (encouraging good habits and consistent coding style).

Naming conventions

JavaScript

We use PascalCase for classes and components (e.g. UIStateStore or DataTable). By "component", we mean any function that returns a lit-html TemplateResult, or a class with a .render() method that does the same. We use camelCase for everything else (e.g. variables and functions).

For file naming, we use PascalCase for files that export one main class or component (e.g. Layer.js or LayerTab.js). We use kebab-case for other JavaScript modules (e.g. color-rules.js or routes.js).

CSS

We try to use BEM (block-element-modifier) naming conventions for CSS classes.

Testing

To run the unit test suite, run npm run test. We use the Mocha test framework and the Chai assertion library. We need to write more unit tests!

Reporting bugs and other issues

One of the best ways to contribute to Districtr (or any open source project) is to report any bugs, problems, or points of confusion that you find. You can file an issue in this GitHub repository.

districtr's People

Contributors

amybecker avatar aoot avatar atlascommaj avatar azure-pipelines[bot] avatar bsuwal avatar chriskgernon avatar dependabot[bot] avatar ekopecky avatar gabeschoenbach avatar gomotopia avatar grandrepublic avatar greenkeeper[bot] avatar innovativeinventor avatar jdeschler avatar jenni-niels avatar mapmeld avatar maxhully avatar mduchin avatar michaelaltmann avatar nerdgear avatar phorva01 avatar pizzimathy avatar rkbuck1 avatar robbie-veglahn avatar tahentx avatar valeriavelasquez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

districtr's Issues

An in-range update of @open-wc/testing-karma is breaking the build 🚨

The devDependency @open-wc/testing-karma was updated from 3.2.8 to 3.2.9.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@open-wc/testing-karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 9 commits.

  • 18ab3e1 chore: release new versions
  • 8c95d97 fix(demoing-storybook): typing in inputs shall not change storybook ui
  • 4eebd38 feat(demoing-storybook): add storybook-start help command
  • 6d47e56 feat(es-dev-server): allow opening on full URL
  • 90cdeaf fix(es-dev-server): don't normalize file path on a browser path
  • 0083c84 docs(publishing): update netlify deploy configuration (#1035)
  • 7f325d6 chore: release new versions
  • 2e34762 chore(lit-helpers): make testing a dev dependency
  • 1079b0f feat(lit-helpers): add live directive

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @open-wc/karma-esm is breaking the build 🚨

The devDependency @open-wc/karma-esm was updated from 2.9.8 to 2.10.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@open-wc/karma-esm is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @open-wc/karma-esm is breaking the build 🚨

The devDependency @open-wc/karma-esm was updated from 2.11.2 to 2.11.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@open-wc/karma-esm is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 8 commits.

  • 8ba7172 chore: release new versions
  • 8ad6d03 fix(es-dev-server): don't transform non-modules (#1067)
  • 750322b chore: restructure website menu (#1078)
  • cedb4af chore: release new versions
  • 3cca3c9 fix(demoing-storybook): export Anchor, Description, Heading doc blocks
  • 17624a7 fix(demoing-storybook): default build folder should be storybook-static
  • 5293400 chore: release new versions
  • b2f4f7e feat(eslint-config): add eslint-plugin-lit (#1024)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Support importing and editing an existing districting definition.

It would be helpful to allow users to upload existing districting plans, and point them to compatible existing data on existing plans. Then we could see the metrics on and modify existing plans.

Note that a request for the documentation on the format of the data itself, a related topic, is in #42.

And thank you for an awesome and very important tool!

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 6.7.1 to 6.7.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v6.7.2
  • bc435a9 Fix: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) (#12616) (Toru Nagashima)
  • 4928d51 Fix: don't ignore the entry directory (fixes #12604) (#12607) (Toru Nagashima)
  • b41677a Docs: Clarify suggestion's data in Working with Rules (refs #12606) (#12617) (Milos Djermanovic)
  • ea16de4 Fix: Support tagged template literal generics in no-unexpected-multiline (#11698) (Brad Zacher)
  • fa6415d Sponsors: Sync README with website (ESLint Jenkins)
  • e1e158b Sponsors: Sync README with website (ESLint Jenkins)
Commits

The new version differs by 8 commits.

  • dbbba83 6.7.2
  • bc54d15 Build: changelog update for 6.7.2
  • bc435a9 Fix: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) (#12616)
  • 4928d51 Fix: don't ignore the entry directory (fixes #12604) (#12607)
  • b41677a Docs: Clarify suggestion's data in Working with Rules (refs #12606) (#12617)
  • ea16de4 Fix: Support tagged template literal generics in no-unexpected-multiline (#11698)
  • fa6415d Sponsors: Sync README with website
  • e1e158b Sponsors: Sync README with website

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Cannot Submit request for new place (state) to redistrict

On the live districtr.org website, a group of us (hoping to use the site in a Math Teachers' Circle activity in early January), have been unable to add a request for Tennessee.
It looks like this might be a general problem, as it has occurred for several of us on different networks.
A screenshot is below, as is a copy paste of the error from the JavaScript console (using Chrome)

ο»Ώ
api.districtr.org/requests/:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
ο»Ώ
​
Screen Shot 2019-11-25 at 8 35 29 AM

An in-range update of @open-wc/testing-karma is breaking the build 🚨

The devDependency @open-wc/testing-karma was updated from 3.2.9 to 3.2.10.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@open-wc/testing-karma is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 8 commits.

  • 8ba7172 chore: release new versions
  • 8ad6d03 fix(es-dev-server): don't transform non-modules (#1067)
  • 750322b chore: restructure website menu (#1078)
  • cedb4af chore: release new versions
  • 3cca3c9 fix(demoing-storybook): export Anchor, Description, Heading doc blocks
  • 17624a7 fix(demoing-storybook): default build folder should be storybook-static
  • 5293400 chore: release new versions
  • b2f4f7e feat(eslint-config): add eslint-plugin-lit (#1024)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

In the Missouri portal, many submissions are not displaying thumbnails in the gallery view

The portal expects the thumbnails to have been created already and placed in S3 in locations like
https://districtr-public.s3.us-east-1.amazonaws.com/85881.png
but for many plans, the file had not been created.

Use the AWS portal to run the planThumbnail lambda revealed two issues.

  1. The missouri_blockgroups20.zip shapefile had a geoid column named GEOID20, but the Districtr config file Missouri.json incorrectly listed the idColumn as GEOID. We considered the option of fixing the Missouri.json and updating all of the maps that had been drawn from it. After much discussion, we decided to adjust the column name in the shape file.

  2. The missouri_vtd20.zip shapefile was missing from S3. The files were retrieved from https://www.dropbox.com/sh/e06nr17nnsxlb0g/AACd_pxm2j3BtpAMkZMVWQSBa?dl=0, zipped and uploaded to S3.

Once the shapefiles had been fixed, the planThumbnail endpoint was called for each submission.
Essentially a curl command like
curl https://gvd4917837.execute-api.us-east-1.amazonaws.com/plan_thumbnail -H 'content-type: application/json' --data-raw '{"id": 25408}'
was invoked for each Districtr ID of a submission.
This was accomplished as follows.

All of the prod submissions were downloaded
serverless invoke --stage prod -f db --data '{"queryStringParameters" : {"op": "submissions", "text": "%" } }' > prod-submissions.json
The the Missouri Districtr IDs were extracted with
jq '.[] | select (.organization_id == 5 and .link != "") | .link | split("/") | .[-1] | split("?") | .[0] | tonumber ' < prod-submissions.json > missouri_plan_ids.txt

Status of the project

Hey folks!

First of all: this project is absolutely awesome and incredibly useful. The UI is so easy to use for such a complex topic and really makes laypeople understand what Gerrymandering is. Much love for all the work you invested here!

In the past years I tried to contact you a couple of times (Email, Twitter Sep-9-2022 etc.) but without success. I see that there are open PR's from 2020 and that - from my perspective - the core issue of this project #140 how to use the tools here with other data goes still unaddressed. I guess it's might be also considered a value that you are trying to provide the tool for the US only and don't lose your focus.

However, consider the value this project could provide if you truly separated concerns:

  • The tool(s) on one side (without US focus)
  • The data on the other

This would allow other countries to build on your amazing work and in return help maintain and improve it. You already did most of the effort I guess (https://districtr.org/import-export). Is there any reason not to offer non-US data?

Is this project in maintenance-only phase or still actively developed? If so, are there any plans to cooperate with international partners?

404 errors on predrawn congressional maps

Issue: Navigated to /wi/congress to see the example of the existing congressional map and got a 404 error.
Tried tx and ca, also getting the same error there.

Steps to repro: clone repo, followed setup steps, started clicking around and ran into that issue.

Error in npm run develop

I am getting the following error when I am trying to start the code base in local system.

[23:56:17] 'develop' errored after 44 s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: gulp develop
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/sayan/.npm/_logs/2020-03-25T18_26_18_014Z-debug.log

NC Congressional not committing changes.

When sharing or reloading the webpage on an NC congressional map, districtr has issues committing those changes. These issues appear when using any district (tested all of them), and affect VTDs in all of Buncombe (Asheville), parts of McDowell, and parts of Mecklenburg (Charlotte) county. Pictures of this issue can be found in this imgur album.

An in-range update of @open-wc/testing-karma-bs is breaking the build 🚨

The devDependency @open-wc/testing-karma-bs was updated from 1.3.9 to 1.3.10.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@open-wc/testing-karma-bs is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 8 commits.

  • 8ba7172 chore: release new versions
  • 8ad6d03 fix(es-dev-server): don't transform non-modules (#1067)
  • 750322b chore: restructure website menu (#1078)
  • cedb4af chore: release new versions
  • 3cca3c9 fix(demoing-storybook): export Anchor, Description, Heading doc blocks
  • 17624a7 fix(demoing-storybook): default build folder should be storybook-static
  • 5293400 chore: release new versions
  • b2f4f7e feat(eslint-config): add eslint-plugin-lit (#1024)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

CI is failing

Travis build is failing for master branch which should be fixed.

Request: Add how-to for using non-districtr maps

I would like to create a mapbox api for census data and blocks for an area that districtr doesn't cover, but I don't know the structure of the data that I need to upload to mapbox.

If you could put together a brief how-to or some example geojson files with the format needed to upload to mapbox, that would be really helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.