Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update disclaimer #135

Merged
merged 29 commits into from
Nov 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a8ca62b
Add vote turnout for index and district pages (#132)
gayaugayau Nov 21, 2019
5e3be2a
add district turnout chart
nandiheath Nov 22, 2019
0aed93f
update turnout chart
nandiheath Nov 23, 2019
1518320
add two more testcases
nandiheath Nov 23, 2019
73c1f59
remove argument checking
nandiheath Nov 23, 2019
856dc27
UI and i18n enhancement
cswbrian Nov 23, 2019
3f781c8
Auto stash before merge of "feat/district-turnout" and "origin/feat/d…
nandiheath Nov 23, 2019
3d43d65
ignore scripts
nandiheath Nov 23, 2019
345cf23
Auto stash before merge of "feat/district-turnout" and "origin/feat/d…
nandiheath Nov 23, 2019
e40b321
Chart UI enhancment
cswbrian Nov 23, 2019
dbd4e6c
update to the latest contract
nandiheath Nov 23, 2019
26cb906
add REACT_APP_LIVE_VOTE_TURNOUT to env
cswbrian Nov 23, 2019
8a8ac3d
Merge branch 'feat/district-turnout' of https://github.com/cswbrian/d…
cswbrian Nov 23, 2019
52f9b43
add env
cswbrian Nov 23, 2019
159d9eb
add env handling for vote live update
cswbrian Nov 23, 2019
22b9c52
Update sample data for turnout
gayaugayau Nov 23, 2019
6770813
update turnout chart
nandiheath Nov 23, 2019
4b097ed
Add link to vote turnout
gayaugayau Nov 23, 2019
ed45b01
Merge remote-tracking branch 'origin/feat/district-turnout' into dev
nandiheath Nov 23, 2019
119bc54
Update styling for VoteTurnouts
gayaugayau Nov 23, 2019
5155129
fix lint
cswbrian Nov 23, 2019
b2c0385
amend landing_alert
cswbrian Nov 23, 2019
83b2d85
fix fetching election data
cswbrian Nov 23, 2019
ab25c3b
fix env logic
cswbrian Nov 23, 2019
373ca92
Update VoteTurnouts UI and style; Move it into DistrictTable
gayaugayau Nov 23, 2019
b27f0a9
support i18n for alert
cswbrian Nov 23, 2019
c49f292
Merge branch 'dev' of https://github.com/cswbrian/district-councils-d…
cswbrian Nov 23, 2019
2cb3637
fix typo
cswbrian Nov 23, 2019
05ec42e
update disclaimer
ylchan87 Nov 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
script/output/*
.DS_Store
node_modules
.idea
.idea
script/gen_turnout_sample.js

script/input/voters.json
21 changes: 21 additions & 0 deletions script/gen_turnout_sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require('fs');

const json = JSON.parse(fs.readFileSync('./input/voters.json'))
const MAX_TURNOUT_RATE = 0.6
const output = {}

json.data.dcd_constituencies.forEach((c) => {
let lastTurnout = 0;
const cumulative_turnout = [];
for (let i = 0; i < 7 + Math.round(Math.random() * 8); i++) {
lastTurnout += Math.random() * (MAX_TURNOUT_RATE / 15)
cumulative_turnout.push(Math.round(lastTurnout * c.vote_stats_aggregate.aggregate.sum.count))
}

output[c.code] = {
cumulative_turnout,
};
})

fs.writeFileSync('./../web/public/turnout_random.json', JSON.stringify(output, null, 2));

Loading