v1.0.0-rc.41
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import React, {Component} from 'react';
|
||||
|
||||
import {DefaultService, plot_type, plot_unit_x, plots} from "../openapi";
|
||||
import {azint_unit, DefaultService, plot_type, plot_unit_x, plots} from "../openapi";
|
||||
import MultiLinePlotWrapper from "./MultiLinePlotWrapper";
|
||||
|
||||
type MyProps = {
|
||||
type: plot_type;
|
||||
binning: number;
|
||||
angle: boolean;
|
||||
azint: azint_unit;
|
||||
};
|
||||
|
||||
type MyState = {
|
||||
@@ -26,20 +27,22 @@ type PlotlyPlot = {
|
||||
|
||||
type PlotlyData = PlotlyPlot[]
|
||||
|
||||
function AxisTypeX(unit: plot_unit_x) : string {
|
||||
function AxisTypeX(unit: plot_unit_x) : string | JSX.Element {
|
||||
if (unit == plot_unit_x.Q_RECIP_A)
|
||||
return "Q [Å<sup>-1</sup>]";
|
||||
else if (unit == plot_unit_x.ANGLE_DEG)
|
||||
return "Rotation angle [deg]";
|
||||
else if (unit == plot_unit_x.ADU)
|
||||
return "ADU";
|
||||
else if (unit == plot_unit_x.D_A)
|
||||
return "d [Å]";
|
||||
else if (unit == plot_unit_x.GRID_UM)
|
||||
return "Grid position [µm]";
|
||||
else
|
||||
return "Image number";
|
||||
}
|
||||
|
||||
function AxisTypeY(plot: plot_type) : string {
|
||||
function AxisTypeY(plot: plot_type) : string | JSX.Element {
|
||||
switch (plot) {
|
||||
case plot_type.IMAGE_COLLECTION_EFFICIENCY:
|
||||
return "Efficiency";
|
||||
@@ -74,6 +77,10 @@ function AxisTypeY(plot: plot_type) : string {
|
||||
return "Position [pixel]";
|
||||
case plot_type.INDEXING_TIME:
|
||||
return "Time [s]";
|
||||
case plot_type.MOSAICITY:
|
||||
return "Mosaicity [deg.]";
|
||||
case plot_type.B_FACTOR:
|
||||
return "B-factor [Å<sup>2</sup>]";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
@@ -97,7 +104,7 @@ class DataProcessingPlot extends Component<MyProps, MyState> {
|
||||
}
|
||||
|
||||
getValues() {
|
||||
DefaultService.getPreviewPlot(this.props.type, this.props.binning, true, this.props.angle,)
|
||||
DefaultService.getPreviewPlot(this.props.type, this.props.binning, true, this.props.angle, this.props.azint)
|
||||
.then(data => this.setState({plots: data, connection_error: false}))
|
||||
.catch(error => {
|
||||
this.setState({connection_error: true});
|
||||
@@ -120,9 +127,9 @@ class DataProcessingPlot extends Component<MyProps, MyState> {
|
||||
|| (this.state.plots.plot.length === 0))
|
||||
return <div>No plots available</div>;
|
||||
|
||||
let grid_scan : boolean = false;
|
||||
let data: PlotlyData = [];
|
||||
if ((this.state.plots.unit_x === plot_unit_x.GRID_UM) && (this.state.plots.plot.length > 0)) {
|
||||
if ((this.state.plots.plot[0].z !== undefined)
|
||||
&& (this.state.plots.plot[0].z.length > 0)) {
|
||||
|
||||
data.push({
|
||||
x: this.state.plots.plot[0].x,
|
||||
|
||||
Reference in New Issue
Block a user