Skip to content

Commit

Permalink
fix bugs, add url query
Browse files Browse the repository at this point in the history
  • Loading branch information
hconhisway committed Nov 28, 2023
1 parent b6d66b4 commit 44ead89
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
class="btn btn-primary" @click="triggerFileInput">
Choose File
</button>
<button class="btn btn-primary download-button" @click="downloadSVG" >downloadSVG</button>
</div>
<div class="content">
<div class="editor-box">
Expand Down Expand Up @@ -110,6 +111,22 @@ export default {
beforeDestroy() {
this.$refs.svgMoviz.removeEventListener('mouseover', this.handleMouseOverDelegate);
},
async created() {
const grometUrl = this.$route.query.gromet_url;
if (grometUrl) {
try {
const response = await axios.get(grometUrl);
this.gromet = response.data;
this.skemaVersion = this.gromet.schema_version;
this.highlightedJson = this.gromet.modules[0];
delete this.highlightedJson.metadata_collection;
delete this.highlightedJson.metadata;
this.drawMoviz();
} catch (error) {
console.error(error);
}
}
},
methods: {
drawMoviz() {
d3.selectAll('g').remove();
Expand Down

0 comments on commit 44ead89

Please sign in to comment.