Skip to content

Commit

Permalink
Merge branch 'dev' into INF_backendInit
Browse files Browse the repository at this point in the history
  • Loading branch information
sellnat77 authored Mar 18, 2020
2 parents b47ab2a + 62cc812 commit 3e9b195
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
Binary file added 311-system-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ CI Is driven by tests, they help instill confidence in pull requests because a d

Our front end tests are run through Enzyme and our backend tests are run through Pytest.

## System architecture
Here is our rough draft of our architecture diagram, since the application is not yet 'deployed to production' this diagram might not be the exact representation of what currently exists
![System diagram](311-system-architecture.png)

## Postgres
Our persistence layer is run by Postgresql. It is recommended to review [this]([https://www.tutorialspoint.com/postgresql/postgresql_overview.htm](https://www.tutorialspoint.com/postgresql/postgresql_overview.htm)) if you are unfamiliar
For local development, we utilize a volatile docker container through docker compose. This is meant for experimentation and working with datasets in isolation. When the application is ready for deployment, the persistence will be offloaded to a shared server in some cloud...somewhere
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"scripts": {
"start": "npm run check-env && npm run dev",
"dev": "webpack-dev-server --config webpack.dev.js --host 0.0.0.0",
"dev": "webpack-dev-server --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"lint": "eslint 'src/**/*.js*'",
"test": "jest --passWithNoTests",
Expand Down
17 changes: 10 additions & 7 deletions src/components/PinMap/PinMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@ import Choropleth from 'react-leaflet-choropleth';
import MarkerClusterGroup from 'react-leaflet-markercluster';
import HeatmapLayer from 'react-leaflet-heatmap-layer';
import PropTypes from 'proptypes';
import COLORS from '@styles/COLORS';

// import neighborhoodOverlay from '../../data/la-county-neighborhoods-v6.json';
// import municipalOverlay from '../../data/la-county-municipal-regions-current.json';
// import councilDistrictsOverlay from '../../data/la-city-council-districts-2012.json';
import ncOverlay from '../../data/nc-boundary-2019.json';

const { BaseLayer, Overlay } = LayersControl;
const boundaryDefaultColor = COLORS.BRAND.MAIN;
const boundaryHighlightColor = COLORS.BRAND.CTA1;

class PinMap extends Component {
constructor(props) {
super(props);

this.state = {
position: [34.0094213, -118.6008506],
zoom: 10,
mapUrl: `https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=${process.env.REACT_APP_MAPBOX_TOKEN}`,
satelliteUrl: `https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=${process.env.REACT_APP_MAPBOX_TOKEN}`,
mapUrl: `https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=${process.env.REACT_APP_MAPBOX_TOKEN}`,
satelliteUrl: `https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/{z}/{x}/{y}?access_token=${process.env.REACT_APP_MAPBOX_TOKEN}`,
geoJSON: ncOverlay,
bounds: null,
};
Expand All @@ -41,7 +43,7 @@ class PinMap extends Component {

layer.setStyle({
weight: 5,
color: 'grey',
color: boundaryHighlightColor,
});

layer.bringToFront();
Expand All @@ -53,7 +55,7 @@ class PinMap extends Component {
layer.setStyle({
weight: 2,
opacity: 1,
color: '#959595',
color: boundaryDefaultColor,
});
}

Expand Down Expand Up @@ -172,7 +174,7 @@ class PinMap extends Component {
fillColor: 'white',
weight: 2,
opacity: 1,
color: '#959595',
color: boundaryDefaultColor,
dashArray: '3',
}}
onEachFeature={this.onEachRegionFeature}
Expand Down Expand Up @@ -203,12 +205,13 @@ class PinMap extends Component {
* improve functionality post-MVP by generating a heatmap list
* on the backend. */}
<HeatmapLayer
max={1}
points={data}
radius={20}
blur={25}
longitudeExtractor={m => m.longitude}
latitudeExtractor={m => m.latitude}
intensityExtractor={() => {}}
intensityExtractor={() => 1}
/>
</Overlay>
</LayersControl>
Expand Down
1 change: 1 addition & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = merge(config, {
contentBase: './public',
compress: true,
port: 3000,
host: '0.0.0.0',
hot: true,
historyApiFallback: true,
},
Expand Down

0 comments on commit 3e9b195

Please sign in to comment.