Skip to content
This repository was archived by the owner on Mar 18, 2022. It is now read-only.

Commit b2ca949

Browse files
committed
Make various improvements for v0.7.0
1 parent 5b4b290 commit b2ca949

11 files changed

Lines changed: 109 additions & 60 deletions

File tree

CHANGELOG.txt renamed to CHANGELOG.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
v0.6.0
1+
# Changelog
2+
3+
## v0.7.0
4+
5+
- [improvement] Remove arrow in hero (everyone wanted to click it)
6+
- [improvement] Move footer into Page component so it doesn't load first
7+
- [improvement] Make districts clickable in first map
8+
- [improvement] Make stacked bar chart clickable
9+
- [improvement] Move stacked bar chart tooltip a bit up
10+
11+
## v0.6.0
12+
213
- [improvement] Improve design.
314
- [improvement] Improve hero appearance.
415
- [improvement] Optimise header scene slightly.
@@ -19,7 +30,8 @@ v0.6.0
1930
- [feature] Add footer.
2031
- [bug] Age group reducers were incorrectly labelled.
2132

22-
v0.5.0
33+
## v0.5.0
34+
2335
- [feature] Add initial content for a couple of sections.
2436
- [improvement] Improve range chart to support employee data.
2537
- [improvement] Improve district profile design.
@@ -29,7 +41,8 @@ v0.5.0
2941
- [improvement] Improve arrangement of financial data.
3042
- [scrapped] Change employee data to reflect population, then change it back because nah.
3143

32-
v0.4.0
44+
## v0.4.0
45+
3346
- [feature] Add map to district selection.
3447
- [feature] Add district selection by clicking on map.
3548
- [feature] Add Gini charts for wealth and income.
@@ -47,7 +60,8 @@ v0.4.0
4760
- [improvement] Make axis labels look better.
4861
- [improvement] Add axis label to map chart.
4962

50-
v0.3.0
63+
## v0.3.0
64+
5165
- [bug] Fix range chart node collisions for very tight data.
5266
- [bug] Give range chart enough padding for longer axis labels to show.
5367
- [bug] Optimise header scene performance.
@@ -56,7 +70,8 @@ v0.3.0
5670
- [feature] Add district profile selection.
5771
- [bug] Fix label positioning.
5872

59-
v0.2.0
73+
## v0.2.0
74+
6075
- [bug] Fix chart spacing.
6176
- [bug] Fix header overflow.
6277
- [bug] Fix color range in map.
@@ -67,5 +82,6 @@ v0.2.0
6782
- [feature] Add full-time employee equivalents range chart.
6883
- [feature] Add full-time employee equivalents map chart.
6984

70-
v0.1.0
85+
## v0.1.0
86+
7187
- Initial version.

README.md

100644100755
Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,17 @@
1-
## Starting the server
1+
# exp-wohnviertel
22

3-
Use `./bin/start-dev` to start a development server.
3+
This is the Basel Districts page, visible at https://baseldistricts.saffron.so.
44

5-
For production, use your platform of choice to start
6-
`NODE_ENV="production" node server.js`.
5+
## Usage
76

8-
## Config
9-
10-
Copy `config-example.js` to `config.js`, then set the appropriate
11-
variables if needed.
12-
13-
## Assets
14-
15-
To build and watch:
7+
To run a development server:
168

179
```bash
18-
npm run gulp
10+
npm run start
1911
```
2012

21-
To just build:
13+
To build:
2214

2315
```bash
2416
npm run build
2517
```
26-
27-
To build in production mode:
28-
29-
```bash
30-
npm run build-production
31-
```
32-
33-
The gulpfile compiles in the following ways:
34-
35-
* `app/views/**/*.js` -> babel -> `public/javascripts/views/`
36-
* `app/stylesheets/**/*.styl` -> stylus -> `public/stylesheets/compiled/`
37-
* `<your configuration>` -> concat -> `public/stylesheets/build/<name>.css`
38-
* `<your configuration>` -> concat -> `public/javascripts/build/<name>.js`
39-
* `<your configuration>` -> browserify -> `public/javascripts/build/<name>.js`

TODO.txt

100644100755
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
* [feature] Add full branding
2-
* [feature] Add i18n
3-
* [feature] Add analytics
1+
# TODO
2+
3+
## Essential
4+
45
* [bug] Fix undefined hover over gray bubbles in Net Worth Inequality
6+
* [bug] Add hover states on first map and stacked bar chart
57
* [improvement] Make arrow clickable
8+
9+
## Ideas
10+
611
* [improvement] Add chart for workers divided by population
712
* [improvement] Make note that Swiss people are excluded in foreigners table
813
* [improvement] Show workers as portion of total population instead of absolute number

app/assets/includes/components/hero.pug

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
a(href='https://www.saffron.so')
1818
div Created in Basel by Vlad-Stefan Harbuz at
1919
img(src='/images/saffron.svg')
20-
.hero-footer
21-
.hero-footer__hint
22-
img(src='/images/downarrow.svg')
20+
//-
21+
.hero-footer
22+
.hero-footer__hint
23+
img(src='/images/downarrow.svg')

app/assets/includes/components/page.pug

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@
3434
include page__religion
3535
#chart-age
3636
include page__age
37+
38+
include ../footer
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
script(src='/vendor.js')
2+
script(src='/app.js')
3+
script.
4+
require('app')
15
script(async src="https://www.googletagmanager.com/gtag/js?id=UA-74607125-4")
26
script.
37
if (window.location.hostname != 'localhost') {
@@ -6,7 +10,3 @@ script.
610
gtag('js', new Date());
711
gtag('config', 'UA-74607125-4');
812
}
9-
script(src='/vendor.js')
10-
script(src='/app.js')
11-
script.
12-
require('app')

app/assets/includes/layout.pug

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ html(lang='en')
3030
#page-container.page-container
3131
include header
3232
block content
33-
include footer
3433
block prescripts
3534
include default-scripts
3635
block scripts

app/components/map-chart.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ Vue.component('map-chart', {
4747
}
4848
}
4949

50-
this.mapSvg
50+
const districts = this.mapSvg
5151
.selectAll('[data-name="wohnviertel"] polygon')
5252
.data(this.graphData, makeKey)
5353
.on('mouseover', util.bindContext(this, this.showTooltip))
5454
.on('mouseout', util.bindContext(this, this.hideTooltip))
5555
.on('click', util.bindContext(this, this.handleClick))
56+
57+
if (this.onClick) {
58+
districts.style('cursor', 'pointer')
59+
}
5660
},
5761

5862
initLegend() {
@@ -97,7 +101,9 @@ Vue.component('map-chart', {
97101
},
98102

99103
handleClick(el, d) {
100-
this.onClick(d.district)
104+
if (this.onClick) {
105+
this.onClick(d.district)
106+
}
101107
},
102108

103109
showTooltip(el, d) {

app/components/stack-chart.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Vue.component('stack-chart', {
225225
let rect = el.getBoundingClientRect()
226226
let barMid = (this.x(d[1]) - this.x(d[0])) / 2
227227
let left = rect.left + window.scrollX + barMid
228-
let top = rect.top + window.scrollY
228+
let top = rect.top + window.scrollY - 20
229229
let barGroup = el.parentNode
230230
let parentDatum = d3.select(barGroup).datum()
231231
if (this.isFocused && !(d3.select(barGroup).classed('bar-group--focused'))) {
@@ -286,6 +286,7 @@ Vue.component('stack-chart', {
286286
.on('mouseover', bindContext(this, this.showTooltip))
287287
.on('mouseout', bindContext(this, this.hideTooltip))
288288
.on('click', bindContext(this, this.toggleFocus))
289+
.style('cursor', 'pointer')
289290
},
290291

291292
draw() {

0 commit comments

Comments
 (0)