Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX-2192 Fix plot bugs #2197

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Src/WitsmlExplorer.Api/Models/LogData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Globalization;
using System.Text.Json.Serialization;

using WitsmlExplorer.Api.Converters;
Expand All @@ -25,7 +26,7 @@ public class LogDataValue
{
public LogDataValue(string value)
{
Value = double.TryParse(value, out double doubleValue) ? doubleValue : value;
Value = double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out double doubleValue) ? doubleValue : value;
}
public object Value { get; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ interface CurveValuesPlotProps {

export const CurveValuesPlot = React.memo(
(props: CurveValuesPlotProps): React.ReactElement => {
const { data, columns, name, autoRefresh, isDescending = false } = props;
const {
data,
columns: rawColumns,
name,
autoRefresh,
isDescending = false
} = props;
const columns = rawColumns.filter(
(col, index) => col.type === ContentType.Number || index === 0
);
const {
operationState: { colors, dateTimeFormat }
} = useContext(OperationContext);
Expand Down Expand Up @@ -322,8 +331,8 @@ const getChartOption = (
curve.length > LABEL_MAXIMUM_LENGHT
? curve.substring(0, LABEL_MAXIMUM_LENGHT) + "..."
: curve;
let minValue = minMaxValue.minValue?.toFixed(3);
let maxValue = minMaxValue.maxValue?.toFixed(3);
let minValue = minMaxValue.minValue?.toFixed(3) ?? "NaN";
let maxValue = minMaxValue.maxValue?.toFixed(3) ?? "NaN";
if (minValue.length > LABEL_NUMBER_MAX_LENGTH) {
minValue =
minValue.substring(0, LABEL_NUMBER_MAX_LENGTH - 2) + "...";
Expand Down Expand Up @@ -448,7 +457,7 @@ const timeFormatter = (params: number, dateTimeFormat: DateTimeFormat) => {
};

const depthFormatter = (params: number, indexUnit: string) => {
return `${params.toFixed(2)} ${indexUnit}`;
return `${params?.toFixed(2)} ${indexUnit}`;
};

const getExtraWidth = (
Expand Down