npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@corva/well3dviewapp

v3.0.8

Published

This module is for showing 3D Wells

Downloads

38

Readme

How to Install


yarn add @corva/well3dviewapp

How to Import


import Well3DApp from '@corva/well3dviewapp';

INITIALIZATION

Import Well3DApp component and add it to the DOM Element. Example:

import Well3DApp from '@corva/well3dviewapp';

this.well3DViewer = new Well3DApp(root, config);

this.well3DViewer.attach();

Parameters

root: ID of the element which you want to add the Well3DViewer
config: Initial configuration of the 3DViewer

Example:

{
  soil,
  initAnimation: true,
  wells,
  unit: 'ft',
  zoomSpeed: 3,
  tooltipFormatter: (name, type, point, unit) => `<div><span>${type}: ${name}</span><br /><span>Depth: ${point.z} ${unit}</span></div>`,
  mainWellId: 'well_002'
}

soil: Array
The array of the information of the soil

[
  ...
  {
    "name": "T/ Porous Sd",
    "top": 0,
    "bottom": 775,
    "color": "49a3a2"
  },
  ...
]

initAnimation: Boolean
The flag for animation of the AntiCollision Indicator when initialize the 3DViewer

wells: Array
Array of the data of the wells. (Main Well, Offset Wells, ...)

[
...
{
  id: 'well_001',
  name: 'Main Well',
  color: '0xFF0000',
  data: tube1,
  antiCollisionIndicator: {
    enable: true
  }
},
...
]

unit: String
The Unit of the depth. Ex: "ft", "km", ...

unit: String
The speed of zoom when using mouse wheel

tooltipFormatter: String
The formatter function of the well's tooltip.

(name, type, point, unit) => `<div><span>${type}: ${name}</span><br /><span>Depth: ${point.z} ${unit}</span></div>`

name: String
Name of the object
yype: String
Type of the object. (It should be "Well" and "Survey" for now)
point: Point
Point of the object. Ex: { x, y, z }
unit: String
Unit of the distance. (It should be "ft", "m", and "Km")

mainWellId: String
The ID of the main well. It will have the AntiCollisionIndicator.

Sample: How to use Well3DApp in React project

Please take a look at this sample

Methods

Well Methods

addNewWell(newWell)

Add a new well to the existing 3D Viewer.

newWell: Object
The data of the new well which you want to add to the 3D Viewer

{
  id: 'well_001',
  name: 'Main Well',
  color: '0xFF0000',
  data: tube1,
  antiCollisionIndicator: {
    enable: true
  }
}

config: Object
Same as the constructor of the Well3DApp

updateWellData(wellId, newPoints)

Replace the all points of the existing well with new points.

wellId: String
The ID of the well which you want to update

newPoints: Array
The array of points of the well which you want to update.

[
...,
{x, y, z},
...
]

Camera Methods

Controll the camera by Mouse

1. Zoom In: You can zoom in by scrolling up the Mouse Wheel.
2. Zoom Out: You can zoom out by scrolling down the Mouse Wheel.
3. Zoom In and Out: You can zoom in and out with clicking the Mouse Wheel button and moving the mouse(up and down) at the same time.
4. Rotate: You can rotate the camera by clicking the Mouse Right button and moving the mouse at the same time.
5. Zoom to a point of the well: You can zoom to a point of the well by clicking a point of the well in the scene. (When you mouse over on the wellbore, it will show a tooltip.)

resetCamera()

Reset the view of camera to the initial view.

rotateYAxisCamera(step, angle)

Rotate the camera by the Y Axis around the AntiCollisionIndicator.

step: Float
The value of radian which you want to rotate for every call This is Optional parameter and the default value is 0.2.

angle: Float
The value of radian which you want to rotate the camera to the target angle. This is Optional parameter.

rotateXAxisCamera(step, angle)

Rotate the camera by the X Axis around the AntiCollisionIndicator.
The parameters are same as above.

zoomToIndicator()

Zoom in the camera for the AntiCollisonIndicator.

zoomToMainWell()

Zoom in camera to fit to the main wellbore.

zoomIn()

Zoom in the camera.

zoomOut()

Zoom out the camera.

setIndicatorTracker (shouldTrackIndicator)

If shouldTrackIndicator is true, it will track the Anti Collision Indicator in real-time when move the indicator.
If shouldTrackIndicator is false, it cancels tracking the Anti Collision Indicator.

Other Methods

allowPan(isAllow)

Allow to move the scene by mouse click and move.

isAllow: Boolean

updateCombo(alpha)

Move the AntiCollisionIndicator on the path of the well with the Camera. Camera will zoom to the AntiCollisionIndicator during the movement.

alpha: Float
Position of the AntiCollisionIndicator. [0, 1]

changeSoilVisibility(isSoil)

Change visibility of the soil levels.

isSoil: Boolean

showOnlyActiveSoil(visible)

Change the opacity of the soil levels which aren't contain the Anti Collision Indicator.

visible: Boolean
If true, set all levels of the soil to 0, except only the soil level which contains the Anti Collision Indicator.
If false, show all the levels of the soil