Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #102

Merged
merged 21 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7d41a1e
Merge pull request #1 from JustinGOSSES/master
nathangeology Jun 6, 2020
cc2a191
fixed a small typo in a comment
nathangeology Jun 6, 2020
c888e3a
Merge branch 'master' of https://github.com/nathangeology/wellioviz
nathangeology Jun 6, 2020
4cd00e6
trying to get wellio viz as package connected to panel.
nathangeology Jun 6, 2020
5c1eb8a
version update?? not sure where this change happened from lol
nathangeology Jun 6, 2020
b250909
Merge branch 'master' of https://github.com/nathangeology/wellioviz
nathangeology Jun 6, 2020
0470d2c
ready to try a holoviews panel app
nathangeology Jun 7, 2020
3bcdc14
removed unnecessary dependancies
nathangeology Jun 7, 2020
f863b8e
trying things
nathangeology Jun 7, 2020
5cabedc
Merge branch 'master' of https://github.com/nathangeology/wellioviz
nathangeology Jun 7, 2020
a7e063f
completed two test, non-notebook MVP deployments of wellioviz.js pack…
nathangeology Jun 9, 2020
c4080c3
updated the index.html for the example panel app
nathangeology Jun 9, 2020
98e0a2b
created an examples folder and moved the deployment examples there. F…
nathangeology Jun 10, 2020
3c15942
Added configuration for jest unit testing. Added abstract class-like …
nathangeology Jun 12, 2020
bdfa163
Currently working through the structure of the style templates and su…
nathangeology Jun 12, 2020
c279aac
Still working through 'browserify-ing' my additional code.
nathangeology Jun 13, 2020
8726550
Making progress on the refactor of the package code. I spent some tim…
nathangeology Jun 13, 2020
0cdf715
Still slogging through the drawing code, trying to understand/refacto…
nathangeology Jun 13, 2020
4a8b8a4
updated docs to include instructions for running the panel app exampl…
nathangeology Jun 13, 2020
ebc3f55
minor modifications to try to make the panel app more dynamic. Still …
nathangeology Jun 13, 2020
2696d64
minor style update to the documentation
nathangeology Jun 13, 2020
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
20 changes: 20 additions & 0 deletions dist/base_template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class BaseTemplate {
constructor(params={}) {
this.handle_params(params)
}

handle_params(params) {
for (const [key, value] in Object.entries(params)){
this[key] = value
}
return this
}

start_draw(div_id){
let d3 = module.exports.d3;
let noDIV = d3.select("#" + div_id).selectAll("div").remove();
let noSVG = d3.select("#" + div_id).selectAll("svg").remove();
return d3
}
}
module.exports = BaseTemplate
Empty file added dist/curve_alias/curve_alias.js
Empty file.
15 changes: 15 additions & 0 deletions dist/fill_templates/curve_fill_template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const BaseTemplate = require("../base_template")

class CurveFillTemplate extends BaseTemplate{
constructor(params={}) {
super();
this.curve_name = "default"
this.fill = "no"
this.fill_direction = "left"
this.cutoffs = Array(0) // TODO should take values OR curve names
this.fill_colors = Array(0)
//Update template based on passed params
this.handle_params(params)
}
}
module.exports = CurveFillTemplate
2,949 changes: 1,523 additions & 1,426 deletions dist/index.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions dist/log_style_templates/CAL.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const LogCurveTemplate = require("./log_curve_template")

class CAL extends LogCurveTemplate {
constructor(params={}) {
super(params);
this.curve_name = "CAL"
this.units = "cm"
this.stroke_type = "dash" // TODO Warning! This might not be a thing haha
this.handle_params(params)
}
}
module.exports = CAL
12 changes: 12 additions & 0 deletions dist/log_style_templates/GR.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const LogCurveTemplate = require("./log_curve_template")

class GR extends LogCurveTemplate {
constructor(params={}) {
super(params);
this.curve_name = "GR"
// this.fill = null // TODO: GR Fill
this.units = "API"
this.handle_params(params)
}
}
module.exports = GR
50 changes: 50 additions & 0 deletions dist/log_style_templates/log_curve_template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Base sort of abstract template, specialized templates can override pieces of this
const fill_template = require('../fill_templates/curve_fill_template');
const BaseTemplate = require("../base_template")

class LogCurveTemplate extends BaseTemplate {
// const obj = {}
// Define Default Settings Values
constructor(params={}) {
super();
this.curve_name = "default"
this.color = "black"
this.stroke_type = "solid"
this.stroke_linecap = "butt"
this.stroke_width = 1.0
this.stroke_transparency = 1.0
this.fill = new fill_template()
this.units = "unkn"
this.depth_limits = {"min": "autocalculate", "max": "autocalculate"}
this.curve_limits = {"min": -100000, "max":3} // TODO: This needs to be looked at more
this.data = Array(0)
this.data_id = ""
this.well_name = "default"
this.uwi14 = "00000000000000"
this.isLinear = true // false sets to a log scale
this.depth_type = "MD"
this.depth_units = "meter"
// Define Template Functions
// TODO: decide if null are handled here or at load validation
//Update template based on passed params
this.handle_params(params)
}
// Simple function to set the data that is associated with this curve
define_data(data) {
// Add data to a template
// TODO: Validation step here??
this.data = data
return this
}
// Function change the target curve name and data for the instance of curve template
set_curve_and_data(curve_name, data, params={}){
this.define_data(data)
this.curve_name = curve_name
//Update template based on passed params
this.handle_params(params)
return this
}

}

module.exports = LogCurveTemplate;
17 changes: 17 additions & 0 deletions dist/main_funcs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// let wellio = require('wellio')
// let TripleCombo = require("./well_log_templates/triple_combo_template")

async function plot_triple_combo_log(div_id, url="./static/00-01-11-082-23W4-0.LAS") {
let ShaleSiltCutOff = 80
let SiltSandCutOff = 55
// var fileUrltoWellLog = "https://gist.githubusercontent.com/JustinGOSSES/2685e588d5c2f2a0ba1591ec7b9c9421/raw/415fe8a2f27dc7621f06f60ffd40a62c0d55a0f0/00-01-01-095-19W4-0.las"
var fetched = await fetch(url)
var well_as_string = await fetched.text()
var well = las2json(well_as_string)
// let depth_curve_name = well['CURVE INFORMATION BLOCK']
var test = new TrackTemplate()
var log = new TripleCombo()
log.load_log(well)
console.log('here')

}
5 changes: 5 additions & 0 deletions dist/test/curve_fill_template.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fill_template = require('../fill_templates/curve_fill_template');

test('default fill curve template curve_name is a property', () => {
expect(new fill_template()).toHaveProperty("curve_name")
})
File renamed without changes.
28 changes: 28 additions & 0 deletions dist/test/log_templates.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const log_curve_template = require('../log_style_templates/log_curve_template');
let test_curve_data_1 = [
{'Depth': 0.0, 'Default': 1.0},
{'Depth': 1.0, 'Default': 0.0},
{'Depth': 2.0, 'Default': 1.0},
{'Depth': 4.0, 'Default': 2.0},
]

let test_curve_data_2 = [
{'Depth': 1.0, 'RHOB': 1.0},
{'Depth': 2.0, 'RHOB': 0.0},
{'Depth': 3.0, 'RHOB': 1.0},
{'Depth': 4.0, 'RHOB': 2.0},
]

test('default log curve template name is a property', () => {
expect(new log_curve_template()).toHaveProperty("curve_name")
})


test('test define data function', () => {
expect(new log_curve_template().define_data(test_curve_data_1).data[0]['Depth']).toBeLessThan(0.5)
})

test('test define curve and data function', () => {
expect(new log_curve_template().set_curve_and_data(
'RHOB', test_curve_data_2).data[0]['Depth']).toBeGreaterThan(0.5)
})
Loading