Skip to content

Commit

Permalink
Code comment fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilscb committed Sep 15, 2023
1 parent 0a4c96a commit 811a3e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
GeometryCollection,
LineString,
} from "geojson";
import { cloneDeep } from "lodash";
import { cloneDeep, range } from "lodash";
import type { Position3D } from "../../utils/layerTools";

/**
Expand Down Expand Up @@ -107,13 +107,6 @@ export function CatmullRom(
return [x, y, z] as Position3D;
}

// Generate a range of numbers with given step length.
const range = (start: number, stop: number, step: number) =>
Array.from(
{ length: (stop - start) / step + 1 },
(_, i) => start + i * step
);

/**
* Will interpolate and refine wellpaths using spline interploation resulting
* in smoother curves with more points.
Expand All @@ -124,10 +117,10 @@ export function splineRefine(data_in: FeatureCollection): FeatureCollection {

const no_wells = data.features.length;

const noSteps = 50;
const noSteps = 5;
const step = 1 / noSteps;

const steps = range(step, 1 - step, step);
const steps = range(step, 1, step);

for (let well_no = 0; well_no < no_wells; well_no++) {
const mds = data.features[well_no].properties?.["md"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
// Reduced details when rotating or panning the view if "optimizedInteraction" is set.
const drawSimple = this.props.optimizedInteraction;

const simple_layer = new UnfoldedGeoJsonLayer(
const simpleLayer = new UnfoldedGeoJsonLayer(
this.getSubLayerProps({
id: "simple",
data: coarseData,
Expand All @@ -409,7 +409,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
visible: drawSimple,
})
);
const outline_layer = new UnfoldedGeoJsonLayer(
const outlineLayer = new UnfoldedGeoJsonLayer(
this.getSubLayerProps({
id: "outline",
data,
Expand All @@ -431,7 +431,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
})
);

const colors_layer = new UnfoldedGeoJsonLayer(
const colorsLayer = new UnfoldedGeoJsonLayer(
this.getSubLayerProps({
id: "colors",
data,
Expand Down Expand Up @@ -464,7 +464,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
);

// Highlight the selected well.
const highlight_layer = new UnfoldedGeoJsonLayer(
const highlightLayer = new UnfoldedGeoJsonLayer(
this.getSubLayerProps({
id: "highlight",
data: getWellObjectByName(
Expand Down Expand Up @@ -519,7 +519,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
})
);

const log_layer = new PathLayer<LogCurveDataType>(
const logLayer = new PathLayer<LogCurveDataType>(
this.getSubLayerProps({
id: "log_curve",
data: this.props.logData,
Expand Down Expand Up @@ -573,7 +573,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
})
);

const selection_layer = new PathLayer<LogCurveDataType>(
const selectionLayer = new PathLayer<LogCurveDataType>(
this.getSubLayerProps({
id: "selection",
data: this.props.logData,
Expand Down Expand Up @@ -629,7 +629,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
);

// well name
const names_layer = new TextLayer<Feature>(
const namesLayer = new TextLayer<Feature>(
this.getSubLayerProps({
id: "names",
data: data.features,
Expand All @@ -651,14 +651,14 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
);

return [
simple_layer,
outline_layer,
log_layer,
colors_layer,
highlight_layer,
simpleLayer,
outlineLayer,
logLayer,
colorsLayer,
highlightLayer,
highlightMultiWells_layer,
selection_layer,
names_layer,
selectionLayer,
namesLayer,
];
}

Expand Down

0 comments on commit 811a3e0

Please sign in to comment.