mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
B: Fix OSS image export. Use PNG for now
This commit is contained in:
parent
f8d411eced
commit
76d54fa709
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { toSvg } from 'html-to-image';
|
||||
import { toPng } from 'html-to-image';
|
||||
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
|
||||
import { toast } from 'react-toastify';
|
||||
import {
|
||||
|
@ -256,7 +256,7 @@ function OssFlow({ isModified, setIsModified }: OssFlowProps) {
|
|||
const imageHeight = PARAMETER.ossImageHeight;
|
||||
const nodesBounds = getNodesBounds(nodes);
|
||||
const viewport = getViewportForBounds(nodesBounds, imageWidth, imageHeight, 0.5, 2);
|
||||
toSvg(canvas, {
|
||||
toPng(canvas, {
|
||||
backgroundColor: colors.bgDefault,
|
||||
width: imageWidth,
|
||||
height: imageHeight,
|
||||
|
@ -268,7 +268,7 @@ function OssFlow({ isModified, setIsModified }: OssFlowProps) {
|
|||
})
|
||||
.then(dataURL => {
|
||||
const a = document.createElement('a');
|
||||
a.setAttribute('download', `${model.schema?.alias ?? 'oss'}.svg`);
|
||||
a.setAttribute('download', `${model.schema?.alias ?? 'oss'}.png`);
|
||||
a.setAttribute('href', dataURL);
|
||||
a.click();
|
||||
})
|
||||
|
@ -416,7 +416,7 @@ function OssFlow({ isModified, setIsModified }: OssFlowProps) {
|
|||
{...menuProps}
|
||||
/>
|
||||
) : null}
|
||||
<div className='relative w-[100vw]' style={{ height: mainHeight }}>
|
||||
<div className='relative w-[100vw]' style={{ height: mainHeight, fontFamily: 'Rubik' }}>
|
||||
{graph}
|
||||
</div>
|
||||
</AnimateFade>
|
||||
|
|
|
@ -51,7 +51,7 @@ export interface IColorTheme {
|
|||
*/
|
||||
// prettier-ignore
|
||||
export const lightT: IColorTheme = {
|
||||
bgDefault: 'var(--cl-bg-100)',
|
||||
bgDefault: 'hsl(000, 000%, 098%)', //var(--cl-bg-100)',
|
||||
bgInput: 'var(--cl-bg-120)',
|
||||
bgControls: 'var(--cl-bg-80)',
|
||||
bgDisabled: 'var(--cl-bg-60)',
|
||||
|
@ -91,7 +91,7 @@ export const lightT: IColorTheme = {
|
|||
*/
|
||||
// prettier-ignore
|
||||
export const darkT: IColorTheme = {
|
||||
bgDefault: 'var(--cd-bg-100)',
|
||||
bgDefault: 'hsl(000, 000%, 005%)', //'var(--cd-bg-100)',
|
||||
bgInput: 'var(--cd-bg-120)',
|
||||
bgControls: 'var(--cd-bg-80)',
|
||||
bgDisabled: 'var(--cd-bg-60)',
|
||||
|
|
Loading…
Reference in New Issue
Block a user