-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Top-down DAG layout with opinionated zoom, jump bar, styled right sid…
…ebar (#222) * Initial pass at vertical DAG * Update graphQL definitions * Remove align option to get vertically centered DAG * Add compact rendering for nodes with > 4 inputs or outputs * Revert settings.json changes * Update jest tests * Center the minified input/output blocks * Replace panzoom with our own library, basic pan + double click to zoom at two distinct levels * Distinct zoom levels, nav in top bar, detail view on right side * Fix the escape hotkey, detection of current text field input * Clean up React hierarchy, address initial feedback * More cleanup * Fix typescript error with new optional config * Update snapshot tests
- Loading branch information
Showing
27 changed files
with
1,253 additions
and
1,020 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import * as React from "react"; | ||
import styled from "styled-components"; | ||
import { Colors } from "@blueprintjs/core"; | ||
|
||
interface IDividerProps { | ||
onMove: (vw: number) => void; | ||
} | ||
interface IDividerState { | ||
down: boolean; | ||
} | ||
|
||
export class PanelDivider extends React.Component< | ||
IDividerProps, | ||
IDividerState | ||
> { | ||
state = { | ||
down: false | ||
}; | ||
|
||
onMouseDown = (event: React.MouseEvent<HTMLDivElement>) => { | ||
this.setState({ down: true }); | ||
const onMouseMove = (event: MouseEvent) => { | ||
let vx = (event.clientX * 100) / window.innerWidth; | ||
this.props.onMove(vx); | ||
}; | ||
const onMouseUp = (event: MouseEvent) => { | ||
this.setState({ down: false }); | ||
document.removeEventListener("mousemove", onMouseMove); | ||
document.removeEventListener("mouseup", onMouseUp); | ||
}; | ||
document.addEventListener("mousemove", onMouseMove); | ||
document.addEventListener("mouseup", onMouseUp); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<DividerWrapper down={this.state.down}> | ||
<DividerHitArea onMouseDown={this.onMouseDown} /> | ||
</DividerWrapper> | ||
); | ||
} | ||
} | ||
|
||
const DividerWrapper = styled.div<{ down: boolean }>` | ||
width: 4px; | ||
background: ${Colors.WHITE}; | ||
border-left: 1px solid ${p => (p.down ? Colors.GRAY5 : Colors.LIGHT_GRAY2)}; | ||
border-right: 1px solid ${p => (p.down ? Colors.GRAY3 : Colors.GRAY5)}; | ||
overflow: visible; | ||
position: relative; | ||
`; | ||
|
||
const DividerHitArea = styled.div` | ||
width: 17px; | ||
height: 100%; | ||
z-index: 2; | ||
cursor: ew-resize; | ||
position: relative; | ||
left: -8px; | ||
`; |
Oops, something went wrong.