The tutorial shows how to display multi strings in SchematicsJS. All SchematicsJS built-in components (based on either RegularComponentNode class or on FlippedComponentNode class) handle offset properties that lets user display multi strings.
# Multi Strings Schematics
The following is an example of a multi-string schematic.
import { ViewMode, WellBoreNode } from "@int/geotoolkit/schematics/scene/WellBoreNode.ts";
import { Plot } from "@int/geotoolkit/plot/Plot.ts";
import { Rect } from "@int/geotoolkit/util/Rect.ts";
import { createWellBoreData } from "/src/code/Schematics/MultiStrings/wellBoreMultiString.ts";
const createScene = (canvas) => {
const wellBoreData = createWellBoreData();
const wellBoreNode = new WellBoreNode({
"data": wellBoreData,
"viewmode": ViewMode.Compressed
});
const plot = new Plot({
"canvaselement": canvas,
"autorootbounds": false
});
const w = plot.getWidth();
const h = plot.getHeight();
const dw = w / 10;
const bounds = new Rect(dw, 0, w - dw, h);
wellBoreNode.setBounds(bounds);
plot.setRoot(wellBoreNode);
return plot;
};
export { createScene };
createScene(document.querySelector('[ref="plot"]'));