Working on Task #17248

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/performfish-analytics-portlet@181509 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-09-06 08:40:00 +00:00
parent 9a55feae3e
commit f983ca871c
18 changed files with 225 additions and 54 deletions

View File

@ -28,6 +28,7 @@ import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulat
import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulationTypeEventHandler;
import org.gcube.portlets.user.performfishanalytics.client.event.SubmitRequestEvent;
import org.gcube.portlets.user.performfishanalytics.client.event.SubmitRequestEventHandler;
import org.gcube.portlets.user.performfishanalytics.client.resources.PerformFishResources;
import org.gcube.portlets.user.performfishanalytics.client.view.LoaderIcon;
import org.gcube.portlets.user.performfishanalytics.client.viewannualbinder.AnalyticsAnnualPanelResult;
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.AnalyticsPanelResult;
@ -48,6 +49,7 @@ import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.resources.client.TextResource;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.ComplexPanel;
@ -322,7 +324,8 @@ public class PerformFishAnnualAnalyticsController {
final DataMinerAlgorithms algorithm = DataMinerAlgorithms.PERFORMFISH_SYNOPTIC_TABLE_FARM;
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
String tabTitle = "Synoptic Table";
final Tab tab = viewAnnualController.createTab(submitRequestPanel, tabTitle+" #"+(viewAnnualController.currentNumberOfTab()+1));
final Tab tab = viewAnnualController.createTab(tabTitle+" #"+(viewAnnualController.currentNumberOfTab()+1),null,submitRequestPanel);
StringBuilder dataInputsFormatter = new StringBuilder();
Map<String, String> performFishResponseMap = thePerformFishResponse.getMapParameters();
@ -489,7 +492,9 @@ public class PerformFishAnnualAnalyticsController {
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
submitRequestPanel.showLoader(true, "Submitting "+DataMinerAlgorithms.CORRELATION.getName()+" request to DM Service...");
String tabTitle = DataMinerAlgorithms.CORRELATION.getName().substring(0,1).toUpperCase()+DataMinerAlgorithms.CORRELATION.getName().toLowerCase().substring(1, DataMinerAlgorithms.CORRELATION.getName().length()); //CAMEL CASE
final Tab tab = viewAnnualController.createTab(submitRequestPanel, tabTitle+" #"+(viewAnnualController.currentNumberOfTab()+1));
final Tab tab = viewAnnualController.createTab(tabTitle+" #"+(viewAnnualController.currentNumberOfTab()+1),PerformFishResources.INSTANCE.farm_CORRELATION().getText(),submitRequestPanel);
PerformFishAnalyticsServiceAsync.Util.getInstance().callingDataMinerPerformFishAnnualCorrelationAnalysis(dmInputParameters.getPerformFishResponse(), mapParameters, new AsyncCallback<DataMinerResponse>() {
@ -558,7 +563,35 @@ public class PerformFishAnnualAnalyticsController {
SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
//submitRequestPanel.getElement().addClassName("ext-horizontal-panel");
String tabTitle = algorithm.getTitle().substring(0,1).toUpperCase()+algorithm.getTitle().toLowerCase().substring(1, algorithm.getTitle().length()); //CAMEL CASE
Tab tab = viewAnnualController.createTab(submitRequestPanel, tabTitle+" #"+(viewAnnualController.currentNumberOfTab()+1));
//TO MANAGE ALGORITHMS DESCRIPTION
TextResource algDescr = null;
switch(algorithm) {
case BOXPLOT:
algDescr = PerformFishResources.INSTANCE.farm_BOXPLOT();
break;
case CORRELATION:
algDescr = PerformFishResources.INSTANCE.farm_CORRELATION();
break;
case DEA_ANALYSIS:
break;
case DEA_CHART:
break;
case PERFORMFISH_SYNOPTIC_TABLE_FARM:
break;
case PERFORMFISH_SYNOPTICTABLE_BATCH:
break;
case SCATTER:
algDescr = PerformFishResources.INSTANCE.farm_SCATTER();
break;
case SPEEDOMETER:
algDescr = PerformFishResources.INSTANCE.farm_SPEEDOMETER();
break;
}
String algDesrTxt = algDescr!=null?algDescr.getText():null;
Tab tab = viewAnnualController.createTab(tabTitle+" #"+(viewAnnualController.currentNumberOfTab()+1),algDesrTxt,submitRequestPanel);
switch (algorithm) {
case BOXPLOT:
@ -755,7 +788,7 @@ public class PerformFishAnnualAnalyticsController {
container.add(alert);
return;
}
final String toTitle = title;
for (final OutputFile outputFile : dmResponse.getListOutput()) {

View File

@ -139,16 +139,17 @@ public class PerformFishAnnualAnalyticsViewController {
RootPanel.get(PERFORM_FISH_ANALYTICS_DIV).add(rootPanel);
}
/**
* Creates the tab.
*
* @param w the w
* @param tabTitle the tab title
* @param tabDescr the tab descr
* @param w the w
* @return the tab
*/
public Tab createTab(Widget w, String tabTitle){
return tabPanel.addAsTab(w, tabTitle, true);
public Tab createTab(String tabTitle, String tabDescr, Widget w){
return tabPanel.addAsTab(tabTitle, tabDescr, true, w);
}

View File

@ -31,6 +31,7 @@ import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulat
import org.gcube.portlets.user.performfishanalytics.client.event.SelectedPopulationTypeEventHandler;
import org.gcube.portlets.user.performfishanalytics.client.event.SubmitRequestEvent;
import org.gcube.portlets.user.performfishanalytics.client.event.SubmitRequestEventHandler;
import org.gcube.portlets.user.performfishanalytics.client.resources.PerformFishResources;
import org.gcube.portlets.user.performfishanalytics.client.view.LoaderIcon;
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.AnalyticsPanelResult;
import org.gcube.portlets.user.performfishanalytics.client.viewbinder.ShowResult;
@ -49,9 +50,13 @@ import com.github.gwtbootstrap.client.ui.Tab;
import com.github.gwtbootstrap.client.ui.constants.AlertType;
import com.github.gwtbootstrap.client.ui.constants.ControlGroupType;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.resources.client.TextResource;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.ComplexPanel;
@ -367,7 +372,7 @@ public class PerformFishAnalyticsController {
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
//submitRequestPanel.getElement().addClassName("ext-horizontal-panel");
String tabTitle = "Synoptic Table"; //CAMEL CASE
final Tab tab = viewController.createTab(submitRequestPanel, tabTitle+" #"+(viewController.currentNumberOfTab()+1));
final Tab tab = viewController.createTab(tabTitle+" #"+(viewController.currentNumberOfTab()+1), null, submitRequestPanel);
final HTMLPanel panelContainer = submitRequestPanel.getContainerPanel();
final LoaderIcon loaderIcon = new LoaderIcon("Submitting request to "+DataMinerAlgorithms.PERFORMFISH_SYNOPTICTABLE_BATCH.getTitle()+"...");
@ -446,7 +451,7 @@ public class PerformFishAnalyticsController {
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
submitRequestPanel.showLoader(true, "Submitting "+DataMinerAlgorithms.CORRELATION.getName()+" request to DM Service...");
String tabTitle = DataMinerAlgorithms.CORRELATION.getName().substring(0,1).toUpperCase()+DataMinerAlgorithms.CORRELATION.getName().toLowerCase().substring(1, DataMinerAlgorithms.CORRELATION.getName().length()); //CAMEL CASE
final Tab tab = viewController.createTab(submitRequestPanel, tabTitle+" #"+(viewController.currentNumberOfTab()+1));
final Tab tab = viewController.createTab(tabTitle+" #"+(viewController.currentNumberOfTab()+1),PerformFishResources.INSTANCE.batch_CORRELATION().getText(),submitRequestPanel);
final List<KPI> selectedKPI = new ArrayList<KPI>(viewController.getSelectedKPIs());
final List<String> batchIDs = new ArrayList<String>(viewController.getListBatchesID());
@ -507,11 +512,39 @@ public class PerformFishAnalyticsController {
if(listBatchID==null || listBatchID.size()==0)
Window.alert("Something seems wrong, no selected BatchID, try again");
SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
final SubmitRequestPanel submitRequestPanel = new SubmitRequestPanel("", 1);
//submitRequestPanel.getElement().addClassName("ext-horizontal-panel");
String tabTitle = algorithm.getTitle().substring(0,1).toUpperCase()+algorithm.getTitle().toLowerCase().substring(1, algorithm.getTitle().length()); //CAMEL CASE
Tab tab = viewController.createTab(submitRequestPanel, tabTitle+" #"+(viewController.currentNumberOfTab()+1));
//TO MANAGE ALGORITHMS DESCRIPTION
TextResource algDescr = null;
switch(algorithm) {
case BOXPLOT:
algDescr = PerformFishResources.INSTANCE.batch_BOXPLOT();
break;
case CORRELATION:
algDescr = PerformFishResources.INSTANCE.batch_CORRELATION();
break;
case DEA_ANALYSIS:
break;
case DEA_CHART:
break;
case PERFORMFISH_SYNOPTIC_TABLE_FARM:
break;
case PERFORMFISH_SYNOPTICTABLE_BATCH:
break;
case SCATTER:
algDescr = PerformFishResources.INSTANCE.batch_SCATTER();
break;
case SPEEDOMETER:
algDescr = PerformFishResources.INSTANCE.batch_SPEEDOMETER();
break;
}
String algDesrTxt = algDescr!=null?algDescr.getText():null;
Tab tab = viewController.createTab(tabTitle+" #"+(viewController.currentNumberOfTab()+1), algDesrTxt, submitRequestPanel);
switch (algorithm) {
case BOXPLOT:
case SPEEDOMETER:

View File

@ -145,16 +145,17 @@ public class PerformFishAnalyticsViewController {
RootPanel.get(PERFORM_FISH_ANALYTICS_DIV).add(rootPanel);
}
/**
* Creates the tab.
*
* @param w the w
* @param tabTitle the tab title
* @param tabDescription the tab description
* @param w the w
* @return the tab
*/
public Tab createTab(Widget w, String tabTitle){
return tabPanel.addAsTab(w, tabTitle, true);
public Tab createTab(String tabTitle, String tabDescription, Widget w){
return tabPanel.addAsTab(tabTitle, tabDescription, true, w);
}

View File

@ -0,0 +1,2 @@
The box plot represents the distribution of batch data in the VRE. Blue dots indicate the position of the selected batch data in the statistical range, and white dots indicate data outliers.
Summary tables report descriptive statistics (i.e. mean, standard deviation, median, range and quartile) of the user's batch data and of all the batch data in the VRE, including anonymised data and users data. KPI summary statistics is calculated on the batches of fishes, so the batch is the statistical unit.

View File

@ -0,0 +1 @@
The correlation matrix is a table displaying the correlation between pairs of KPIs. Correlation coefficients are calculated using the Person parametric correlation test and coloured according to the value in red (significant positive correlation), yellow (significant negative correlation), and in light blue (non-significant correlation). The correlation matrix is a table displaying the correlation between pairs of KPIs. Correlation coefficients are calculated using the Person parametric correation test and coloured according to the value in red (significant positive correlation), yellow (significant negative correlation), and in light blue (non-significant correlation). The Student t-test is used to determine the ranges of correlation for Pearson coefficients.

View File

@ -0,0 +1 @@
The scatter plot is a two-dimensional chart displaying batch data for two KPIs. Users data is displayed as point, each having the value of one KPI determining the position on the horizontal axis and the value of the other KPI determining the position on the vertical axis. The position of the users batches is displayed with respect to farms batches in the VRE (anonymous). When the analysis is carried out on a single batch, an arrowhead indicates the selected batch data. Colour coded summary statistics (i.e. median and quartiles) are reported for each axis.

View File

@ -0,0 +1,3 @@
The performeter is a chart displaying the quantity and quality of KPI batch value over a radial scale. It shows the range (i.e. minimum, maximum) and the KPI value of batch data analysed in the VRE in a coloured range. Five colours categories are assigned to indicate different performances in the KPI (i.e. very good, good, normal, bad, and very bad). The pointer indicates the absolute value of the KPI and its position in the range. When the analysis is carried out on a single batch, the KPI value will refer to the batch value, while on all batches, the KPI value is calculated on all users batches.
For KPIs having percentage as unit of measure, the range and the KPI value are normalised (scaled) between 0 and 100, where 0 indicates the minimum KPI value in the VRE and 100 the maximum.
For KPIs having number as unit of measure, the range and the KPI value are reported between the minimum and maximum KPI value in the VRE.

View File

@ -0,0 +1,2 @@
The box plot represents the distribution of farm data in the VRE. Blue dots indicate the position of users farm data in the statistical range, and white dots indicate data outliers.
A summary table reports descriptive statistics (i.e. mean, standard deviation, median, range and quartile) of the user's farm data and of all farm data in the VRE, including anonymised data. KPI summary statistics is obtained considering farm as the statistical unit.

View File

@ -0,0 +1 @@
The correlation matrix is a table displaying the correlation between pairs of KPIs. Correlation coefficients are calculated using the Person parametric correation test and coloured according to the value in red (significant positive correlation), yellow (significant negative correlation), and in light blue (non-significant correlation). The Student t-test is used to determine the ranges of correlation for Pearson coefficients.

View File

@ -0,0 +1 @@
The scatter plot is a two-dimensional chart displaying farm data for two KPIs. Users data is displayed as point, each having the value of one KPI determining the position on the horizontal axis and the value of the other KPI determining the position on the vertical axis. The position of the users farm is displayed with respect to other farms in the VRE (anonymous). Colour coded summary statistics (i.e. median and quartiles) are reported for each axis.

View File

@ -0,0 +1,3 @@
The performeter is a chart displaying the quantity and quality of KPI farm value over a radial scale. It shows the range (i.e. minimum, maximum) and the KPI value of farm data analysed in the VRE in a coloured range. Five colours categories are assigned to indicate different performances in the KPI (i.e. very good, good, normal, bad, and very bad). The pointer indicates the absolute value of the KPI and its position in the range. When the analysis is carried out on a single year, the KPI value will refer to the year value, while on all years, the KPI value is calculated on all users annual data.
For KPIs having percentage as unit of measure, the range and the KPI value are normalised (scaled) between 0 and 100, where 0 indicates the minimum KPI value in the VRE and 100 the maximum.
For KPIs having number as unit of measure, the range and the KPI value are reported between the minimum and maximum KPI value in the VRE.

View File

@ -78,4 +78,28 @@ public interface PerformFishResources extends ClientBundle {
@Source("Error_Page.html")
public TextResource errorPage();
@Source("Batch_BOXPLOT")
public TextResource batch_BOXPLOT();
@Source("Farm_BOXPLOT")
public TextResource farm_BOXPLOT();
@Source("Batch_SCATTER")
public TextResource batch_SCATTER();
@Source("Farm_SCATTER")
public TextResource farm_SCATTER();
@Source("Batch_SPEEDOMETER")
public TextResource batch_SPEEDOMETER();
@Source("Farm_SPEEDOMETER")
public TextResource farm_SPEEDOMETER();
@Source("Batch_CORRELATION")
public TextResource batch_CORRELATION();
@Source("Farm_CORRELATION")
public TextResource farm_CORRELATION();
}

View File

@ -0,0 +1,41 @@
package org.gcube.portlets.user.performfishanalytics.client.view;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
/**
* The Class ManualPanel.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Sep 5, 2019
*/
public class ManualPanel extends Composite {
private static ManualPanelUiBinder uiBinder = GWT.create(ManualPanelUiBinder.class);
/**
* The Interface ManualPanelUiBinder.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Sep 5, 2019
*/
interface ManualPanelUiBinder extends UiBinder<Widget, ManualPanel> {
}
/**
* Instantiates a new manual panel.
*
* @param parent the parent
*/
public ManualPanel(Panel parent) {
initWidget(uiBinder.createAndBindUi(this));
//parent.add(this);
}
}

View File

@ -0,0 +1,13 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
.important {
font-weight: bold;
}
</ui:style>
<g:HTMLPanel>
<g:Frame url="https://docs.google.com/document/d/1QK-I9LwQ5yDJhmHi-cgWpgC3f1Qux05gYgwGYHks-zQ" height="100%" width="100%"></g:Frame>
</g:HTMLPanel>
</ui:UiBinder>

View File

@ -697,38 +697,6 @@ public class AnalyticsPanelResult extends Composite {
}
// /**
// * Call box plot and speedo meter.
// *
// * @param rowIndex the row index
// * @param columnIndex the column index
// * @param button the button
// */
// private void callBoxPlotAndSpeedoMeter(int rowIndex, int columnIndex, Button button){
//
// String focusID = checkValidFocusID();
//
// if(focusID==null)
// return;
//
// GWT.log("Called BoxPlotAndSpeedoMeter at rowIndex: "+rowIndex +", columnIndex: "+columnIndex);
// HorizontalPanel hp = new HorizontalPanel();
// hp.getElement().addClassName("ext-horizontal-panel");
// HorizontalPanel boxPlot = new HorizontalPanel();
// HorizontalPanel speedometer = new HorizontalPanel();
// hp.add(boxPlot);
// hp.add(speedometer);
// //hp.getElement().addClassName("ext-horizontal-panel");
// field_unary_algorithm_container.add(hp);
// //KPI selectKPI = getKPIForName(button.getText());
// List<KPI> selectedKPI = getKPIForIndexes(rowIndex, columnIndex);
// GWT.log("Selected KPI: "+selectedKPI);
// field_unary_algorithm.setVisible(true);
// callDataMinerServiceForChart(dataInputParameters, selectedKPI, null, DataMinerAlgorithms.BOXPLOT, focusID, boxPlot);
// callDataMinerServiceForChart(dataInputParameters, selectedKPI, null, DataMinerAlgorithms.SPEEDOMETER, focusID, speedometer);
// }
/**
* Check valid focus id.
*

View File

@ -19,6 +19,7 @@ import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
@ -108,12 +109,13 @@ public class TabPanelView extends Composite {
/**
* Adds the as tab.
*
* @param w the w
* @param tabTitle the tab title
* @param tabDescr the tab descr
* @param spinner the spinner
* @param w the w
* @return the tab
*/
public Tab addAsTab(Widget w, String tabTitle, boolean spinner){
public Tab addAsTab(String tabTitle, String tabDescr, boolean spinner, Widget w){
// field_create_analytics_request.setActive(false);
@ -135,9 +137,13 @@ public class TabPanelView extends Composite {
//tab.setActive(true);
tab.setHeading(tabTitle);
results.add(tab);
if(tabDescr!=null) {
HTML html = new HTML(tabDescr);
tab.add(html);
}
tab.add(w);
activeTabPanels(false);
field_base_tabpanel.selectTab(results.size());
field_base_tabpanel.selectTab(results.size()+1); //+1 because the first tab is "Manual"
return tab;
// tab.setActive(true);

View File

@ -1,13 +1,50 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<ui:style>
/* Add CSS here. See the GWT docs on UI Binder for more details */
.background-tab {
background-color: #E5E5E5;
}
.text-size {
font-size: 18px !important;
}
.color-title {
color: #4DE1FF;
}
.margin-panel {
margin: 20px;
}
</ui:style>
<b:TabPanel tabPosition="above" ui:field="field_base_tabpanel">
<b:TabPanel tabPosition="above"
ui:field="field_base_tabpanel">
<b:Tab heading="Manual" active="false" ui:field="field_manual"
icon="BOOK">
<g:HTMLPanel styleName="{style.margin-panel}">
<g:VerticalPanel>
<g:Image
url="https://services.d4science.org/image/layout_set_logo?img_id=77937416">
</g:Image>
</g:VerticalPanel>
<g:VerticalPanel>
<g:HorizontalPanel>
<g:HTML styleName="{style.text-size}">Go to &nbsp;</g:HTML>
<g:Anchor styleName="{style.text-size}" target="_blank"
href="https://docs.google.com/document/d/1QK-I9LwQ5yDJhmHi-cgWpgC3f1Qux05gYgwGYHks-zQ">KPIs VRE - User Manual</g:Anchor>
</g:HorizontalPanel>
</g:VerticalPanel>
<!-- <b:Heading size="5" styleName="{style.color-title}">Integrating
Innovative -->
<!-- Approaches for Competitive and Sustainable Performance across the -->
<!-- Mediterranean Aquaculture Value Chain -->
<!-- </b:Heading> -->
</g:HTMLPanel>
</b:Tab>
<b:Tab heading="Create Analytics Request" active="true"
ui:field="field_create_analytics_request" icon="TASKS">
</b:Tab>