-
Notifications
You must be signed in to change notification settings - Fork 5
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
ui-chart: spacetimechart: bordered path layer #962
base: dev
Are you sure you want to change the base?
Conversation
4da5206
to
1e55ad0
Compare
1e55ad0
to
720dca2
Compare
720dca2
to
fd1bfd7
Compare
ui-charts/src/spaceTimeChart/stories/additional-data.stories.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Uriel-Sautron <[email protected]> Signed-off-by: Math_R_ <[email protected]>
fd1bfd7
to
b833579
Compare
@@ -66,6 +67,13 @@ export type PathLayerProps = { | |||
color: string; | |||
pickingTolerance?: number; | |||
level?: PathLevel; | |||
border?: { | |||
offset: number; | |||
level: PathLevel; |
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.
Seems like this is unused
const drawAll = useCallback<DrawingFunction>( | ||
(ctx, stcContext) => { | ||
if (border !== undefined) { |
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.
Nit: no need for an if
here, since we already have one inside the function.
drawSegments(totalPathWidth + borderWidth * 2); | ||
|
||
if (border.backgroundColor) { | ||
drawSegments(totalPathWidth, border.backgroundColor); |
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.
if (i === 0) { | ||
ctx.moveTo(x, y); | ||
} else if (i === segments.length - 1) { | ||
ctx.lineTo(x - border.offset / 2, y); |
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.
Why the - border.offset / 2
here? It seems like the spacing on the right is smaller than offset
with this adjustment.
This PR allow the user to add a border around a PathLayer.
it closes #11056