From 811a3e0fbce054979c25d10d9b24e031fb7c53be Mon Sep 17 00:00:00 2001 From: Nils Christian Bonnevie Date: Fri, 15 Sep 2023 13:09:12 +0200 Subject: [PATCH] Code comment fixes. --- .../src/layers/wells/utils/spline.ts | 13 ++------- .../src/layers/wells/wellsLayer.ts | 28 +++++++++---------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/typescript/packages/subsurface-viewer/src/layers/wells/utils/spline.ts b/typescript/packages/subsurface-viewer/src/layers/wells/utils/spline.ts index ad0041575..7cfa07b6e 100644 --- a/typescript/packages/subsurface-viewer/src/layers/wells/utils/spline.ts +++ b/typescript/packages/subsurface-viewer/src/layers/wells/utils/spline.ts @@ -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"; /** @@ -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. @@ -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"]; diff --git a/typescript/packages/subsurface-viewer/src/layers/wells/wellsLayer.ts b/typescript/packages/subsurface-viewer/src/layers/wells/wellsLayer.ts index 967879e8d..b57b4604b 100644 --- a/typescript/packages/subsurface-viewer/src/layers/wells/wellsLayer.ts +++ b/typescript/packages/subsurface-viewer/src/layers/wells/wellsLayer.ts @@ -384,7 +384,7 @@ export default class WellsLayer extends CompositeLayer { // 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, @@ -409,7 +409,7 @@ export default class WellsLayer extends CompositeLayer { visible: drawSimple, }) ); - const outline_layer = new UnfoldedGeoJsonLayer( + const outlineLayer = new UnfoldedGeoJsonLayer( this.getSubLayerProps({ id: "outline", data, @@ -431,7 +431,7 @@ export default class WellsLayer extends CompositeLayer { }) ); - const colors_layer = new UnfoldedGeoJsonLayer( + const colorsLayer = new UnfoldedGeoJsonLayer( this.getSubLayerProps({ id: "colors", data, @@ -464,7 +464,7 @@ export default class WellsLayer extends CompositeLayer { ); // Highlight the selected well. - const highlight_layer = new UnfoldedGeoJsonLayer( + const highlightLayer = new UnfoldedGeoJsonLayer( this.getSubLayerProps({ id: "highlight", data: getWellObjectByName( @@ -519,7 +519,7 @@ export default class WellsLayer extends CompositeLayer { }) ); - const log_layer = new PathLayer( + const logLayer = new PathLayer( this.getSubLayerProps({ id: "log_curve", data: this.props.logData, @@ -573,7 +573,7 @@ export default class WellsLayer extends CompositeLayer { }) ); - const selection_layer = new PathLayer( + const selectionLayer = new PathLayer( this.getSubLayerProps({ id: "selection", data: this.props.logData, @@ -629,7 +629,7 @@ export default class WellsLayer extends CompositeLayer { ); // well name - const names_layer = new TextLayer( + const namesLayer = new TextLayer( this.getSubLayerProps({ id: "names", data: data.features, @@ -651,14 +651,14 @@ export default class WellsLayer extends CompositeLayer { ); return [ - simple_layer, - outline_layer, - log_layer, - colors_layer, - highlight_layer, + simpleLayer, + outlineLayer, + logLayer, + colorsLayer, + highlightLayer, highlightMultiWells_layer, - selection_layer, - names_layer, + selectionLayer, + namesLayer, ]; }