-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat: Resizable dataset and controls panels on Explore view #12411
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import { bindActionCreators } from 'redux'; | |
import { connect } from 'react-redux'; | ||
import { styled, t, supersetTheme, css } from '@superset-ui/core'; | ||
import { debounce } from 'lodash'; | ||
import { Resizable } from 're-resizable'; | ||
|
||
import { useDynamicPluginContext } from 'src/components/DynamicPlugins'; | ||
import { Global } from '@emotion/core'; | ||
|
@@ -81,10 +82,8 @@ const Styles = styled.div` | |
border-top: 1px solid ${({ theme }) => theme.colors.grayscale.light2}; | ||
.explore-column { | ||
display: flex; | ||
flex: 0 0 ${({ theme }) => theme.gridUnit * 95}px; | ||
flex-direction: column; | ||
padding: ${({ theme }) => 2 * theme.gridUnit}px 0; | ||
max-width: ${({ theme }) => theme.gridUnit * 95}px; | ||
max-height: 100%; | ||
} | ||
.data-source-selection { | ||
|
@@ -404,7 +403,11 @@ function ExploreViewContainer(props) { | |
dashboardId={props.dashboardId} | ||
/> | ||
)} | ||
<div | ||
<Resizable | ||
defaultSize={{ width: 300 }} | ||
minWidth={300} | ||
maxWidth="33%" | ||
enable={{ right: true }} | ||
className={ | ||
isCollapsed ? 'no-show' : 'explore-column data-source-selection' | ||
} | ||
|
@@ -430,7 +433,7 @@ function ExploreViewContainer(props) { | |
controls={props.controls} | ||
actions={props.actions} | ||
/> | ||
</div> | ||
</Resizable> | ||
{isCollapsed ? ( | ||
<div | ||
className="sidebar" | ||
|
@@ -452,7 +455,13 @@ function ExploreViewContainer(props) { | |
<Icon name="dataset-physical" width={16} /> | ||
</div> | ||
) : null} | ||
<div className="col-sm-3 explore-column controls-column"> | ||
<Resizable | ||
defaultSize={{ width: 320 }} | ||
minWidth={320} | ||
maxWidth="33%" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think of increasing maxWidth to somewhere around 40% to 50%? Sometimes it's useful to test how the chart looks like when in very small containers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 33% is already squeezing the viz. we tested different options. we probably don't want to increase the max width and compromise the chart area. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Increasing maxWidth wouldn't do much, as the chart section has a minWidth 512px set. |
||
enable={{ right: true }} | ||
className="col-sm-3 explore-column controls-column" | ||
> | ||
<QueryAndSaveBtns | ||
canAdd={!!(props.can_add || props.can_overwrite)} | ||
onQuery={onQuery} | ||
|
@@ -470,7 +479,7 @@ function ExploreViewContainer(props) { | |
datasource_type={props.datasource_type} | ||
isDatasourceMetaLoading={props.isDatasourceMetaLoading} | ||
/> | ||
</div> | ||
</Resizable> | ||
<div | ||
className={`main-explore-content ${ | ||
isCollapsed ? 'col-sm-9' : 'col-sm-7' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make this
width
persistent and save it in localStorage. Could be in another PR, though.