-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NN-588 Added export window for graph
- Loading branch information
Showing
7 changed files
with
159 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 116 additions & 35 deletions
151
frontend/src/components/toolbar/modules/ExportScreen.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,140 @@ | ||
<template> | ||
<div | ||
class="tool-item" | ||
v-on:mouseover="show_export = true" | ||
v-on:mouseleave="show_export = false" | ||
> | ||
<span v-on:click="take_screen('white', 'png')">Save graph as</span> | ||
<div id="select-de">></div> | ||
<div class="subform-de-values" v-if="show_export"> | ||
<span v-on:click="take_screen('white', 'png')">White/.png</span> | ||
<br /> | ||
<span v-on:click="take_screen('black', 'png')">Black/.png</span> | ||
<br /> | ||
<span v-on:click="take_screen('white', 'svg')">White/.svg</span> | ||
<br /> | ||
<span v-on:click="take_screen('black', 'svg')">Black/.svg</span> | ||
<div> | ||
<!-- Modal for export selection --> | ||
<div v-if="show_export" class="export-modal-overlay"> | ||
<div class="export-modal"> | ||
<h2>Select Export Type</h2> | ||
|
||
<!-- Export options --> | ||
<div class="export-options"> | ||
<button class="export-option" @click="take_screen('white', 'png')"> | ||
White / .png | ||
</button> | ||
<button class="export-option" @click="take_screen('black', 'png')"> | ||
Black / .png | ||
</button> | ||
<button class="export-option" @click="take_screen('white', 'svg')"> | ||
White / .svg | ||
</button> | ||
<button class="export-option" @click="take_screen('black', 'svg')"> | ||
Black / .svg | ||
</button> | ||
</div> | ||
|
||
<!-- Close button --> | ||
<button class="close-btn" @click="show_export = false">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "ExportScreen", | ||
props: ["mode"], | ||
props: ["mode", "filter_views"], | ||
data() { | ||
return { | ||
show_export: false, | ||
currentView: null, | ||
}; | ||
}, | ||
mounted() { | ||
this.emitter.on("openExportScreen", (state) => { | ||
let checkView = new Set(this.filter_views); | ||
if (!checkView.has(state)) { | ||
this.show_export = true; | ||
this.currentView = state; | ||
} | ||
}); | ||
}, | ||
methods: { | ||
take_screen(mode, format) { | ||
this.emitter.emit("exportGraph", { | ||
params: { mode, format }, | ||
mode: this.mode, | ||
}); | ||
let checkView = new Set(this.filter_views); | ||
if (!checkView.has(this.currentView)) { | ||
this.emitter.emit("exportGraph", { | ||
params: { mode, format }, | ||
mode: this.currentView, | ||
}); | ||
this.show_export = false; // Close modal after exporting | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
.subform-de-values { | ||
<style scoped> | ||
/* Button to trigger the modal */ | ||
.export-btn:hover { | ||
background-color: #45a049; | ||
} | ||
/* Modal overlay */ | ||
.export-modal-overlay { | ||
position: fixed; | ||
margin-top: -0.3%; | ||
left: 49.4%; | ||
width: auto; | ||
height: auto; | ||
font-size: 0.9vw; | ||
padding: 0.5vw; | ||
border-style: solid; | ||
border-width: 1px; | ||
border-color: #0a0a1a; | ||
background: rgba(222, 222, 222, 0.61); | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
z-index: 999998; | ||
} | ||
/* Modal content */ | ||
.export-modal { | ||
-webkit-backdrop-filter: blur(7.5px); | ||
border: 1px solid #e0e0e0; | ||
background-color: rgba(107, 107, 107, 0.5); | ||
padding: 20px; | ||
border-radius: 10px; | ||
text-align: center; | ||
width: 300px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
z-index: 999998; | ||
} | ||
.export-modal h2 { | ||
margin-bottom: 20px; | ||
font-size: 1.5rem; | ||
color: white; | ||
} | ||
/* Export options */ | ||
.export-options { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
.export-option { | ||
padding: 10px; | ||
border: none; | ||
background-color: #f0f0f0; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-size: 1rem; | ||
transition: background-color 0.3s ease; | ||
} | ||
.export-option:hover { | ||
background-color: #ddd; | ||
} | ||
/* Close button */ | ||
.close-btn { | ||
margin-top: 20px; | ||
padding: 8px 16px; | ||
background-color: #ff4c4c; | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
text-align: left; | ||
overflow: hidden; | ||
cursor: default; | ||
cursor: pointer; | ||
} | ||
.close-btn:hover { | ||
background-color: #e04343; | ||
} | ||
</style> |
27 changes: 27 additions & 0 deletions
27
frontend/src/components/toolbar/modules/ExportingButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<div> | ||
<div class="tool-item"> | ||
<span v-on:click="open_export()">Export proteins as .csv</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "ExportingButton", | ||
props: ["mode"], | ||
data() { | ||
return { | ||
}; | ||
}, | ||
methods: { | ||
open_export() { | ||
this.emitter.emit("openExportScreen", this.mode); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters