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

feat: add hide-nav config for web use #365

Merged
merged 1 commit into from
Apr 8, 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
18 changes: 13 additions & 5 deletions packages/graphic-walker/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { ErrorBoundary } from 'react-error-boundary';
import Errorpanel from './components/errorpanel';
import { useCurrentMediaTheme } from './utils/media';
import Painter from './components/painter';
import { classNames, parseErrorMessage } from './utils';
import { classNames, cn, parseErrorMessage } from './utils';
import { VizEmbedMenu } from './components/embedMenu';
import DataBoard from './components/dataBoard';
import SideResize from './components/side-resize';
Expand Down Expand Up @@ -176,10 +176,18 @@ export const VizApp = observer(function VizApp(props: BaseVizProps) {
</div>
</TabsContent>
<TabsContent value={ISegmentKey.vis}>
<div className="px-2 mx-2 mt-2">
<VisNav />
</div>
<div style={{ marginTop: '0em' }} className="m-4 p-4 border border-border rounded-md rounded-tl-none">
{!props.hideChartNav && (
<div className="px-2 mx-2 mt-2">
<VisNav />
</div>
)}
<div
style={{ marginTop: '0em' }}
className={cn(
'm-4 p-4 border border-border rounded-md rounded-tl-none',
props.hideChartNav ? 'border-t-0 rounded-t-none' : ''
)}
>
{enhanceAPI?.features?.askviz && (
<AskViz
api={typeof enhanceAPI.features.askviz === 'boolean' ? '' : enhanceAPI.features.askviz}
Expand Down
3 changes: 2 additions & 1 deletion packages/graphic-walker/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { GWGlobalConfig } from './vis/theme';
import { VizSpecStore } from './store/visualSpecStore';
import { CommonStore } from './store/commonStore';
import type { XOR } from 'ts-xor';
import { ThemeConfig } from 'tailwindcss/types/config';

export type DeepReadonly<T extends Record<keyof any, any>> = {
readonly [K in keyof T]: T[K] extends Record<keyof any, any> ? DeepReadonly<T[K]> : T[K];
Expand Down Expand Up @@ -901,6 +900,8 @@ export interface IVizProps {
extra?: ToolbarItemProps[];
exclude?: string[];
};
/** hide the chart navigation so make user can only edit on the only chart. */
hideChartNav?: boolean;
geographicData?: IGeographicData & {
key: string;
};
Expand Down
Loading