Skip to content

Commit e2c241d

Browse files
committed
Unify SVG export to always use compat mode, remove separate LaTeX item
1 parent b68a9b0 commit e2c241d

5 files changed

Lines changed: 30 additions & 23 deletions

File tree

src/lib/components/contextMenuBuilders.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -409,24 +409,12 @@ function buildCanvasMenu(
409409
icon: 'image',
410410
action: async () => {
411411
try {
412-
const svg = await exportToSVG();
412+
const svg = await exportToSVG({ compat: 'inkscape' });
413413
downloadSvg(svg, 'pathview-graph.svg');
414414
} catch (e) {
415415
console.error('SVG export failed:', e);
416416
}
417417
}
418-
},
419-
{
420-
label: 'Export SVG (LaTeX)',
421-
icon: 'image',
422-
action: async () => {
423-
try {
424-
const svg = await exportToSVG({ compat: 'inkscape' });
425-
downloadSvg(svg, 'pathview-graph-latex.svg');
426-
} catch (e) {
427-
console.error('SVG export (LaTeX) failed:', e);
428-
}
429-
}
430418
}
431419
];
432420

src/lib/export/dom2svg/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface SvgCompatConfig {
1717
stripXmlSpace: boolean;
1818
stripGroupOpacity: boolean;
1919
inlineClipPathTransforms: boolean;
20+
flattenNestedSvg: boolean;
2021
}
2122
/** SVG compatibility preset */
2223
type SvgCompat = 'full' | 'inkscape' | SvgCompatConfig;

src/lib/export/dom2svg/index.js

Lines changed: 25 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/export/dom2svg/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/export/svg/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export interface ExportOptions {
1111
background?: 'transparent' | 'solid';
1212
/** Padding around content in pixels */
1313
padding?: number;
14-
/** SVG compatibility preset (default: 'full') */
14+
/** SVG compatibility preset (default: 'inkscape') */
1515
compat?: SvgCompat;
1616
}
1717

1818
/** Default export options */
1919
export const DEFAULT_OPTIONS: Required<ExportOptions> = {
2020
background: 'transparent',
2121
padding: EXPORT_PADDING,
22-
compat: 'full'
22+
compat: 'inkscape'
2323
};

0 commit comments

Comments
 (0)