Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion documents/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ The generator functions can be imported from `videx-3d/generators` (default impl
| **Casings** | casings | generateCasings | - position-logs<br/>- casings |
| **CompletionAnnotations** | completionToolAnnotations | generateCompletionToolAnnotations | - position-logs<br/>- completion-tools |
| **CompletionTools** | completionTools | generateCompletionTools | - position-logs<br/>- completion-tools |
| **WellboreFormationColumn** | wellboreFormationColumn | generateWellboreFormationColumnGeometries | - position-logs<br/>- picks<br/>- strat column |
| **DepthMarkers** | depthMarkers | generateDepthMarkers | - position-logs |
| **Perforations** | perforationSymbols | generatePerforations | - position-logs<br/>- perforations |
| **Perimeter** | perimeterGeometry | generatePerimeterGeometry | - position-logs |
| **Picks** | pickSymbols | generatePicks | - position-logs<br/>- picks |
| **Picks** | pickSymbols | generatePicks | - position-logs<br/>- picks<br/>- strat column |
| **Shoes** | shoeSymbols | generateShoes | - position-logs<br/>- casings |
| **Surface** | surfaceGeometry | generateSurfaceGeometry | - surface-meta<br/>- surface-values |
| **Surface** | surfaceTextures | generateSurfaceTextureData | - surface-meta<br/>- surface-values |
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "videx-3d",
"version": "0.1.3-beta",
"version": "0.2.0-beta",
"private": false,
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion public/data/picks.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/strat-columns.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/generate-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* !!!IMPORTANT: surface irapbin files must be put in the /public/data/surfaces folder, named by surface id!
*
* node scripts/generate-data --input import/_troll && node scripts/generate-story-args
* node scripts/generate-data --input import/_volve && node scripts/generate-story-args
*/

import minimist from 'minimist'
Expand Down
17 changes: 17 additions & 0 deletions scripts/generate-story-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export function createStoryArgs() {
fs.readFileSync('public/data/surface-meta.json')
)

const stratColumns = JSON.parse(
fs.readFileSync('public/data/strat-columns.json')
)

const wellboreOptions = Object.values(wellboreHeadersData)
.filter(d => d.drilled)
.sort((a, b) => a.name.localeCompare(b.name))
Expand All @@ -38,13 +42,26 @@ export function createStoryArgs() {
[surface.id]: surface.name
}), {})

const stratUnitTypes = new Set()
const stratUnits = new Set()

Object.values(stratColumns).forEach(stratColumn => {
stratColumn.units.forEach(unit => {
stratUnitTypes.add(unit.unitType)
stratUnits.add(unit.name)
})
})

const output = {
utmZone: config.utmZone || '31N',
origin: config.origin,
defaultWellbore: config.wellbore,
defaultWell: config.well,
defaultStratColumn: config.stratColumn,
wellboreOptions,
surfaceOptions,
stratUnitOptions: Array.from(stratUnits),
stratUnitTypeOptions: Array.from(stratUnitTypes),
}

fs.writeFile('src/storybook/story-args.json', JSON.stringify(output), (err) => {
Expand Down
39 changes: 15 additions & 24 deletions scripts/transformations/transformPicks.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import { verify } from '../utils.js'

function mapPicksData(picksData, stratColumn) {
function mapPicksData(picksData) {
const grouped = picksData.reduce((map, p) => {
let picks = map[p.wellbore_uuid]
if (!picks) {
picks = []
map[p.wellbore_uuid] = picks
}

const unit = stratColumn.units.find(
(u) => u.top === p.pick_identifier || u.base === p.pick_identifier
)
if (unit) {
picks.push({
name: p.pick_identifier,
color: unit.color,
level: unit.level,
mdMsl: p.md_msl,
tvdMsl: p.tvd_msl,
})
}
picks.push({
id: p.uuid,
wellboreId: p.wellbore_uuid,
pickIdentifier: p.pick_identifier,
mdMsl: p.md_msl,
tvdMsl: p.tvd_msl,
properties: {
confidence: p.confidence,
qualifier: p.qualifier,
}
})

return map
}, {})

Expand All @@ -33,13 +32,5 @@ export function transformPicks(input, output) {

if (!picksData) return

verify(input, 'config')
verify(output, 'strat-columns')

const config = input['config']
const stratColumn = output['strat-columns'][config.stratColumn]

if (stratColumn) {
output['picks'] = mapPicksData(picksData, stratColumn)
}
output['picks'] = mapPicksData(picksData)
}
1 change: 1 addition & 0 deletions scripts/transformations/transformStratColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function mapStratColumnsData(stratColumnData) {
stratCol.units.push({
id: s.uuid,
name: s.identifier,
unitType: s.strat_unit_type || 'unknown',
top: s.top,
topAge: s.top_age,
base: s.base,
Expand Down
3 changes: 2 additions & 1 deletion src/components/Distance/Distance.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default meta
type Story = StoryObj<StoryArgs>

const wellboreId = storyArgs.defaultWellbore
const stratColumnId = storyArgs.defaultStratColumn

export const Default: Story = {
args: {
Expand All @@ -53,7 +54,7 @@ export const Default: Story = {
<WellboreBounds id={wellboreId}>
<TubeTrajectory color="white" radius={2} />
<Distance {...args}>
<Picks />
<Picks stratColumnId={stratColumnId} />
</Distance>
</WellboreBounds>
</Wellbore>
Expand Down
14 changes: 7 additions & 7 deletions src/components/Html/WellMap/WellMap.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Decorator, Meta, StoryObj } from '@storybook/react'
import { scaleOrdinal } from 'd3-scale'
import { ComponentProps, CSSProperties, useMemo, useState } from 'react'
import { ComponentProps, CSSProperties, useState } from 'react'
import { DataProviderDecorator } from '../../../storybook/decorators/data-provider-decorator'
import storyArgs from '../../../storybook/story-args.json'
import { WellMapCasingShoes } from './addons/WellMapCasingShoes'
Expand Down Expand Up @@ -89,15 +89,12 @@ export const WithCasingAndCompletionIntervals: Story = {
}
}

export const WithAllAddons: Story = {
export const WithFormationsAndTvdDepths: Story = {
decorators: [darkThemeDecorator],
render: (args: ComponentProps<typeof WellMap>) => {
const formations = useMemo(() => ['NORDLAND GP.', 'HORDALAND GP.', 'ROGALAND GP.', 'SHETLAND GP.', 'CROMER KNOLL GP.', 'VIKING GP.'], [])
return (
<WellMap {...args} colors={w => colorScale(w.id)}>
<WellMapFormations formations={formations} />
<WellMapCompletionIntervals />
<WellMapCasingShoes />
<WellMapFormations stratColumnId={storyArgs.defaultStratColumn} />
<WellMapTvd />
</WellMap>
)
Expand Down Expand Up @@ -135,7 +132,10 @@ export const LightThemed: Story = {
decorators: [lightThemeDecorator],
render: (args: ComponentProps<typeof WellMap>) => {
return (
<WellMap {...args} colors={w => colorScale(w.id)} />
<WellMap {...args} colors={w => colorScale(w.id)}>
<WellMapFormations stratColumnId={storyArgs.defaultStratColumn} />
<WellMapCasingShoes color="black" />
</WellMap>
)
}
}
Expand Down
Loading