Skip to content

Commit

Permalink
Merge pull request #1175 from data-for-change/revert-1174-1173-bug-ro…
Browse files Browse the repository at this point in the history
…ad-light-widget

Revert "Update AccidentCountByRoadLight"
  • Loading branch information
atalyaalon authored Dec 18, 2024
2 parents 504659a + 19b3987 commit bcf7628
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
20 changes: 4 additions & 16 deletions src/components/molecules/widgets/AccidentCountByRoadLight.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
import React, { FC } from 'react';
import { IWidgetAccidentCountByRoadLight } from 'models/WidgetData';
import PieChartView from 'components/molecules/PieChartView';

const ROAD_LIGHT = 'road_light';
const COUNT = 'count';
const INNER_RADIUS = '40%';
const OUTER_RADIUS = '70%';
interface IProps {
data: IWidgetAccidentCountByRoadLight;
segmentText: string;
}

const AccidentCountByRoadLight: FC<IProps> = ({ data }) => {
return (
<PieChartView
data={data.items}
xLabel={ROAD_LIGHT}
yLabel={COUNT}
outerRadius={OUTER_RADIUS}
innerRadius={INNER_RADIUS}
/>
);
const AccidentCountByRoadLight: FC<IProps> = () => {
return <div> {} </div>;
};
export default AccidentCountByRoadLight;
export default AccidentCountByRoadLight;
4 changes: 3 additions & 1 deletion src/components/molecules/widgets/WidgetWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ const WidgetWrapper: FC<IProps> = ({ widget, locationText, sizeOptions, editorBa
break;
}
case WidgetName.accident_count_by_road_light: {
widgetComponent = <AccidentCountByRoadLight data={data as IWidgetAccidentCountByRoadLight} />;
widgetComponent = (
<AccidentCountByRoadLight data={data as IWidgetAccidentCountByRoadLight} segmentText={locationText} />
);
break;
}
case WidgetName.accident_count_by_driver_type: {
Expand Down
5 changes: 1 addition & 4 deletions src/models/WidgetData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ export interface IWidgetTopRoadSegmentsAccidentsPerKm extends IWidgetDataBase {
items: {}[];
}
export interface IWidgetAccidentCountByRoadLight extends IWidgetDataBase {
items: {
count: number;
road_light: string;
}[];
items: {}[];
}
export interface IWidgetAccidentCountByDriverType extends IWidgetDataBase {
items: {
Expand Down

0 comments on commit bcf7628

Please sign in to comment.