-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feedback fixes from Prod deploy v1.10.0 #225
Merged
Afani97
merged 18 commits into
develop
from
CU-8685dcrr6_Expand-graphchart-visuals-when-only-two-graph-types-are-selected
Sep 8, 2023
+87
−33
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2887711
Adjust grouped stop purpose graph widths when showing/hiding
Afani97 5d903a4
Merge branch 'develop' into CU-8685dcrr6_Expand-graphchart-visuals-wh…
Afani97 79c9abb
expand list of urls for prime caching
Afani97 9543b0f
Update tooltip language and placement
Afani97 fc1dbb5
make downloadable pie chart have white labels
Afani97 92589ab
change tooltip background to white
Afani97 d14f5e1
add loading states
Afani97 c690ead
Merge branch 'CU-8685dcrr6_Expand-graphchart-visuals-when-only-two-gr…
Afani97 d7f3fbc
Merge pull request #230 from caktus/update-pie-chart-styling
Afani97 fc6096e
Merge branch 'CU-8685dcrr6_Expand-graphchart-visuals-when-only-two-gr…
Afani97 00312e5
Merge pull request #228 from caktus/add-endpoints-to-prime-cache-list
Afani97 ff40364
Merge branch 'CU-8685dcrr6_Expand-graphchart-visuals-when-only-two-gr…
Afani97 31295b8
Merge pull request #229 from caktus/update-traffic-stops-tooltips
Afani97 b61b37e
Upgrade node version to 18
Afani97 9790344
Merge branch 'CU-8685dcrr6_Expand-graphchart-visuals-when-only-two-gr…
Afani97 90e733c
Merge pull request #231 from caktus/upgrade-node-version
Afani97 b0e6721
Fix bug that crashes if no records were found for stop purpose group …
Afani97 cb0e257
Fix pie charts layout direction
Afani97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import { Line } from 'react-chartjs-2'; | |
import { tooltipLanguage } from '../../util/tooltipLanguage'; | ||
import { usePopper } from 'react-popper'; | ||
import styled from 'styled-components'; | ||
import DataLoading from '../Charts/ChartPrimitives/DataLoading'; | ||
|
||
export const Tooltip = styled.div` | ||
background: #333; | ||
|
@@ -21,13 +22,14 @@ export const Tooltip = styled.div` | |
export default function LineChart({ | ||
data, | ||
title, | ||
maintainAspectRatio = true, | ||
maintainAspectRatio = false, | ||
displayTitle = true, | ||
displayLegend = true, | ||
yAxisMax = null, | ||
yAxisShowLabels = true, | ||
displayStopPurposeTooltips = false, | ||
showLegendOnBottom = true, | ||
redraw = false, | ||
}) { | ||
const options = { | ||
responsive: true, | ||
|
@@ -47,8 +49,10 @@ export default function LineChart({ | |
} | ||
}, | ||
onLeave() { | ||
setTooltipText(''); | ||
hideTooltip(); | ||
if (displayStopPurposeTooltips) { | ||
setTooltipText(''); | ||
hideTooltip(); | ||
} | ||
}, | ||
}, | ||
tooltip: { | ||
|
@@ -94,17 +98,25 @@ export default function LineChart({ | |
popperElement.removeAttribute('data-show'); | ||
}; | ||
|
||
if (!data.datasets.length) { | ||
return <DataLoading />; | ||
} | ||
|
||
return ( | ||
<> | ||
<div ref={setReferenceElement} /> | ||
<Tooltip | ||
ref={setPopperElement} | ||
style={{ ...styles.popper, width: '300px' }} | ||
{...attributes.popper} | ||
> | ||
{tooltipText} | ||
</Tooltip> | ||
<Line options={options} data={data} /> | ||
{displayStopPurposeTooltips && ( | ||
<> | ||
<div ref={setReferenceElement} /> | ||
<Tooltip | ||
ref={setPopperElement} | ||
style={{ ...styles.popper, width: '300px' }} | ||
{...attributes.popper} | ||
> | ||
{tooltipText} | ||
</Tooltip> | ||
</> | ||
)} | ||
<Line options={options} data={data} redraw={redraw} datasetIdKey={title} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
</> | ||
); | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This popper tooltip was re-rendering on scroll, which caused the graphs to re-render and provide a bad experience. Here we just want to show the tooltip if we actually need to.