Commit 2e2c6914 authored by maxchaza's avatar maxchaza

Merge branch 'hotfix/discreterepart'

parents 8b890910 d333c04d
......@@ -7,7 +7,7 @@
/**
* The version of the application.
*/
"version": "3.0.7",
"version": "3.0.8",
/**
* The relative path to the application's markup file (html, jsp, asp, etc.).
......
......@@ -716,6 +716,50 @@ Ext.define('metExploreViz.view.form.selectConditionForm.SelectConditionFormContr
}
}
}
},
specialkey: function(field, e){
if (e.getKey() == e.ENTER) {
var value =this.getRawValue();
if(aStyleFormParent.styleType==="int") {
value=parseInt(value);
}
if(aStyleFormParent.styleType==="float") {
value=parseFloat(value);
}
if(color.getValue()!==value){
newValue=value;
if(isNaN(newValue)){
Ext.Msg.show({
title:'Warning',
msg: "Please enter a number.",
icon: Ext.Msg.WARNING
});
}
else
{
if(aStyleFormParent.min <= newValue && aStyleFormParent.max >= newValue )
{
color.setValue(newValue);
var mappingName = selectedCondition.split(" / ")[0];
var conditionName = selectedCondition.split(" / ")[1];
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
{
Ext.Msg.show({
title:'Warning',
msg: "Please enter a number between "+view.min+" and "+view.max,
icon: Ext.Msg.WARNING
});
}
}
}
}
}
}
......
......@@ -990,15 +990,9 @@ metExploreD3.GraphMapping = {
valuesParsed = values.map(function (value) { return parseInt(value); });
}
var maxValue = Math.max.apply(null, valuesParsed);
var minValue = Math.min.apply(null, valuesParsed);
var linearScale = d3.scaleLinear()
.domain([minValue, maxValue])
.range([aStyleFormParent.min, aStyleFormParent.max]);
for (var i = 0; i < valuesParsed.length; i++) {
aStyleFormParent.getController().addValueMapping("Discrete", values[i], linearScale(valuesParsed[i]));
aStyleFormParent.getController().addValueMapping("Discrete", values[i], aStyleFormParent.default);
}
var valueMapping = aStyleFormParent.getController().getValueMappingsSet(session.getMappingDataType());
......
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