Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #416 from onaio/staging
Browse files Browse the repository at this point in the history
v1.3.3 Release
  • Loading branch information
Conor Kelly authored Feb 4, 2020
2 parents 7877d51 + 5378e88 commit 1476724
Show file tree
Hide file tree
Showing 12 changed files with 358 additions and 381 deletions.
2 changes: 1 addition & 1 deletion build/gisida.js

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributing to Gisida

The following is a set of guidelines for contributing to Gisida. Changes to this document can be proposed via a pull request.

### Table of contents

[Branch naming](#branch-naming)

[Creating an issue](#creating-an-issue)

[Don't](#dont)

## Branch naming

A branch is named by separating various parts with a forward slash. The structure of a branch name is as follows

`group-token/issue-number_awesome-branch-name`

e.g **feature/300_layer-builder**

The following are tokens that can be used and their meaning:

**bug**: Malfunctions that should be fixed to comply with the expected behaviour

**enhancement**: Improvement of an existing feature

**feature**: A new feature

## Creating an issue

### Before creating an issue

- Use the search feature to make sure there issue doesn’t already exist. If this does happen though, close the less thorough issue and include a comment e.g **Duplicate of #123**

### How do I create a good issue?

- Keep the titles short and descriptive. Have the specific details in the issue descripion.

- Avoid issues that contain too much detail. Split a complex issue.

- Mention relevant people _@username_ if necessary.

- Add information that can help clarify the issue e.g screenshots of Javascript errors and warnings.

- In case of a bug, give as details as possible of how to reproduce the bug and the expected behaviour.

## Don't Do

- Don't create a merge request if your source branch has commented out code.

- Don't use long and descriptive names when creating issues and pull requests.
37 changes: 37 additions & 0 deletions docs/labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Labels

## Show zeros

Some situations may require that 0 values be rendered on the map while others may require the 0 values to be omitted.
The default behaviour is that 0s are rendered. If you do not want 0 values to render for a certain layer, update the layer configuration as

```
{
...
"labels": {
...
"showZeros": false
...
}
...
}
```

The fill color needs to be set to white for 0 limit so that it provides the illusion of no data rendered. If you choose to have another color other than white, the fill will render on the map but will have no value associated with it.

Here is an example:

```
{
...
"categories": {
...
"color": ["#ffffff","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"
],
"limit": [0,13,32,52,61,100],
}
...
}
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gisida",
"version": "1.3.2",
"version": "1.3.3",
"description": "A dashboard builder library for map visualizations",
"keywords": [
"data visualization",
Expand Down Expand Up @@ -66,6 +66,7 @@
},
"dependencies": {
"@babel/runtime": "^7.4.3",
"@mapbox/geojsonhint": "^3.0.0",
"@onaio/superset-connector": "^0.0.13",
"babel-core": "v6.25.0",
"babel-loader": "^7.1.2",
Expand Down
20 changes: 12 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import app from './store/reducers/app';
import APP from './store/reducers/app';
import filter from './store/reducers/filter';
import layersReducer from './store/reducers/layers';
import loc from './store/reducers/loc';
import locationsReducer from './store/reducers/locations';
import regions from './store/reducers/regions';
import styles from './store/reducers/styles';
import supersetConfig from './store/reducers/superset-config';
import MAP from './store/reducers/createMapReducer/createMapReducer';

// eslint-disable-next-line no-underscore-dangle, global-require
if (!global._babelPolyfill) require('babel-polyfill');
Expand All @@ -18,8 +19,16 @@ gisida.loadLayers = require('./store/initStore').loadLayers;
gisida.reducerRegistry = require('./store/reducerRegistry').default;
gisida.createMapReducer = require('./store/reducers/app').createMapReducer;

gisida.reducers = {
...app, filter, layersReducer, loc, locationsReducer, regions, styles, supersetConfig,
gisida.defaultReducers = {
APP,
filter,
layersReducer,
loc,
locationsReducer,
regions,
styles,
supersetConfig,
'map-1': MAP,
};
gisida.Actions = require('./store/actions/actions').default;
gisida.prepareLayer = require('./map/prepareLayer').default;
Expand Down Expand Up @@ -50,17 +59,12 @@ gisida.buildParsedBasicDetailItem = require('./map/buildDetailView').buildParsed
gisida.processFormData = require('./connectors/ona-api/aggregateFormData').processFormData;
gisida.lngLat = require('./utils/lngLat').default;

gisida.defaultReducers = {};
gisida.defaultReducers.APP = require('./store/reducers/app').APP;
gisida.defaultReducers.STYLES = require('./store/reducers/styles');

gisida.files = {};
gisida.files.loadJSON = require('./utils/files').loadJSON;
gisida.files.loadCSV = require('./utils/files').loadCSV;
gisida.addChart = require('./map/addChart').default;
gisida.buildDetailView = require('./map/buildDetailView').default;
gisida.buildParsedBasicDetailItem = require('./map/buildDetailView').buildParsedBasicDetailItem;

gisida.buildFilterState = require('./filter/buildFilterState').default;
gisida.clearFilterState = require('./filter/clearFilterState').default;

Expand Down
6 changes: 4 additions & 2 deletions src/map/addLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,11 @@ export default function (layer, mapConfig, dispatch) {

if (layer.categories && layer.categories.shape) {
const iconStops = [];
layer.categories.type.forEach((type, index) => {

layer.categories.type.forEach((type, index) => {
iconStops.push([type, layer.categories.shape[index]]);
});
})

styleSpec.layout['icon-image'].stops = iconStops;
}

Expand Down
Loading

0 comments on commit 1476724

Please sign in to comment.