Skip to content
Snippets Groups Projects
Commit 5309bf37 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

swap x and y for data table

parent 47c0d342
No related branches found
No related tags found
1 merge request!533NCM Geophysical Updates
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
TableData, TableData,
} from '@ghsc/nshmp-lib-ng/nshmp'; } from '@ghsc/nshmp-lib-ng/nshmp';
import {NshmpPlot, plotUtils} from '@ghsc/nshmp-lib-ng/plot'; import {NshmpPlot, plotUtils} from '@ghsc/nshmp-lib-ng/plot';
import {DataTitle} from 'plotly.js';
import {AppService} from '../../services/app.service'; import {AppService} from '../../services/app.service';
...@@ -61,16 +62,28 @@ export class DataComponent { ...@@ -61,16 +62,28 @@ export class DataComponent {
index: number, index: number,
hideX = true hideX = true
): TableData[] { ): TableData[] {
const data = plot.plotData.data[index];
return plotUtils.plotDataToTableData( return plotUtils.plotDataToTableData(
{ {
...plot, ...plot,
plotData: { plotData: {
...plot.plotData, ...plot.plotData,
data: [plot.plotData.data[index]], data: [
{
...data,
x: data.y,
y: data.x,
},
],
}, },
}, },
{ {
hideX, hideX,
xLabelTransform: () =>
(plot.plotData.layout.yaxis.title as DataTitle).text,
yLabelTransform: () =>
(plot.plotData.layout.xaxis.title as DataTitle).text,
yValueFormat: (y: number) => y.toFixed(4), yValueFormat: (y: number) => y.toFixed(4),
} }
); );
......
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