diff --git a/src/components/ModelRun.vue b/src/components/ModelRun.vue index 50391ed..17982bd 100644 --- a/src/components/ModelRun.vue +++ b/src/components/ModelRun.vue @@ -206,14 +206,14 @@ {{ $store.state.terms.get_term_for_locale("model_runs.types.simple") }} +

No modifications to the model's region settings in this run.

- +

Crop Modifications

- Table - Scatterplot + + - {{ item.max_land_area_proportion }} +

No modifications to the model's crop settings in this run.

diff --git a/src/utils.js b/src/utils.js index 545ee9b..a0b8dd0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -168,43 +168,29 @@ export const stormchaser_utils = { }, download_array_as_csv(args) { - /* Also shamelessly adapted and commented from - https://www.developintelligence.com/blog/2017/04/use-javascript-to-export-your-data-as-csv/- */ - let output_data, filename, link; - let csv = stormchaser_utils.convert_array_of_objects_to_csv({ // get the CSV representation of the data - data: args.data, - lookups: args.lookups, - drop_fields: args.drop_fields - }); - if (csv == null) return; - - filename = args.filename || 'export.csv'; // set the filename + /* Also shamelessly adapted and commented from + https://www.developintelligence.com/blog/2017/04/use-javascript-to-export-your-data-as-csv/- */ + let output_data, filename, link; + let csv = stormchaser_utils.convert_array_of_objects_to_csv({ // get the CSV representation of the data + data: args.data, + lookups: args.lookups, + drop_fields: args.drop_fields + }); + if (csv == null) return; - if (!csv.match(/^data:text\/csv/i)) { - csv = 'data:text/csv;charset=utf-8,' + csv; - } - output_data = encodeURI(csv); // get the URI the browser will use to download the data + filename = args.filename || 'export.csv'; // set the filename - link = document.createElement('a'); // attach the URI to the document, hide it, and click it - link.style.display = "none"; - link.setAttribute('href', output_data); - link.setAttribute('download', filename); - link.click(); -}, -// default_title_getter = function(stormchaser){return stormchaser.$store.getters.current_model_area.name}; -// function set_window_title(title, stormchaser){ -// document.title = `${default_title_getter(stormchaser)}: ${title}` || default_title_getter(stormchaser); -// } - -// utils = { -// model_run_status_text, -// regions_as_geojson, -// download_regions_as_shapefile, -// download_array_as_csv, -// set_window_title -// } + if (!csv.match(/^data:text\/csv/i)) { + csv = 'data:text/csv;charset=utf-8,' + csv; + } + output_data = encodeURI(csv); // get the URI the browser will use to download the data + + link = document.createElement('a'); // attach the URI to the document, hide it, and click it + link.style.display = "none"; + link.setAttribute('href', output_data); + link.setAttribute('download', filename); + link.click(); + }, } -// make the function available within Vue objects -// const app = createApp({}) -// Object.defineProperty(app.config.globalProperties, '$stormchaser_utils', {value: utils}); +