This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 77ff781 Author: VWSCoronaDashboard25 <[email protected]> Date: Tue May 31 11:12:17 2022 +0200 feature(CMS): slice first 3 path elements of for the title because they are redundant in the preview (#4272) closes: COR-543 Co-authored-by: VWSCoronaDashboard25 <[email protected]> commit f5bd004 Author: MN <[email protected]> Date: Mon May 30 16:10:34 2022 +0200 COR-725 unix date correction (#4255) * fix: use startOfDay for all graph values * fix: convert dates to startOfDay * fix: use endOfDay instead of middleOfDay for current date hook * fix: update tests Co-authored-by: VWSCoronaDashboard24 <[email protected]> commit 6fcf9b4 Author: J <[email protected]> Date: Fri May 27 10:52:13 2022 +0200 Feature/cor 750 add dotted time series style (#4267) * Added a dot line for the time series graph * Added laganda support and group scatter plot dots commit 4eeff20 Author: VWSCoronaDashboard22 <[email protected]> Date: Wed May 25 15:22:14 2022 +0200 Removed obsolete code for international pages (#4268) * Removed obsolete code for international pages * Removed type parameter commit 10d9706 Author: VWSCoronaDashboard25 <[email protected]> Date: Wed May 25 14:24:46 2022 +0200 fix: set icon size for the top menu icons on smaller screens (#4266) These were forgotten with the refactor Co-authored-by: VWSCoronaDashboard25 <[email protected]> commit 4f4abc9 Author: VWSCoronaDashboard22 <[email protected]> Date: Wed May 25 13:27:53 2022 +0200 Implemented redesign combobox and select list (#4264) * Implemented redesign combobox and select list * Removed unused imports * Removed sorting by score * Added padding to no results message * Always keep the same width for search form * Removed unused import * Fixed padding search results commit 38ec557 Author: MN <[email protected]> Date: Tue May 24 16:29:36 2022 +0200 COR-736 Behavior Choropleth Tooltip (#4262) * fix: fall back to - when no data is available for behavior choropleth tooltip * fix: show 0% when data is not null but 0 Co-authored-by: VWSCoronaDashboard24 <[email protected]> commit cb44e92 Author: HO <[email protected]> Date: Tue May 24 14:45:50 2022 +0200 fix: revert changes, replace with empty div and pass optional props (#4263) commit 26a07c7 Author: MN <[email protected]> Date: Tue May 24 11:34:08 2022 +0200 COR-618 Resolve duplicate IDs (#4261) * fix: only render mini charts once based on screen size * fix: use unique ids for different chart elements and accessibility-annotations * fix: mock useUniqueId hook * fix: cleanup mock after test Co-authored-by: VWSCoronaDashboard24 <[email protected]> commit 64861ee Author: HO <[email protected]> Date: Mon May 23 15:02:23 2022 +0200 Archive page and add warning tile (#4260) * feat(situationsPage): archive page and add warning tile * feat: added new key for warning commit 1ab4c1b Author: VWSCoronaDashboard25 <[email protected]> Date: Mon May 23 12:05:16 2022 +0200 Refactor/cor 73 remove fixed width and height in icons (#4256) * refactor: remove width and height of icons with a viewBox * refactor: replace width and height of icons with a viewBox * refactor: set size of metadata icon in metadata instead Use a styled span similar to the icon in the header component * refactor: set size of situation icon in code Using the extended properties of the generated React element Co-authored-by: VWSCoronaDashboard25 <[email protected]> commit 2605658 Author: VWSCoronaDashboard22 <[email protected]> Date: Thu May 19 15:05:53 2022 +0200 Added string year to age group (#4259) commit f506760 Author: J <[email protected]> Date: Thu May 19 13:58:38 2022 +0200 Feature/cor 615 fix two kpi tiles with one column (#4257) * change to grid * Remove extra KPI tile * Fix margins and paddings commit 4d02ed5 Author: MN <[email protected]> Date: Thu May 19 13:46:30 2022 +0200 fix: fall back to - when no data is available for behavior choropleth tooltip (#4258) Co-authored-by: VWSCoronaDashboard24 <[email protected]> commit 2fd679b Author: VWSCoronaDashboard22 <[email protected]> Date: Thu May 19 08:46:13 2022 +0200 Feature/cor 733 hospital admissions per 100000 (#4254) * Removed user-scalable and added maximum-scale=5 * Changed metric key and legend on hospital admissions choropleth commit ed58ee4 Author: VWSCoronaDashboard22 <[email protected]> Date: Wed May 18 12:37:29 2022 +0200 Removed user-scalable and added maximum-scale=5 (#4253) commit eed6f66 Author: HO <[email protected]> Date: Wed May 18 10:05:48 2022 +0200 feat: upgrade version sanity cli (#4251) commit 479eab0 Author: VWSCoronaDashboard22 <[email protected]> Date: Wed May 18 09:51:22 2022 +0200 Set text y axis to bold and black (#4250) commit 20f9d6a Author: VWSCoronaDashboard22 <[email protected]> Date: Wed May 18 08:37:22 2022 +0200 Ignore forced maximum when out of bounds value is outside time domain (#4246) * Ignore forced maximum when out of bounds value is outside time domain * Lint fixes * Added hasOutofBoudsValues to useMemo dependency array * Use Math.min instead of ternary operator * Type check calculatedForcedMaximumValue for seriesMax commit f34638f Author: MN <[email protected]> Date: Tue May 17 14:58:00 2022 +0200 COR-676 - Behavior keys optional in json schemas (#4241) * fix: make selftest_visit_behavior optional in json schemas * feat: make behavior json keys optional Co-authored-by: VWSCoronaDashboard24 <[email protected]> commit 390905b Author: HO <[email protected]> Date: Tue May 17 13:57:11 2022 +0200 Remove booster past seven days from vaccinations page (#4249) * feat: updated schemas * feat(booster): remove last seven days from booster commit 50fc1e8 Author: HO <[email protected]> Date: Tue May 17 09:54:11 2022 +0200 feat(measures): change h2 to h1 for page title (#4247) commit 7d0b918 Author: HO <[email protected]> Date: Tue May 17 09:03:53 2022 +0200 feat: change display names to search terms (#4245) commit 83dff18 Author: HO <[email protected]> Date: Fri May 13 11:50:42 2022 +0200 feat: flip h1 with h2 and keep styling as it is (#4244)
- Loading branch information
1 parent
8ecb650
commit 8b32345
Showing
211 changed files
with
616 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
packages/app/src/components/time-series-chart/components/scatter-plot.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { useMemo } from 'react'; | ||
import { isPresent } from 'ts-is-present'; | ||
import { SeriesItem, SeriesSingleValue } from '../logic'; | ||
import { Group } from '@visx/group'; | ||
|
||
const DEFAULT_DOT_SIZE = 3; | ||
|
||
type LineTrendProps = { | ||
series: SeriesSingleValue[]; | ||
color: string; | ||
getX: (v: SeriesItem) => number; | ||
getY: (v: SeriesSingleValue) => number; | ||
id: string; | ||
}; | ||
|
||
export function ScatterPlot({ | ||
series: dataSeries, | ||
color, | ||
getX, | ||
getY, | ||
id, | ||
}: LineTrendProps) { | ||
const series = useMemo( | ||
() => dataSeries.filter((x) => isPresent(x.__value)), | ||
[dataSeries] | ||
); | ||
|
||
return series.length === 0 ? null : ( | ||
<Group> | ||
{series.map((data, i) => ( | ||
<circle | ||
key={i} | ||
id={`${id}-${i}`} | ||
r={DEFAULT_DOT_SIZE} | ||
cx={getX(data)} | ||
cy={getY(data)} | ||
fill={color} | ||
/> | ||
))} | ||
</Group> | ||
); | ||
} | ||
|
||
interface ScatterPlotIconProps { | ||
color: string; | ||
radius?: number; | ||
width?: number; | ||
height?: number; | ||
} | ||
|
||
export function ScatterPlotIcon({ | ||
color, | ||
width = 15, | ||
height = 15, | ||
radius = 3, | ||
}: ScatterPlotIconProps) { | ||
return ( | ||
<svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}> | ||
<circle | ||
r={Math.min(width / 2, radius)} | ||
fill={color} | ||
cy={height / 2} | ||
cx={width / 2} | ||
/> | ||
</svg> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.