Skip to content
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

Dash canvas resize handles #3881

Merged
merged 5 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

### 🐞 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
Loading