Commit 0b815a7b authored by maxchaza's avatar maxchaza

Merge branch 'hotfix/changeAsSelectionMapping'

parents 38b6c77a 4f0d362e
......@@ -7,7 +7,7 @@
/**
* The version of the application.
*/
"version": "3.0.0",
"version": "3.0.1",
/**
* The relative path to the application's markup file (html, jsp, asp, etc.).
......
......@@ -9,6 +9,8 @@ Ext.define('metExploreViz.Application', {
name: 'metExploreViz',
stores: [
'metExploreViz.view.form.selectMapping.MappingStore',
'mappingStore',
'metExploreViz.view.form.selectCondition.ConditionStore',
'conditionStore'
......@@ -17,7 +19,7 @@ Ext.define('metExploreViz.Application', {
launch: function () {
Ext.create('metExploreViz.view.form.selectCondition.ConditionStore');
Ext.create('metExploreViz.view.form.selectMapping.MappingStore');
// TODO - Launch the application
},
......
......@@ -7,8 +7,10 @@ Ext.define('metExploreViz.view.form.selectCondition.ConditionModel', {
extend: 'Ext.data.Model',
fields: [
{
name: 'name', type: 'string',
name: 'biologicalType', type: 'string',
name: 'name',
type: 'string',
name: 'biologicalType',
type: 'string'
}
]
});
\ No newline at end of file
......@@ -587,6 +587,10 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
var captions = view.lookupReference('discreteCaptions');
var scaleCaption = view.lookupReference('scaleCaption');
var selectCondition = view.lookupReference('selectCondition');
var selectConditionType = view.lookupReference('selectConditionType');
var dataType = selectConditionType.getValue();
var selectedCondition = selectCondition.getValue();
var networkVizSession = _metExploreViz.getSessionById("viz");
var colorStore;
......@@ -696,8 +700,10 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
var mappingName = selectedCondition.split(" / ")[0];
var conditionName = selectedCondition.split(" / ")[1];
metExploreD3.GraphStyleEdition.setCollectionStyleDiscreteMapping(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, conditionName, mappingName, color.getName(), color.getValue());
if(dataType==="As selection")
metExploreD3.GraphStyleEdition.setCollectionStyleAsSelectionMapping(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, conditionName, mappingName, "Identified", color.getValue())
else
metExploreD3.GraphStyleEdition.setCollectionStyleDiscreteMapping(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, conditionName, mappingName, color.getName(), color.getValue());
}
else
......@@ -752,8 +758,10 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
var mappingName = selectedCondition.split(" / ")[0];
var conditionName = selectedCondition.split(" / ")[1];
metExploreD3.GraphStyleEdition.setCollectionStyleDiscreteMapping(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, conditionName, mappingName, color.getName(), color.getValue());
if(dataType==="As selection")
metExploreD3.GraphStyleEdition.setCollectionStyleAsSelectionMapping(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, conditionName, mappingName, "Identified", color.getValue())
else
metExploreD3.GraphStyleEdition.setCollectionStyleDiscreteMapping(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, conditionName, mappingName, color.getName(), color.getValue());
});
},
scope: me
......
/**
* @author MC
* (a)description class to control contion selection panel and to draw mapping in the mapping story
*/
Ext.define('metExploreViz.view.form.selectMapping.MappingModel', {
extend: 'Ext.data.Model',
fields: [
{
name: 'name', type: 'string'
}
]
});
\ No newline at end of file
/**
* @author MC
* (a)description class to control contion selection panel and to draw mapping in the mapping story
*/
Ext.define('metExploreViz.view.form.selectMapping.MappingStore', {
extend: 'Ext.data.Store',
alias: 'store.MappingStore',
requires: [
"metExploreViz.view.form.selectMapping.MappingModel"
],
model: 'metExploreViz.view.form.selectMapping.MappingModel',
storeId: 'mappingStore',
data: [{name:'None'}],
listeners: {
add: function(store, records) {
// if(store.count()==1)
}
}
});
\ No newline at end of file
......@@ -8,17 +8,17 @@ Ext.define('metExploreViz.view.form.selectMapping.SelectMapping', {
alias: 'widget.selectMapping',
requires: [
"metExploreViz.view.form.selectMapping.SelectMappingController",
"metExploreViz.view.form.selectMapping.MappingStore",
"metExploreViz.view.form.selectMapping.SelectMappingModel"
],
controller: "form-selectMapping-selectMapping",
viewModel: {
type: "form-selectMapping-selectMapping"
},
store: {
fields: ['name'],
data: [{name:'None'}]
},
listeners: {
beforerender: function(c) {
this.setStore(Ext.getStore("mappingStore"));
},
render: function(c) {
new Ext.ToolTip({
target: c.getEl(),
......
/**
* @author MC
* (a)description combobox to select condition in mapping
* selectMappingForExtraction
*/
Ext.define('metExploreViz.view.form.selectMappingForExtraction.SelectMappingForExtraction', {
extend: 'Ext.window.Window',
alias: 'widget.selectMappingForExtraction',
requires: [
"metExploreViz.view.form.selectMappingForExtraction.SelectMappingForExtractionController"
],
controller: "form-selectMappingForExtraction-selectMappingForExtraction",
title: 'Continuous color scale mapping editor',
height: "400px",
maxWidth: 600,
minWidth: 600,
x: 100,
y: 100,
maxHeight: 365,
minHeight: 365,
layout:{
type:'vbox',
align:'stretch'
},
items: [
{
margin: "10 10 10 10",
xtype: "selectMapping",
multiSelect: true,
reference: "selectMappingForExtraction"
},
{
xtype: "panel",
reference: "buttonPanel",
layout:{
type:'hbox',
pack : 'end'
},
items:[
{
margin: "5 5 5 5",
xtype: 'button',
reference: 'okButton',
text : 'OK'
},
{
margin: "5 15 5 5",
xtype: 'button',
reference: 'cancelButton',
text : 'Cancel'
}
]
}
]
});
\ No newline at end of file
/**
* @author MC
* (a)description class to control contion selection panel and to draw mapping in the mapping story
*/
Ext.define('metExploreViz.view.form.selectMappingForExtraction.SelectMappingForExtractionController', {
extend: 'Ext.app.ViewController',
alias: 'controller.form-selectMappingForExtraction-selectMappingForExtraction',
/**
* Aplies event linsteners to the view
*/
init:function(){
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
view.on({
show : function(that){
var store = Ext.getStore("mappingStore");
store.filter(function (mapping) {
console.log(mapping.get("name"));
return mapping.get("name")!=="None";
})
},
close : function(that){
var store = Ext.getStore("mappingStore");
store.clearFilter();
}
});
view.lookupReference('okButton').on({
click : function(that){
if(view.lookupReference('selectMappingForExtraction').getValue() && view.lookupReference('selectMappingForExtraction').getValue()!=="None"){
var selectedMappings = view.lookupReference('selectMappingForExtraction').getValue();
var nodesToLinks = _metExploreViz.getSessionById("viz").getD3Data().getNodes()
.filter(function(node){ return node.mappingDatas.length!==0;})
.filter(function (node) {
return node.getMappingDatas()
.filter(map => selectedMappings.includes(map.getMappingName())).length !==0;
})
.map(node => node.getId());
console.log(nodesToLinks);
metExploreD3.GraphFunction.keepOnlySubnetwork(nodesToLinks);
}
view.close();
}
});
view.lookupReference('cancelButton').on({
click : function(that){
view.close();
}
});
}
});
\ No newline at end of file
......@@ -16,6 +16,7 @@ Ext.define('metExploreViz.view.main.Main', {
'metExploreViz.view.main.MainController',
'metExploreViz.view.main.MainModel',
'metExploreViz.view.panel.networkPanel.NetworkPanel',
"metExploreViz.view.form.selectMapping.MappingStore",
"metExploreViz.view.form.selectCondition.ConditionStore"
],
......
......@@ -9,6 +9,8 @@ Ext.define('metExploreViz.view.main.MainController', {
alias: 'controller.main',
stores: [
'metExploreViz.view.form.selectMapping.MappingStore',
'mappingStore',
'metExploreViz.view.form.selectCondition.ConditionStore',
'conditionStore'
......
Ext.define('metExploreViz.view.menu.viz_ExtractSubNetworkMenu.Viz_ExtractSubNetworkMenuController', {
extend: 'Ext.app.ViewController',
alias: 'controller.menu-vizExtractSubNetworkMenu-vizExtractSubNetworkMenu',
requires: [
"metExploreViz.view.form.selectMappingForExtraction.SelectMappingForExtraction"
],
/**
* Aplies event linsteners to the view
*/
......@@ -9,12 +11,14 @@ Ext.define('metExploreViz.view.menu.viz_ExtractSubNetworkMenu.Viz_ExtractSubNetw
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
var win =
view.lookupReference('keepOnlySubnetworkFromMapping').on({
click : function(){
var session = _metExploreViz.getSessionById('viz');
console.log(session.getNodesMap());
metExploreD3.GraphFunction.keepOnlySubnetwork(session.getNodesMap());
var win = Ext.create("metExploreViz.view.form.selectMappingForExtraction.SelectMappingForExtraction");
win.show();
},
scope : me
});
......
......@@ -32,7 +32,6 @@ Ext.define('metExploreViz.view.menu.viz_MiningMenu.Viz_MiningMenu', {
text: 'Highlight Subnetwork',
reference :'highlightSubnetwork',
id :'highlightSubnetwork',
tooltip:'Highlight sub-network based on node selection or mapped nodes',
iconCls:'highlightSubnetwork',
hidden:true
},
......@@ -40,14 +39,12 @@ Ext.define('metExploreViz.view.menu.viz_MiningMenu.Viz_MiningMenu', {
text: 'Highlight sink',
reference :'highlightSink',
id :'highlightSink',
tooltip:'Highlight Sink',
iconCls:'highlightSink'
},
{
text: 'Highlight source',
reference :'highlightSource',
id :'highlightSource',
tooltip:'Highlight Source',
iconCls:'highlightSource'
},{
text: 'Extract Subnetwork',
......@@ -56,8 +53,7 @@ Ext.define('metExploreViz.view.menu.viz_MiningMenu.Viz_MiningMenu', {
id:'vizExtractSubNetworkID',
reference:'vizExtractSubNetworkID',
padding:'0 0 0 0',
iconCls:'subnetwork',
tooltip:'Extract sub-network based on node selection or node mapping'
iconCls:'subnetwork'
}
// {
// text: 'Extract Subnetwork',action:'subnetwork',tooltip:'Extract sub-network based on node selection',iconCls:'subnetwork',
......
......@@ -7,6 +7,7 @@ Ext.define('metExploreViz.view.panel.networkPanel.NetworkPanelController', {
extend: 'Ext.app.ViewController',
alias: 'controller.panel-networkPanel-networkPanel',
stores: [
'metExploreViz.view.form.selectMapping.MappingStore',
'metExploreViz.view.form.selectCondition.ConditionStore'
// TODO: add global / shared stores here
......@@ -21,6 +22,7 @@ Ext.define('metExploreViz.view.panel.networkPanel.NetworkPanelController', {
view = me.getView();
Ext.create('metExploreViz.view.form.selectCondition.ConditionStore');
Ext.create('metExploreViz.view.form.selectMapping.MappingStore');
view.on({
afterrender : me.initParams,
......
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