+ `;
+ }
+}
+
+customElements.define("sea-export-popup", ExportPopup);
\ No newline at end of file
diff --git a/client/jsFiles/SEAWebClientGraphics.js b/client/jsFiles/SEAWebClientGraphics.js
index 420cc4c..e954bbe 100644
--- a/client/jsFiles/SEAWebClientGraphics.js
+++ b/client/jsFiles/SEAWebClientGraphics.js
@@ -261,7 +261,10 @@ let globalIndicators = (function (){
function loadGraphicsMenu(panel){
let menuGraphicsPopup = new MenuPopup();
+ let exportActionEntry = new ActionEntry("Export", graphs.displayExportPopup);
let removeCursorHelpEntry = new HelpEntry("How to remove the cursor", "You can double click/tap on any graph.");
+ menuGraphicsPopup.addEntry(exportActionEntry)
+ menuGraphicsPopup.addHorizontalDivider();
menuGraphicsPopup.addEntry(removeCursorHelpEntry);
let graphicsMenuControl = new Control("res/menu_white.png", "res/menu_white.png", "Menu", () => {menuGraphicsPopup.show()});
@@ -273,6 +276,18 @@ function loadGraphicsMenu(panel){
graphicsMenuControl.style.marginRight="6px";
}
+let exportPopup = undefined;
+
+function loadExportPopup(){
+ let graphsContainer = document.getElementsByClassName("graphs-container")[0];
+ exportPopup = new ExportPopup(exportCallback);
+ graphsContainer.appendChild(exportPopup);
+}
+
+function exportCallback(selectedVariables, startDateTimeMs, endDateTimeMs, binning=null){
+ console.log(selectedVariables, startDateTimeMs, endDateTimeMs, binning);
+}
+
let graphs = (function (){
let dataset_to_graph_map = {}; // a dictionnary mapping a variable name to a two values array, containing its graph index and its position inside the graph
let blocks, liveMode=true, top_vars=[], bottom_vars=[];
@@ -891,6 +906,7 @@ let graphs = (function (){
currentSwiper.slideNext();
});
+ loadExportPopup();
globalIndicators.loadIndicators(graphicsPanel);
globalControls.loadControls(graphicsPanel);
loadGraphicsMenu(graphicsPanel);
@@ -1145,6 +1161,10 @@ let graphs = (function (){
}
}
+ function displayExportPopup(){
+ exportPopup.show(blocks,currentMinTime, currentMaxTime);
+ }
+
/**
* Make sure that the updatAuto() function called in chartJS' onZoomComplete callback is delayed
* This is needed for mobile phones, as this callback is triggered too often
@@ -1188,6 +1208,8 @@ let graphs = (function (){
jumpToDate: jumpToDate,
initGraphs: initGraphs,
onZoomCompleteCallback:onZoomCompleteCallback,
+
+ displayExportPopup:displayExportPopup
}
})();
diff --git a/seaweb.py b/seaweb.py
index ee95048..ae44b17 100755
--- a/seaweb.py
+++ b/seaweb.py
@@ -151,6 +151,8 @@ def subdir_test_file(file):
resp = flask.send_file("client/test/"+file, mimetype=guess_mimetype(file))
return resp
+@app.route('/components/action_entry/')
+@app.route('/components/export_popup/')
@app.route('/components/dates_popup/')
@app.route('/components/menu_popup/')
@app.route('/components/help_popup/')