Skip to content
Snippets Groups Projects
Commit 57c8a0a7 authored by cramakri's avatar cramakri
Browse files

LMS-1697 Fixed minor bugs with graphs that popped up as a result of recent work.

SVN: 17574
parent 71ff8bea
No related branches found
No related tags found
No related merge requests found
......@@ -94,10 +94,10 @@ public class TabularDataGraphServlet extends AbstractTabularDataGraphServlet
headerLabels[2] = WELL_COLUMN_COLUMN;
headerCodes = new String[headerTokensLength];
headerCodes[0] = CodeAndLabel.normalize(WELL_NAME_COLUMN);
headerCodes[1] = CodeAndLabel.normalize(WELL_NAME_COLUMN);
headerCodes[2] = CodeAndLabel.normalize(WELL_NAME_COLUMN);
headerCodes[1] = CodeAndLabel.normalize(WELL_ROW_COLUMN);
headerCodes[2] = CodeAndLabel.normalize(WELL_COLUMN_COLUMN);
int i = 1;
int i = 3;
for (CodeAndLabel featureCodeAndLabel : featureCodeAndLabels)
{
headerCodes[i] = featureCodeAndLabel.getCode();
......@@ -114,9 +114,9 @@ public class TabularDataGraphServlet extends AbstractTabularDataGraphServlet
String rowLetter = PlateUtils.translateRowNumberIntoLetterCode(pos.getWellRow());
String columnNumber = Integer.toString(row.getWellPosition().getWellColumn());
line[0] = rowLetter + columnNumber;
line[1] = rowLetter;
line[2] = columnNumber;
i = 1;
line[1] = Integer.toString(pos.getWellRow());
line[2] = Integer.toString(pos.getWellColumn());
i = 3;
float[] values = row.getFeatureValues();
for (float value : values)
{
......@@ -124,36 +124,6 @@ public class TabularDataGraphServlet extends AbstractTabularDataGraphServlet
}
lines.add(line);
}
// final ImgDatasetDTO dataSet = dao.tryGetDatasetByPermId(dataSetCode);
// if (dataSet == null)
// {
// throw new UserFailureException("Unkown data set " + dataSetCode);
// }
//
// final List<ImgFeatureDefDTO> featureDefinitions =
// dao.listFeatureDefsByDataSetId(dataSet.getId());
//
// int headersLength = featureDefinitions.size();
// headerTokens = new String[headersLength];
// lines = new ArrayList<String[]>();
// int featureDefCount = 0;
// for (ImgFeatureDefDTO featureDefinition : featureDefinitions)
// {
// headerTokens[featureDefCount++] = featureDefinition.getName();
// }
// int numRows = dataSet.getFieldNumberOfRows();
// int numCols = dataSet.getFieldNumberOfColumns();
// for (int row = 0; row < numRows; ++row)
// {
// for (int col = 0; col < numCols; ++col)
// {
// for (ImgFeatureDefDTO featureDefinition : featureDefinitions)
// {
// List<ImgFeatureValuesDTO> featureValues =
// dao.getFeatureValues(featureDefinition);
// }
// }
// }
}
public List<String[]> getDataLines()
......
......@@ -185,7 +185,7 @@ public class TabularDataGraphCollectionConfiguration implements ICsvFileReaderCo
TabularDataGraphServlet.WELL_ROW_COLUMN);
CodeAndLabel yAxis =
getCodeAndLabelWithDefault(props, Y_AXIS_KEY,
TabularDataGraphServlet.WELL_ROW_COLUMN);
TabularDataGraphServlet.WELL_COLUMN_COLUMN);
CodeAndLabel zAxis = getCodeAndLabel(props, COLUMN_KEY);
if (xAxis.equals(yAxis))
{
......
......@@ -216,7 +216,7 @@ public class TabularDataHeatmap extends AbstractTabularDataGraph<TabularDataHeat
{
try
{
element.x = Integer.parseInt(line[xColumn]);
element.x = (int) Float.parseFloat(line[xColumn]);
} catch (NumberFormatException ex)
{
// handle a case when X is alphanumeric
......@@ -224,7 +224,7 @@ public class TabularDataHeatmap extends AbstractTabularDataGraph<TabularDataHeat
Location.tryCreateLocationFromTransposedMatrixCoordinate(
line[xColumn] + "1").getY();
}
element.y = Integer.parseInt(line[yColumn]);
element.y = (int) Float.parseFloat(line[yColumn]);
} else
{
Location loc =
......
......@@ -30,16 +30,27 @@ public class TabularDataTickUnit extends NumberTickUnit
{
private static final long serialVersionUID = 1L;
/** Constant for log(10.0). */
final private static double LOG_10_VALUE = Math.log(10.0);
final private static int largeScientificNotationTransition = 6;
final private static int smallScientificNotationTransition = 3;
public TabularDataTickUnit(double size)
{
// The precision is determined by the number of digits in size
this(size, Math.abs(Math.ceil(Math.log(size) / LOG_10_VALUE)), size >= 1.0);
}
/**
* @param size
* @param size The tick unit size
* @param precision The number of digits we want to show
* @param greaterThan1 Is the tick unit greater than 1?
*/
public TabularDataTickUnit(double size)
public TabularDataTickUnit(double size, double precision, boolean greaterThan1)
{
super(size, getNumberFormat(Math.abs(size), size >= 1.0));
super(size, getNumberFormat(precision, greaterThan1));
}
/**
......@@ -101,4 +112,10 @@ public class TabularDataTickUnit extends NumberTickUnit
return new DecimalFormat(sb.toString());
}
@Override
public String valueToString(double value)
{
return super.valueToString(value);
}
}
......@@ -75,6 +75,6 @@ public class TabularDataTickUnitSource implements TickUnitSource, Serializable
final double halfTickIncrement = fullTickIncrement / 2;
final double tickIncrement =
(size <= halfTickIncrement) ? halfTickIncrement : fullTickIncrement;
return new TabularDataTickUnit(tickIncrement);
return new TabularDataTickUnit(tickIncrement, Math.abs(higher), size >= 1.0);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment