Commit 96e08e43 authored by maxchaza's avatar maxchaza
Browse files

Remove logs & import styles fix

parent 06b9abc3
......@@ -53,8 +53,6 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleForm', {
listeners : {
beforeshow: function(tooltip) {
var color = tooltip.target.el.dom.querySelector("#html5colorpicker").getAttribute("value");
console.log(tooltip.target.el.dom.querySelector("#html5colorpicker"));
console.log(color);
tooltip.update(color);
}
}
......
......@@ -50,92 +50,100 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
// As a result, render and afterrender can't be used on header
var header = view.down('header');
var bypassButton = header.lookupReference('bypassButton');
var colorButtonBypass = header.lookupReference('colorButtonBypass');
var colorButtonBypassEl = colorButtonBypass.el.dom.querySelector("#html5colorpicker");
var numberButtonBypass = header.lookupReference('numberButtonBypass');
if(header){
var bypassButton = header.lookupReference('bypassButton');
var colorButtonBypass = header.lookupReference('colorButtonBypass');
var colorButtonBypassEl = colorButtonBypass.el.dom.querySelector("#html5colorpicker");
var numberButtonBypass = header.lookupReference('numberButtonBypass');
var activeSession = _metExploreViz.getSessionById(metExploreD3.GraphNode.activePanel);
if(activeSession) {
var activeSession = _metExploreViz.getSessionById(metExploreD3.GraphNode.activePanel);
if(activeSession) {
var mapNodes = activeSession.getSelectedNodes()
.map(function (nodeId) {
return activeSession.getD3Data().getNodeById(nodeId);
})
.filter(function (n) {
return n!==undefined
});
var mapNodes = activeSession.getSelectedNodes()
.map(function (nodeId) {
return activeSession.getD3Data().getNodeById(nodeId);
})
.filter(function (n) {
return n!==undefined
var selectedNodes = mapNodes.filter(function (node) {
return node.getBiologicalType()===view.biologicalType;
});
var selectedNodes = mapNodes.filter(function (node) {
return node.getBiologicalType()===view.biologicalType;
});
var selection = d3.select("#"+metExploreD3.GraphNode.activePanel)
.select("#D3viz")
.selectAll("g.node")
.filter(function (n) { return n.getBiologicalType()===view.biologicalType});
var selection = d3.select("#"+metExploreD3.GraphNode.activePanel)
.select("#D3viz")
.selectAll("g.node")
.filter(function (n) { return n.getBiologicalType()===view.biologicalType});
if(selectedNodes.length>0) {
bypassButton.enable();
if(selection){
if(selectedNodes.length>0) {
bypassButton.enable();
if(selection){
var value = metExploreD3.GraphStyleEdition.getCollectionStyleBypass(view.target, view.attrType, view.attrName, view.biologicalType);
if(value==="multiple" || value==="none") {
bypassButton.show();
numberButtonBypass.hide();
colorButtonBypass.hide();
var value = metExploreD3.GraphStyleEdition.getCollectionStyleBypass(view.target, view.attrType, view.attrName, view.biologicalType);
if(value==="multiple" || value==="none") {
bypassButton.show();
numberButtonBypass.hide();
colorButtonBypass.hide();
if(value==="multiple"){
if (view.styleType === "float" || view.styleType === "int") {
numberButtonBypass.fireEvent("setIcon", "mapMultipleNumbers");
}
if(value==="multiple"){
if (view.styleType === "float" || view.styleType === "int") {
numberButtonBypass.fireEvent("setIcon", "mapMultipleNumbers");
}
if (view.styleType === "color")
colorButtonBypass.fireEvent("setIcon", "mapMultipleColors");
if (view.styleType === "color")
colorButtonBypass.fireEvent("setIcon", "mapMultipleColors");
}
else
{
numberButtonBypass.fireEvent("setIcon", "noneIcon");
colorButtonBypass.fireEvent("setIcon", "noneIcon");
}
}
else
{
numberButtonBypass.fireEvent("setIcon", "noneIcon");
colorButtonBypass.fireEvent("setIcon", "noneIcon");
}
}
else
{
numberButtonBypass.fireEvent("setIcon", "noneIcon");
colorButtonBypass.fireEvent("setIcon", "noneIcon");
if (view.styleType === "float") {
if (parseFloat(view.default) !== parseFloat(value)){
numberButtonBypass.show();
bypassButton.hide();
if (view.styleType === "float") {
if (parseFloat(view.default) !== parseFloat(value)){
numberButtonBypass.show();
bypassButton.hide();
me.replaceText(numberButtonBypass.el.dom, parseFloat(value));
}
me.replaceText(numberButtonBypass.el.dom, parseFloat(value));
}
if (view.styleType === "int") {
if (parseInt(view.default) !== parseInt(value)){
numberButtonBypass.show();
bypassButton.hide();
}
if (view.styleType === "int") {
if (parseInt(view.default) !== parseInt(value)){
numberButtonBypass.show();
bypassButton.hide();
me.replaceText(numberButtonBypass.el.dom, parseInt(value));
me.replaceText(numberButtonBypass.el.dom, parseInt(value));
}
}
}
if (view.styleType === "color") {
if (view.styleType === "color") {
if (view.default !== metExploreD3.GraphUtils.RGBString2Color(value))
{
colorButtonBypass.show();
bypassButton.hide();
if (view.default !== metExploreD3.GraphUtils.RGBString2Color(value))
{
colorButtonBypass.show();
bypassButton.hide();
colorButtonBypassEl.setAttribute("value", metExploreD3.GraphUtils.RGBString2Color(value));
colorButtonBypassEl.setAttribute("value", metExploreD3.GraphUtils.RGBString2Color(value));
}
}
}
}
}
else {
bypassButton.show();
numberButtonBypass.hide();
colorButtonBypass.hide();
bypassButton.disable();
}
}
else {
bypassButton.show();
......@@ -144,12 +152,6 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
bypassButton.disable();
}
}
else {
bypassButton.show();
numberButtonBypass.hide();
colorButtonBypass.hide();
bypassButton.disable();
}
},
updateContinuousCaption : function(){
......@@ -261,7 +263,8 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
if(view.biologicalType==="link")
styleToUse = metExploreD3.getLinkStyle();
view.default = styleToUse[view.access];
if(!view.default)
view.default = styleToUse[view.access];
// WARNING Header render is executed afterrender view
// As a result, render and afterrender can't be used on header
......@@ -335,6 +338,48 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
}
},
updateDefaultFormValues : function(){
var me = this;
var view = me.getView();
var styleToUse;
if(view.biologicalType==="metabolite")
styleToUse = metExploreD3.getMetaboliteStyle();
if(view.biologicalType==="reaction")
styleToUse = metExploreD3.getReactionStyle();
if(view.biologicalType==="link")
styleToUse = metExploreD3.getLinkStyle();
// WARNING Header render is executed afterrender view
// As a result, render and afterrender can't be used on header
var header = view.down('header');
if(header) {
me.updateSelectionSet();
if (view.styleType === "float" || view.styleType === "int") {
var numberButton = header.lookupReference('numberButton');
numberButton.show();
me.replaceText(numberButton.el.dom, view.default);
}
if (view.styleType === "color") {
var colorButton = header.lookupReference('colorButton');
var colorButtonEl = colorButton.el.dom.querySelector("#html5colorpicker");
colorButtonEl.setAttribute("value", view.default);
colorButton.show();
}
}
},
/**
* Define listeners to manage each style
* @param func
......@@ -353,8 +398,8 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
if(view.biologicalType==="link")
styleToUse = metExploreD3.getLinkStyle();
view.default = styleToUse[view.access];
if(!view.default)
view.default = styleToUse[view.access];
// WARNING Header render is executed afterrender view
// As a result, render and afterrender can't be used on header
......@@ -592,12 +637,10 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
// ValueMapping
getValueMappingsByType : function(type){
var view = this.getView();
console.log(view);
console.log(type);
type = type.toLowerCase();
type = type.replace(" ", "");
console.log(type);
switch (type) {
case 'asselection':
if(!view.valueAsSelectionMappings) view.valueAsSelectionMappings = [];
......@@ -623,7 +666,6 @@ Ext.define('metExploreViz.view.form.aStyleForm.AStyleFormController', {
},
getValueMappingsSet : function(type){
var valueMappings = this.getValueMappingsByType(type);
console.log(valueMappings);
return valueMappings;
},
getValueMappingById : function(type, id){
......
......@@ -48,7 +48,6 @@ Ext.define('metExploreViz.view.form.allStylesByTypeForm.AllStylesByTypeFormContr
var view = me.getView();
if(view)
{
console.log(view.lookupReference("caption"));
var parentElement = view.lookupReference("caption").el.dom;
// Obtenir une référence au premier enfant
var theFirstChild = parentElement.firstChild;
......@@ -90,8 +89,6 @@ Ext.define('metExploreViz.view.form.allStylesByTypeForm.AllStylesByTypeFormContr
.attr("transform","translate(106, 22) rotate(-35)")
.style("text-anchor","middle")
.style("fill", "#ffffff");
console.log(me);
console.log(view);
}
},
updateForm : function(){
......
......@@ -75,14 +75,14 @@ Ext.define('metExploreViz.view.form.allStylesForm.AllStylesFormController', {
allScales.forEach(function (scale) {
var form = Ext.getCmp(scale.biologicalType+"StyleForm");
if(form){
console.log(form);
var theStyleForm = form.query("aStyleForm").find(function (aStyleForm) { return aStyleForm.title===scale.title;});
if(theStyleForm){
console.log(theStyleForm);
if (scale.default){
if(scale.default!==theStyleForm.default){
theStyleForm.default=scale.default;
theStyleForm.getController().updateDefaultFormValues();
metExploreD3.GraphStyleEdition.setCollectionStyle(theStyleForm.target, theStyleForm.attrType, theStyleForm.attrName, theStyleForm.biologicalType, scale.default);
}
}
......
......@@ -22,8 +22,6 @@ Ext.define('metExploreViz.view.form.continuousNumberMappingEditor.ContinuousNumb
view.on({
afterrender : function(that){
console.log(view);
console.log(view.aStyleFormParent);
var width = 450;
var height = 85;
......
......@@ -53,8 +53,6 @@ Ext.define('metExploreViz.view.form.selectComponent.SelectComponentController',
initCaption:function(componentJSON){
console.log(componentJSON);
var comboComponent = Ext.getCmp('selectComponentVisu');
var store = comboComponent.getStore();
......
......@@ -457,7 +457,8 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
if(aStyleFormParent.biologicalType==="link")
styleToUse = metExploreD3.getLinkStyle();
aStyleFormParent.default = styleToUse[aStyleFormParent.access];
if(!aStyleFormParent.default)
aStyleFormParent.default = styleToUse[aStyleFormParent.access];
metExploreD3.GraphStyleEdition.removeMappedClassStyle(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, aStyleFormParent.default);
metExploreD3.GraphStyleEdition.setCollectionStyle(aStyleFormParent.target, aStyleFormParent.attrType, aStyleFormParent.attrName, aStyleFormParent.biologicalType, aStyleFormParent.default);
......@@ -603,8 +604,6 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
if(captions && type==="discrete")
{
console.log(captions);
if(Ext.getCmp('panel'+ cond)===undefined || type==="suggestion")
{
......@@ -742,7 +741,6 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
afterrender: function () {
var colorButtonMappingEl = newMappingCaptionForm.el.dom.querySelector("#html5colorpicker");
console.log();
colorButtonMappingEl
.addEventListener("change", function (evt) {
var newColor = evt.target.value;
......@@ -920,7 +918,6 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
}
if(scaleCaption && type==="continuous"){
console.log(aStyleFormParent);
if(aStyleFormParent.styleType==="color") {
me.drawContinuousScaleCaption();
}
......
......@@ -142,7 +142,6 @@ Ext.define('metExploreViz.view.menu.viz_ConvexHullMenu.Viz_ConvexHullMenuControl
},
highlightComponents : function(component){
console.log(component);
var me = this,
viewModel = me.getViewModel(),
view = me.getView();
......
......@@ -442,7 +442,6 @@ metExploreD3.GraphNetwork = {
})
.on("end", function() {
var scrollable = metExploreD3.GraphNetwork.scrollable;
console.log(scrollable);
if(scrollable===false){
......
......@@ -775,12 +775,12 @@ metExploreD3.GraphPanel = {
networkVizSession.setD3Data(networkData);
if(sessions[key].selectedNodes)
{
sessions[key].selectedNodes.forEach(function(nodeId){
networkVizSession.addSelectedNode(nodeId);
});
}
// if(sessions[key].selectedNodes)
// {
// sessions[key].selectedNodes.forEach(function(nodeId){
// networkVizSession.addSelectedNode(nodeId);
// });
// }
if(sessions[key].duplicatedNodes)
{
......
......@@ -539,8 +539,6 @@ metExploreD3.GraphStyleEdition = {
if(biologicalType==="link")
selection = d3.select("#viz").select("#D3viz").selectAll(".linkGroup");
console.log(selection);
console.log(target+":not(.bypassed"+attrType+attrName+biologicalType+")");
selection.selectAll(target+":not(.bypassed"+attrType+attrName+biologicalType+")"+":not(.mapped"+attrType+attrName+biologicalType+")")[attrType](attrName, value);
});
},
......
......@@ -1667,7 +1667,6 @@ clone.setAttribute("version", "1.1");
metExploreD3.deferFunction(function() {
console.log(scaleRange);
//
// var networkJSON ="{";
// var session = _metExploreViz.getSessionById('viz');
......
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