Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed Sep 26, 2023
1 parent bee41f1 commit f770477
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/graphic-walker/src/visualSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ const VisualSettings: React.FC<IVisualSettings> = ({
[rendererHandler]
);

const downloadBase64 = useCallback(
throttle(() => {
rendererHandler?.current?.getCanvasData().then(x => navigator.clipboard.writeText(x.join(',')));
}, 200),
[rendererHandler]
);


const downloadCSV = useCallback(
throttle(() => {
csvHandler?.current?.download();
Expand Down Expand Up @@ -530,6 +538,17 @@ const VisualSettings: React.FC<IVisualSettings> = ({
>
{t('button.export_chart_as', { type: 'svg' })}
</button>
<button
className={`text-xs pt-1 pb-1 pl-6 pr-6 ${
dark
? 'dark bg-zinc-900 text-gray-100 hover:bg-gray-700'
: 'bg-white hover:bg-gray-200 text-gray-800'
}`}
aria-label={t('button.export_chart_as', { type: 'base64' })}
onClick={() => downloadBase64()}
>
{t('button.export_chart_as', { type: 'base64' })}
</button>
</FormContainer>
),
}]:[],
Expand Down

1 comment on commit f770477

@vercel
Copy link

@vercel vercel bot commented on f770477 Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.