@webviz/well-log-viewer 2.3.2 → 2.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SyncLogViewer.d.ts +4 -5
- package/dist/SyncLogViewer.js +14 -59
- package/dist/SyncLogViewer.js.map +1 -1
- package/dist/WellLogViewer.js +2 -1
- package/dist/WellLogViewer.js.map +1 -1
- package/dist/components/WellLogAxesPanel.js +1 -1
- package/dist/components/WellLogAxesPanel.js.map +1 -1
- package/dist/components/WellLogSpacer.d.ts +1 -1
- package/dist/components/WellLogView.d.ts +17 -19
- package/dist/components/WellLogView.js +96 -142
- package/dist/components/WellLogView.js.map +1 -1
- package/dist/components/WellLogViewWithScroller.js +0 -14
- package/dist/components/WellLogViewWithScroller.js.map +1 -1
- package/dist/utils/arrays.d.ts +64 -0
- package/dist/utils/arrays.js +117 -0
- package/dist/utils/arrays.js.map +1 -0
- package/dist/utils/axes.d.ts +7 -0
- package/dist/utils/axes.js +3 -0
- package/dist/utils/axes.js.map +1 -1
- package/dist/{components/ColorMapFunction.d.ts → utils/color-function.d.ts} +2 -1
- package/dist/utils/color-function.js +20 -0
- package/dist/utils/color-function.js.map +1 -0
- package/dist/utils/color-table.d.ts +1 -1
- package/dist/utils/color-table.js +1 -1
- package/dist/utils/color-table.js.map +1 -1
- package/dist/utils/fill-info.js +1 -1
- package/dist/utils/fill-info.js.map +1 -1
- package/dist/utils/generateColor.d.ts +1 -0
- package/dist/utils/generateColor.js +15 -0
- package/dist/utils/generateColor.js.map +1 -0
- package/dist/utils/gradientfill-plot-legend.js +1 -1
- package/dist/utils/gradientfill-plot-legend.js.map +1 -1
- package/dist/utils/gradientfill-plot.d.ts +1 -1
- package/dist/utils/gradientfill-plot.js +2 -2
- package/dist/utils/gradientfill-plot.js.map +1 -1
- package/dist/utils/log-viewer.d.ts +174 -19
- package/dist/utils/log-viewer.js +311 -68
- package/dist/utils/log-viewer.js.map +1 -1
- package/dist/utils/plots.d.ts +109 -0
- package/dist/utils/plots.js +344 -0
- package/dist/utils/plots.js.map +1 -0
- package/dist/utils/template.d.ts +25 -0
- package/dist/utils/template.js +124 -0
- package/dist/utils/template.js.map +1 -0
- package/dist/utils/trackFactory.d.ts +39 -0
- package/dist/utils/trackFactory.js +79 -0
- package/dist/utils/trackFactory.js.map +1 -0
- package/dist/utils/tracks.d.ts +100 -52
- package/dist/utils/tracks.js +323 -935
- package/dist/utils/tracks.js.map +1 -1
- package/dist/utils/well-log.d.ts +14 -2
- package/dist/utils/well-log.js +102 -0
- package/dist/utils/well-log.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/ColorMapFunction.js +0 -6
- package/dist/components/ColorMapFunction.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-viewer.js","sourceRoot":"","sources":["../../src/utils/log-viewer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,MAAM,UAAU,aAAa;AACzB,8DAA8D;AAC9D,EAA0B;AAC1B,8DAA8D;AAC9D,EAA0B;IAE1B,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,WAAW,CACvB,EAAU,CAAC,oBAAoB,EAC/B,EAAU,CAAC,oBAAoB;IAE/B,IACI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC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BAAiB,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for configuring and creating plots for well log visualization.
|
|
3
|
+
*/
|
|
4
|
+
import type { GraphTrack, Plot } from "@equinor/videx-wellog";
|
|
5
|
+
import type { PlotConfig } from "@equinor/videx-wellog/dist/tracks/graph/interfaces";
|
|
6
|
+
import type { LegendInfo } from "@equinor/videx-wellog/dist/plots/legend/interfaces";
|
|
7
|
+
import { type AreaData } from "@equinor/videx-wellog";
|
|
8
|
+
import type { TemplatePlot, TemplatePlotType, TemplateTrack } from "../components/WellLogTemplateTypes";
|
|
9
|
+
import type { WellLogCurve, WellLogDataRow, WellLogSet } from "../components/WellLogTypes";
|
|
10
|
+
import { type AxesInfo } from "./axes";
|
|
11
|
+
import type { ColorMapFunction } from "./color-function";
|
|
12
|
+
import { type GradientFillPlotOptions } from "./gradientfill-plot";
|
|
13
|
+
import { type DiscreteMeta } from "./well-log";
|
|
14
|
+
export declare const DEFAULT_SCALE = "linear";
|
|
15
|
+
export declare const DEFAULT_PLOT_TYPE = "line";
|
|
16
|
+
/**
|
|
17
|
+
* Extension of videx plot options, to expose legendInfo() function.
|
|
18
|
+
*/
|
|
19
|
+
export interface ExtPlotOptions extends GradientFillPlotOptions {
|
|
20
|
+
legendInfo: () => LegendInfo;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Worker object containing all necessary information to create a plot.
|
|
24
|
+
*/
|
|
25
|
+
export type PlotSetup = {
|
|
26
|
+
iCurve: number;
|
|
27
|
+
iSet: number;
|
|
28
|
+
sourceLogSet: WellLogSet;
|
|
29
|
+
curve: WellLogCurve;
|
|
30
|
+
plotData: PlotData;
|
|
31
|
+
minmax: [number, number];
|
|
32
|
+
templatePlot: TemplatePlot;
|
|
33
|
+
isSecondary: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Data-class used when translating JSON well-log data to videx-data
|
|
37
|
+
*/
|
|
38
|
+
export declare class PlotData {
|
|
39
|
+
minmax: [number, number];
|
|
40
|
+
minmaxPrimaryAxis: [number, number];
|
|
41
|
+
data: [number | null, number | string | null][];
|
|
42
|
+
constructor();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Prepares plot data from well log data rows.
|
|
46
|
+
*
|
|
47
|
+
* @param data - An row of data from a JSON Well-log.
|
|
48
|
+
* @param iCurve - The index of the curve to be plotted.
|
|
49
|
+
* @param iPrimaryAxis - The index of the primary axis. If negative, the index will be used as the primary axis.
|
|
50
|
+
* @returns A PlotData object containing the prepared plot data.
|
|
51
|
+
*/
|
|
52
|
+
export declare function preparePlotData(data: WellLogDataRow[], iCurve: number, iPrimaryAxis: number): PlotData;
|
|
53
|
+
/**
|
|
54
|
+
* Maps a videx plot type to their respective plot-template option
|
|
55
|
+
* `LinePlot` - linear line graph
|
|
56
|
+
* `LineStepPlot` - linear stepladder graph
|
|
57
|
+
* `AreaPlot` - area graph
|
|
58
|
+
* `DotPlot` - discrete points graph
|
|
59
|
+
* `DifferentialPlot` - differential graph, for correlation of two data series.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getPlotType(plot: Plot): TemplatePlotType;
|
|
62
|
+
/**
|
|
63
|
+
* Builds a valid videx configuration for a plot, based on setups and templates
|
|
64
|
+
*
|
|
65
|
+
* @param plotSetup - The setup information for the primary plot.
|
|
66
|
+
* @param plotSetup2 - The setup information for the secondary plot, if any.
|
|
67
|
+
* @param trackTemplate - The template for the track.
|
|
68
|
+
* @param colorMapFunctions - An array of color map functions, for coloring the plot.
|
|
69
|
+
* @param iData - The index of the parent track's data array that corresponds to the primary plot.
|
|
70
|
+
* @param iData2 - The index for the secondary curve, if any.
|
|
71
|
+
* @returns The configuration for the plot.
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildPlotConfig(plotSetup: PlotSetup, plotSetup2: PlotSetup | null, trackTemplate: TemplateTrack, colorMapFunctions: ColorMapFunction[] | undefined, iData: number, iData2: number): PlotConfig;
|
|
74
|
+
/**
|
|
75
|
+
* Creates an array of `AreaData` objects that together form a discrete stacked graph.
|
|
76
|
+
*
|
|
77
|
+
* @param data - An array of key-value tuple rows.
|
|
78
|
+
* @param colorMapFunction - A function that maps values to colors. Can be undefined.
|
|
79
|
+
* @param meta - Metadata defining how a value is represented (i.e label and color).
|
|
80
|
+
*
|
|
81
|
+
* @returns A promise that resolves to an array of `AreaData` objects.
|
|
82
|
+
*/
|
|
83
|
+
export declare function createStackData(data: [number | null, number | string | null][], colorMapFunction: ColorMapFunction | undefined, meta: DiscreteMeta | undefined | null): Promise<AreaData[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Sets up the plot configuration for a given well log set and template plot.
|
|
86
|
+
*
|
|
87
|
+
* @param wellLog - A JSON well-log set to source data from.
|
|
88
|
+
* @param templatePlot - The template plot configuration.
|
|
89
|
+
* @param axesInfo - Information about the log's axes.
|
|
90
|
+
* @param useSecondCurve - Optional flag to indicate that the "name2" curve should be used
|
|
91
|
+
* @returns A PlotSetup object containing the plot configuration, or null if the setup is invalid.
|
|
92
|
+
*/
|
|
93
|
+
export declare function setupPlot(wellLog: WellLogSet[], templatePlot: TemplatePlot, axesInfo: AxesInfo, useSecondCurve?: boolean): PlotSetup | null;
|
|
94
|
+
/**
|
|
95
|
+
* Generates setup objects for all relevant plots in a given template (aka, curve 1 and sometimes 2)
|
|
96
|
+
* @param templatePlot A template config for a plot
|
|
97
|
+
* @param wellLogSets A JSON Well-Log data set to source from
|
|
98
|
+
* @param axesInfo Information about the axes to be used
|
|
99
|
+
* @returns An array of all successfully created plot setups
|
|
100
|
+
*/
|
|
101
|
+
export declare function setupTrackPlot(templatePlot: TemplatePlot, wellLogSets: WellLogSet[], axesInfo: AxesInfo): PlotSetup[];
|
|
102
|
+
/**
|
|
103
|
+
* Builds a graph plot using internals from an existing track
|
|
104
|
+
*
|
|
105
|
+
* @param plotConfig - The configuration for the plot to be created.
|
|
106
|
+
* @param track - The graph track containing options and scale information.
|
|
107
|
+
* @returns The created plot.
|
|
108
|
+
*/
|
|
109
|
+
export declare function buildGraphPlotFromTrackOptions(plotConfig: PlotConfig, track: GraphTrack): Plot;
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { LinePlot, AreaPlot, DotPlot, DifferentialPlot, LineStepPlot, } from "@equinor/videx-wellog";
|
|
11
|
+
import { getColorMapFunction } from "./color-function";
|
|
12
|
+
import GradientFillPlot from "./gradientfill-plot";
|
|
13
|
+
import { checkMinMaxValue, roundLogMinMax, roundMinMax } from "./minmax";
|
|
14
|
+
import { getDiscreteColorAndName, findSetAndCurveIndex, getAxisIndices, } from "./well-log";
|
|
15
|
+
export const DEFAULT_SCALE = "linear";
|
|
16
|
+
export const DEFAULT_PLOT_TYPE = "line";
|
|
17
|
+
/**
|
|
18
|
+
* Data-class used when translating JSON well-log data to videx-data
|
|
19
|
+
*/
|
|
20
|
+
export class PlotData {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.data = [];
|
|
23
|
+
this.minmax = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
|
|
24
|
+
this.minmaxPrimaryAxis = [
|
|
25
|
+
Number.POSITIVE_INFINITY,
|
|
26
|
+
Number.NEGATIVE_INFINITY,
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Prepares plot data from well log data rows.
|
|
32
|
+
*
|
|
33
|
+
* @param data - An row of data from a JSON Well-log.
|
|
34
|
+
* @param iCurve - The index of the curve to be plotted.
|
|
35
|
+
* @param iPrimaryAxis - The index of the primary axis. If negative, the index will be used as the primary axis.
|
|
36
|
+
* @returns A PlotData object containing the prepared plot data.
|
|
37
|
+
*/
|
|
38
|
+
export function preparePlotData(data, iCurve, iPrimaryAxis) {
|
|
39
|
+
const plot = new PlotData();
|
|
40
|
+
let i = 0;
|
|
41
|
+
for (const row of data) {
|
|
42
|
+
let value = row[iCurve];
|
|
43
|
+
if (typeof value === "number")
|
|
44
|
+
checkMinMaxValue(plot.minmax, value);
|
|
45
|
+
const primary = iPrimaryAxis >= 0 ? row[iPrimaryAxis] : i++;
|
|
46
|
+
if (primary === null)
|
|
47
|
+
// videx library do not like such data
|
|
48
|
+
value = null; // force a gap in the graph
|
|
49
|
+
checkMinMaxValue(plot.minmaxPrimaryAxis, primary);
|
|
50
|
+
plot.data.push([primary, value]);
|
|
51
|
+
}
|
|
52
|
+
return plot;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Maps a videx plot type to their respective plot-template option
|
|
56
|
+
* `LinePlot` - linear line graph
|
|
57
|
+
* `LineStepPlot` - linear stepladder graph
|
|
58
|
+
* `AreaPlot` - area graph
|
|
59
|
+
* `DotPlot` - discrete points graph
|
|
60
|
+
* `DifferentialPlot` - differential graph, for correlation of two data series.
|
|
61
|
+
*/
|
|
62
|
+
export function getPlotType(plot) {
|
|
63
|
+
if (plot instanceof GradientFillPlot)
|
|
64
|
+
return "gradientfill";
|
|
65
|
+
if (plot instanceof LinePlot)
|
|
66
|
+
return "line";
|
|
67
|
+
if (plot instanceof AreaPlot)
|
|
68
|
+
return "area";
|
|
69
|
+
if (plot instanceof DotPlot)
|
|
70
|
+
return "dot";
|
|
71
|
+
if (plot instanceof DifferentialPlot)
|
|
72
|
+
return "differential";
|
|
73
|
+
if (plot instanceof LineStepPlot)
|
|
74
|
+
return "linestep";
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
function getScaledDomain(templatePlot, scale, minmax) {
|
|
78
|
+
if (templatePlot.domain)
|
|
79
|
+
return templatePlot.domain;
|
|
80
|
+
if (scale === "log")
|
|
81
|
+
return roundLogMinMax(minmax);
|
|
82
|
+
if (templatePlot.type === "gradientfill" &&
|
|
83
|
+
templatePlot.colorScale === "log")
|
|
84
|
+
return roundLogMinMax(minmax);
|
|
85
|
+
return roundMinMax(minmax);
|
|
86
|
+
}
|
|
87
|
+
function makeLegendInfoFunc(curve1, curve2) {
|
|
88
|
+
return () => {
|
|
89
|
+
var _a, _b, _c, _d;
|
|
90
|
+
return ({
|
|
91
|
+
label: curve1.name,
|
|
92
|
+
unit: (_a = curve1.unit) !== null && _a !== void 0 ? _a : "",
|
|
93
|
+
// DifferentialPlotLegendInfo,
|
|
94
|
+
serie1: {
|
|
95
|
+
show: true,
|
|
96
|
+
label: curve1.name,
|
|
97
|
+
unit: (_b = curve1.unit) !== null && _b !== void 0 ? _b : "",
|
|
98
|
+
},
|
|
99
|
+
serie2: {
|
|
100
|
+
show: true,
|
|
101
|
+
label: (_c = curve2 === null || curve2 === void 0 ? void 0 : curve2.name) !== null && _c !== void 0 ? _c : "",
|
|
102
|
+
unit: (_d = curve2 === null || curve2 === void 0 ? void 0 : curve2.unit) !== null && _d !== void 0 ? _d : "",
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
class DataAccessor {
|
|
108
|
+
/**
|
|
109
|
+
* Utility class to handle data access in Videx plots
|
|
110
|
+
* @param iData the index to access the main data on
|
|
111
|
+
* @param iData2 the index to access second curve data on. Leave undefined if you only have a single plot
|
|
112
|
+
*/
|
|
113
|
+
constructor(iData, iData2) {
|
|
114
|
+
this.iData = iData;
|
|
115
|
+
this.iData2 = iData2;
|
|
116
|
+
}
|
|
117
|
+
access(data) {
|
|
118
|
+
if (this.iData2 != null) {
|
|
119
|
+
return [data[this.iData], data[this.iData2]];
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return data[this.iData];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function makeDataAccessorFunc(iData, iData2) {
|
|
127
|
+
const _dataAccessor = new DataAccessor(iData, iData2);
|
|
128
|
+
return _dataAccessor.access.bind(_dataAccessor);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Builds a valid videx configuration for a plot, based on setups and templates
|
|
132
|
+
*
|
|
133
|
+
* @param plotSetup - The setup information for the primary plot.
|
|
134
|
+
* @param plotSetup2 - The setup information for the secondary plot, if any.
|
|
135
|
+
* @param trackTemplate - The template for the track.
|
|
136
|
+
* @param colorMapFunctions - An array of color map functions, for coloring the plot.
|
|
137
|
+
* @param iData - The index of the parent track's data array that corresponds to the primary plot.
|
|
138
|
+
* @param iData2 - The index for the secondary curve, if any.
|
|
139
|
+
* @returns The configuration for the plot.
|
|
140
|
+
*/
|
|
141
|
+
export function buildPlotConfig(plotSetup, plotSetup2, trackTemplate, colorMapFunctions, iData, iData2) {
|
|
142
|
+
var _a;
|
|
143
|
+
const { iCurve, iSet, templatePlot } = plotSetup;
|
|
144
|
+
return {
|
|
145
|
+
id: `${iSet}-${iCurve}`,
|
|
146
|
+
type: (_a = templatePlot.type) !== null && _a !== void 0 ? _a : DEFAULT_PLOT_TYPE,
|
|
147
|
+
options: buildPlotOptions(plotSetup, plotSetup2, trackTemplate, colorMapFunctions, iData, iData2),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function buildPlotOptions(plotSetup, plotSetup2, trackTemplate, colorMapFunctions, iData, iData2) {
|
|
151
|
+
var _a;
|
|
152
|
+
const { minmax, templatePlot } = plotSetup;
|
|
153
|
+
const scale = templatePlot.scale || trackTemplate.scale || DEFAULT_SCALE;
|
|
154
|
+
const domain = getScaledDomain(templatePlot, scale, minmax);
|
|
155
|
+
const colorMapFunction = getColorMapFunction(templatePlot.colorMapFunctionName, colorMapFunctions);
|
|
156
|
+
const inverseColorMapFunction = getColorMapFunction(templatePlot.inverseColorMapFunctionName, colorMapFunctions);
|
|
157
|
+
const dataAccessorFunc = makeDataAccessorFunc(iData, plotSetup2 ? iData2 : undefined);
|
|
158
|
+
const legendInfoFunc = makeLegendInfoFunc(plotSetup.curve, plotSetup2 === null || plotSetup2 === void 0 ? void 0 : plotSetup2.curve);
|
|
159
|
+
const fillOpacity = (_a = templatePlot.fillOpacity) !== null && _a !== void 0 ? _a : 0.25;
|
|
160
|
+
return {
|
|
161
|
+
dataAccessor: dataAccessorFunc,
|
|
162
|
+
legendInfo: legendInfoFunc,
|
|
163
|
+
scale,
|
|
164
|
+
domain,
|
|
165
|
+
color: templatePlot.color,
|
|
166
|
+
inverseColor: templatePlot.inverseColor,
|
|
167
|
+
fill: templatePlot.fill, // for 'area'!
|
|
168
|
+
fillOpacity, // for 'area' and 'gradientfill'!
|
|
169
|
+
useMinAsBase: true, // for 'area' and 'gradientfill'!
|
|
170
|
+
colorMapFunction,
|
|
171
|
+
inverseColorMapFunction,
|
|
172
|
+
colorScale: templatePlot.colorScale,
|
|
173
|
+
inverseColorScale: templatePlot.inverseColorScale,
|
|
174
|
+
// @ts-expect-error Somethings wrong with the typing here,
|
|
175
|
+
serie1: {
|
|
176
|
+
scale: scale, //"linear" or "log"
|
|
177
|
+
domain: domain,
|
|
178
|
+
color: templatePlot.color,
|
|
179
|
+
fill: templatePlot.fill,
|
|
180
|
+
},
|
|
181
|
+
serie2: {
|
|
182
|
+
// ? =scale2, =domain2 ?
|
|
183
|
+
scale: scale,
|
|
184
|
+
domain: domain,
|
|
185
|
+
color: templatePlot.color2,
|
|
186
|
+
fill: templatePlot.fill2,
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function createAreaData(from, to, value, colorMapFunction, meta) {
|
|
191
|
+
const { color, name } = getDiscreteColorAndName(value, colorMapFunction, meta);
|
|
192
|
+
return {
|
|
193
|
+
from: from,
|
|
194
|
+
to: to,
|
|
195
|
+
name: name,
|
|
196
|
+
color: {
|
|
197
|
+
r: color[0],
|
|
198
|
+
g: color[1],
|
|
199
|
+
b: color[2],
|
|
200
|
+
//, a: color[3]!==undefined? color[3]: 1.0
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Creates an array of `AreaData` objects that together form a discrete stacked graph.
|
|
206
|
+
*
|
|
207
|
+
* @param data - An array of key-value tuple rows.
|
|
208
|
+
* @param colorMapFunction - A function that maps values to colors. Can be undefined.
|
|
209
|
+
* @param meta - Metadata defining how a value is represented (i.e label and color).
|
|
210
|
+
*
|
|
211
|
+
* @returns A promise that resolves to an array of `AreaData` objects.
|
|
212
|
+
*/
|
|
213
|
+
export function createStackData(data, colorMapFunction, meta) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const arr = new Array();
|
|
216
|
+
let prev = null;
|
|
217
|
+
let area = null;
|
|
218
|
+
for (const p of data) {
|
|
219
|
+
let boundary = p[0];
|
|
220
|
+
if (boundary === null) {
|
|
221
|
+
// do the same work as at the end of data
|
|
222
|
+
if (area) {
|
|
223
|
+
// store the area
|
|
224
|
+
arr.push(area);
|
|
225
|
+
area = null;
|
|
226
|
+
}
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (prev) {
|
|
230
|
+
/* move area boundary to the middle of the last interval
|
|
231
|
+
const d = boundary - prev[0];
|
|
232
|
+
boundary = prev[0] + d * 0.5;
|
|
233
|
+
*/
|
|
234
|
+
// move area boundary to the beginnig of the last interval
|
|
235
|
+
boundary = prev[0];
|
|
236
|
+
if (boundary === null)
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
// extend current area
|
|
240
|
+
if (area)
|
|
241
|
+
area.to = boundary; // null is already processed
|
|
242
|
+
const value = p[1]; // current value
|
|
243
|
+
if (prev) {
|
|
244
|
+
if (value !== prev[1]) {
|
|
245
|
+
// new value encountered
|
|
246
|
+
if (area) {
|
|
247
|
+
// store the area
|
|
248
|
+
arr.push(area);
|
|
249
|
+
area = null; // wait for a new non-null value
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (!area && value !== null && value !== undefined && p[0] !== null) {
|
|
254
|
+
// new value is not null
|
|
255
|
+
// create new interval colored and labeled for the value
|
|
256
|
+
area = createAreaData(boundary, p[0], value, colorMapFunction, meta);
|
|
257
|
+
}
|
|
258
|
+
prev = p;
|
|
259
|
+
}
|
|
260
|
+
if (area)
|
|
261
|
+
// store the area
|
|
262
|
+
arr.push(area);
|
|
263
|
+
return arr;
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Sets up the plot configuration for a given well log set and template plot.
|
|
268
|
+
*
|
|
269
|
+
* @param wellLog - A JSON well-log set to source data from.
|
|
270
|
+
* @param templatePlot - The template plot configuration.
|
|
271
|
+
* @param axesInfo - Information about the log's axes.
|
|
272
|
+
* @param useSecondCurve - Optional flag to indicate that the "name2" curve should be used
|
|
273
|
+
* @returns A PlotSetup object containing the plot configuration, or null if the setup is invalid.
|
|
274
|
+
*/
|
|
275
|
+
export function setupPlot(wellLog, templatePlot, axesInfo, useSecondCurve) {
|
|
276
|
+
var _a;
|
|
277
|
+
const curveName = useSecondCurve ? templatePlot.name2 : templatePlot.name;
|
|
278
|
+
if (useSecondCurve && templatePlot.type !== "differential")
|
|
279
|
+
return null;
|
|
280
|
+
if (!curveName)
|
|
281
|
+
return null;
|
|
282
|
+
const { iCurve, iSet } = findSetAndCurveIndex(wellLog, curveName);
|
|
283
|
+
if (iCurve < 0)
|
|
284
|
+
return null;
|
|
285
|
+
const sourceLogSet = wellLog[iSet];
|
|
286
|
+
const data = sourceLogSet.data;
|
|
287
|
+
const curves = sourceLogSet.curves;
|
|
288
|
+
const curve = curves[iCurve];
|
|
289
|
+
const dimensions = (_a = curve.dimensions) !== null && _a !== void 0 ? _a : 1;
|
|
290
|
+
if (dimensions !== 1)
|
|
291
|
+
return null;
|
|
292
|
+
if (curve.valueType === "string" && templatePlot.type !== "stacked")
|
|
293
|
+
return null;
|
|
294
|
+
const axisIndices = getAxisIndices(sourceLogSet.curves, axesInfo);
|
|
295
|
+
const plotData = preparePlotData(data, iCurve, axisIndices.primary);
|
|
296
|
+
const minmax = [plotData.minmax[0], plotData.minmax[1]];
|
|
297
|
+
return {
|
|
298
|
+
iCurve,
|
|
299
|
+
iSet,
|
|
300
|
+
sourceLogSet,
|
|
301
|
+
curve,
|
|
302
|
+
plotData,
|
|
303
|
+
minmax,
|
|
304
|
+
templatePlot,
|
|
305
|
+
isSecondary: Boolean(useSecondCurve),
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Generates setup objects for all relevant plots in a given template (aka, curve 1 and sometimes 2)
|
|
310
|
+
* @param templatePlot A template config for a plot
|
|
311
|
+
* @param wellLogSets A JSON Well-Log data set to source from
|
|
312
|
+
* @param axesInfo Information about the axes to be used
|
|
313
|
+
* @returns An array of all successfully created plot setups
|
|
314
|
+
*/
|
|
315
|
+
export function setupTrackPlot(templatePlot, wellLogSets, axesInfo) {
|
|
316
|
+
const retArr = [];
|
|
317
|
+
const plotSetup = setupPlot(wellLogSets, templatePlot, axesInfo);
|
|
318
|
+
const plotSetup2 = setupPlot(wellLogSets, templatePlot, axesInfo, true);
|
|
319
|
+
if (plotSetup)
|
|
320
|
+
retArr.push(plotSetup);
|
|
321
|
+
if (plotSetup2)
|
|
322
|
+
retArr.push(plotSetup2);
|
|
323
|
+
return retArr;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Builds a graph plot using internals from an existing track
|
|
327
|
+
*
|
|
328
|
+
* @param plotConfig - The configuration for the plot to be created.
|
|
329
|
+
* @param track - The graph track containing options and scale information.
|
|
330
|
+
* @returns The created plot.
|
|
331
|
+
*/
|
|
332
|
+
// Somewhat hacky approach to generate a valid plot instance, for when you're adding a plot to an existing track
|
|
333
|
+
export function buildGraphPlotFromTrackOptions(plotConfig, track) {
|
|
334
|
+
const factory = track.options.plotFactory;
|
|
335
|
+
const scale = track.scale;
|
|
336
|
+
if (!factory) {
|
|
337
|
+
throw Error(`No plot factory found in track!`);
|
|
338
|
+
}
|
|
339
|
+
if (!factory[plotConfig.type]) {
|
|
340
|
+
throw Error(`No factory function for creating '${plotConfig.type}'-plot!`);
|
|
341
|
+
}
|
|
342
|
+
return factory[plotConfig.type](plotConfig, scale);
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=plots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plots.js","sourceRoot":"","sources":["../../src/utils/plots.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,YAAY,GACf,MAAM,uBAAuB,CAAC;AAmB/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,gBAEN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAEH,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,GACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAwBxC;;GAEG;AACH,MAAM,OAAO,QAAQ;IAKjB;QACI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACnE,IAAI,CAAC,iBAAiB,GAAG;YACrB,MAAM,CAAC,iBAAiB;YACxB,MAAM,CAAC,iBAAiB;SAC3B,CAAC;IACN,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C,CAAC;IAExC,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,gHAAgH;AAChH,MAAM,UAAU,8BAA8B,CAC1C,UAAsB,EACtB,KAAiB;IAEjB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAE1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,KAAK,CACP,qCAAqC,UAAU,CAAC,IAAI,SAAS,CAChE,CAAC;IACN,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for working with config templates for tracks and plots.
|
|
3
|
+
*/
|
|
4
|
+
import type { TemplateTrack, TemplateStyle, Template } from "../components/WellLogTemplateTypes";
|
|
5
|
+
import type { WellLogCurve } from "../components/WellLogTypes";
|
|
6
|
+
/**
|
|
7
|
+
* Applies styles in a template to it's tracks, adding defaults values for missing fields
|
|
8
|
+
* @param template The log viewer template.
|
|
9
|
+
* @returns An array of styled template tracks.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getStyledTemplateTracks(template: Template): TemplateTrack[];
|
|
12
|
+
/**
|
|
13
|
+
* Determines if a template track is a stacked track.
|
|
14
|
+
* @param templateTrack The template track to check.
|
|
15
|
+
* @param templateStyles Optional styles to consider.
|
|
16
|
+
* @returns True if the template track is a stacked track, false otherwise.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isStackedTrackTemplate(templateTrack: TemplateTrack, templateStyles?: TemplateStyle[]): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Generates a title shown at the top of the track.
|
|
21
|
+
* @param curves The well log curves.
|
|
22
|
+
* @param templateTrack The template track.
|
|
23
|
+
* @returns The generated track header.
|
|
24
|
+
*/
|
|
25
|
+
export declare function makeTrackHeader(curves: WellLogCurve[], templateTrack: TemplateTrack): string;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for working with config templates for tracks and plots.
|
|
3
|
+
*/
|
|
4
|
+
import { DEFAULT_PLOT_TYPE } from "./plots";
|
|
5
|
+
import { generateColor } from "./generateColor";
|
|
6
|
+
import { elementByName, indexOfElementByName } from "./arrays";
|
|
7
|
+
/**
|
|
8
|
+
* Applies styles in a template to it's tracks, adding defaults values for missing fields
|
|
9
|
+
* @param template The log viewer template.
|
|
10
|
+
* @returns An array of styled template tracks.
|
|
11
|
+
*/
|
|
12
|
+
export function getStyledTemplateTracks(template) {
|
|
13
|
+
if (!template.styles)
|
|
14
|
+
return template.tracks;
|
|
15
|
+
return template.tracks.map((track) => applyStylesToTemplateTrack(track, template.styles));
|
|
16
|
+
}
|
|
17
|
+
function applyStylesToTemplateTrack(templateTrack, templateStyles) {
|
|
18
|
+
const styledPlots = templateTrack.plots.map((plot) => applyTemplateStyle(plot, templateStyles));
|
|
19
|
+
return Object.assign(Object.assign({}, templateTrack), { plots: styledPlots });
|
|
20
|
+
}
|
|
21
|
+
function applyTemplateStyle(templatePlot, templateStyles) {
|
|
22
|
+
const styledTemplate = applyStyleToTemplatePlot(templatePlot, templateStyles);
|
|
23
|
+
if (!styledTemplate.type)
|
|
24
|
+
styledTemplate.type = DEFAULT_PLOT_TYPE;
|
|
25
|
+
if (!isValidPlotType(styledTemplate.type)) {
|
|
26
|
+
console.error("unknown plot type '" +
|
|
27
|
+
styledTemplate.type +
|
|
28
|
+
"': use default type '" +
|
|
29
|
+
DEFAULT_PLOT_TYPE +
|
|
30
|
+
"'");
|
|
31
|
+
styledTemplate.type = DEFAULT_PLOT_TYPE;
|
|
32
|
+
}
|
|
33
|
+
if (styledTemplate.type !== "stacked") {
|
|
34
|
+
if (!styledTemplate.color)
|
|
35
|
+
styledTemplate.color = generateColor();
|
|
36
|
+
}
|
|
37
|
+
if (styledTemplate.type === "area") {
|
|
38
|
+
if (!styledTemplate.fill) {
|
|
39
|
+
//styledTemplate.fill = generateColor();
|
|
40
|
+
styledTemplate.fillOpacity = 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (styledTemplate.type === "gradientfill") {
|
|
44
|
+
if (!styledTemplate.colorMapFunctionName) {
|
|
45
|
+
//styledTemplate.fill = generateColor();
|
|
46
|
+
styledTemplate.fillOpacity = 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else if (styledTemplate.type === "differential") {
|
|
50
|
+
// "differential" plot
|
|
51
|
+
if (!styledTemplate.fill)
|
|
52
|
+
styledTemplate.fill = generateColor();
|
|
53
|
+
if (!styledTemplate.color2)
|
|
54
|
+
styledTemplate.color2 = generateColor();
|
|
55
|
+
if (!styledTemplate.fill2)
|
|
56
|
+
styledTemplate.fill2 = generateColor();
|
|
57
|
+
}
|
|
58
|
+
return styledTemplate;
|
|
59
|
+
}
|
|
60
|
+
function applyStyleToTemplatePlot(templatePlot, templateStyles) {
|
|
61
|
+
var _a;
|
|
62
|
+
if (!templateStyles || !templatePlot.style)
|
|
63
|
+
return Object.assign({}, templatePlot);
|
|
64
|
+
const style = (_a = elementByName(templateStyles, templatePlot.style)) !== null && _a !== void 0 ? _a : {};
|
|
65
|
+
return Object.assign(Object.assign({}, style), templatePlot);
|
|
66
|
+
}
|
|
67
|
+
// Validates that a plot type string is a recognized type
|
|
68
|
+
function isValidPlotType(plotType) {
|
|
69
|
+
return [
|
|
70
|
+
"line",
|
|
71
|
+
"linestep",
|
|
72
|
+
"dot",
|
|
73
|
+
"area",
|
|
74
|
+
"differential",
|
|
75
|
+
"gradientfill",
|
|
76
|
+
"stacked",
|
|
77
|
+
].includes(plotType);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Determines if a template track is a stacked track.
|
|
81
|
+
* @param templateTrack The template track to check.
|
|
82
|
+
* @param templateStyles Optional styles to consider.
|
|
83
|
+
* @returns True if the template track is a stacked track, false otherwise.
|
|
84
|
+
*/
|
|
85
|
+
export function isStackedTrackTemplate(templateTrack, templateStyles) {
|
|
86
|
+
var _a, _b, _c;
|
|
87
|
+
// Stacked tracks only render the first plot, so we only care about the first
|
|
88
|
+
const firstTrackPlot = (_b = (_a = templateTrack.plots) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : {};
|
|
89
|
+
if (firstTrackPlot.type === "stacked")
|
|
90
|
+
return true;
|
|
91
|
+
if (!firstTrackPlot.style || !templateStyles)
|
|
92
|
+
return false;
|
|
93
|
+
const iStyle = indexOfElementByName(templateStyles, firstTrackPlot.style);
|
|
94
|
+
if (iStyle < 0)
|
|
95
|
+
return false;
|
|
96
|
+
return ((_c = templateStyles[iStyle]) === null || _c === void 0 ? void 0 : _c.type) === "stacked";
|
|
97
|
+
} // Remove any leading numbers followed by whitespace from the description
|
|
98
|
+
// Examples:
|
|
99
|
+
// * `"0 Depth" -> "Depth"`
|
|
100
|
+
// * `"1 BVW:CPI:rC:0001:v1" -> "BVW:CPI:rC:0001:v1"`
|
|
101
|
+
// * `"02 DRAW DOWN PRESSURE" -> "DRAW DOWN PRESSURE"`
|
|
102
|
+
function shortDescription(description) {
|
|
103
|
+
return description.replace(/^\d+\s+/, "");
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Generates a title shown at the top of the track.
|
|
107
|
+
* @param curves The well log curves.
|
|
108
|
+
* @param templateTrack The template track.
|
|
109
|
+
* @returns The generated track header.
|
|
110
|
+
*/
|
|
111
|
+
export function makeTrackHeader(curves, templateTrack) {
|
|
112
|
+
if (templateTrack.title)
|
|
113
|
+
return templateTrack.title;
|
|
114
|
+
if (!templateTrack.plots[0])
|
|
115
|
+
return "";
|
|
116
|
+
const plotTemplate = templateTrack.plots[0];
|
|
117
|
+
const curve = elementByName(curves, plotTemplate.name);
|
|
118
|
+
// Something went wrong
|
|
119
|
+
if (!curve)
|
|
120
|
+
return plotTemplate.name;
|
|
121
|
+
return curve.description ? shortDescription(curve.description) : curve.name;
|
|
122
|
+
}
|
|
123
|
+
// export function templateTracksFromController(log): Template
|
|
124
|
+
//# sourceMappingURL=template.js.map
|