Legend
- { legendItem(set1) }
- { legendItem(set2) }
+ { legendItem('set1') }
+ { legendItem('set2') }
);
};
const mapStateToProps = state => ({
- set1: state.comparisonFilters.comparison.set1,
- set2: state.comparisonFilters.comparison.set2,
- chart: state.comparisonFilters.comparison.chart,
+ comparison: state.comparisonFilters.comparison,
});
export default connect(mapStateToProps)(ComparisonLegend);
ComparisonLegend.propTypes = {
- set1: PropTypes.shape({
- district: PropTypes.string,
- }).isRequired,
- set2: PropTypes.shape({
- district: PropTypes.string,
- }).isRequired,
- chart: PropTypes.string,
+ comparison: PropTypes.shape({
+ set1: PropTypes.shape({
+ district: PropTypes.string,
+ list: PropTypes.arrayOf(PropTypes.string),
+ }),
+ set2: PropTypes.shape({
+ district: PropTypes.string,
+ list: PropTypes.arrayOf(PropTypes.string),
+ }).isRequired,
+ chart: PropTypes.string,
+ }),
};
ComparisonLegend.defaultProps = {
- chart: null,
+ comparison: {},
};
diff --git a/src/components/common/CONSTANTS.js b/src/components/common/CONSTANTS.js
index eb2e8a6d0..fce15ecc7 100644
--- a/src/components/common/CONSTANTS.js
+++ b/src/components/common/CONSTANTS.js
@@ -92,12 +92,23 @@ export const REQUEST_SOURCES = [
];
export const DISTRICT_TYPES = [
- { id: 'nc', name: 'Neighborhood Council District', color: '#DDEC9F' },
- { id: 'cc', name: 'City Council District', color: '#565656' },
+ { id: 'nc', name: 'Neighborhood Council District' },
+ { id: 'cc', name: 'City Council District' },
// { id: 'bid', name: 'Business Improvement District' },
// { id: 'sd', name: 'Supervisory District' },
];
+export const COMPARISON_SETS = {
+ set1: {
+ color: '#DDEC9F',
+ name: 'Set 1',
+ },
+ set2: {
+ color: '#565656',
+ name: 'Set 2',
+ },
+};
+
export const MENU_TABS = {
MAP: 'Map',
VISUALIZATIONS: 'Data Visualization',