diff --git a/projects/planner/src/app/profilechart/profilechart.component.ts b/projects/planner/src/app/profilechart/profilechart.component.ts index 1a4856dd..4ec0bb18 100644 --- a/projects/planner/src/app/profilechart/profilechart.component.ts +++ b/projects/planner/src/app/profilechart/profilechart.component.ts @@ -1,8 +1,9 @@ import { Component, OnInit } from '@angular/core'; import { takeUntil } from 'rxjs'; -import { DiveResults } from '../shared/diveresults'; -import { faChartArea, faFire } from '@fortawesome/free-solid-svg-icons'; import * as Plotly from 'plotly.js-dist'; +import * as _ from 'lodash'; +import { faChartArea, faFire } from '@fortawesome/free-solid-svg-icons'; +import { DiveResults } from '../shared/diveresults'; import { SelectedWaypoint } from '../shared/selectedwaypointService'; import { Streamed } from '../shared/streamed'; import { DiveSchedules } from '../shared/dive.schedules'; @@ -91,8 +92,10 @@ export class ProfileChartComponent extends Streamed implements OnInit { this.plotter.plotCharts(this.dive.totalDuration); // TODO layout jumps to right when switching on/off the heatmap - if (this.showHeatMap) - this.heatmapPlotter.plotHeatMap(this.dive.tissueOverPressures); + if (this.showHeatMap) { + const transponed = _.zip.apply(_, this.dive.tissueOverPressures) as number[][]; + this.heatmapPlotter.plotHeatMap(transponed); + } } private hookChartEvents(): void { diff --git a/projects/scuba-physics/src/lib/Tissues.spec.ts b/projects/scuba-physics/src/lib/Tissues.spec.ts index 37e261d0..32668c01 100644 --- a/projects/scuba-physics/src/lib/Tissues.spec.ts +++ b/projects/scuba-physics/src/lib/Tissues.spec.ts @@ -64,7 +64,7 @@ describe('Tissues', () => { // simple depth conversion at surface const tissues = Tissues.create(1); tissues.load(segment, StandardGases.air); - const saturationRatios = tissues.saturationRatio(2, 1); + const saturationRatios = tissues.saturationRatio(2, 1, 1); expect(saturationRatios[0]).toBeCloseTo(1, 8); }); diff --git a/projects/scuba-physics/src/lib/Tissues.ts b/projects/scuba-physics/src/lib/Tissues.ts index 70e8c1f5..1daa4ef0 100644 --- a/projects/scuba-physics/src/lib/Tissues.ts +++ b/projects/scuba-physics/src/lib/Tissues.ts @@ -275,7 +275,7 @@ export class Tissues { return t.gradientFactor(ambientPressure); } - return t.pTotal / ambientPressure; + return t.pTotal / ambientPressure -1; }).value(); }