Skip to content

Commit bcf7628

Browse files
authored
Merge pull request #1175 from data-for-change/revert-1174-1173-bug-road-light-widget
Revert "Update AccidentCountByRoadLight"
2 parents 504659a + 19b3987 commit bcf7628

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed
Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
import React, { FC } from 'react';
22
import { IWidgetAccidentCountByRoadLight } from 'models/WidgetData';
3-
import PieChartView from 'components/molecules/PieChartView';
43

5-
const ROAD_LIGHT = 'road_light';
6-
const COUNT = 'count';
7-
const INNER_RADIUS = '40%';
8-
const OUTER_RADIUS = '70%';
94
interface IProps {
105
data: IWidgetAccidentCountByRoadLight;
6+
segmentText: string;
117
}
128

13-
const AccidentCountByRoadLight: FC<IProps> = ({ data }) => {
14-
return (
15-
<PieChartView
16-
data={data.items}
17-
xLabel={ROAD_LIGHT}
18-
yLabel={COUNT}
19-
outerRadius={OUTER_RADIUS}
20-
innerRadius={INNER_RADIUS}
21-
/>
22-
);
9+
const AccidentCountByRoadLight: FC<IProps> = () => {
10+
return <div> {} </div>;
2311
};
24-
export default AccidentCountByRoadLight;
12+
export default AccidentCountByRoadLight;

src/components/molecules/widgets/WidgetWrapper.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ const WidgetWrapper: FC<IProps> = ({ widget, locationText, sizeOptions, editorBa
199199
break;
200200
}
201201
case WidgetName.accident_count_by_road_light: {
202-
widgetComponent = <AccidentCountByRoadLight data={data as IWidgetAccidentCountByRoadLight} />;
202+
widgetComponent = (
203+
<AccidentCountByRoadLight data={data as IWidgetAccidentCountByRoadLight} segmentText={locationText} />
204+
);
203205
break;
204206
}
205207
case WidgetName.accident_count_by_driver_type: {

src/models/WidgetData.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,7 @@ export interface IWidgetTopRoadSegmentsAccidentsPerKm extends IWidgetDataBase {
157157
items: {}[];
158158
}
159159
export interface IWidgetAccidentCountByRoadLight extends IWidgetDataBase {
160-
items: {
161-
count: number;
162-
road_light: string;
163-
}[];
160+
items: {}[];
164161
}
165162
export interface IWidgetAccidentCountByDriverType extends IWidgetDataBase {
166163
items: {

0 commit comments

Comments
 (0)