Skip to content

Commit

Permalink
render individual points in port report events vessels
Browse files Browse the repository at this point in the history
  • Loading branch information
j8seangel committed Jan 14, 2025
1 parent ad22fc1 commit 18f13c4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/fishing-map/features/reports/ports/PortsReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { useFetchPortsReport } from './ports-report.hooks'
import {
selectPortReportsDataview,
selectPortReportVesselsGrouped,
selectPortReportVesselsIndividualData,
selectPortReportVesselsPaginated,
selectPortReportVesselsPagination,
} from './ports-report.selectors'
Expand Down Expand Up @@ -66,6 +67,7 @@ function PortsReport() {
const portsReportData = useSelector(selectPortsReportData)
const portsReportDataStatus = useSelector(selectPortsReportStatus)
const portsReportVesselsGrouped = useSelector(selectPortReportVesselsGrouped)
const portReportIndividualData = useSelector(selectPortReportVesselsIndividualData)
const portsReportVesselsPaginated = useSelector(selectPortReportVesselsPaginated)
const {
data,
Expand Down Expand Up @@ -222,6 +224,7 @@ function PortsReport() {
</div>
<EventsReportVesselsGraph
data={portsReportVesselsGrouped}
individualData={portReportIndividualData}
color={color}
property={portReportVesselsProperty}
filterQueryParam="portsReportVesselsFilter"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {
TEMPLATE_VESSEL_DATAVIEW_SLUG,
} from 'data/workspaces'
import { selectAllDataviews } from 'features/dataviews/dataviews.slice'
import { REPORT_FILTER_PROPERTIES } from '../vessel-groups/vessels/vessel-group-report-vessels.selectors'
import {
getVesselIndividualGroupedData,
REPORT_FILTER_PROPERTIES,
} from '../vessel-groups/vessels/vessel-group-report-vessels.selectors'
import { OTHER_CATEGORY_LABEL } from '../vessel-groups/vessel-group-report.config'
import { selectPortsReportVessels } from './ports-report.slice'
import {
Expand Down Expand Up @@ -115,6 +118,14 @@ export const selectPortReportVesselsGrouped = createSelector(
}
)

export const selectPortReportVesselsIndividualData = createSelector(
[selectPortReportVesselsFiltered, selectPortReportVesselsProperty],
(vessels, groupBy) => {
if (!vessels || !groupBy) return []
return getVesselIndividualGroupedData(vessels, groupBy)
}
)

export const selectPortReportVesselsPaginated = createSelector(
[
selectPortReportVesselsFiltered,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export const selectVGRVesselsGraphAggregatedData = createSelector(
}
)

function getVesselIndividualGroupedData(
export function getVesselIndividualGroupedData(
vessels: (EventsStatsVessel | VesselGroupVesselTableParsed)[],
groupByProperty: VGRSubsection | VGREventsVesselsProperty
) {
Expand Down

0 comments on commit 18f13c4

Please sign in to comment.