diff --git a/README.md b/README.md index 03e5b1befea38931a7909a47f346b260514e7e99..c28475fbf151966bdfd7dc7180adda86d050e07b 100644 --- a/README.md +++ b/README.md @@ -540,17 +540,22 @@ TODO ``` * `showBioEntity({element, type, options})` - * Arguments: TODO - * Example: + * Arguments: + * element - object identifying the element, it should contain three fields: id, type, model; where id is the element id, type is type of the element ('ALIAS', 'REACTION'), and model define submap on which it's defined + * type - how do you want to visualize BioEntity: 'ICON', 'SURFACE' + * options - set of visualization options: color, opacity, lineColor, lineWeight, lineOpacity + * Example: ``` -TODO +customMap.showBioEntity({element:{id:18306,type:"ALIAS", modelId:5}, type: "SURFACE", options:{color:"#FF0000"}}); ``` * `hideBioEntity({element, type})` - * Arguments: TODO + * Arguments: + * element - object identifying the element, it should contain three fields: id, type, model; where id is the element id, type is type of the element ('ALIAS', 'REACTION'), and model define submap on which it's defined + * type - which visualization of BioEntity you want to hide: 'ICON', 'SURFACE' * Example: ``` -TODO +customMap.hideBioEntity({element:{id:18306,type:"ALIAS", modelId:5}, type: "SURFACE"}); ``` * `setCenter({modelId, x, y})` diff --git a/frontend-js/.idea/frontend-js.iml b/frontend-js/.idea/frontend-js.iml index b6d6506e8893d7574cd478c3f94f16a0d3a0f679..3bba33a18114e4636092f26823e9b5f578d36fd0 100644 --- a/frontend-js/.idea/frontend-js.iml +++ b/frontend-js/.idea/frontend-js.iml @@ -3,11 +3,12 @@ <component name="NewModuleRootManager"> <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/.tmp" /> - <excludeFolder url="file://$MODULE_DIR$/temp" /> <excludeFolder url="file://$MODULE_DIR$/dist" /> + <excludeFolder url="file://$MODULE_DIR$/temp" /> <excludeFolder url="file://$MODULE_DIR$/tmp" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="chai-DefinitelyTyped" level="application" /> </component> </module> \ No newline at end of file diff --git a/web/src/main/webapp/export-new.xhtml b/web/src/main/webapp/export-new.xhtml deleted file mode 100644 index e84a149b5e2969e49651600830450d5271be382b..0000000000000000000000000000000000000000 --- a/web/src/main/webapp/export-new.xhtml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" -"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:p="http://primefaces.org/ui"> - -<f:view contentType="text/html"> -<h:head> - <script src="https://maps.google.com/maps/api/js?libraries=drawing&v=3.26" type="text/javascript"/> - - <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"/> - <script src="https://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.min.js" type="text/javascript"/> - - <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> - <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script> - - - <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"/> - <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/> - - <link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png" /> - - <h:outputScript library="js" name="minerva.js" /> - - <script type="text/javascript"> -//<![CDATA[ - -function initMap(){ - var element = document.getElementById('minervaAppDiv'); - return minerva.createExport({ - element : element, - }).then(function(result){ - customMap = result; - document.title = result.getProject().getName(); - }).catch(function(rejectReason){ - minerva.GuiConnector.alert(rejectReason); - }); -} - -//]]> - </script> -</h:head> -<h:body onload="initMap();" > -<h:outputStylesheet library="css" name="style.css"/> -<h:outputStylesheet library="css" name="minerva.css" /> -<h:outputStylesheet library="css" name="pileup.css"/> -<h:outputStylesheet library="css" name="bootstrap.min.css"/> - - <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> - <div id="minervaAppDiv" style="height: 100%;width: 100%;margin: 0;"/> - -</h:body> -</f:view> -</html> diff --git a/web/src/main/webapp/export.xhtml b/web/src/main/webapp/export.xhtml index 0975336022720d7933c97200d2a0813ad4aaa6d8..e84a149b5e2969e49651600830450d5271be382b 100644 --- a/web/src/main/webapp/export.xhtml +++ b/web/src/main/webapp/export.xhtml @@ -7,97 +7,51 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> +<f:view contentType="text/html"> <h:head> - <title>#{mapMB.currentProject.name} - data export</title> - <link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png" /> - <h:outputStylesheet library="css" name="style.css"/> - <h:outputStylesheet library="css" name="export.css"/> + <script src="https://maps.google.com/maps/api/js?libraries=drawing&v=3.26" type="text/javascript"/> + + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"/> + <script src="https://twitter.github.io/typeahead.js/releases/latest/typeahead.bundle.min.js" type="text/javascript"/> + + <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> + <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script> + + + <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"/> + <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/> - <ui:include src="/WEB-INF/components/admin/statistics.xhtml" /> + <link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png" /> + + <h:outputScript library="js" name="minerva.js" /> + <script type="text/javascript"> +//<![CDATA[ + +function initMap(){ + var element = document.getElementById('minervaAppDiv'); + return minerva.createExport({ + element : element, + }).then(function(result){ + customMap = result; + document.title = result.getProject().getName(); + }).catch(function(rejectReason){ + minerva.GuiConnector.alert(rejectReason); + }); +} + +//]]> + </script> </h:head> -<h:body> - <ui:include src="/WEB-INF/components/admin/header.xhtml" /> - - <h:form prependId="false"> - <p:tabView id="tabView" dynamic="true"> - <p:tab id="speciesTab" title="Elements export"> - <h:panelGrid columns="2" style="margin-bottom:10px;" columnClasses="topAligned" cellpadding="5"> - <h:outputLabel value="Type: " /> - <p:selectManyCheckbox id="speciesTypeList" value="#{exportMB.selectedSpeciesType}" columns="5" - layout="grid" > - <f:selectItems value="#{exportMB.speciesTypeList}"/> - </p:selectManyCheckbox> - <h:outputLabel value="Columns: " /> - <p:selectManyCheckbox id="speciesColumnList" value="#{exportMB.selectedSpeciesColumn}" columns="5" - layout="grid" > - <f:selectItems value="#{exportMB.speciesColumnList}"/> - </p:selectManyCheckbox> - <h:outputLabel value="Annotations: " /> - <p:pickList value="#{exportMB.elementAvailableMiriam}" var="miriam" itemLabel="#{miriam.left.commonName} (#{miriam.right})" itemValue="#{miriam}" converter="miriamTypeConverter"> - <f:facet name="sourceCaption">Available</f:facet> - <f:facet name="targetCaption">Used</f:facet> - <p:column> - <h:outputText value="#{miriam.left.commonName} (#{miriam.right})" style="background-color: #{miriam.right>0?'#00FF00':'#FFFFFF'}"/> - </p:column> - </p:pickList> - <h:outputLabel value="Included compartments/pathways: " /> - <p:pickList value="#{exportMB.elementIncludedComponent}" var="comp" itemLabel="#{comp}" itemValue="#{comp}" > - <f:facet name="sourceCaption">Available</f:facet> - <f:facet name="targetCaption">Used</f:facet> - </p:pickList> - <h:outputLabel value="Excluded compartments/pathways: " /> - <p:pickList value="#{exportMB.elementExcludedComponent}" var="comp" itemLabel="#{comp}" itemValue="#{comp}" > - <f:facet name="sourceCaption">Available</f:facet> - <f:facet name="targetCaption">Used</f:facet> - </p:pickList> - </h:panelGrid> - <h:commandButton action="#{exportMB.downloadElements}" value="DOWNLOAD" type="submit" styleClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" style="font-size:13px; font-weight:900; margin-top:5px; padding:5px 20px; margin-left:205px;"/> - </p:tab> - <p:tab id="networkTab" title="Network export"> - <h:panelGrid columns="2" style="margin-bottom:10px;" columnClasses="topAligned" cellpadding="5"> - <h:outputLabel value="Nodes: " /> - <p:selectManyCheckbox id="networkTypeList" value="#{exportMB.selectedNetworkType}" columns="5" - layout="grid" > - <f:selectItems value="#{exportMB.speciesTypeList}"/> - </p:selectManyCheckbox> - <h:outputLabel value="Annotations: " /> - <p:pickList value="#{exportMB.networkAvailableMiriam}" var="miriam" itemLabel="#{miriam.left.commonName} (#{miriam.right})" itemValue="#{miriam}" converter="miriamTypeConverter"> - <f:facet name="sourceCaption">Available</f:facet> - <f:facet name="targetCaption">Used</f:facet> - <p:column> - <h:outputText value="#{miriam.left.commonName} (#{miriam.right})" style="background-color: #{miriam.right>0?'#00FF00':'#FFFFFF'}"/> - </p:column> - </p:pickList> - <h:outputLabel value="Included compartments/pathways: " /> - <p:pickList value="#{exportMB.networkIncludedComponent}" var="comp" itemLabel="#{comp}" itemValue="#{comp}" > - <f:facet name="sourceCaption">Available</f:facet> - <f:facet name="targetCaption">Used</f:facet> - </p:pickList> - <h:outputLabel value="Excluded compartments/pathways: " /> - <p:pickList value="#{exportMB.networkExcludedComponent}" var="comp" itemLabel="#{comp}" itemValue="#{comp}" > - <f:facet name="sourceCaption">Available</f:facet> - <f:facet name="targetCaption">Used</f:facet> - </p:pickList> - <h:outputLabel value="File type: " /> - <p:selectOneRadio id="networkFileType" value="#{exportMB.selectedNetworkFileType}" columns="5" - layout="grid" > - <f:selectItems value="#{exportMB.networkFileTypeList}"/> - </p:selectOneRadio> - </h:panelGrid> - - <h:commandButton action="#{exportMB.downloadNetwork}" value="DOWNLOAD" type="submit" styleClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" style="font-size:13px; font-weight:900; margin-top:5px; padding:5px 20px; margin-left:205px;"/> - </p:tab> - <p:tab id="graphicsTab" title="Graphics"> - <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> - <p:selectOneRadio id="svgSelectedModel" value="#{exportMB.selectedModelString}" columns="1" - layout="grid" > - <f:selectItems value="#{exportMB.models}"/> - </p:selectOneRadio> - <h:commandButton action="#{exportMB.downloadSvg}" value="DOWNLOAD SVG" type="submit" styleClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" style="font-size:13px; font-weight:900; margin-top:5px; padding:5px 20px;" /> - </p:tab> - </p:tabView> - </h:form> +<h:body onload="initMap();" > +<h:outputStylesheet library="css" name="style.css"/> +<h:outputStylesheet library="css" name="minerva.css" /> +<h:outputStylesheet library="css" name="pileup.css"/> +<h:outputStylesheet library="css" name="bootstrap.min.css"/> + + <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> + <div id="minervaAppDiv" style="height: 100%;width: 100%;margin: 0;"/> + </h:body> +</f:view> </html> -