-
Notifications
You must be signed in to change notification settings - Fork 114
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
Feature/parallel chart tooltip #1186
Merged
Huongg
merged 21 commits into
feature/parallel-chart
from
feature/parallel-chart-tooltip
Nov 30, 2022
Merged
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9aa05b9
first draft of the tooltip
Huongg 738ffa8
create share tooltip for chart
Huongg c1d5b8b
Merge branch 'feature/parallel-chart' of github.com:kedro-org/kedro-v…
Huongg 3a2eaa6
set timeout to show tooltip
Huongg 6ad7f04
remove LinePath component as it no longer needs
Huongg f60154b
remove unused styling
Huongg 2724c90
styling sorting
Huongg 9c65510
set default props for tooltip
Huongg 5446b61
use css to fadein tooltip instead timeout
Huongg f469906
not to reset opacity after the animation
Huongg 7fba4b5
sorting
Huongg 8de8eda
sorting props
Huongg af05fac
set tooltip to default value on mouseout
Huongg 224fc53
declare variable on the top
Huongg 9aaaec5
declare variable on the top
Huongg 91d86b4
pull the latest changes
Huongg 780026f
formate date
Huongg 1082657
use sidebarWidth from the config
Huongg 021c3c1
update label name
Huongg c1fd96f
update label name
Huongg 6c8b88b
update label name
Huongg 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
51 changes: 0 additions & 51 deletions
51
src/components/experiment-tracking/parallel-coordinates/components/line-path.js
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
|
||
import './tooltip.css'; | ||
|
||
export const tooltipDefaultProps = { | ||
content: { label1: '', value1: '', label2: '', value2: '' }, | ||
direction: 'right', | ||
position: { x: -500, y: -500 }, | ||
visible: false, | ||
}; | ||
|
||
export const MetricsChartsTooltip = ({ | ||
content = tooltipDefaultProps.content, | ||
direction = tooltipDefaultProps.direction, | ||
position = tooltipDefaultProps.position, | ||
visible = tooltipDefaultProps.visible, | ||
}) => { | ||
return ( | ||
<div | ||
className={classnames('tooltip', { 'tooltip--show': visible })} | ||
style={{ transform: `translate(${position.x}px, ${position.y}px)` }} | ||
> | ||
<span | ||
className={classnames('tooltip-arrow', `tooltip-arrow--${direction}`)} | ||
/> | ||
<h3 className="tooltip-label">{`${content?.label1}:`}</h3> | ||
<h4 className="tooltip-value">{content?.value1}</h4> | ||
|
||
<br /> | ||
<h3 className="tooltip-label">{`${content?.label2}:`}</h3> | ||
<h4 className="tooltip-value">{content?.value2}</h4> | ||
</div> | ||
); | ||
}; |
104 changes: 104 additions & 0 deletions
104
src/components/experiment-tracking/tooltip/tooltip.scss
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,104 @@ | ||
@use '../../../styles/variables' as colors; | ||
|
||
@mixin fade-in($waitTime) { | ||
animation: wait #{$waitTime}, fade-in 800ms #{$waitTime}; | ||
Huongg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
@keyframes wait { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
opacity: 0; | ||
} | ||
} | ||
|
||
@keyframes fade-in { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
$triangle-size: 10px; | ||
|
||
.tooltip { | ||
background: white; | ||
display: flex; | ||
flex-direction: column; | ||
opacity: 0; | ||
padding: 10px 30px 10px 10px; | ||
position: absolute; | ||
} | ||
|
||
.tooltip--show { | ||
@include fade-in('700ms'); | ||
animation-fill-mode: forwards; | ||
} | ||
|
||
.tooltip-arrow { | ||
display: inline-block; | ||
height: 0; | ||
left: 1px; | ||
|
||
margin-right: 1.6em; | ||
margin-top: -1.2em; | ||
|
||
position: absolute; | ||
top: 22px; | ||
white-space: nowrap; | ||
width: 0; | ||
} | ||
|
||
.tooltip-arrow--right { | ||
&::before { | ||
border-left: $triangle-size solid transparent; | ||
border-top: $triangle-size solid var(--color-bg-alt); | ||
|
||
content: ''; | ||
|
||
height: 0; | ||
left: -$triangle-size + 0.5; | ||
position: absolute; | ||
top: calc(50% - #{$triangle-size}); | ||
width: 0; | ||
} | ||
} | ||
|
||
.tooltip-arrow--left { | ||
&::before { | ||
border-right: $triangle-size solid transparent; | ||
border-top: $triangle-size solid var(--color-bg-alt); | ||
|
||
content: ''; | ||
|
||
height: 0; | ||
position: absolute; | ||
right: -225.5px; | ||
top: calc(50% - #{$triangle-size}); | ||
width: 0; | ||
} | ||
} | ||
|
||
.tooltip-label, | ||
.tooltip-value { | ||
font-size: 12px; | ||
font-weight: 400; | ||
margin: 0; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
width: 180px; | ||
} | ||
|
||
.tooltip-label { | ||
color: #{colors.$black-500}; | ||
} | ||
|
||
.tooltip-value { | ||
color: #{colors.$black-900}; | ||
} |
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.
Can we augment this util function to return a date in the format specified by the design? That format is this:
DD MMM YYYY
(e.g.12 Jan 2022
).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.
I was going to check with @comym actually that whether we dont want to show the time at all, just a date but will update to match the design for now