adjusted scrollbar for dag in all possible modes

removed pages
This commit is contained in:
ari committed 2022-01-14 11:31:55 -05:00
1 parent 3f74c10cbf
commit 28fbdf1698
26 files changed
+92 -155

No files matched your search

-32
View File
@@ -1,32 +0,0 @@
.board-btn {
position: absolute;
}
.board-btn:hover {
background: #5e44444f;
cursor: pointer;
}
.board-btn.right {
right: 0;
top: 0;
height: 100%;
width: 5%;
}
.board-btn.left {
left: 0;
top: 0;
height: 100%;
width: 5%;
}
.board-btn.top {
left: 0;
top: 0;
height: 5%;
width: 100%;
}
.board-btn.bottom {
left: 0;
bottom: 0;
height: 5%;
width: 100%;
}
+2 -5
View File
@@ -1,4 +1,3 @@
import "./Board.css";
import { FC } from 'react';
import useWindowSize from "utils/useWindowSize";
import { useBoardStyles } from "./styles";
@@ -29,12 +28,10 @@ export const SVGBoard: FC<{
);
const { classes, theme } = useBoardStyles({
boardHeight: Math.max(nodeHeight, graphHeight) * zoomLevel,
boardWidth: Math.max(5 * nodeWidth, graphWidth) * zoomLevel,
boardWidth: Math.max(4 * nodeWidth, graphWidth) * zoomLevel,
});
// render
return <div className={classes.dag}>
return <div className={classes.dag} >
<svg
className={classes.svg}
viewBox={[0, 0, graphWidth, graphHeight].join(" ")}
@@ -3,7 +3,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react';
import { DAGBoard, DAGElement, DAGNodeElm } from "./DAGBoard";
import { NODE_HEIGHT, NODE_WIDTH, ADD_HEIGHT, ADD_WIDTH, DISTANCE_FACTOR, CIRCLE_SIZE } from './constants';
import { AutomationAction } from 'types/automations/actions';
import { arrayToIter } from "utils/iter";
export default {
@@ -51,7 +50,12 @@ function* makeDummyData(pts: Array<any>, extras: DAGElement[]): Generator<DAGEle
}
export const Simple: ComponentStory<typeof DAGBoard> = args => <DAGBoard {...args} />
export const Simple: ComponentStory<typeof DAGBoard> = args => {
return <div className="page">
<DAGBoard {...args} />
</div>
}
Simple.args = {
...Simple.args,
elements: makeDummyData(
@@ -94,7 +98,12 @@ Simple.args = {
}
export const Complex: ComponentStory<typeof DAGBoard> = args => <DAGBoard {...args} />
export const Complex: ComponentStory<typeof DAGBoard> = args => {
return <div className="page">
<DAGBoard {...args} />
</div>
}
Complex.args = {
...Complex.args,
elements: makeDummyData(
+1 -1
View File
@@ -194,7 +194,7 @@ export const DAGBoard: FC<Props & { zoomLevel: number }> = props => {
];
return <SVGBoard
graphHeight={y1 - y0}
minGraphWidth={Math.max(x1 - x0, props.settings.nodeWidth * 15)}
minGraphWidth={Math.max(x1 - x0, props.settings.nodeWidth * 8)}
nodeHeight={props.settings.nodeHeight}
nodeWidth={props.settings.nodeWidth}
zoomLevel={props.zoomLevel}