+
{renderChart()}
@@ -266,14 +278,9 @@ const ExploreChartPanel = props => {
[chartPanelRef, renderChart],
);
- const standaloneChartBody = useMemo(
- () =>
{renderChart()}
,
- [chartPanelRef, renderChart],
- );
+ const standaloneChartBody = useMemo(() => renderChart(), [renderChart]);
- const [queryFormData, setQueryFormData] = useState(
- props.chart.latestQueryFormData,
- );
+ const [queryFormData, setQueryFormData] = useState(chart.latestQueryFormData);
useEffect(() => {
// only update when `latestQueryFormData` changes AND `triggerRender`
@@ -281,13 +288,13 @@ const ExploreChartPanel = props => {
// as this can trigger a query downstream based on incomplete form data.
// (`latestQueryFormData` is only updated when a a valid request has been
// triggered).
- if (!props.triggerRender) {
- setQueryFormData(props.chart.latestQueryFormData);
+ if (!triggerRender) {
+ setQueryFormData(chart.latestQueryFormData);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [props.chart.latestQueryFormData]);
+ }, [chart.latestQueryFormData]);
- if (props.standalone) {
+ if (standalone) {
// dom manipulation hack to get rid of the boostrap theme's body background
const standaloneClass = 'background-transparent';
const bodyClasses = document.body.className.split(' ');
@@ -302,8 +309,8 @@ const ExploreChartPanel = props => {
});
return (
-
- {props.vizType === 'filter_box' ? (
+
+ {vizType === 'filter_box' ? (
panelBody
) : (
{
gutterSize={gutterHeight}
onDragEnd={onDragEnd}
elementStyle={elementStyle}
+ expandToMin
>
{panelBody}
)}
diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx
index b856ba706cf88..7299adf251085 100644
--- a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx
+++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx
@@ -63,8 +63,6 @@ import ConnectedExploreChartHeader from '../ExploreChartHeader';
const propTypes = {
...ExploreChartPanel.propTypes,
- height: PropTypes.string,
- width: PropTypes.string,
actions: PropTypes.object.isRequired,
datasource_type: PropTypes.string.isRequired,
dashboardId: PropTypes.number,
@@ -135,6 +133,7 @@ const ExplorePanelContainer = styled.div`
flex: 1;
min-width: ${theme.gridUnit * 128}px;
border-left: 1px solid ${theme.colors.grayscale.light2};
+ padding: 0 ${theme.gridUnit * 4}px;
.panel {
margin-bottom: 0;
}
@@ -172,23 +171,6 @@ const ExplorePanelContainer = styled.div`
`};
`;
-const getWindowSize = () => ({
- height: window.innerHeight,
- width: window.innerWidth,
-});
-
-function useWindowSize({ delayMs = 250 } = {}) {
- const [size, setSize] = useState(getWindowSize());
-
- useEffect(() => {
- const onWindowResize = debounce(() => setSize(getWindowSize()), delayMs);
- window.addEventListener('resize', onWindowResize);
- return () => window.removeEventListener('resize', onWindowResize);
- }, []);
-
- return size;
-}
-
const updateHistory = debounce(
async (formData, datasetId, isReplace, standalone, force, title, tabId) => {
const payload = { ...formData };
@@ -246,7 +228,6 @@ function ExploreViewContainer(props) {
const [lastQueriedControls, setLastQueriedControls] = useState(
props.controls,
);
- const windowSize = useWindowSize();
const [showingModal, setShowingModal] = useState(false);
const [isCollapsed, setIsCollapsed] = useState(false);
@@ -254,11 +235,6 @@ function ExploreViewContainer(props) {
const tabId = useTabId();
const theme = useTheme();
- const width = `${windowSize.width}px`;
- const navHeight = props.standalone ? 0 : 120;
- const height = props.forcedHeight
- ? `${props.forcedHeight}px`
- : `${windowSize.height - navHeight}px`;
const defaultSidebarsWidth = {
controls_width: 320,
@@ -515,8 +491,6 @@ function ExploreViewContainer(props) {
function renderChartContainer() {
return (