Published
Edited
Feb 20, 2022
2 stars
Insert cell
Insert cell
Insert cell
html `<div id="well_holder" style="width:600px;height:650px;outline:1px solid blue;"></>`
Insert cell
Insert cell
plot1 = CurveBox(well_curve_config_template,curve_stroke_d3)
Insert cell
viewof short_or_long_time_plotted = select({
title: "Select how the 1D GDE (gross depositional environment) moves relative to the well location over time. This also impacts the amount of time modeled.",
description: "",
options: ["shortSortaRandom","mediumSortaRandom","longSortaRandom","rhythmicSimpleShort","rhythmicSimpleMedium","rhythmicshort","rhythmicmedium"],
value: "short"
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vegalite({
"width": screen.width-screen.width*.450,
"height": 120,
data: {values: new_log2},
title:"new_log2 - How GDE map moved over time in dip direction relative to fixed well locatin. ",
mark: "line",
encoding: {
y: {field: "Location", type: "quantitative", axis: {}},
x: {field: "depth", type: "ordinal"
},"color": {"value": "brown"}
},
})
Insert cell
Insert cell
Insert cell
Insert cell
// vegalite({
// "width": screen.width-screen.width*.450,
// "height": 120,
// data: {values: new_log2},
// title:"new_log2 - Reflection Coefficient on point by point basis...needs more work",
// mark: "line",
// encoding: {
// y: {field: "reflectionCoEf", type: "quantitative", axis: {}},
// x: {field: "depth", type: "ordinal"
// },"color": {"value": "orange"}
// }
// })

Insert cell
// vegalite({
// "width": screen.width-screen.width*.450,
// "height": 120,
// data: {values: array_facies_on_gde_original},
// title:"new_log2 - Original Facies Distribution on 1D Gross Depositional Map",
// mark: "point",
// encoding: {
// x: {field: "PositionOnGDEarray", type: "quantitative"},
// y: {field: "Facies","type": "ordinal", "sort": ["coastal_plain", "shoreface", "shelf","deepwater"]},
// color: {field: "Facies", "type": "nominal"},
// },
// },
// )
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
names_depositional_env = [{"0":"deepwater","1":"shelf","2":"shoreface","3":"coastal_plain"}]
Insert cell
Insert cell
facies_array_original = [[3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/// The position of the well in the GDE array of arrays. Over time steps, the map moves relative to the well.
starting_position_in_2D_grid = [1,starting_x_position]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
different_length_movements = [{
"shortSortaRandom":[1,5,4,10,10,-2,-7,-6,2,2,15,-6,-3,-2,5,0,-7,-9,-9,-6,-2,9,7,0,0,0,1,-8,-5,-1,1,-1,10,10,-4,5,-1,1,1,0,0,5,0,0,0,0,10,-2],
"mediumSortaRandom":[1,5,4,10,10,-2,-7,-6,2,2,15,-6,-3,-2,5,0,-7,-9,-9,-6,-2,9,7,0,0,0,1,-8,-5,-1,1,-1,10,10,-4,5,-1,1,1,0,0,5,0,0,0,0,10,-2,-2,0,0,4,5,6,-8,1,5,4,10,10,-2,-7,-6,2,2,15,-6,-3,-2,5,0,-7,-9,-9,-6,10,10,-2,-7,-6,2,2,15,-6,-3,-2,5,0,-7,-9,-9,10,1,5,4,10,10,-2,-7,-6,2,2,15,-6,-3,-2,5,0,-7,-9,-9,-6,-2,9,7,0,0,0,1,-8,-5,-1,1,-1,10,10,-4,5,-1,1,1,0,0,5,0,0,0,0,10,-2,-2,0,0,4,5,6,-8,1,5,4,10,10,-2,-7,-6,2,2,15,-6,-3,-2,5,0,-7,-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-1,-1,-1,-1,-1,-1,-1],
"rhythmicshort":[0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0],
"rhythmicmedium":[0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0,1,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0]

}]
Insert cell
Insert cell
function switchOutDifferentLengthsOfTimeAndMovement(short_or_long_time_plotted){
let keys = Object.keys(different_length_movements[0])
for (let i = 0; i<keys.length; i++){
if(short_or_long_time_plotted==keys[i]){return different_length_movements[0][keys[i]]}
}
}
Insert cell
Insert cell
Insert cell
Insert cell
log_shapes = [{"up_coarsen":[2,2,3,3,4,5,6,7,8,8],"up_fine":[7,8,7,6,5,4,3,2,1,1],"blocky":[5,7,9,10,10,10,10,10,10,10],"serrated_sand":[1,6,2,8,4,9,9,1,2,4],"serrated_shale":[1,4,1,3,1,1,3,1,5,1],"shale":[0,1,1,1,1,1,1,1,1,0]}]
Insert cell
Insert cell
probability_dep_or_eros_per_faces = [{"0":{"erosion":0.0,"deposition":0.9,"nondeposition":0.1},"1":{"erosion":0.1,"deposition":0.8,"nondeposition":0.1},"2":{"erosion":0.3,"deposition":0.5,"nondeposition":0.2},"3":{"erosion":0.5,"deposition":0.2,"nondeposition":0.3}}]
Insert cell
Insert cell
function randomHit(modifier) {
return Math.random() < modifier;
}
Insert cell
function createLog(probability_dep_or_eros_per_faces,facies_array,fraction_log_shapes_within_depositional_env,names_depositional_env,starting_position_in_2D_grid, x_movement_of_GDE_over_time){
//let position_x
let position_x = starting_position_in_2D_grid[1]
let last_position_x = starting_position_in_2D_grid[1]
let log = []
let positions = []
let facies_at_time = []
//let position_x = starting_position_in_2D_grid[1]
for (let i = 0; i < x_movement_of_GDE_over_time.length; i++){
//// Get position given last or starting position,
/// apply in turn each movement in x_movement_of_GDE_over_time and get new position
let facies_at_position = 0
///
position_x = position_x+x_movement_of_GDE_over_time[i]
let max_facies_array_position = facies_array[1].length
if (position_x >= max_facies_array_position){
position_x = max_facies_array_position-1
}
////
facies_at_position = facies_array[starting_position_in_2D_grid[0]][position_x]
////
let log_shape_key = fraction_log_shapes_within_depositional_env[0][String(facies_at_position)]
let random01 = Math.random()
let logShape
let log_shape_key_keysArray = Object.keys(log_shape_key)
for (let i = 0; i < log_shape_key_keysArray.length; i++){
if(random01 < log_shape_key[log_shape_key_keysArray[i]]){
logShape = log_shape_key_keysArray[i]
}
}
let log_shape_array = log_shapes[0][logShape]
log.push(log_shape_array);
positions.push(position_x)
facies_at_time.push(names_depositional_env[0][facies_at_position])
}
let final_log = log.flat().reverse()
let final_positions = positions.reverse()
let final_facies_at_time = facies_at_time.reverse()
let final_x_movement_of_GDE_over_time =x_movement_of_GDE_over_time.reverse()
return [final_log,positions,facies_at_time,x_movement_of_GDE_over_time]
}
Insert cell
log1_and_position = createLog(probability_dep_or_eros_per_faces,facies_array,fraction_log_shapes_within_depositional_env,names_depositional_env,starting_position_in_2D_grid, x_movement_of_GDE_over_time)
Insert cell
log1 = log1_and_position[0]
Insert cell
positions = log1_and_position[1]
Insert cell
facies_at_time = log1_and_position[2]
Insert cell
function addDepthToLogArray (log,positions,facies_at_time,x_movement_of_GDE_over_time){
////
x_movement_of_GDE_over_time = x_movement_of_GDE_over_time.reverse()
positions = positions.reverse()
////
let new_log = []
let facies_at_time_counter = 0
let facies_position = 0
let movement_position = 0
let movement = 0
let last_facies_position = facies_at_time[0]
let last_movement_position = positions[0]
let last_movement = x_movement_of_GDE_over_time[0]
///// reflection coefficient calculation from bottom of notebook
let log_rfe = find_reflectionCoEfficient_forEachItemInArray(log)
/////
for (let m = 0; m < log.length; m++){
let new_log_obj = {"depth": "0", "curveGR": "0", "curveName":"fakeSand","Facies":0,"Location":0,"Movement":0, "UWI": "fake"}
new_log_obj["depth"] = m
new_log_obj["curveGR"] = log[m]
new_log_obj["reflectionCoEf"] = log_rfe[m]
if(facies_at_time_counter == 10){
////
facies_position=facies_position+1
movement_position=movement_position+1
movement=movement+1
////
new_log_obj["Facies"]= facies_at_time[m/10]
new_log_obj["Location"]= positions[m/10]
new_log_obj["Movement"]= x_movement_of_GDE_over_time[m/10]
/////
last_facies_position = facies_position
last_movement_position = movement_position
last_movement = movement
///
facies_at_time_counter = 0
}
else if(m<=10){
new_log_obj["Facies"]= facies_at_time[0]
new_log_obj["Location"]= positions[0]
new_log_obj["Movement"]= 0
}
else{
new_log_obj["Facies"]= facies_at_time[last_facies_position]
new_log_obj["Location"]= positions[last_movement_position]
new_log_obj["Movement"]= 0
}
new_log.push(new_log_obj)
facies_at_time_counter += 1
}
return new_log
}
Insert cell
new_log2 = addDepthToLogArray(log1,positions,facies_at_time,x_movement_of_GDE_over_time)
Insert cell
new_log2[1]
Insert cell
new_log2[476]
Insert cell
function replaceNumbersWithFacies(facies_array,names_depositional_env){
let new_facies_array_with_words = []
for (let i = 0; i < facies_array.length; i++){
new_facies_array_with_words[i]= []
for (let j = 0; j < facies_array[i].length; j++){
new_facies_array_with_words[i].push(names_depositional_env[0][facies_array[i][j]])
}
}
return new_facies_array_with_words
}
Insert cell
function turnFaciesArraysToObj(facies_array,GDE_y_value){
let array_facies_on_gde_original = []
for (let m = 0; m < facies_array[GDE_y_value].length; m++){
let template = {"PositionOnGDEarray":0,"Facies":0}
let facies = facies_array[GDE_y_value][m]
template["PositionOnGDEarray"]=m
template["Facies"]=names_depositional_env[0][facies]
template["starting_x_position"] = starting_x_position
array_facies_on_gde_original.push(template)
}

return array_facies_on_gde_original
}
Insert cell
array_facies_on_gde_original = turnFaciesArraysToObj(facies_array,1)
Insert cell
facies_array_1 = replaceNumbersWithFacies(facies_array,names_depositional_env)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function find_reflectionCoEfficient_forEachItemInArray(gr_array){
let sand = [8,9,10]
let silt = [4,5,6,7]
let shale = [0,1,2,3]
let gr_to_facies = {1:"shale",2:"shale",3:"shale",4:"shale",5:"siltySand",6:"siltySand",7:"sand",8:"sand",9:"sand",10:"sand"}
// let {"shale":"","siltySand":"p_siltySan","sand":""}
let reflectionCoEfficient_array = []
let p_array = []
let v_array = []
for (let m = 0; m < gr_array.length; m++){
if(gr_array[m]<=shale[shale.length-1]){
p_array.push(p_shale_sat);
v_array.push(V_shale_sat)}
else if(silt[0]< gr_array[m]<=silt[silt.length-1]){
p_array.push(p_silt_sat);
v_array.push(V_silt_sat);
}
else if(sand[0]< gr_array[m]<=sand[sand.length-1]){
p_array.push(p_sand_sat);
v_array.push(V_sandstone_sat);
}
else{p_array.push(0); v_array.push(0);}
}
let rce
for (let n = 0; n < gr_array.length; n++){
if(n==0){
reflectionCoEfficient_array.push(0)
}
else{
rce = reflectionCoEfficient(p_array[n-1],p_array[n],v_array[n-1],v_array[n])
reflectionCoEfficient_array.push(rce)
}
}
return reflectionCoEfficient_array
}
Insert cell
test_gr = [1,1,1,6,6,6,6,7,8,9,1,9,9,1,4,5,6,1,5,5,5]
Insert cell
md `not sure this looks right?`
Insert cell
find_reflectionCoEfficient_forEachItemInArray(test_gr)
Insert cell
find_reflectionCoEfficient_forEachItemInArray(log1)
Insert cell
new_log2
Insert cell
Insert cell
Insert cell
curve_stroke_d3 =1.6
Insert cell
CurveBox = wellioviz.curveBox
Insert cell
// function CurveBox(well_curve_config_template,curve_stroke_d3){
// //// Getting the variables out of the input json template
// well_curve_config_template = well_curve_config_template[0]
// let multipleLines = well_curve_config_template["multipleLines"]
// let curveNames = well_curve_config_template["curveNames"]
// let curveColors = well_curve_config_template["curveColors"]
// let curveName = curveNames[0]
// let curveColor = curveColors[0]
// ////
// let data = well_curve_config_template["data"]
// let width = well_curve_config_template["width"]
// let height = well_curve_config_template["height"]
// let margin = well_curve_config_template["margin"]
// let depth_curve_name = well_curve_config_template["depth_curve_name"]
// //// Calculate depth min and max
// let depth_min
// if(!depth_min){depth_min = d3.min(data, function(d) { return +d[depth_curve_name];});}
// let depth_max
// if(!depth_max){depth_max = d3.max(data, function(d) { return +d[depth_curve_name];});}
// // Calculate x domain extent for one or more than one curve
// let mins = []
// let maxes = []
// for (let i = 0; i < curveNames.length; i++) {
// let min_this = d3.min(data, function(d) { return +d[curveNames[i]]})
// let max_this = d3.max(data, function(d) { return +d[curveNames[i]]})
// mins.push(min_this)
// maxes.push(max_this)
// }
// let min_all_curves = d3.min(mins)
// let max_all_curves = d3.max(maxes)
// //// Calculate Axis & Scales
// let x = d3.scaleLinear().domain([min_all_curves,max_all_curves]).nice().range([margin.left, width - margin.right])
// let y = d3.scaleLinear().domain([depth_max, depth_min]).nice().range([height - margin.bottom, margin.top])
// let xAxis = g => g.attr("transform", `translate(0,${height - margin.bottom})`).call(d3.axisBottom(x).ticks(width / 80).tickSizeOuter(0))
// let yAxis = g => g.attr("transform", `translate(${margin.left},0)`).call(d3.axisLeft(y)).call(g => g.select(".domain").remove())
// /////// All variables created above now they are applied below
// /////// , some in for loops for multiple curves and areas
// /////// attempt at function for color used in .....
// function colors(data_array){
// let color_array = []
// for (let i =0;i<data_array.length;i++){
// if (data[i][curveName] > 0){
// color_array.push =("blue")
// }
// else {
// color_array.push("green")
// }
// }
// return color_array
// }
// //// START to make the firt SVG
// const svg = d3.create("svg")
// svg.attr("width",width)
// .attr("height",height);
// svg.append("g")
// .call(xAxis);
// svg.append("g")
// .call(yAxis);
// /////// throw away code for single curve to plot that will be deleted soon
// ///// was here:
// //// Code that assumes multiple curves are plotted in same curvebox
// if(multipleLines == "yes"){
// for (let k = 0; k < curveNames.length; k++) {
// ///// code that creates a line for each Curve in order provided and applies
// ///// the color in the color array in order provided
// let another_line = d3.line().x(d => x(d[curveNames[k]])).y(d => y(d[depth_curve_name]));
// svg.append("path")
// .datum(data)
// .attr("fill", "none")
// .attr("stroke", curveColors[k])
// .attr("stroke-width", curve_stroke_d3)
// .attr("stroke-linejoin", "round")
// .attr("stroke-linecap", "round")
// .attr("d", another_line);
// }
// // define the area filled under the curve
// let two_curve_fill_flag = "no"
// for (let i = 0; i < well_curve_config_template["fill"].length; i++) {
// ////
// if (well_curve_config_template["fill"][i]["fill"] == "yes"){
// let number_colors = well_curve_config_template["fill"][i]["fillColors"].length
// let curveName1 = well_curve_config_template["fill"][i]["curveName"]
// let threshold = -99999999
// let fillColor = "gray"
// console.log("got inside fill,",curveName1,'number_colors',number_colors)
// //////
// for (let j = 0; j < number_colors; j++) {
// console.log("got to start of J loop",j)
// let area1 = d3.area()
// if (number_colors != 0){
// threshold = well_curve_config_template["fill"][i]["cutoffs"][j]
// fillColor = well_curve_config_template["fill"][i]["fillColors"][j]
// }
// if(well_curve_config_template["fill"][i]["fillDirection"] == "left"){
// let startFromLeft = well_curve_config_template["margin"]["left"]
// area1
// .x1(d => x(d[curveName1]))
// .x0(d => startFromLeft)
// .defined(d => ((d[curveName1])>threshold))
// .y(d => y(d[depth_curve_name]));
// }
// if(well_curve_config_template["fill"][i]["fillDirection"] == "right"){
// let startFromRight = well_curve_config_template["margin"]["right"]
// area1
// .x0(d => x(d[curveName1]))
// .x1(d => startFromRight)
// .defined(d => ((d[curveName1])<threshold))
// .y(d => y(d[depth_curve_name]));
// }
// if(well_curve_config_template["fill"][i]["fillDirection"] == "between"){
// let between2Curve = well_curve_config_template["fill"][i]["curve2"]
// area1
// .x1(d => x(d[curveName1]))
// .x0(d => x(d[between2Curve]))
// .defined(d => ((d[curveName1])>threshold))
// .y(d => y(d[depth_curve_name]));
// }
// svg.append("path")
// .datum(data)
// .attr("class", "area")
// .attr("d", area1)
// .attr("stroke", fillColor)
// .attr("fill",fillColor)
// .attr("fill-opacity",0.8);
// /////
// console.log("got to end of J loop",j)
// }
// }
// }
// }
// return svg.node();
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// import {select} from "@jashkenas/inputs"
Insert cell
function select(config = {}) {
let {
value: formValue,
title,
description,
disabled,
submit,
multiple,
size,
options
} = Array.isArray(config) ? { options: config } : config;
options = options.map(o =>
typeof o === "object" ? o : { value: o, label: o }
);
const form = input({
type: "select",
title,
description,
submit,
attributes: { disabled },
getValue: input => {
const selected = Array.prototype.filter
.call(input.options, i => i.selected)
.map(i => i.value);
return multiple ? selected : selected[0];
},
form: html`
<form>
<select name="input" ${
multiple ? `multiple size="${size || options.length}"` : ""
}>
${options.map(({ value, label,disabled }) =>
Object.assign(html`<option>`, {
value,
selected: Array.isArray(formValue)
? formValue.includes(value)
: formValue === value,
disabled : disabled ? disabled : false,
textContent: label
})
)}
</select>
</form>
`
});
form.output.remove();
return form;
}
Insert cell
import {multipleLogPlot} from "@justingosses/well-log-in-d3-js-v5"
Insert cell
// wellioviz = require('https://bundle.run/wellioviz@0.0.11')
Insert cell
wellioviz = require('https://bundle.run/wellioviz@0.0.32')
Insert cell
wellioviz.define_wellioviz()
Insert cell
wellioviz.help()
Insert cell
Insert cell
example_template = wellioviz.curveBoxTemplateExamples("example")
Insert cell
example_template[0]["components"][0]["rectangles"][0] = []
Insert cell
example_template[0]["curve_box"]["height_multiplier_components"] = 1
Insert cell
example_template
Insert cell
well_curve_config_template_old = [
{"multipleLines":"yes","curveNames":["curveGR"],
"curveColors":["black"],
"fill":[
{"curveName":"curveGR","fill":"yes","fillDirection":"left","cutoffs":[0,4,6],"fillColors":["gray","orange","yellow"],"curve2":""},
{"curveName":"RESD","fill":"no","fillDirection":"left","cutoffs":[],"fillColors":[],"curve2":""}
],
"data":new_log2,
"width":200,
"height":600,
"margin":({top: 20, right: 3, bottom: 30, left: 30}),
"depth_curve_name":"depth"}]
Insert cell
well_curve_config_template_location_old = [
{"multipleLines":"yes","curveNames":["Location"],
"curveColors":["black"],
"fill":[
{"curveName":"curveGR","fill":"yes","fillDirection":"left","cutoffs":[0,4,6],"fillColors":["gray","orange","yellow"],"curve2":""},
{"curveName":"RESD","fill":"no","fillDirection":"left","cutoffs":[],"fillColors":[],"curve2":""}
],
"data":new_log2,
"width":200,
"height":600,
"margin":({top: 20, right: 3, bottom: 30, left: 30}),
"depth_curve_name":"depth"}]
Insert cell
well_curve_config_template_Movement_old = [
{"multipleLines":"yes","curveNames":["Movement"],
"curveColors":["black"],
"fill":[
{"curveName":"curveGR","fill":"no","fillDirection":"left","cutoffs":[0,4,6],"fillColors":["gray","orange","yellow"],"curve2":""},
{"curveName":"RESD","fill":"no","fillDirection":"left","cutoffs":[],"fillColors":[],"curve2":""}
],
"data":new_log2,
"width":200,
"height":600,
"margin":({top: 20, right: 3, bottom: 30, left: 30}),
"depth_curve_name":"depth"}]
Insert cell
well_curve_config_template = wellioviz.minimumDataIntoTemplateFunc(example_template,new_log2,["made up well"],["curveGR"],["black"],[""],[[
{"curve_name":"curveGR","fill":"yes","fill_direction":"left","cutoffs":[0,4,6],"fill_colors":["gray","orange","yellow"],"curve2":""}]],"well_holder",200,600,"depth")
Insert cell
well_curve_config_template_location = wellioviz.minimumDataIntoTemplateFunc(example_template,new_log2,["made up well"],["Location"],["black"],[""],[[
{"curve_name":"Location","fill":"no","fill_direction":"left","cutoffs":[0,4,6],"fill_colors":["gray","orange","yellow"],"curve2":""}]],"well_holder",200,600,"depth")
Insert cell
well_curve_config_template_Movement = wellioviz.minimumDataIntoTemplateFunc(example_template,new_log2,["made up well"],["Movement"],["black"],[""],[[
{"curve_name":"Location","fill":"no","fill_direction":"left","cutoffs":[],"fill_colors":[],"curve2":""}]],"well_holder",200,600,"depth")
Insert cell
result = wellioviz.multipleLogPlot("well_holder",[well_curve_config_template,well_curve_config_template_location,well_curve_config_template_Movement])
Insert cell
// result_old = multipleLogPlot("well_holder",[well_curve_config_template,well_curve_config_template_location,well_curve_config_template_Movement])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more