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 20, 2023
1 parent 1363a5e commit d8b8057
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import PropTypes from "prop-types";
import type { colorTablesArray } from "@emerson-eps/color-tables/";
import type { Unit } from "convert-units";
import convert from "convert-units";
import type { PickingInfo } from "@deck.gl/core/typed";

export type {
BoundsAccessor,
Expand Down Expand Up @@ -99,7 +100,7 @@ export interface SubsurfaceViewerProps {
*/
isLoadedCallback?: (arg: boolean) => void;

onDragStart?: (info: unknown, event: unknown) => void;
onDragStart?: (info: PickingInfo, event: unknown) => void;
onDragEnd?: (info: unknown, event: unknown) => void;

/**
Expand Down
4 changes: 2 additions & 2 deletions typescript/packages/subsurface-viewer/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ export interface MapProps {
*/
isLoadedCallback?: (arg: boolean) => void;

onDragStart?: (info: unknown, event: unknown) => void;
onDragEnd?: (info: unknown, event: unknown) => void;
onDragStart?: (info: PickingInfo, event: unknown) => void;
onDragEnd?: (info: PickingInfo, event: unknown) => void;

/**
* If changed will reset camera to default position.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,7 @@ export function coarsenWells(data_in: FeatureCollection): FeatureCollection {
return index === 0 || index === array.length - 1 || index % 10 == 0;
};

(
(data.features[well_no].geometry as GeometryCollection)
.geometries[1] as LineString
).coordinates = coords.filter(filterFunc);
lineString.coordinates = coords.filter(filterFunc);

if (data.features[well_no].properties) {
data.features[well_no].properties!["md"] = mds.filter(filterFunc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {
colorTables,
} from "@emerson-eps/color-tables";
import type { MapMouseEvent } from "../../components/Map";
import WellsLayer from "./wellsLayer";
import AxesLayer from "../axes/axesLayer";

const PREFIX = "VolveWells";

const classes = {
Expand Down Expand Up @@ -446,19 +449,17 @@ export const Wells3DGullfaks: ComponentStory<typeof SubsurfaceViewer> = (
onDragStart: () => setOptimizedInteraction(true),
onDragEnd: () => setOptimizedInteraction(false),
layers: [
{
"@@type": "WellsLayer",
data: "@@#resources.wellsData",
new WellsLayer({
data: "./gullfaks.json",
wellHeadStyle: { size: 4 },
refine: true,
outline: true,
optimizedInteraction, // If true will cause wellslayer to draw simplified.
},
{
"@@type": "AxesLayer",
}),
new AxesLayer({
id: "axes-layer",
bounds: [450000, 6781000, 0, 464000, 6791000, 3500],
},
}),
],
};

Expand All @@ -467,9 +468,6 @@ export const Wells3DGullfaks: ComponentStory<typeof SubsurfaceViewer> = (

Wells3DGullfaks.args = {
id: "gullfaks",
resources: {
wellsData: "./gullfaks.json",
},
bounds: [450000, 6781000, 464000, 6791000] as [
number,
number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface WellsLayerProps extends ExtendedLayerProps {
*/
ZIncreasingDownwards: boolean;
/** If true means that a simplified representation of the wells will be drawn.
* Useful for example during panning and roation to gain speed.
* Useful for example during panning and rotation to gain speed.
*/
optimizedInteraction: boolean;
}
Expand Down Expand Up @@ -382,7 +382,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 fastDrawing = this.props.optimizedInteraction;

const simpleLayer = new UnfoldedGeoJsonLayer(
this.getSubLayerProps({
Expand All @@ -406,7 +406,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
lineBillboard: false,
pointBillboard: false,
parameters,
visible: drawSimple,
visible: fastDrawing,
})
);
const outlineLayer = new UnfoldedGeoJsonLayer(
Expand All @@ -427,7 +427,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
lineBillboard: true,
pointBillboard: true,
parameters,
visible: this.props.outline && !drawSimple,
visible: this.props.outline && !fastDrawing,
})
);

Expand Down Expand Up @@ -459,7 +459,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
lineBillboard: true,
pointBillboard: true,
parameters,
visible: !drawSimple,
visible: !fastDrawing,
})
);

Expand Down Expand Up @@ -487,12 +487,12 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
getFillColor: getColor(this.props.wellHeadStyle?.color),
getLineColor: getColor(this.props.lineStyle?.color),
parameters,
visible: this.props.logCurves && !drawSimple,
visible: this.props.logCurves && !fastDrawing,
})
);

// Highlight the multi selected wells.
const highlightMultiWells_layer = new UnfoldedGeoJsonLayer(
const highlightMultiWellsLayer = new UnfoldedGeoJsonLayer(
this.getSubLayerProps({
id: "highlight2",
data: getWellObjectsByName(
Expand All @@ -515,7 +515,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
getFillColor: [255, 140, 0],
getLineColor: [255, 140, 0],
parameters,
visible: this.props.logCurves && !drawSimple,
visible: this.props.logCurves && !fastDrawing,
})
);

Expand Down Expand Up @@ -569,7 +569,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
this.setLegend(value);
},
parameters,
visible: this.props.logCurves && !drawSimple,
visible: this.props.logCurves && !fastDrawing,
})
);

Expand Down Expand Up @@ -624,7 +624,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
this.setLegend(value);
},
parameters,
visible: this.props.logCurves && !drawSimple,
visible: this.props.logCurves && !fastDrawing,
})
);

Expand All @@ -646,7 +646,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
getAlignmentBaseline: "bottom",
getSize: this.props.wellNameSize,
parameters,
visible: this.props.wellNameVisible && !drawSimple,
visible: this.props.wellNameVisible && !fastDrawing,
})
);

Expand All @@ -656,7 +656,7 @@ export default class WellsLayer extends CompositeLayer<WellsLayerProps> {
logLayer,
colorsLayer,
highlightLayer,
highlightMultiWells_layer,
highlightMultiWellsLayer,
selectionLayer,
namesLayer,
];
Expand Down

0 comments on commit d8b8057

Please sign in to comment.