Reference Line

LogReferenceLine is a simple shape usually used to specify one of the fill borders.

# Reference Line Shape

By default ReferenceLine is using Track model space (from 0 to 1), however you can use LogCurve as a reference, and use value from LogCurve model space.

import { Plot } from "@int/geotoolkit/plot/Plot.ts";
import { Point } from "@int/geotoolkit/util/Point.ts";
import { LinearGradientStyle } from "@int/geotoolkit/attributes/LinearGradientStyle.ts";
import { LogFill } from "@int/geotoolkit/welllog/LogFill.ts";
import { TrackType } from "@int/geotoolkit/welllog/TrackType.ts";
import { HeaderType } from "@int/geotoolkit/welllog/header/LogAxisVisualHeader.ts";
import { LogReferenceLine, ReferenceType } from "@int/geotoolkit/welllog/LogReferenceLine.ts";
import { CompositeLogCurve } from "@int/geotoolkit/welllog/CompositeLogCurve.ts";
import { createWellLogWidget } from "/src/code/WellLog/utils/common.ts";
import { data } from "/src/code/WellLog/Visuals/ReferenceLine/data.ts";
function createScene(canvas) {
  const widget = createWellLogWidget().setAxisHeaderType(HeaderType.Simple).setDepthLimits(100, 400);
  widget.addTrack(TrackType.IndexTrack);
  widget.addTrack(TrackType.LinearTrack).addChild([
    new LogReferenceLine({
      "value": 0.25,
      "linestyle": "2px solid orange"
    }),
    new LogReferenceLine({
      "value": 0.5,
      "linestyle": "2px dash green"
    }),
    new LogReferenceLine({
      "value": 0.75,
      "linestyle": "2px [4, 6] blue"
    })
  ].reverse());
  widget.addTrack(TrackType.IndexTrack);
  let leftReferenceLine = null;
  let rightReferenceLine = null;
  let logFill = null;
  widget.addTrack(TrackType.LinearTrack).addChild([
    leftReferenceLine = new LogReferenceLine({
      "value": 0.25,
      "linestyle": "2px dash black"
    }),
    rightReferenceLine = new LogReferenceLine({
      "value": 0.75,
      "linestyle": "2px dash black"
    }),
    logFill = new LogFill({
      "curve2": leftReferenceLine,
      "curve1": rightReferenceLine,
      "fillstyle": new LinearGradientStyle({
        "startcolor": "#ffe0b2",
        "endcolor": "#ff7043",
        "startpoint": new Point(0.75, 0),
        "endpoint": new Point(0, 0.1)
      })
    })
  ].reverse());
  widget.getHeaderContainer().getHeaderProvider().getHeader(logFill).setVisible(false);
  widget.addTrack(TrackType.IndexTrack);
  let leftCurve;
  let rightCurve;
  widget.addTrack(TrackType.LinearTrack).addChild([
    leftCurve = new CompositeLogCurve({
      "name": "Left fill",
      "data": data[0],
      "linestyle": "#ef6c00"
    }).setLeftReferencePointSet({
      "value": 60,
      "type": ReferenceType.Curve,
      "linestyle": "2px dash black"
    }).setRightReferencePointSet({
      "value": 60,
      "type": ReferenceType.Curve,
      "linestyle": "2px dash black"
    }).setMicroPosition(0, 0.5),
    leftCurve.getLeftReferencePointSet(),
    rightCurve = new CompositeLogCurve({
      "name": "Rigth fill",
      "data": data[1],
      "linestyle": "#ef6c00"
    }).setLeftReferencePointSet({
      "value": 60,
      "type": ReferenceType.Curve,
      "linestyle": "2px dash black"
    }).setRightReferencePointSet({
      "value": 60,
      "type": ReferenceType.Curve,
      "linestyle": "2px dash black"
    }).setMicroPosition(0.5, 1),
    rightCurve.getLeftReferencePointSet()
  ].reverse());
  widget.addTrack(TrackType.IndexTrack);
  const plot = new Plot({
    "canvaselement": canvas,
    "root": widget
  });
  widget.setHeaderHeight("auto");
  return plot;
}
export { createScene };

createScene(document.querySelector('[ref="plot"]'));