-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui-manchette: integration manchette + spacetimechart done
- Loading branch information
Showing
7 changed files
with
221 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export const BASE_OP_HEIGHT = 32; | ||
export const BASE_KM_HEIGHT = 8; | ||
export const INITIAL_OP_LIST_HEIGHT = 521; | ||
export const INITIAL_SPACE_TIME_CHART_HEIGHT = INITIAL_OP_LIST_HEIGHT + 40; |
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,39 @@ | ||
import React, { useState, useLayoutEffect, useRef, RefObject } from 'react'; | ||
|
||
interface CallbackFunction { | ||
(hasOverflow: boolean): void; | ||
} | ||
|
||
interface CallbackFunction { | ||
(hasOverflow: boolean): void; | ||
} | ||
|
||
export const useIsOverflow = ( | ||
ref: RefObject<HTMLElement>, | ||
callback: CallbackFunction | ||
): boolean | undefined => { | ||
const [isOverflow, setIsOverflow] = useState<boolean | undefined>(undefined); | ||
|
||
useLayoutEffect(() => { | ||
const { current } = ref; | ||
|
||
const trigger = () => { | ||
if (current) { | ||
const hasOverflow = current.scrollHeight > current.clientHeight; | ||
setIsOverflow(hasOverflow); | ||
|
||
if (callback) callback(hasOverflow); | ||
} | ||
}; | ||
|
||
if (current) { | ||
if ('ResizeObserver' in window) { | ||
new ResizeObserver(trigger).observe(current); | ||
} | ||
|
||
trigger(); | ||
} | ||
}, [callback, ref]); | ||
|
||
return isOverflow; | ||
}; |
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 |
---|---|---|
@@ -1,21 +1,41 @@ | ||
.manchette { | ||
height: 561px; | ||
overflow: auto; | ||
-webkit-border-bottom-left-radius: 4px; | ||
-moz-border-radius-bottomleft: 4px; | ||
border-bottom-left-radius: 4px; | ||
.manchette-space-time-chart-wrapper{ | ||
border-radius: 10px; | ||
box-shadow: 0px 4px 9px rgba(0, 0, 0, 0.06), 0px 1px 2px rgba(0, 0, 0, 0.19); | ||
opacity: 1; | ||
background-color: rgba(255, 255, 255, 1); | ||
.manchette { | ||
height: 561px; | ||
overflow: auto; | ||
-webkit-border-bottom-left-radius: 4px; | ||
-moz-border-radius-bottomleft: 4px; | ||
border-bottom-left-radius: 4px; | ||
|
||
|
||
&-actions { | ||
background-color: rgba(250, 249, 245, 0.20); | ||
height: 2.5rem; | ||
width: inherit; | ||
position: sticky; | ||
bottom: 0; | ||
left: 0; | ||
width: 100%; | ||
backdrop-filter: blur(8px); | ||
-webkit-backdrop-filter: blur(8px); | ||
border-top: solid 1px; | ||
border-right: solid 1px; | ||
@apply border-black-25; | ||
border-radius: 0px 0px 0px 10px; | ||
|
||
|
||
&-actions { | ||
background-color: rgba(250, 249, 245, 0.20); | ||
height: 2.5rem; | ||
width: inherit; | ||
position: sticky; | ||
bottom: 0; | ||
left: 0; | ||
width: 100%; | ||
backdrop-filter: blur(8px); | ||
border: solid 1px; | ||
@apply border-black-25 | ||
.zoom-out:disabled { | ||
opacity: 0.4; | ||
|
||
} | ||
} | ||
|
||
.space-time-chart-container { | ||
height: 561px; | ||
width: 100%; | ||
bottom:0; | ||
} | ||
} | ||
} |
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,11 @@ | ||
export type Point = { | ||
x: number; | ||
y: number; | ||
}; | ||
|
||
export function getDiff(a: Point, b: Point): Point { | ||
return { | ||
x: b.x - a.x, | ||
y: b.y - a.y, | ||
}; | ||
} |