@kando-env/kando-ui 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CovidView/views/components/Body.js +11 -5
- package/lib/CovidView/views/components/MapStyle.scss +7 -30
- package/lib/CovidView/views/components/Sidebar.js +22 -4
- package/lib/CovidView/views/components/SummaryStyle.scss +1 -1
- package/lib/CovidView/views/components/TrendGraphNVL/TrendGraphNVL.js +176 -0
- package/lib/CovidView/views/components/TrendGraphNVL/index.js +13 -0
- package/lib/CovidView/views/components/TrendGraphNVL/styles.scss +20 -0
- package/lib/CovidView/views/components/{areas/TrendPopupContent → TrendPopupContent}/TrendPopupContent.js +36 -24
- package/lib/CovidView/views/components/areas/Area.js +74 -64
- package/lib/CovidView/views/components/areas/AreaPolygonWBE.js +37 -13
- package/lib/CovidView/views/components/areas/AreasList.js +11 -11
- package/lib/CovidView/views/components/areas/AreasStyle.scss +76 -1
- package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Areas/AreaBox/AreaBox.js +7 -3
- package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Areas/AreaBox/styles.js +3 -3
- package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Areas/styles.js +1 -1
- package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Factories/FactoryBox/styles.js +1 -1
- package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Factories/styles.js +1 -1
- package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Tabs/Tabs.js +2 -2
- package/lib/EventsView/views/components/UtilityDashboard/MostSevereEvents/MostSevereEvents.scss +6 -3
- package/lib/EventsView/views/components/UtilityDashboard/MostSevereEvents/SevereEvent/SevereEvent.scss +193 -0
- package/lib/EventsView/views/components/UtilityDashboard/TopBar/MostCommon/styles.js +1 -1
- package/lib/EventsView/views/components/UtilityDashboard/TopBar/QualitySummary/PieChart/PieChart.js +117 -0
- package/lib/EventsView/views/components/UtilityDashboard/TopBar/QualitySummary/QualitySummary.js +4 -34
- package/lib/EventsView/views/components/UtilityDashboard/TopBar/QualitySummary/styles.js +3 -3
- package/lib/EventsView/views/components/UtilityDashboard/TopBar/TopBar.js +1 -1
- package/lib/EventsView/views/components/UtilityDashboard/TopBar/styles.js +1 -1
- package/lib/EventsView/views/components/UtilityDashboard/UtilityDashboard.js +1 -1
- package/lib/EventsView/views/components/events/event_info/EventInfo.js +3 -5
- package/lib/EventsView/views/components/map/FloatingGraph.js +11 -17
- package/lib/EventsView/views/components/map/Map.js +4 -2
- package/lib/EventsView/views/components/map/floatingGraphStyle.scss +54 -0
- package/lib/EventsView/views/components/map/mapStyle.scss +7 -29
- package/lib/EventsView/views/components/points/PointMarker.js +16 -15
- package/lib/shared/components/KandoModal/KandoModal.js +9 -6
- package/lib/shared/redux/global/actions.js +5 -0
- package/package.json +1 -1
- /package/lib/CovidView/views/components/{areas/TrendPopupContent → TrendPopupContent}/index.js +0 -0
- /package/lib/CovidView/views/components/{areas/TrendPopupContent → TrendPopupContent}/styles.scss +0 -0
|
@@ -17,15 +17,15 @@ var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
|
17
17
|
|
|
18
18
|
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
19
19
|
|
|
20
|
-
var _i18n = _interopRequireDefault(require("../../../../shared/utilities/i18n"));
|
|
21
|
-
|
|
22
20
|
var _reactRedux = require("react-redux");
|
|
23
21
|
|
|
22
|
+
var _i18n = _interopRequireDefault(require("../../../../shared/utilities/i18n"));
|
|
23
|
+
|
|
24
24
|
var _actions = require("../../../../shared/redux/WBE/actions");
|
|
25
25
|
|
|
26
26
|
var _KandoModal = _interopRequireDefault(require("../../../../shared/components/KandoModal"));
|
|
27
27
|
|
|
28
|
-
var _TrendPopupContent = _interopRequireDefault(require("
|
|
28
|
+
var _TrendPopupContent = _interopRequireDefault(require("../../../../CovidView/views/components/TrendPopupContent"));
|
|
29
29
|
|
|
30
30
|
var _useQueryURL = _interopRequireDefault(require("../../../../shared/utilities/custom_hooks/useQueryURL"));
|
|
31
31
|
|
|
@@ -60,7 +60,7 @@ var Area = function Area(props) {
|
|
|
60
60
|
return "MEDIUM";
|
|
61
61
|
} else if (area.NVL >= 1000 && area.NVL <= 1000000000) {
|
|
62
62
|
return "LOW";
|
|
63
|
-
} else if (area.NVL
|
|
63
|
+
} else if (area.NVL >= 0 && area.NVL < 1000) {
|
|
64
64
|
return "CLEAN";
|
|
65
65
|
} else if (area.NVL === null) {
|
|
66
66
|
return;
|
|
@@ -86,12 +86,19 @@ var Area = function Area(props) {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
var handleAreaClick = function handleAreaClick() {
|
|
89
|
+
var handleAreaClick = function handleAreaClick(mobile) {
|
|
90
90
|
var setZoomedArea = function setZoomedArea(zoomedArea) {
|
|
91
91
|
if (area.shape_data !== undefined && area.shape_data.length !== 0) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
if (mobile && zoomedArea !== null) {
|
|
93
|
+
dispatch((0, _actions.updateWBE)({
|
|
94
|
+
zoomedArea: zoomedArea,
|
|
95
|
+
sidenavExpanded: false
|
|
96
|
+
}));
|
|
97
|
+
} else {
|
|
98
|
+
dispatch((0, _actions.updateWBE)({
|
|
99
|
+
zoomedArea: zoomedArea
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
95
102
|
}
|
|
96
103
|
};
|
|
97
104
|
|
|
@@ -109,63 +116,66 @@ var Area = function Area(props) {
|
|
|
109
116
|
console.log("sampling history");
|
|
110
117
|
};
|
|
111
118
|
|
|
119
|
+
var renderArea = function renderArea(mobile) {
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: "area ".concat(area.sampling_taken === null ? 'area--no_sampling' : '', " ").concat(expanded ? 'area--expanded' : '', " ").concat(mobile ? 'area--mobile' : 'area--desktop')
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
+
className: "area-container"
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: "area__header area__header--".concat(verbalizeNVL()),
|
|
126
|
+
onClick: function onClick() {
|
|
127
|
+
return setExpanded(!expanded);
|
|
128
|
+
}
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_Truncate.default, {
|
|
130
|
+
characters: 0
|
|
131
|
+
}, area.name)), area.sampling_taken !== null && /*#__PURE__*/_react.default.createElement("span", null, area.NVL.toExponential(2), " (", displayNVLChange(), ")")), /*#__PURE__*/_react.default.createElement("div", {
|
|
132
|
+
className: "area__details",
|
|
133
|
+
onClick: function onClick() {
|
|
134
|
+
return handleAreaClick(mobile);
|
|
135
|
+
}
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
137
|
+
className: "area__detail"
|
|
138
|
+
}, _i18n.default.t("covid_view.area_details.NVL_change"), ": ", /*#__PURE__*/_react.default.createElement("b", null, displayNVLChange())), /*#__PURE__*/_react.default.createElement("span", {
|
|
139
|
+
className: "area__detail"
|
|
140
|
+
}, _i18n.default.t("covid_view.area_details.last_updated"), ": ", /*#__PURE__*/_react.default.createElement("b", null, area.last_updated === null ? null : new Date(area.last_updated).toLocaleDateString())), /*#__PURE__*/_react.default.createElement("span", {
|
|
141
|
+
className: "area__detail"
|
|
142
|
+
}, _i18n.default.t("covid_view.area_details.sampling_taken"), ": ", /*#__PURE__*/_react.default.createElement("b", null, area.sampling_taken === null ? null : new Date(area.sampling_taken).toLocaleDateString())), /*#__PURE__*/_react.default.createElement("span", {
|
|
143
|
+
className: "area__detail"
|
|
144
|
+
}, _i18n.default.t("covid_view.area_details.status"), ": ", /*#__PURE__*/_react.default.createElement("b", null, _i18n.default.t("covid_view.area_statuses.".concat(area.status)))), /*#__PURE__*/_react.default.createElement("span", {
|
|
145
|
+
className: "area__detail"
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
147
|
+
icon: _freeSolidSvgIcons.faUsers
|
|
148
|
+
}), " ", area.population)))), isSubAreasDisplayed ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
className: "area__actions"
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
151
|
+
onClick: function onClick() {
|
|
152
|
+
return displaySubAreas();
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
155
|
+
icon: _freeSolidSvgIcons.faLevelDownAlt
|
|
156
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, " ", _i18n.default.t("covid_view.sub_areas"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
+
className: "divider"
|
|
158
|
+
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
159
|
+
onClick: function onClick() {
|
|
160
|
+
return displaySamplingHistory();
|
|
161
|
+
}
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
163
|
+
icon: _freeSolidSvgIcons.faHistory
|
|
164
|
+
}), /*#__PURE__*/_react.default.createElement(_KandoModal.default, {
|
|
165
|
+
buttonLabel: _i18n.default.t("covid_view.NVL_trend"),
|
|
166
|
+
openerClass: "inline",
|
|
167
|
+
type: "big",
|
|
168
|
+
isOpen: popupAreaID === area.id,
|
|
169
|
+
changeHistory: {
|
|
170
|
+
popup_area_id: area.id
|
|
171
|
+
}
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement(_TrendPopupContent.default, {
|
|
173
|
+
areaID: area.id
|
|
174
|
+
})))));
|
|
175
|
+
};
|
|
176
|
+
|
|
112
177
|
(0, _react.useEffect)(function () {}, [zoomedArea]);
|
|
113
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
114
|
-
className: "area ".concat(area.sampling_taken === null ? 'area--no_sampling' : '', " ").concat(expanded ? 'area--expanded' : '')
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
-
className: "area-container"
|
|
117
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
118
|
-
className: "area__header area__header--".concat(verbalizeNVL()),
|
|
119
|
-
onClick: function onClick() {
|
|
120
|
-
return setExpanded(!expanded);
|
|
121
|
-
}
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_Truncate.default, {
|
|
123
|
-
characters: 0
|
|
124
|
-
}, area.name)), area.sampling_taken !== null && /*#__PURE__*/_react.default.createElement("span", null, area.NVL.toExponential(2), " (", displayNVLChange(), ")")), /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
-
className: "area__details",
|
|
126
|
-
onClick: function onClick() {
|
|
127
|
-
return handleAreaClick();
|
|
128
|
-
}
|
|
129
|
-
}, area.sampling_taken !== null ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
130
|
-
className: "area__detail"
|
|
131
|
-
}, "NVL Change: ", /*#__PURE__*/_react.default.createElement("b", null, displayNVLChange())), /*#__PURE__*/_react.default.createElement("span", {
|
|
132
|
-
className: "area__detail"
|
|
133
|
-
}, "Last updated: ", /*#__PURE__*/_react.default.createElement("b", null, new Date(area.last_updated).toLocaleDateString())), /*#__PURE__*/_react.default.createElement("span", {
|
|
134
|
-
className: "area__detail"
|
|
135
|
-
}, "Sampling taken: ", /*#__PURE__*/_react.default.createElement("b", null, new Date(area.sampling_taken).toLocaleDateString())), /*#__PURE__*/_react.default.createElement("span", {
|
|
136
|
-
className: "area__detail"
|
|
137
|
-
}, "Status: ", /*#__PURE__*/_react.default.createElement("b", null, _i18n.default.t("covid_view.area_statuses.".concat(area.status)))), /*#__PURE__*/_react.default.createElement("span", {
|
|
138
|
-
className: "area__detail"
|
|
139
|
-
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
140
|
-
icon: _freeSolidSvgIcons.faUsers
|
|
141
|
-
}), " ", area.population)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, "No sampling was taken")))), isSubAreasDisplayed ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
-
className: "area__actions"
|
|
143
|
-
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
144
|
-
onClick: function onClick() {
|
|
145
|
-
return displaySubAreas();
|
|
146
|
-
}
|
|
147
|
-
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
148
|
-
icon: _freeSolidSvgIcons.faLevelDownAlt
|
|
149
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, " ", _i18n.default.t("covid_view.sub_areas"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
-
className: "divider"
|
|
151
|
-
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
152
|
-
onClick: function onClick() {
|
|
153
|
-
return displaySamplingHistory();
|
|
154
|
-
}
|
|
155
|
-
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
156
|
-
icon: _freeSolidSvgIcons.faHistory
|
|
157
|
-
}), /*#__PURE__*/_react.default.createElement(_KandoModal.default, {
|
|
158
|
-
buttonLabel: _i18n.default.t("covid_view.NVL_trend"),
|
|
159
|
-
openerClass: "inline",
|
|
160
|
-
type: "big",
|
|
161
|
-
isOpen: popupAreaID === area.id,
|
|
162
|
-
changeHistory: {
|
|
163
|
-
popup_area_id: area.id
|
|
164
|
-
}
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement(_TrendPopupContent.default, {
|
|
166
|
-
areaID: area.id,
|
|
167
|
-
period: "3m"
|
|
168
|
-
})))));
|
|
178
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderArea(true), renderArea(false));
|
|
169
179
|
};
|
|
170
180
|
|
|
171
181
|
exports.Area = Area;
|
|
@@ -11,32 +11,33 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
+
var _reactRedux = require("react-redux");
|
|
15
|
+
|
|
14
16
|
var _useRemoveExistingLayers = _interopRequireDefault(require("../../../../shared/utilities/custom_hooks/useRemoveExistingLayers"));
|
|
15
17
|
|
|
16
18
|
var _i18n = _interopRequireDefault(require("../../../../shared/utilities/i18n"));
|
|
17
19
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var _invalidSampling = _interopRequireDefault(require("../../../../assets/area_statuses/invalid-sampling.png"));
|
|
20
|
+
var _actions = require("../../../../shared/redux/WBE/actions");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _validSampling = _interopRequireDefault(require("../../../../assets/images/area_statuses/valid-sampling.png"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _invalidSampling = _interopRequireDefault(require("../../../../assets/images/area_statuses/invalid-sampling.png"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _missingSampling = _interopRequireDefault(require("../../../../assets/images/area_statuses/missing-sampling.png"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _pendingSampling = _interopRequireDefault(require("../../../../assets/images/area_statuses/pending-sampling.png"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _up = _interopRequireDefault(require("../../../../assets/images/NVL_trends/up.png"));
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _down = _interopRequireDefault(require("../../../../assets/images/NVL_trends/down.png"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _same = _interopRequireDefault(require("../../../../assets/images/NVL_trends/same.png"));
|
|
35
35
|
|
|
36
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
37
|
|
|
38
38
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
39
|
|
|
40
|
+
//TODO make sure assets are in
|
|
40
41
|
var AreaPolygonWBE = function AreaPolygonWBE(props) {
|
|
41
42
|
var L = props.L,
|
|
42
43
|
map = props.map,
|
|
@@ -122,7 +123,7 @@ var AreaPolygonWBE = function AreaPolygonWBE(props) {
|
|
|
122
123
|
iconUrl: iconURL,
|
|
123
124
|
iconSize: [54, 58],
|
|
124
125
|
iconAnchor: [19, 42],
|
|
125
|
-
popupAnchor: [
|
|
126
|
+
popupAnchor: [8, -36]
|
|
126
127
|
};
|
|
127
128
|
};
|
|
128
129
|
|
|
@@ -165,6 +166,7 @@ var AreaPolygonWBE = function AreaPolygonWBE(props) {
|
|
|
165
166
|
marker["kando_object_id"] = area.point.id;
|
|
166
167
|
marker["kando_object"] = "Point";
|
|
167
168
|
marker.addTo(map);
|
|
169
|
+
marker.bindPopup("\n <p>".concat(area.name, " / ").concat(area.point.name, "</p>\n "));
|
|
168
170
|
}
|
|
169
171
|
};
|
|
170
172
|
|
|
@@ -189,6 +191,28 @@ var AreaPolygonWBE = function AreaPolygonWBE(props) {
|
|
|
189
191
|
}
|
|
190
192
|
};
|
|
191
193
|
|
|
194
|
+
var samplingsForSubAreas = function samplingsForSubAreas() {
|
|
195
|
+
var noSamplings = false;
|
|
196
|
+
|
|
197
|
+
if (area.sub_areas !== undefined && area.sub_areas.length !== 0) {
|
|
198
|
+
area.sub_areas.forEach(function (sub_area) {
|
|
199
|
+
if (sub_area.status !== 3) {
|
|
200
|
+
noSamplings = false;
|
|
201
|
+
} else {
|
|
202
|
+
noSamplings = true;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
if (noSamplings) {
|
|
207
|
+
return _i18n.default.t("covid_view.no_valid_samplings");
|
|
208
|
+
} else {
|
|
209
|
+
return '';
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return _i18n.default.t("covid_view.no_valid_samplings");
|
|
214
|
+
};
|
|
215
|
+
|
|
192
216
|
(0, _useRemoveExistingLayers.default)(map, area, "Area", mapZoom);
|
|
193
217
|
(0, _useRemoveExistingLayers.default)(map, fakeLayer(), "Point", mapZoom);
|
|
194
218
|
(0, _react.useEffect)(function () {
|
|
@@ -220,14 +244,14 @@ var AreaPolygonWBE = function AreaPolygonWBE(props) {
|
|
|
220
244
|
if (area.sub_areas !== undefined && area.sub_areas.length !== 0) {
|
|
221
245
|
dispatch((0, _actions.updateWBE)({
|
|
222
246
|
focusedArea: area,
|
|
223
|
-
zoomedArea:
|
|
247
|
+
zoomedArea: area.sub_areas[0]
|
|
224
248
|
}));
|
|
225
249
|
}
|
|
226
250
|
});
|
|
227
251
|
polygon.on('mouseover', function (e) {
|
|
228
252
|
var layer = e.target;
|
|
229
253
|
var LatLng = layer.getBounds().getCenter();
|
|
230
|
-
var popup = L.popup().setLatLng(LatLng).setContent("\n <h4>".concat(area.name, "</h4>\n <p>").concat(NVLScoreForSite(), "</p>\n <p>").concat(_i18n.default.t('covid_view.viral_load'), ": ").concat(area.NVL.toExponential(2), "</p>\n <p>").concat(_i18n.default.t('covid_view.status'), ": ").concat(_i18n.default.t("covid_view.area_statuses.".concat(area.status)), "</p>\n <p>
|
|
254
|
+
var popup = L.popup().setLatLng(LatLng).setContent("\n <h4>".concat(area.name, "</h4>\n <p>").concat(NVLScoreForSite(), "</p>\n <p>").concat(_i18n.default.t('covid_view.viral_load'), ": ").concat(area.NVL.toExponential(2), "</p>\n <p>").concat(_i18n.default.t('covid_view.status'), ": ").concat(_i18n.default.t("covid_view.area_statuses.".concat(area.status)), "</p>\n <p>").concat(samplingsForSubAreas(), "</p>\n ")).openOn(map);
|
|
231
255
|
polygon.on('mouseout', function (e) {
|
|
232
256
|
map.closePopup(popup);
|
|
233
257
|
});
|
|
@@ -13,19 +13,19 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var _Area = require("./Area");
|
|
17
|
-
|
|
18
|
-
require("./AreasStyle.scss");
|
|
19
|
-
|
|
20
|
-
var _actions = require("../../../../shared/redux/WBE/actions");
|
|
21
|
-
|
|
22
16
|
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
23
17
|
|
|
24
18
|
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
25
19
|
|
|
26
20
|
var _reactRedux = require("react-redux");
|
|
27
21
|
|
|
28
|
-
var
|
|
22
|
+
var _Area = require("./Area");
|
|
23
|
+
|
|
24
|
+
require("./AreasStyle.scss");
|
|
25
|
+
|
|
26
|
+
var _actions = require("../../../../shared/redux/WBE/actions");
|
|
27
|
+
|
|
28
|
+
var _Sort = _interopRequireDefault(require("../../../../CovidView/views/components/areas/Sort"));
|
|
29
29
|
|
|
30
30
|
var _i18n = _interopRequireDefault(require("../../../../shared/utilities/i18n"));
|
|
31
31
|
|
|
@@ -56,7 +56,7 @@ var AreasList = function AreasList(props) {
|
|
|
56
56
|
|
|
57
57
|
if (sort == 1) {
|
|
58
58
|
sorted = areas.slice().sort(function (a, b) {
|
|
59
|
-
return
|
|
59
|
+
return b.NVL - a.NVL;
|
|
60
60
|
});
|
|
61
61
|
setModifiedAreas(undefined);
|
|
62
62
|
setTimeout(function () {
|
|
@@ -64,7 +64,7 @@ var AreasList = function AreasList(props) {
|
|
|
64
64
|
}, 50);
|
|
65
65
|
} else if (sort == 2) {
|
|
66
66
|
sorted = areas.slice().sort(function (a, b) {
|
|
67
|
-
return
|
|
67
|
+
return b.NVL_diff_ratio - a.NVL_diff_ratio;
|
|
68
68
|
});
|
|
69
69
|
setModifiedAreas(undefined);
|
|
70
70
|
setTimeout(function () {
|
|
@@ -83,7 +83,7 @@ var AreasList = function AreasList(props) {
|
|
|
83
83
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
84
|
className: "main"
|
|
85
85
|
}, isSubAreasDisplayed ? /*#__PURE__*/_react.default.createElement("h3", null, focusedArea.name) : /*#__PURE__*/_react.default.createElement("h3", null, _i18n.default.t("covid_view.main_areas")), isSubAreasDisplayed ? /*#__PURE__*/_react.default.createElement("a", {
|
|
86
|
-
className: "back-button",
|
|
86
|
+
className: "back-button--sub-areas",
|
|
87
87
|
onClick: function onClick() {
|
|
88
88
|
dispatch((0, _actions.updateWBE)({
|
|
89
89
|
focusedArea: null,
|
|
@@ -92,7 +92,7 @@ var AreasList = function AreasList(props) {
|
|
|
92
92
|
}
|
|
93
93
|
}, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
94
94
|
icon: _freeSolidSvgIcons.faArrowLeft
|
|
95
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, "
|
|
95
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, " ", _i18n.default.t('covid_view.back_to_main_areas'))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("span", null, areas !== undefined && areas.length !== 0 && /*#__PURE__*/_react.default.createElement(_Sort.default, {
|
|
96
96
|
triggerSort: triggerSort,
|
|
97
97
|
areas: areas,
|
|
98
98
|
focusedArea: focusedArea
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
@media only screen and (max-width: 450px) {
|
|
2
|
+
.react-responsive-modal-modal {
|
|
3
|
+
max-width: 90vw !important;
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
.sidebar {
|
|
3
7
|
width: 100vw !important;
|
|
4
8
|
|
|
@@ -15,17 +19,76 @@
|
|
|
15
19
|
&--collapsed {
|
|
16
20
|
.ltrs & {
|
|
17
21
|
left: -100vw !important;
|
|
22
|
+
transition: .2s ease-in-out;
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
.rtls & {
|
|
21
26
|
right: -100vw !important;
|
|
27
|
+
transition: .2s ease-in-out;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.summarybar {
|
|
33
|
+
width: 100vw !important;
|
|
34
|
+
|
|
35
|
+
.trend-button {
|
|
36
|
+
padding: .3em !important;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.back-button {
|
|
41
|
+
&--mobile {
|
|
42
|
+
&--shown {
|
|
43
|
+
display: block;
|
|
22
44
|
}
|
|
23
45
|
}
|
|
24
46
|
}
|
|
47
|
+
|
|
48
|
+
.area--desktop {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.area--mobile {
|
|
53
|
+
display: block !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.zoomed {
|
|
57
|
+
display: block !important;
|
|
58
|
+
}
|
|
25
59
|
}
|
|
26
60
|
|
|
27
61
|
.sidebar {
|
|
28
62
|
padding-bottom: 4em;
|
|
63
|
+
transition: .1s ease-in-out;
|
|
64
|
+
|
|
65
|
+
.ltrs & {
|
|
66
|
+
left: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rtls & {
|
|
70
|
+
right: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.back-button {
|
|
74
|
+
position: fixed;
|
|
75
|
+
top: 10em;
|
|
76
|
+
width: 100vw;
|
|
77
|
+
left: 0em;
|
|
78
|
+
background: white;
|
|
79
|
+
padding: 9px;
|
|
80
|
+
border: 1px solid rgba(0,0,0,.1);
|
|
81
|
+
border-left: 0;
|
|
82
|
+
border-right: 0;
|
|
83
|
+
|
|
84
|
+
&--mobile {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.zoomed {
|
|
91
|
+
display: none;
|
|
29
92
|
}
|
|
30
93
|
|
|
31
94
|
.areas-container {
|
|
@@ -109,6 +172,14 @@
|
|
|
109
172
|
|
|
110
173
|
.area__details {
|
|
111
174
|
display: none;
|
|
175
|
+
|
|
176
|
+
.ltrs & {
|
|
177
|
+
text-align: left;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.rtls & {
|
|
181
|
+
text-align: right;
|
|
182
|
+
}
|
|
112
183
|
}
|
|
113
184
|
|
|
114
185
|
.area__actions {
|
|
@@ -141,6 +212,10 @@
|
|
|
141
212
|
transition: 0.1s ease;
|
|
142
213
|
}
|
|
143
214
|
|
|
215
|
+
&--mobile {
|
|
216
|
+
display: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
144
219
|
&--expanded {
|
|
145
220
|
height: max-content !important;
|
|
146
221
|
transition: .1s ease-in-out;
|
|
@@ -156,7 +231,7 @@
|
|
|
156
231
|
|
|
157
232
|
&--no_sampling {
|
|
158
233
|
.area__header {
|
|
159
|
-
background:
|
|
234
|
+
background: rgb(187, 187, 187) !important;
|
|
160
235
|
}
|
|
161
236
|
}
|
|
162
237
|
|
package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Areas/AreaBox/AreaBox.js
CHANGED
|
@@ -48,7 +48,7 @@ var AreaBox = function AreaBox(_ref) {
|
|
|
48
48
|
return /*#__PURE__*/_react.default.createElement(_styles.Box, {
|
|
49
49
|
up: area.up
|
|
50
50
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
-
className: "top ".concat(enableToolTip ?
|
|
51
|
+
className: "top ".concat(enableToolTip ? ' tooltip' : ''),
|
|
52
52
|
"data-text": area.title
|
|
53
53
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
54
54
|
className: "title",
|
|
@@ -59,14 +59,18 @@ var AreaBox = function AreaBox(_ref) {
|
|
|
59
59
|
className: "content"
|
|
60
60
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
61
61
|
className: "percent"
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
63
|
+
className: "up"
|
|
62
64
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
63
65
|
className: "number"
|
|
64
66
|
}, area.percent, "% "), /*#__PURE__*/_react.default.createElement(_assets.Arrow, {
|
|
65
67
|
fill: area.up ? '#1db232' : '#f6004f',
|
|
66
68
|
height: "10px",
|
|
67
69
|
width: "11px",
|
|
68
|
-
css: "\n
|
|
69
|
-
}), ' '
|
|
70
|
+
css: "\n vertical-align: middle;\n "
|
|
71
|
+
}), ' '), /*#__PURE__*/_react.default.createElement("span", {
|
|
72
|
+
className: "down"
|
|
73
|
+
}, area.up ? 'Improvement' : 'Decline')), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
74
|
className: "map" // onMouseEnter={() => setShowPieChart(prev=>!prev)}
|
|
71
75
|
,
|
|
72
76
|
onMouseEnter: function onMouseEnter() {
|
package/lib/EventsView/views/components/UtilityDashboard/MostPolluting/Areas/AreaBox/styles.js
CHANGED
|
@@ -12,12 +12,12 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var Box = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "styles__Box",
|
|
14
14
|
componentId: "sc-1fvta03-0"
|
|
15
|
-
})(["border:solid 1px #ebebeb;width:100%;height:100%;color:#1d1d1d;> .top{height:38px;padding:9px 19px;background-color:#f9f9f9;display:flex;justify-content:space-between;position:relative;align-items:baseline;&.tooltip{&[data-text]::after{content:attr(data-text);position:absolute;color:white;background-color:rgba(0,0,0,0.9);border-radius:5px;top:5px;left:20px;z-index:3;padding:4px 2px;opacity:0;z-index:-1;transition:all 0.5s ease-in-out;}&:hover{&[data-text]::after{opacity:1;z-index:1;}}}> .title{font-size:18px;font-weight:600;line-height:1.22;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:auto;&::-webkit-scrollbar{display:none;}-ms-overflow-style:none;scrollbar-width:none;max-width:60%;}> .factories{font-size:14px;}}> .content{display:flex;justify-content:space-between;padding:11px 20px;height:calc(100% - 38px);> .percent{flex:1;align-items:center;margin:auto 0;font-size:14px;> .number{font-size:24px;font-weight:700;}> svg{vertical-align:baseline;transform:rotate(", ");}
|
|
15
|
+
})(["border:solid 1px #ebebeb;width:100%;height:100%;color:#1d1d1d;> .top{height:38px;padding:9px 19px;background-color:#f9f9f9;display:flex;justify-content:space-between;position:relative;align-items:baseline;&.tooltip{&[data-text]::after{content:attr(data-text);position:absolute;color:white;background-color:rgba(0,0,0,0.9);border-radius:5px;top:5px;left:20px;z-index:3;padding:4px 2px;opacity:0;z-index:-1;transition:all 0.5s ease-in-out;}&:hover{&[data-text]::after{opacity:1;z-index:1;}}}> .title{font-size:18px;font-weight:600;line-height:1.22;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;overflow-y:auto;&::-webkit-scrollbar{display:none;}-ms-overflow-style:none;scrollbar-width:none;max-width:60%;}> .factories{font-size:14px;}}> .content{display:flex;justify-content:space-between;padding:11px 20px;height:calc(100% - 38px);> .percent{flex:1;align-items:center;margin:auto 0;font-size:14px;color:", ";> .up{display:block;> .number{font-size:24px;font-weight:700;}> svg{vertical-align:baseline;transform:rotate(", ");}}> .down{}}> .map{flex:3;height:100%;position:relative;padding:5px;@keyframes hide{from{opacity:0;}to{opacity:1;}}> .front{background-color:rgba(0,0,255,0.2);display:flex;height:100%;justify-content:center;align-items:center;animation-name:hide;animation-duration:0.5s;transition:all 1s ease-in-out;}> .back{background-color:#f9f9f9;}}@media (max-width:500px){flex-direction:column-reverse;justify-content:space-between;padding:5x 10px;> .percent{flex:1;align-items:none;font-size:14px;> .up{display:inline-block;> .number{font-size:18px;font-weight:700;}}}> .map{flex:4;padding:0;}}}"], function (_ref) {
|
|
16
16
|
var up = _ref.up;
|
|
17
|
-
return up ? '
|
|
17
|
+
return up ? '#1db232' : '#f6004f';
|
|
18
18
|
}, function (_ref2) {
|
|
19
19
|
var up = _ref2.up;
|
|
20
|
-
return up ? '
|
|
20
|
+
return up ? '180deg' : '0';
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.Box = Box;
|
|
@@ -12,7 +12,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var GridBoxContainer = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "styles__GridBoxContainer",
|
|
14
14
|
componentId: "sc-yje1vj-0"
|
|
15
|
-
})(["display:grid;grid-template-columns:repeat(4,minmax(200px,1fr));@media (max-width:1450px){grid-template-columns:repeat(3,minmax(200px,1fr))
|
|
15
|
+
})(["display:grid;grid-template-columns:repeat(4,minmax(200px,1fr));@media (max-width:1450px){grid-template-columns:repeat(3,minmax(200px,1fr));}@media (max-width:1250px){grid-template-columns:repeat(2,minmax(200px,1fr));}@media (max-width:768px){grid-template-columns:repeat(1,minmax(200px,1fr));}grid-auto-rows:208px;grid-gap:20px;width:100%;height:100%;"]);
|
|
16
16
|
|
|
17
17
|
exports.GridBoxContainer = GridBoxContainer;
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var Box = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "styles__Box",
|
|
14
14
|
componentId: "sc-mo052r-0"
|
|
15
|
-
})(["border:solid 1px #ebebeb;width:100%;height:100%;color:#1d1d1d;> .top{height:38px;padding:11px 19px;background-color:#f9f9f9;display:flex;justify-content:space-between;position:relative;> .title{font-size:18px;font-weight:600;line-height:1.22;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:50%;height:38px;position:relative;}> .area{font-size:14px;font-weight:300;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:50%;text-align:right;height:38px;}}> .content{display:flex;justify-content:space-between;padding:20px;height:calc(100% - 38px);> .details{position:relative;&::after{content:'';position:absolute;width:29px;top:50%;left:0;transform:translateY(-50%);border-bottom:1px solid #ebebeb;}flex:4;display:flex;flex-direction:column;justify-content:space-between;> .percent{align-items:center;font-size:14px;> .number{font-size:24px;font-weight:700;}> svg{vertical-align:baseline;transform:rotate(", ");}color:", ";}> .sector{font-size:14px;display:flex;align-items:center;> .image{margin-right:6px;}> .text{> .title{font-weight:300;margin:0;}> .sector-type{font-weight:700;}}}}> .chart{flex:2;height:100%;position:relative;}}"], function (_ref) {
|
|
15
|
+
})(["border:solid 1px #ebebeb;width:100%;height:100%;color:#1d1d1d;> .top{height:38px;padding:11px 19px;background-color:#f9f9f9;display:flex;justify-content:space-between;position:relative;> .title{font-size:18px;font-weight:600;line-height:1.22;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:50%;height:38px;position:relative;}> .area{font-size:14px;font-weight:300;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:50%;text-align:right;height:38px;}}> .content{display:flex;justify-content:space-between;padding:20px;height:calc(100% - 38px);> .details{position:relative;&::after{content:'';position:absolute;width:29px;top:50%;left:0;transform:translateY(-50%);border-bottom:1px solid #ebebeb;}flex:4;display:flex;flex-direction:column;justify-content:space-between;> .percent{align-items:center;font-size:14px;> .number{font-size:24px;font-weight:700;}> svg{vertical-align:baseline;transform:rotate(", ");}color:", ";}> .sector{font-size:14px;display:flex;align-items:center;> .image{margin-right:6px;}> .text{> .title{font-weight:300;margin:0;}> .sector-type{font-weight:700;}}}}> .chart{flex:2;height:100%;position:relative;}@media (max-width:500px){> .details{flex:2;> .percent{font-size:12px;> .number{font-size:18px;}}> .sector{font-size:12px;}}}}"], function (_ref) {
|
|
16
16
|
var up = _ref.up;
|
|
17
17
|
return up ? '180deg' : '0';
|
|
18
18
|
}, function (_ref2) {
|
|
@@ -12,7 +12,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var GridBoxContainer = _styledComponents.default.div.withConfig({
|
|
13
13
|
displayName: "styles__GridBoxContainer",
|
|
14
14
|
componentId: "sc-16jva4m-0"
|
|
15
|
-
})(["display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));grid-auto-rows:181px;grid-gap:20px;width:100%;height:100%;"]);
|
|
15
|
+
})(["display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));@media (max-width:500px){grid-template-columns:repeat(1,1fr);}grid-auto-rows:181px;grid-gap:20px;width:100%;height:100%;"]);
|
|
16
16
|
|
|
17
17
|
exports.GridBoxContainer = GridBoxContainer;
|
|
18
18
|
|
|
@@ -18,12 +18,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
18
18
|
var Container = _styledComponents.default.div.withConfig({
|
|
19
19
|
displayName: "Tabs__Container",
|
|
20
20
|
componentId: "sc-h45hsm-0"
|
|
21
|
-
})(["display:
|
|
21
|
+
})(["display:grid;margin-bottom:17px;grid-auto-rows:38px;grid-template-columns:repeat(7,1fr);grid-gap:10px;@media (max-width:1450px){grid-template-columns:repeat(6,1fr);}@media (max-width:1224px){grid-template-columns:repeat(5,1fr);}@media (max-width:960px){grid-template-columns:repeat(3,1fr);}"]);
|
|
22
22
|
|
|
23
23
|
var Tab = _styledComponents.default.div.withConfig({
|
|
24
24
|
displayName: "Tabs__Tab",
|
|
25
25
|
componentId: "sc-h45hsm-1"
|
|
26
|
-
})(["height:38px;
|
|
26
|
+
})(["height:38px;cursor:pointer;border:solid 1px #ebebeb;display:flex;justify-content:center;align-items:center;background-color:#fcfcfc;font-family:Gilroy;font-size:14px;@media (max-width:768px){font-size:10px;text-align:center;}font-weight:300;font-stretch:normal;font-style:normal;line-height:1.57;letter-spacing:0.35px;color:#1d1d1d;user-select:none;&.active{background-color:#ebebeb;font-weight:600;position:relative;&&::after{content:'';position:absolute;bottom:-5px;left:50%;transform:translateX(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #ebebeb;}}"]);
|
|
27
27
|
|
|
28
28
|
var Tabs = function Tabs(_ref) {
|
|
29
29
|
var selected = _ref.selected,
|
package/lib/EventsView/views/components/UtilityDashboard/MostSevereEvents/MostSevereEvents.scss
CHANGED
|
@@ -18,14 +18,17 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
> .events-container {
|
|
21
|
-
|
|
22
21
|
display: grid;
|
|
23
22
|
grid-template-columns: repeat(auto-fill, 446px);
|
|
24
23
|
grid-gap: 24px;
|
|
25
24
|
grid-auto-rows: 315px;
|
|
25
|
+
@media (max-width: 446px) {
|
|
26
|
+
grid-template-columns: repeat(1, 1fr);
|
|
27
|
+
grid-auto-rows: 400px;
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
justify-content: center;
|
|
27
32
|
align-items: center;
|
|
28
|
-
|
|
29
|
-
|
|
30
33
|
}
|
|
31
34
|
}
|