Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mbforr committed Sep 11, 2018
1 parent ade2ec5 commit 6ef25fd
Show file tree
Hide file tree
Showing 36 changed files with 9 additions and 1,552 deletions.
Binary file removed public/mc.png
Binary file not shown.
11 changes: 0 additions & 11 deletions src/actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,12 @@ export const changeCartoBBox = boundingbox => ({
});


export const SET_PRICE = '@Filters/SET_PRICE';
export const setPriceFilter = filter => ({
type: SET_PRICE,
filter,
});

export const SET_BBOX = '@Filters/SET_BBOX';
export const setBboxFilter = bbox => ({
type: SET_BBOX,
bbox,
});

export const SET_NEIGHBOURHOODS = '@Filters/SET_NEIGHBOURHOODS';
export const setNeighbourhoods = neighbourhoods => ({
type: SET_NEIGHBOURHOODS,
neighbourhoods,
});

export const TOGGLE_LAYER = '@Layers/TOGGLE';
export const toggleLayer = name => ({
Expand Down
8 changes: 8 additions & 0 deletions src/components/RightBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ class RightBar extends Component {
operationColumn='total_damage'
/>

<Category
heading='State'
description='Total damage for each railroad company in USD'
categoryLayer={this.props.layers.railaccidents.source}
column='state'
operation={carto.operation.SUM}
operationColumn='equipment_damage'
/>
<Histogram />
</div>
)
Expand Down
25 changes: 0 additions & 25 deletions src/data/layers/metro_lines.js

This file was deleted.

51 changes: 0 additions & 51 deletions src/data/layers/metro_stations.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/data/layers/neighbourhoods.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/data/railLayer.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/data/utils.js

This file was deleted.

45 changes: 0 additions & 45 deletions src/reducers/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,48 +88,3 @@ export const layers = (state = DEFAULT_LAYERS, action) => {
return state;
}
}

const FILTERS_INITIAL_STATE = {
price: false,
bbox: false,
neighbourhoods: false,
}

export const filters = (state = FILTERS_INITIAL_STATE, action) => {
switch (action.type) {
case actions.SET_PRICE: {
const { min, max } = action.filter;

return {
...state,
price: `price BETWEEN ${min} AND ${max}`,
};
}

case actions.SET_BBOX: {
const [ xmin, ymin, xmax, ymax ] = action.bbox;

return {
...state,
bbox: `ST_Intersects(the_geom_webmercator, ST_Transform(ST_MakeEnvelope(${xmin}, ${ymin}, ${xmax}, ${ymax}, 4326), 3857))`,
};
}

case actions.SET_NEIGHBOURHOODS: {
const neighbourhoods = action.neighbourhoods.map(name => `'${name}'`).join(',');

if (neighbourhoods.length === 0) return {
...state,
neighbourhoods: false,
};

return {
...state,
neighbourhoods: `railroad IN (${neighbourhoods})`,
};
}

default:
return state;
}
}
1 change: 1 addition & 0 deletions src/routers/AppRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const AppRouter = () => (
<div>
<Switch>
<Route path="/" component={Page} exact={true} />
<Route path="/page" component={Page} exact={true} />
<Route component={NotFoundPage} />
</Switch>
</div>
Expand Down
5 changes: 0 additions & 5 deletions src/tests/__mocks__/moment.js

This file was deleted.

51 changes: 0 additions & 51 deletions src/tests/actions/expenses.test.js

This file was deleted.

49 changes: 0 additions & 49 deletions src/tests/actions/filters.test.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/tests/components/AddExpensePage.test.js

This file was deleted.

38 changes: 0 additions & 38 deletions src/tests/components/EditExpensePage.test.js

This file was deleted.

Loading

0 comments on commit 6ef25fd

Please sign in to comment.