Commit 8d6ded56 authored by maxchaza's avatar maxchaza

Add neighbor of metabolites on context menu

parent 2ad56e78
......@@ -719,7 +719,6 @@ Ext.define('metExploreViz.view.panel.viz.VizController', {
metabolite : theNode,
height : 300
});
console.log(win);
win.show();
}
},{
......
......@@ -14,11 +14,11 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
title: 'Metabolite informations',
height: 400,
width: 400,
maxWidth: 800,
maxWidth: 1000,
minWidth: 800,
x: 100,
y: 100,
maxHeight: 400,
maxHeight: 600,
minHeight: 400,
layout:{
type:'vbox',
......@@ -29,8 +29,8 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
xtype: 'grid',
title: 'Neighbours',
reference: "gridNeighbours",
height: 400,
width: 400,
height: '100%',
width: '100%',
border: false,
multiSelect: true,
autoScroll: true,
......@@ -40,48 +40,29 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
background:'#5F82A3'
}
},
tbar: {
items: [
{
xtype: 'tbtext',
text: '<b>Nb abstracted elements : 0</b>'
}, '->',{
iconCls: 'help',
tooltip: 'Documentation for abstraction',
handler: function() {
window.open('http://metexplore.toulouse.inra.fr/metexploreViz/doc/documentation.php');
}
}]
},
columns: [
{
xtype: 'actioncolumn',
header: '',
menuText: 'revealAbstraction',
dataIndex: 'revealAbstraction',
width: 80,
width: 30,
iconCls: "vmh",
sortable: false,
handler: function () {
var me = this,
view = me.getView();
handler: function (grid, index) {
var id = grid.getStore().getAt(index).getData().getDbIdentifier();
var strWindowFeatures = "resizable,scrollbars,status";
if(theNode.getBiologicalType()==="reaction")
window.open("https://www.vmh.life/#reaction/"+view.metabolite.getDbIdentifier().replace("R_", ""), "_blank", strWindowFeatures);
else window.open("https://www.vmh.life/#metabolite/"+view.metabolite.getDbIdentifier().replace("M_", ""), "_blank", strWindowFeatures);
window.open("https://www.vmh.life/#reaction/"+ id.replace("R_", ""), "_blank", strWindowFeatures);
}
},
{
text: 'Name',
width: '15%',
width: '30%',
sortable: false,
dataIndex: 'name'
},
{
text: 'Id',
dataIndex: 'dbIdentifier',
width: '35%'
width: '15%'
},
{
text: 'Confidence score',
......@@ -104,11 +85,10 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
return value;
}
}
],
plugins: [{
ptype: 'rowwidget',
pluginId: 'rowwidgetId',
// The widget definition describes a widget to be rendered into the expansion row.
// It has access to the application's ViewModel hierarchy. Its immediate ViewModel
// contains a record and recordIndex property. These, or any property of the record
......@@ -120,36 +100,81 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
widget: {
xtype: 'grid',
autoLoad: true,
forId: 'gridReactants',
height: '100%',
width: '100%',
bind: {
store: '{record.orders}',
title: 'Orders for {record.name}'
store: '{record.reactantsStore}'
},
columns: [{
text: 'Order Id',
dataIndex: 'id',
width: 75
}, {
text: 'Procuct code',
dataIndex: 'productCode',
width: 265
}, {
text: 'Quantity',
dataIndex: 'quantity',
xtype: 'numbercolumn',
width: 100,
align: 'right'
}, {
xtype: 'datecolumn',
format: 'Y-m-d',
width: 120,
text: 'Date',
dataIndex: 'date'
}, {
text: 'Shipped',
xtype: 'checkcolumn',
dataIndex: 'shipped',
width: 75
}]
xtype: 'actioncolumn',
header: '',
width: 30,
iconCls: "vmh",
dataIndex: 'dbIdentifier',
sortable: false,
handler: function (grid, index) {
var id = grid.getStore().getAt(index).getData().getDbIdentifier();
var strWindowFeatures = "resizable,scrollbars,status";
window.open("https://www.vmh.life/#metabolite/"+id.replace("M_", ""), "_blank", strWindowFeatures);
}
},
{
text: 'Name',
width: '15%',
sortable: false,
dataIndex: 'name'
},
{
text: 'Id',
dataIndex: 'dbIdentifier',
width: '10%'
},
{
text: 'Type',
dataIndex: 'type',
width: '15%'
},
{
text: 'Is seed?',
dataIndex: 'mappingDatas',
width: '10%',
renderer: function(mappingDatas){
var isSeed = mappingDatas.map(m=>m.getMappingName()).includes("seed(json)");
if (isSeed) {
return 'True';
}
return 'False';
}
}
,
{
text: 'MetaboRank IN',
dataIndex: 'mappingDatas',
width: '20%',
renderer: function(mappingDatas){
var rankMapping = mappingDatas.filter(m=>m.getMappingName().includes("rank.txt(json)"));
if(rankMapping)
return rankMapping.find(m=>m.getConditionName().includes("inrank")).getMapValue();
return "NA";
}
},
{
text: 'MetaboRank OUT',
dataIndex: 'mappingDatas',
width: '20%',
renderer: function(mappingDatas){
var rankMapping = mappingDatas.filter(m=>m.getMappingName().includes("rank.txt(json)"));
if(rankMapping)
return rankMapping.find(m=>m.getConditionName().includes("outrank")).getMapValue();
return "NA";
}
}
]
}
}],
listeners: {
......
......@@ -16,22 +16,36 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
view.on({
setConditionProgramaticaly : me.setConditionProgramaticaly,
scope:me
});
view.setTitle(view.metabolite.getName() + " informations");
setConditionProgramaticaly : me.setConditionProgramaticaly,
scope:me
});
if(view.metabolite.asSubstrates)
console.log(view.metabolite.asSubstrates);
if(view.metabolite.asProducts)
console.log(view.metabolite.asProducts);
view.setTitle(view.metabolite.getName() + " informations");
var reactionShowable = metExploreD3.GraphNode.getAllReactionsByNode(view.metabolite);
reactionShowable = reactionShowable.filter(r=>r.isHidden());
metExploreD3.GraphNode.sortReactionFromMetaboRank(reactionShowable, view.metabolite);
console.log(reactionShowable);
reactionShowable.forEach(function (reac) {
var substrates = reac.substrates.map(function (s) {
s.type = "substrate";
return s;
});
var products = reac.products.map(function (p) {
p.type = "products";
return p;
});
var reactants = substrates.concat(products);
reac.reactantsStore = Ext.create('Ext.data.Store', {
fields: ['name', 'dbIdentifier', 'mappingDatas', 'biologicalType', "type"],
data: reactants
});
});
var store = Ext.create('Ext.data.Store', {
fields: ['name', 'dbIdentifier', 'mcs', 'pathway'],
......@@ -40,18 +54,7 @@ Ext.define('metExploreViz.view.window.metaboliteInformations.MetaboliteInformati
view.lookupReference("gridNeighbours").setStore(store);
/*
view.lookupReference('okButton').on({
click : function(){
view.aStylewindowParent.scaleRange = view.aStylewindowParent.graphColorScaleEditor.getScaleRange();
view.aStylewindowParent.getController().updateContinuousCaption();
view.aStylewindowParent.getController().updateContinuousMapping();
view.close();
}
});
*/
},
},
// To choose directly a condition (pimp use it)
setConditionProgramaticaly:function(conditionName){
if(this.getView().getRawValue()==""){
......
......@@ -201176,6 +201176,7 @@ Ext.define('Ext.panel.Table', {
setStore: function(store) {
var me = this;
me.reconfigure(store, undefined, true);
console.log(store);
// If we are visible, load the store
if (me.isVisible(true)) {
if (store && me.autoLoad && !store.isEmptyStore && !(store.loading || store.isLoaded())) {
......@@ -3,7 +3,7 @@ $grid-row-cell-border-color: dynamic(mix(#000, $neutral-light-color, 5%));
$grid-row-cell-over-background-color: dynamic(mix($neutral-light-color, $base-highlight-color, 90%));
$grid-row-cell-over-border-color: dynamic(mix(#000, $grid-row-cell-over-background-color, 5%));
$grid-row-cell-selected-background-color: dynamic(#ffefbb);
$grid-row-cell-selected-background-color: dynamic(#ADBFD0);
$grid-row-cell-selected-border-color: dynamic(mix(#000, $grid-row-cell-selected-background-color, 5%));
$grid-row-cell-focus-border-color: dynamic($base-color);
$grid-row-cell-line-height: dynamic(round($grid-row-cell-font-size * 1.45));
......
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