From 480cdb572c2be0fe5930a31f88e7d03f6d9b8d73 Mon Sep 17 00:00:00 2001 From: John Brunton <1276413+jbrunton@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:45:40 +0000 Subject: [PATCH] feat: show input data scatterplot on forecast page --- .../reports/forecast/forecast-page.tsx | 45 +++++++++++++++++-- packages/charts/src/util/style.ts | 3 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/projects/reports/forecast/forecast-page.tsx b/apps/client/src/app/projects/reports/forecast/forecast-page.tsx index c0c68c7c..ee9a3707 100644 --- a/apps/client/src/app/projects/reports/forecast/forecast-page.tsx +++ b/apps/client/src/app/projects/reports/forecast/forecast-page.tsx @@ -3,6 +3,7 @@ import { CompletedIssue, DateFilterType, HierarchyLevel, + Issue, SummaryResult, filterCompletedIssues, forecast, @@ -10,12 +11,16 @@ import { toClientFilter, } from "@agileplanning-io/flow-metrics"; import { useAtomValue } from "jotai"; -import { ForecastChart } from "@agileplanning-io/flow-charts"; +import { ForecastChart, Scatterplot } from "@agileplanning-io/flow-charts"; import { useProjectContext } from "../../context"; import { ChartParams, newSeed, useChartParams } from "./use-chart-params"; import { chartStyleAtom } from "../chart-style"; import { useFilterParams } from "@app/filter/use-filter-params"; -import { defaultDateRange, formatDate } from "@agileplanning-io/flow-lib"; +import { + asAbsolute, + defaultDateRange, + formatDate, +} from "@agileplanning-io/flow-lib"; import { Project } from "@data/projects"; import { ControlBar, @@ -25,9 +30,18 @@ import { Popdown, ReportType, } from "@agileplanning-io/flow-components"; -import { Button, Checkbox, Form, InputNumber, Space, Tooltip } from "antd"; +import { + Button, + Checkbox, + Form, + InputNumber, + Space, + Tooltip, + Typography, +} from "antd"; import { isNonNullish } from "remeda"; import { RedoOutlined } from "@ant-design/icons"; +import { IssueDetailsDrawer } from "../components/issue-details-drawer"; export const ForecastPage = () => { const { issues } = useProjectContext(); @@ -37,6 +51,7 @@ export const ForecastPage = () => { hierarchyLevel: HierarchyLevel.Story, })); const [filteredIssues, setFilteredIssues] = useState([]); + const [selectedIssues, setSelectedIssues] = useState([]); const { chartParams, setChartParams } = useChartParams(); const chartStyle = useAtomValue(chartStyleAtom); @@ -88,6 +103,30 @@ export const ForecastPage = () => { showPercentiles={chartParams.showPercentileLabels} /> ) : null} + + {filter?.dates && ( + <> + Input Data + + + )} + + setSelectedIssues([])} + open={selectedIssues.length > 0} + /> ); }; diff --git a/packages/charts/src/util/style.ts b/packages/charts/src/util/style.ts index d2966ed8..d8b30a6a 100644 --- a/packages/charts/src/util/style.ts +++ b/packages/charts/src/util/style.ts @@ -10,10 +10,9 @@ const defaultStyle: ChartStyle = { export const buildFontSpec = (style?: ChartStyle): Partial => { const fontSize = style?.fontSize ?? defaultStyle.fontSize; - const font = { + return { size: fontSize, }; - return font; }; export const defaultBarStyle = Object.freeze({