Skip to content

An open source alternative to Tableau. Embeddable visual analytic

fix: reactive layout

ObservedObservera55da887894b
diff --git a/packages/graphic-walker/src/App.tsx b/packages/graphic-walker/src/App.tsx
index 1d9f0dc8..35c746b5 100644
--- a/packages/graphic-walker/src/App.tsx
+++ b/packages/graphic-walker/src/App.tsx
@@ -101,15 +101,15 @@ const App: React.FC<EditorProps> = props => {
<Container style={{ marginTop: '0em', borderTop: 'none' }}>
<Menubar />
<VisualSettings rendererHandler={rendererRef} />
- <div className="grid grid-cols-12 xl:grid-cols-6">
- <div className="col-span-3 xl:col-span-1">
+ <div className="md:grid md:grid-cols-12 xl:grid-cols-6">
+ <div className="md:col-span-3 xl:col-span-1">
<DatasetFields />
</div>
- <div className="col-span-2 xl:col-span-1">
+ <div className="md:col-span-2 xl:col-span-1">
<FilterField />
<AestheticFields />
</div>
- <div className="col-span-7 xl:col-span-4">
+ <div className="md:col-span-7 xl:col-span-4">
<div>
<PosFields />
</div>
diff --git a/packages/graphic-walker/src/components/modal.tsx b/packages/graphic-walker/src/components/modal.tsx
index ade865b2..7b380c1d 100644
--- a/packages/graphic-walker/src/components/modal.tsx
+++ b/packages/graphic-walker/src/components/modal.tsx
@@ -2,7 +2,6 @@ import React, { useRef } from 'react';
import styled from 'styled-components';
import { XCircleIcon } from '@heroicons/react/24/outline';
-
const Background = styled.div({
position: 'fixed',
left: 0,
@@ -14,7 +13,13 @@ const Background = styled.div({
});
const Container = styled.div`
- width: 880px;
+ width: 98%;
+ @media (min-width: 600px) {
+ width: 80%;
+ }
+ @media (min-width: 1100px) {
+ width: 880px;
+ }
max-height: 800px;
overflow: auto;
> div.header {
diff --git a/packages/graphic-walker/src/fields/datasetFields/index.tsx b/packages/graphic-walker/src/fields/datasetFields/index.tsx
index 1489191e..c25f545f 100644
--- a/packages/graphic-walker/src/fields/datasetFields/index.tsx
+++ b/packages/graphic-walker/src/fields/datasetFields/index.tsx
@@ -1,17 +1,24 @@
import React from "react";
import { Droppable } from "react-beautiful-dnd";
import { useTranslation } from "react-i18next";
+import styled from 'styled-components';
import { NestContainer } from "../../components/container";
import DimFields from "./dimFields";
import MeaFields from "./meaFields";
+const DSContainer = styled(NestContainer)`
+ @media (min-width: 768px) {
+ height: 680px;
+ }
+`
+
const DatasetFields: React.FC = (props) => {
const { t } = useTranslation("translation", { keyPrefix: "main.tabpanel.DatasetFields" });
return (
- <NestContainer className="flex flex-col" style={{ height: "680px", paddingBlock: 0 }}>
+ <DSContainer className="flex md:flex-col" style={{ paddingBlock: 0 }}>
<h4 className="text-xs mb-2 flex-grow-0 cursor-default select-none mt-2">{t("field_list")}</h4>
- <div className="pd-1 overflow-y-auto" style={{ maxHeight: "380px" }}>
+ <div className="pd-1 overflow-y-auto" style={{ maxHeight: "380px", minHeight: '100px' }}>
<Droppable droppableId="dimensions" direction="vertical">
{(provided, snapshot) => <DimFields provided={provided} />}
</Droppable>
@@ -21,7 +28,7 @@ const DatasetFields: React.FC = (props) => {
{(provided, snapshot) => <MeaFields provided={provided} />}
</Droppable>
</div>
- </NestContainer>
+ </DSContainer>
);
};