Accumulation Cycles

In this WellLog Accumulation Cycle tutorial, create accumulation cycles which represent erosion or sedimentation cycles. Each interval is an isosceles trapezoid or triangle with start and end depth and start and end width. Each interval has one fill style and line style. The accumulation cycle must be constructed with a datasource which provides start–end depth and start–end width. A header can display a text/title for the Accumulation Cycle widget.

# Create Accumulation Cycles

The following code shows how to create accumulation cycles. Depths of the two samples provide start and end depth, and values provide width of the sides. The NaN (not a number) value can specify a break.

import { Plot } from "@int/geotoolkit/plot/Plot.ts";
import { AccumulationCycleData } from "@int/geotoolkit/welllog/data/AccumulationCycleData.ts";
import { TrackType } from "@int/geotoolkit/welllog/TrackType.ts";
import { AccumulationCycle } from "@int/geotoolkit/welllog/AccumulationCycle.ts";
import { createWellLogWidget } from "/src/code/WellLog/utils/common.ts";
const INDEX_OFFSET = 50;
const DEPTHS = [4550, 4570, 4590, 4610, 4630, 4650, 4670, 4690, 4710, 4730, 4730, 4750, 4770, 4790];
const VALUES = [0, 1, 0, 0.5, 1, 0.5, 0, 1, 0, Number.NaN, 0, 1, 0, 1];
const COLORS = ["yellow", "blue", "yellow", "orange", "blue", "white", "yellow", "blue", null, null, "yellow", "blue", "orange"];
function createScene(canvas) {
  const widget = createWellLogWidget();
  widget.addTrack(TrackType.IndexTrack);
  const accumulationData = new AccumulationCycleData("Accumulations", DEPTHS, VALUES, COLORS);
  const accumulationCycle = new AccumulationCycle(accumulationData);
  widget.addTrack(TrackType.LinearTrack).addChild([
    accumulationCycle
  ]);
  const accumulationBounds = accumulationCycle.getBounds();
  widget.setDepthLimits(accumulationBounds.getTop() - INDEX_OFFSET, accumulationBounds.getBottom() + INDEX_OFFSET);
  return new Plot({
    "canvaselement": canvas,
    "root": widget
  });
}
export { createScene };

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