Skip to content

Commit

Permalink
include custom download at start of modebar
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Nov 6, 2023
1 parent 0228b21 commit c11dcbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 0 additions & 2 deletions app/static/src/app/components/plot/WodinPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ export default defineComponent({
const downloadImageClick = (gd: PlotlyDataLayoutConfig) => {
plotlyContext.value = gd;
const layout = gd.layout! as any;
console.log("xaxis is: " + JSON.stringify(layout.xaxis))
console.log("yaxis is: " + JSON.stringify(layout.yaxis))
downloadImageProps.title = layout.title || "";
downloadImageProps.xLabel = layout.xaxis.title?.text || "";
downloadImageProps.yLabel = layout.yaxis.title?.text || "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<script setup lang="ts">
import {computed, defineProps, defineEmits, watch, reactive} from "vue";
// TODO: sort out buttons - put 'custom' download first, then the other standard buttons except download
// TODO put the WodinPlot changes in a mixin and use that from Sensitivity Summary plot too
const props = defineProps({
Expand Down
18 changes: 11 additions & 7 deletions app/static/src/app/plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ export const margin = {

export const config = (downloadClick: (gd: PlotlyDataLayoutConfig) => void) => ({
responsive: true,
modeBarButtonsToAdd: [
{
name: "Custom Download",
icon: (Plotly as any).Icons.camera,
click: downloadClick
}
]
modeBarButtons: [[{
name: "Custom Download",
icon: (Plotly as any).Icons.camera,
click: downloadClick
},
"zoom2d",
"pan2d",
"zoomIn2d",
"zoomOut2d",
"autoScale2d",
"resetScale2d"]]
} as any);

export function filterUserTypeSeriesSet(s: OdinUserTypeSeriesSet, param: string, names: string[]): OdinSeriesSet {
Expand Down

0 comments on commit c11dcbe

Please sign in to comment.