Commit b300161e authored by maxchaza's avatar maxchaza

Merge branch 'hotfix/findCycle'

parents 2fff8d7a 447dafe0
/**
* @author MC
* @description CycleDetectionForm : Display Settings
*/
Ext.define('metExploreViz.view.form.cycleDetectionForm.CycleDetectionForm', {
extend: 'Ext.panel.Panel',
alias: 'widget.cycleDetectionForm',
requires: [
"metExploreViz.view.form.cycleDetectionForm.CycleDetectionFormController",
"metExploreViz.view.form.SelectDisplayReactionLabel",
"metExploreViz.view.form.SelectDisplayMetaboliteLabel"
],
controller: "form-cycleDetectionForm-cycleDetectionForm",
region:'north',
margins:'0 0 0 0',
flex:1,
width:'100%',
border:false,
autoScroll:true,
layout: {
type: 'vbox',
align: 'stretch'
},
autoHeight: true,
disabled: true,
items:[{
xtype:'button',
text:'Draw Cycle',
margin: '10 10 10 10',
align:'stretch',
width:'95%',
reference:'buttonDrawCycle',
hidden: true
},{
xtype:'menuseparator'
},{
xtype:'fieldcontainer',
reference:'cycleDetectionPanel'
},{
xtype:'button',
text:'Hide cycle',
margin: '10 10 10 10',
align:'stretch',
width:'50%',
reference:'buttonHideCycle',
hidden: true
}]
});
\ No newline at end of file
/**
* @author MC
* @description class to control settings or configs
*/
Ext.define('metExploreViz.view.form.cycleDetectionForm.CycleDetectionFormController', {
extend: 'Ext.app.ViewController',
alias: 'controller.form-cycleDetectionForm-cycleDetectionForm',
/**
* Init function Checks the changes on drawing style
*/
init : function() {
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
view.on({
listCycles : me.listCycles,
scope:me
});
view.lookupReference('buttonDrawCycle').on({
click:me.drawMetaboliteCycle,
scope:me
});
view.lookupReference('buttonHideCycle').on({
click:me.hideMetaboliteCycle,
scope:me
});
},
drawMetaboliteCycle: function () {
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
this.lookupReference('cycleDetectionPanel').items.each(function (d) {
if (d.checked){
metExploreD3.GraphFunction.drawMetaboliteCycle(d.cycle);
}
})
},
hideMetaboliteCycle: function () {
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
this.lookupReference('cycleDetectionPanel').items.each(function (d) {
if (d.checked){
d.setValue(false);
metExploreD3.GraphFunction.removeHighlightCycle(d.cycle);
}
})
},
listCycles: function (cycles) {
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
view.enable();
this.lookupReference('cycleDetectionPanel').removeAll(true);
if (cycles.length > 0) {
for (var i = 0; i < cycles.length; i++) {
var newCheckbox = Ext.create('Ext.form.field.Radio', {
reference: 'radioCycle' + i,
boxLabel: 'Cycle ' + (i + 1),
name: 'cycle',
cycle: cycles[i],
margin: '0 0 0 20',
listeners: {
change: function () {
if (this.checked === true) {
metExploreD3.GraphFunction.highlightCycle(this.cycle);
}
}
}
});
this.lookupReference('cycleDetectionPanel').add(newCheckbox);
if (i === 0) {
this.lookupReference('radioCycle' + i).setValue(true);
}
}
Ext.getCmp('comparisonSidePanel').expand();
view.show();
view.expand();
this.lookupReference('buttonDrawCycle').show();
this.lookupReference('buttonHideCycle').show();
}
else {
this.lookupReference('buttonDrawCycle').hide();
this.lookupReference('buttonHideCycle').hide();
}
}
});
...@@ -22,7 +22,6 @@ Ext.define('metExploreViz.view.menu.viz_ExportMenu.Viz_ExportMenu', { ...@@ -22,7 +22,6 @@ Ext.define('metExploreViz.view.menu.viz_ExportMenu.Viz_ExportMenu', {
{ {
text: 'Export Viz as svg', text: 'Export Viz as svg',
reference:'exportSVG', reference:'exportSVG',
tooltip:'Export network viz as a svg file',
iconCls:'exportSvg' iconCls:'exportSvg'
}, },
{ {
...@@ -32,8 +31,7 @@ Ext.define('metExploreViz.view.menu.viz_ExportMenu.Viz_ExportMenu', { ...@@ -32,8 +31,7 @@ Ext.define('metExploreViz.view.menu.viz_ExportMenu.Viz_ExportMenu', {
id:'vizExportPNGID', id:'vizExportPNGID',
reference:'vizExportPNGID', reference:'vizExportPNGID',
padding:'0 0 0 0', padding:'0 0 0 0',
iconCls:'exportPng', iconCls:'exportPng'
tooltip:'Export network viz as a png file'
}, },
{ {
text: 'Export Viz as jpeg', text: 'Export Viz as jpeg',
...@@ -42,8 +40,7 @@ Ext.define('metExploreViz.view.menu.viz_ExportMenu.Viz_ExportMenu', { ...@@ -42,8 +40,7 @@ Ext.define('metExploreViz.view.menu.viz_ExportMenu.Viz_ExportMenu', {
id:'vizExportJPGID', id:'vizExportJPGID',
reference:'vizExportJPGID', reference:'vizExportJPGID',
padding:'0 0 0 0', padding:'0 0 0 0',
iconCls:'exportJpg', iconCls:'exportJpg'
tooltip:'Export network viz as a jpeg file'
} }
// , // ,
// { // {
......
...@@ -22,15 +22,12 @@ Ext.define('metExploreViz.view.menu.viz_ExportPNGMenu.Viz_ExportPNGMenu', { ...@@ -22,15 +22,12 @@ Ext.define('metExploreViz.view.menu.viz_ExportPNGMenu.Viz_ExportPNGMenu', {
{ {
text: 'original resolution', text: 'original resolution',
reference:'exportPNGX1', reference:'exportPNGX1',
tooltip:'Export network viz as a png file'
}, { }, {
text: 'original resolution * 2', text: 'original resolution * 2',
reference:'exportPNGX2', reference:'exportPNGX2',
tooltip:'Export network viz as a png file (resolution * 2)'
}, { }, {
text: 'original resolution * 4', text: 'original resolution * 4',
reference:'exportPNGX4', reference:'exportPNGX4',
tooltip:'Export network viz as a png file (resolution * 4)'
} }
] ]
}); });
......
...@@ -21,12 +21,10 @@ Ext.define('metExploreViz.view.menu.viz_ExtractSubNetworkMenu.Viz_ExtractSubNetw ...@@ -21,12 +21,10 @@ Ext.define('metExploreViz.view.menu.viz_ExtractSubNetworkMenu.Viz_ExtractSubNetw
items: [ items: [
{ {
text: 'From Mapping', text: 'From Mapping',
reference:'keepOnlySubnetworkFromMapping', reference:'keepOnlySubnetworkFromMapping'
tooltip:'Extract sub-network based on node mapping'
}, { }, {
text: 'From Selection', text: 'From Selection',
reference:'keepOnlySubnetworkFromSelection', reference:'keepOnlySubnetworkFromSelection'
tooltip:'Extract sub-network based on node selection'
} }
] ]
}); });
......
...@@ -21,7 +21,6 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', { ...@@ -21,7 +21,6 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', {
{ {
text: 'Import mapping from tab file', text: 'Import mapping from tab file',
reference:'importMapping', reference:'importMapping',
tooltip:'Import mapping from tab file',
iconCls:'importData' iconCls:'importData'
}, },
{ {
...@@ -33,7 +32,6 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', { ...@@ -33,7 +32,6 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', {
{ {
text: 'Import side compounds from tab file', text: 'Import side compounds from tab file',
reference:'importSideCompounds', reference:'importSideCompounds',
tooltip:'Import side compounds from tab file',
iconCls:'importData' iconCls:'importData'
}, },
{ {
...@@ -59,7 +57,6 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', { ...@@ -59,7 +57,6 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', {
{ {
text: 'Import Cycle', text: 'Import Cycle',
reference: 'importCycle', reference: 'importCycle',
tooltip: 'Import cycle for drawing',
iconCls:'importCycle' iconCls:'importCycle'
}, },
{ {
...@@ -74,12 +71,10 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', { ...@@ -74,12 +71,10 @@ Ext.define('metExploreViz.view.menu.viz_ImportMenu.Viz_ImportMenu', {
{ {
text: 'By Name', text: 'By Name',
reference: 'importImageMappingName', reference: 'importImageMappingName',
tooltip: 'Import image for mapping by name'
}, },
{ {
text: 'By Id', text: 'By Id',
reference: 'importImageMappingID', reference: 'importImageMappingID',
tooltip: 'Import image for mapping by id'
}] }]
}, },
......
...@@ -10,6 +10,7 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanel', { ...@@ -10,6 +10,7 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanel', {
"metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanelController", "metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanelController",
"metExploreViz.view.form.selectConditionForm.SelectConditionForm", "metExploreViz.view.form.selectConditionForm.SelectConditionForm",
"metExploreViz.view.form.drawingStyleForm.DrawingStyleForm", "metExploreViz.view.form.drawingStyleForm.DrawingStyleForm",
"metExploreViz.view.form.cycleDetectionForm.CycleDetectionForm",
"metExploreViz.view.form.captionForm.CaptionForm", "metExploreViz.view.form.captionForm.CaptionForm",
"metExploreViz.view.form.allStylesForm.AllStylesForm" "metExploreViz.view.form.allStylesForm.AllStylesForm"
], ],
...@@ -27,7 +28,6 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanel', { ...@@ -27,7 +28,6 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanel', {
split:true, split:true,
closable: false, closable: false,
region: 'west', region: 'west',
// hidden:true,
tabBar:{ tabBar:{
cls:"vizTBar" cls:"vizTBar"
}, },
...@@ -70,36 +70,8 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanel', { ...@@ -70,36 +70,8 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanel', {
}, },
{ {
title:'Cycle', title:'Cycle',
reference: 'cycleDetection',
id:'cycleDetection', id:'cycleDetection',
xtype:'panel', xtype:'cycleDetectionForm'
autoScroll: true,
autoHeight: true,
collapsed: true,
hidden: true,
items:[{
xtype:'button',
text:'Draw Cycle',
margin: '10 10 10 10',
align:'stretch',
width:'95%',
reference:'buttonDrawCycle',
hidden: true
},{
xtype:'menuseparator'
},{
xtype:'fieldcontainer',
id:'cycleDetectionPanel',
reference:'cycleDetectionPanel'
},{
xtype:'button',
text:'Hide cycle',
margin: '10 10 10 10',
align:'stretch',
width:'50%',
reference:'buttonHideCycle',
hidden: true
}]
} }
] ]
}); });
\ No newline at end of file
...@@ -14,80 +14,9 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanelCont ...@@ -14,80 +14,9 @@ Ext.define('metExploreViz.view.panel.comparisonSidePanel.ComparisonSidePanelCont
newMapping : me.drawCaption, newMapping : me.drawCaption,
scope:me scope:me
}); });
view.lookupReference('cycleDetectionPanel').on({
listCycles : me.listCycles,
scope:me
});
view.lookupReference('buttonDrawCycle').on({
click:me.drawMetaboliteCycle,
scope:me
});
view.lookupReference('buttonHideCycle').on({
click:me.hideMetaboliteCycle,
scope:me
});
},
drawCaption : function(){
metExploreD3.GraphCaption.drawCaption();
},
drawMetaboliteCycle: function () {
this.lookupReference('cycleDetectionPanel').items.each(function (d) {
if (d.checked){
metExploreD3.GraphFunction.drawMetaboliteCycle(d.cycle);
}
})
}, },
hideMetaboliteCycle: function () { drawCaption : function(){
this.lookupReference('cycleDetectionPanel').items.each(function (d) { metExploreD3.GraphCaption.drawCaption();
if (d.checked){
d.setValue(false);
metExploreD3.GraphFunction.removeHighlightCycle(d.cycle);
}
})
},
listCycles: function (cycles) {
this.lookupReference('cycleDetection').setVisible(true);
this.lookupReference('cycleDetectionPanel').removeAll(true);
if (cycles.length > 0) {
for (var i = 0; i < cycles.length; i++) {
var newCheckbox = Ext.create('Ext.form.field.Radio', {
reference: 'radioCycle' + i,
boxLabel: 'Cycle ' + (i + 1),
name: 'cycle',
cycle: cycles[i],
margin: '0 0 0 20',
listeners: {
change: function () {
if (this.checked === true) {
metExploreD3.GraphFunction.highlightCycle(this.cycle);
}
}
}
});
this.lookupReference('cycleDetectionPanel').add(newCheckbox);
if (i === 0) {
this.lookupReference('radioCycle' + i).setValue(true);
}
}
this.getView().expand();
this.lookupReference('cycleDetection').expand();
Ext.getCmp('selectConditionForm').collapsed = true;
Ext.getCmp('captionFormPathways').collapsed = true;
Ext.getCmp('captionFormCompartments').collapsed = true;
this.lookupReference('buttonDrawCycle').show();
this.lookupReference('buttonHideCycle').show();
}
else {
this.lookupReference('buttonDrawCycle').hide();
this.lookupReference('buttonHideCycle').hide();
}
} }
}); });
...@@ -444,7 +444,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', { ...@@ -444,7 +444,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', {
if (longestCycles.length === 0){ if (longestCycles.length === 0){
metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes'); metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes');
} }
metExploreD3.fireEventArg('cycleDetectionPanel', "listCycles", longestCycles); metExploreD3.fireEventArg('cycleDetection', "listCycles", longestCycles);
} }
},{ },{
text: 'Going through all selected nodes', text: 'Going through all selected nodes',
...@@ -465,7 +465,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', { ...@@ -465,7 +465,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', {
if (longestCycles.length === 0){ if (longestCycles.length === 0){
metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes'); metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes');
} }
metExploreD3.fireEventArg('cycleDetectionPanel', "listCycles", longestCycles); metExploreD3.fireEventArg('cycleDetection', "listCycles", longestCycles);
} }
}] }]
},{ },{
...@@ -481,7 +481,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', { ...@@ -481,7 +481,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', {
if (shortestCycles.length === 0){ if (shortestCycles.length === 0){
metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes'); metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes');
} }
metExploreD3.fireEventArg('cycleDetectionPanel', "listCycles", shortestCycles); metExploreD3.fireEventArg('cycleDetection', "listCycles", shortestCycles);
} }
},{ },{
text: 'Going through all selected nodes', text: 'Going through all selected nodes',
...@@ -502,7 +502,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', { ...@@ -502,7 +502,7 @@ Ext.define('metExploreViz.view.panel.viz.VizController', {
if (shortestCycles.length === 0){ if (shortestCycles.length === 0){
metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes'); metExploreD3.displayWarning('No cycles found', 'There is no cycles of more than 2 reactions going through the selected nodes');
} }
metExploreD3.fireEventArg('cycleDetectionPanel', "listCycles", shortestCycles); metExploreD3.fireEventArg('cycleDetection', "listCycles", shortestCycles);
} }
}] }]
},{ },{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment