Skip to content

Commit

Permalink
Transformed tissues to timeline traces
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Nov 20, 2024
1 parent fe20772 commit 11ceb39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions projects/planner/src/app/profilechart/profilechart.component.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion projects/scuba-physics/src/lib/Tissues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion projects/scuba-physics/src/lib/Tissues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export class Tissues {
return t.gradientFactor(ambientPressure);
}

return t.pTotal / ambientPressure;
return t.pTotal / ambientPressure -1;
}).value();
}

Expand Down

0 comments on commit 11ceb39

Please sign in to comment.