UNPKG

@webviz/subsurface-viewer

Version:

3D visualization component for subsurface reservoir data

47 lines 1.55 kB
function getLineStringGeometry(well_object) { const geometries = well_object.geometry.geometries; return geometries.find((item) => item.type === "LineString"); } export function getColor(accessor) { if (accessor) { return accessor; } return (object, objectInfo) => { var _a; if (typeof accessor === "function") { const colorFunc = accessor; const color = colorFunc(object, objectInfo); if (color) { return color; } } return (_a = object.properties) === null || _a === void 0 ? void 0 : _a.color; }; } /** * Get trajectory transparency based on alpha of trajectory color */ function isTrajectoryTransparent(well_object, color_accessor) { var _a; let alpha; const accessor = getColor(color_accessor); if (typeof accessor === "function") { alpha = (_a = accessor(well_object)) === null || _a === void 0 ? void 0 : _a[3]; } else { alpha = accessor === null || accessor === void 0 ? void 0 : accessor[3]; } return alpha === 0; } /** * Get trajectory data from LineString Geometry if it's visible (checking * trajectory visiblity based on line color) */ export function getTrajectory(well_object, color_accessor) { var _a; if (!isTrajectoryTransparent(well_object, color_accessor)) return (_a = getLineStringGeometry(well_object)) === null || _a === void 0 ? void 0 : _a.coordinates; else return undefined; } //# sourceMappingURL=trajectory.js.map