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

Add SVG export!!!! #525

Merged
merged 7 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
up
  • Loading branch information
theosanderson committed Sep 14, 2023
commit 17022781d7bb130259cd576f475e6461a16156bd
5 changes: 4 additions & 1 deletion taxonium_component/src/utils/deckglToSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const accessOrConstant = (accessor, node) => {
};
if(!viewState.min_x){
window.alert("Please zoom in and out a little before SVG export")
return
return false
}
let svgContent = `<svg xmlns='http://www.w3.org/2000/svg' width="${svgWidth}" height="${svgHeight}">`

Expand Down Expand Up @@ -142,6 +142,9 @@ const accessOrConstant = (accessor, node) => {
const svgWidth = deckSize.width
const svgHeight = deckSize.height
const svgContent = getSVG(layers, viewState, svgWidth, svgHeight);
if (!svgContent) {
return;
}
// Create a new blob object
const blob = new Blob([svgContent], { type: "image/svg+xml" });
// Create a link element, hide it, direct it towards the blob, and then 'click' it programatically
Expand Down