Skip to content

Commit

Permalink
update: add material name to gif
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Jan 10, 2025
1 parent ba736d7 commit 925628c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wave.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,13 @@ export class Wave extends mix(WaveBase).with(
try {
const gifDataUrl = await createRotatingGif(this, options);

const fileName =
this._structure.name || this._structure.formula || "wave-visualization";

// Download the GIF
const a = document.createElement("a");
a.href = gifDataUrl;
a.download = "wave-visualization.gif";
a.download = `${fileName}.gif`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
Expand Down

0 comments on commit 925628c

Please sign in to comment.