Skip to content

Commit

Permalink
Dash canvas resize handles (#3881)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsolomon authored and lbwexler committed Dec 31, 2024
1 parent 4b46bcf commit 6d8d83b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
ID and access tokens in a single request and to use refresh tokens to maintain access without
relying on third-party cookies.
* Updated sorting on grouped grids to place ungrouped items at the bottom.
* `DashCanvas` views can now be resized left and up in addition to right and down.
* `FetchService.autoGenCorrelationIds` now supports a functional form for per-request behavior.

### 🐞 Bug Fixes
Expand Down
68 changes: 57 additions & 11 deletions desktop/cmp/dash/canvas/DashCanvas.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
@mixin resize-handle-ew {
height: 100%;
top: 0;
transform: rotate(0);
width: 8px;
}

@mixin resize-handle-ns {
height: 8px;
left: 0;
transform: rotate(0);
width: 100%;
}

@mixin resize-handle-corner {
height: 16px;
width: 16px;
}

@mixin resize-handle-se-sw {
@include resize-handle-corner;
bottom: -8px;
}

@mixin resize-handle-ne-nw {
@include resize-handle-corner;
top: -8px;
}

.xh-dash-canvas {
width: 100%;
height: 100%;
Expand All @@ -21,27 +50,44 @@

> .react-resizable-handle {
// Make the resize handles fill the entire side
&.react-resizable-handle-n {
@include resize-handle-ns;
top: -4px;
}

&.react-resizable-handle-s {
@include resize-handle-ns;
bottom: -4px;
height: 8px;
left: 0;
transform: rotate(0);
width: 100%;
}

&.react-resizable-handle-e {
height: 100%;
@include resize-handle-ew;
right: -4px;
top: 0;
transform: rotate(0);
width: 8px;
}

&.react-resizable-handle-w {
@include resize-handle-ew;
left: -4px;
}

&.react-resizable-handle-ne {
@include resize-handle-ne-nw;
right: -8px;
}

&.react-resizable-handle-nw {
@include resize-handle-ne-nw;
left: -8px;
}

&.react-resizable-handle-se {
bottom: -8px;
height: 16px;
@include resize-handle-se-sw;
right: -8px;
width: 16px;
}

&.react-resizable-handle-sw {
@include resize-handle-se-sw;
left: -8px;
}

// Hide the resize handles
Expand Down
4 changes: 3 additions & 1 deletion desktop/cmp/dash/canvas/DashCanvasModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export class DashCanvasModel

return {
...it,
resizeHandles: autoHeight ? ['e'] : ['e', 's', 'se'],
resizeHandles: autoHeight
? ['w', 'e']
: ['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'],
maxH: viewSpec.maxHeight,
minH: viewSpec.minHeight,
maxW: viewSpec.maxWidth,
Expand Down

0 comments on commit 6d8d83b

Please sign in to comment.