Commit f19b84de authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Removed fixed ranges from the thermal properties plots. Now range is defined by the data.

parent 88f453c8
Pipeline #85328 skipped with stage
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -40,7 +40,6 @@ class HeatCapPlotter extends PlotterBase{
this.clear();
// Null values are ignored.
let indexOf600K = x.indexOf(600)+1;
let xClean = [];
let yClean = [];
for (let i=0; i<x.length; ++i) {
......@@ -52,18 +51,17 @@ class HeatCapPlotter extends PlotterBase{
}
}
// Up to 600K data is taken
let xClipped = xClean.slice(0, indexOf600K);
let yClipped = yClean.slice(0, indexOf600K);
let yMaxValue = Math.max.apply(null, yClipped);
this.setRangeAndLabels('T (K)', 0, 600, 'Cv (J/K/kg)', 0, Math.ceil(yMaxValue/200)*200);
let yMaxValue = Math.max.apply(null, y);
let yAxisMaxValue = Math.ceil(yMaxValue/200)*200;
let xMaxValue = Math.max.apply(null, x);
let xAxisMaxValue = Math.ceil(xMaxValue/50)*50;
this.setRangeAndLabels('T (K)', 0, xAxisMaxValue, 'Cv (J/K/kg)', 0, yAxisMaxValue);
this.drawAxis(4, 4, 0);
let polylinePoints = '';
xClipped.forEach( (t, i) => {
let y = yClipped[i];;
polylinePoints+= ' '+this.xRel*t+' -'+this.yRel*(y - this.yMin);
x.forEach( (t, i) => {
let iy = y[i];
polylinePoints+= ' '+this.xRel*t+' -'+this.yRel*(iy - this.yMin);
});
svg.addPolyline(this.plotArea, polylinePoints, 'plotSpin1');
}
......
......@@ -39,7 +39,6 @@ class HelmholtzPlotter extends PlotterBase {
this.clear();
// Null values are ignored.
let indexOf600K = x.indexOf(600)+1;
let xClean = [];
let yClean = [];
for (let i=0; i<x.length; ++i) {
......@@ -50,23 +49,20 @@ class HelmholtzPlotter extends PlotterBase {
yClean.push(yi);
}
}
// Up to 600K data is taken
let xClipped = xClean.slice(0, indexOf600K);
let yClipped = yClean.slice(0, indexOf600K);
let yMaxValue = Math.max.apply(null, yClipped);
let yMinValue = Math.min.apply(null, yClipped);
let yMaxValue = Math.max.apply(null, y);
let yMinValue = Math.min.apply(null, y);
let yAxisMaxValue = Math.ceil(yMaxValue/1000)*1000;
let yAxisMinValue = Math.floor(yMinValue/1000)*1000;
let xMaxValue = Math.max.apply(null, x);
let xAxisMaxValue = Math.floor(xMaxValue/50)*50;
this.setRangeAndLabels('T (K)', 0, 600, 'F (J/kg)', yAxisMinValue, yAxisMaxValue);
this.setRangeAndLabels('T (K)', 0, xAxisMaxValue, 'F (J/kg)', yAxisMinValue, yAxisMaxValue);
this.drawAxis(4, null, 0);
let polylinePoints = '';
xClipped.forEach( (t, i) => {
let y = yClipped[i];;
polylinePoints += ' ' + this.xRel*t + ' -' + this.yRel * (y - this.yMin);
x.forEach( (t, i) => {
let iy = y[i];;
polylinePoints += ' ' + this.xRel*t + ' -' + this.yRel * (iy - this.yMin);
});
svg.addPolyline(this.plotArea, polylinePoints, 'plotSpin1');
}
......
Supports Markdown
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