Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Update AccidentCountByRoadLight" #1175

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading