{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"type":"markdown"},"seo":{"title":"Deviated Schematics Widget","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"deviated-schematics-widget","__idx":0},"children":["Deviated Schematics Widget"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This tutorial demonstrates how to use the Deviated Schematics Widget for data visualization. The Deviated Schematics Widget is derived from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["geotoolkit/widgets/AnnotatedWidget"]}," and uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["geotoolkit/schematics/data/WellBoreData"]}," as the data model. Familiarization with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/Schematics/Basics/basics"},"children":["SchematicsWidget - Basics"]}," tutorial in CarnacJS will be beneficial."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"widget-initialization","__idx":1},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/Schematics/DeviatedSchematicsWidget/deviatedSchematicsWidget#widgetInitialization"},"children":["#"]}," Widget Initialization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Widget initialization is similar to a vertical, non-deviated schematic widget. First, create a new instance of ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/doc/classes/geotoolkit.schematics.widgets.deviatedschematicswidget.deviatedschematicswidget.html"},"children":["geotoolkit/schematics/widgets/DeviatedSchematicWidget"]},". The only required parameter is the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," object. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," will contain the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["elements"]}," property that contains the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WellBoreData"]}," and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trajectory"]}," property that provides data on how the well deviates."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After creating the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeviatedSchematicWidget"]}," object, instantiate a new ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/doc/classes/geotoolkit.plot.plot.plot.html"},"children":["geotoolkit/plot/Plot"]}," instance and add the widget as a root."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"main","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"import { Axis } from \"@int/geotoolkit/axis/Axis.ts\";\nimport { NumberFormat } from \"@int/geotoolkit/util/NumberFormat.ts\";\nimport { from } from \"@int/geotoolkit/selection/from.ts\";\nimport { Plot } from \"@int/geotoolkit/plot/Plot.ts\";\nimport { WellBoreData } from \"@int/geotoolkit/schematics/data/WellBoreData.ts\";\nimport { CompositeSchematicsWidget } from \"@int/geotoolkit/schematics/widgets/CompositeSchematicsWidget.ts\";\nimport { DisplayMode } from \"@int/geotoolkit/schematics/scene/WellBoreWithLabels.ts\";\nimport { LocationType } from \"@int/geotoolkit/schematics/labeling/LocationType.ts\";\nimport { Trajectory2d } from \"@int/geotoolkit/deviation/Trajectory2d.ts\";\nimport data from \"/src/assets/data/wellBoreData.json?import\";\nfunction createScene(canvas) {\n  function createWellBoreData() {\n    return new WellBoreData(data);\n  }\n  const wellBoreData = createWellBoreData();\n  const geometryBounds = wellBoreData.getGeometryBounds();\n  const minDepth = geometryBounds.getTop();\n  const maxDepth = geometryBounds.getBottom();\n  const trajectory = new Trajectory2d({\n    \"data\": {\n      \"x\": [0, 0, 200],\n      \"y\": [0, 250, 500],\n      \"d\": [minDepth, (minDepth + maxDepth) / 2, maxDepth]\n    }\n  });\n  const options = {\n    \"north\": {\n      \"title\": {\n        \"text\": \"Deviated Schematics Widget\"\n      }\n    },\n    \"gap\": {\n      \"left\": {\n        \"size\": \"180px\",\n        \"resizable\": false\n      },\n      \"right\": {\n        \"size\": \"100px\",\n        \"resizable\": false\n      },\n      \"bottom\": {\n        \"size\": \"50px\",\n        \"resizable\": false\n      }\n    },\n    \"trajectory\": {\n      \"stations\": {\n        \"visible\": true\n      }\n    },\n    \"data\": {\n      \"elements\": wellBoreData,\n      \"trajectory\": trajectory\n    }\n  };\n  const widget = new CompositeSchematicsWidget(options);\n  widget.setDisplayMode(DisplayMode.Deviated);\n  widget.setProperties({\n    \"labeling\": {\n      \"defaultlocation\": LocationType.Auto\n    }\n  });\n  from(widget).where((child) => child instanceof Axis).selectToArray().forEach((axis) => {\n    axis.getTickGenerator().setLabelFormat(\"major\", new NumberFormat({ \"maximumfractiondigits\": 0 }));\n  });\n  return new Plot({\n    \"canvaselement\": canvas,\n    \"root\": widget\n  });\n}\nexport { createScene };\n\ncreateScene(document.querySelector('[ref=\"plot\"]'));\n\n","lang":"ts"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"css","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"css","header":{"controls":{"copy":{}}},"source":"\n.cg-tooltip-holder {\n  position: relative;\n}\n\n.cg-tooltip {\n  position: absolute;\n  display: block;\n  padding: 2px 12px 3px 7px;\n  overflow: visible !important;\n  font-family: Roboto, Helvetica, Arial, sans-serif;\n  font-size: 13px;\n  background: white !important;\n  opacity: 0.9;\n  color: #333333;\n  border: solid 1px gray;\n  border-radius: 5px;\n  text-align: left;\n  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\n  border-radius: 5px;\n  margin: 0 !important;\n  z-index: 10000;\n  max-width: 400px;\n  text-wrap: normal !important;\n  white-space: normal !important;\n}\n/* Default setting for tooltip */\n.cg-tooltip-container {\n  position: absolute;\n  display: block;\n  overflow: visible !important;\n  font-family: Roboto, Helvetica, Arial, sans-serif;\n  font-size: 12px;\n  padding: 3px 7px;\n  background: #f7f7f7;\n  color: #333333;\n  border: 1px solid #938e8e;\n  opacity: 0.8;\n  text-align: left;\n  box-shadow: 3px 3px 10px #888;\n  margin: 0 !important;\n  z-index: 10000;\n  max-width: 400px;\n  text-wrap: normal !important;\n  white-space: normal !important;\n  user-select: none;\n}\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n  .cg-tooltip-container {\n    border-radius: 0;\n  }\n}\n/* Default left arrow for tooltip */\n.cg-tooltip-arrow-left::before {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  left: 0;\n  top: 50%;\n  border: 5px solid transparent;\n  border-left: 0;\n  border-right: 5px solid  #938e8e;\n  transform: translate(calc(-100%), -50%);\n}\n.cg-tooltip-arrow-left::after {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  left: 0;\n  top: 50%;\n  border: 4px solid transparent;\n  border-left: 0;\n  border-right: 4px solid #f7f7f7;\n  transform: translate(calc(-100%), -50%);\n}\n/* Default top arrow for tooltip */\n.cg-tooltip-arrow-top::before {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  left: 50%;\n  top: 0;\n  border: 5px solid transparent;\n  border-top: 0;\n  border-bottom: 5px solid #938e8e;\n  transform: translate(-50%, -100%);\n}\n.cg-tooltip-arrow-top::after {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  left: 50%;\n  top: 0;\n  border: 4px solid transparent;\n  border-top: 0;\n  border-bottom: 4px solid #f7f7f7;\n  transform: translate(-50%, -100%);\n}\n/* Default right arrow for tooltip */\n.cg-tooltip-arrow-right::before {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  right: 0;\n  top: 50%;\n  border: 5px solid transparent;\n  border-right: 0;\n  border-left: 5px solid #938e8e;\n  transform: translate(100%, -50%);\n}\n.cg-tooltip-arrow-right::after {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  right: 0;\n  top: 50%;\n  border: 4px solid transparent;\n  border-right: 0;\n  border-left: 4px solid #f7f7f7;\n  transform: translate(100%, -50%);\n}\n/* Default bottom arrow for tooltip */\n.cg-tooltip-arrow-bottom::before {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  left: 50%;\n  bottom: 0px;\n  border: 5px solid transparent;\n  border-bottom: 0;\n  border-top: 5px solid #938e8e;\n  transform: translate(-50%, 100%);\n  z-index: 10000;\n}\n.cg-tooltip-arrow-bottom::after {\n  content: '';\n  position: absolute;\n  display: block;\n  width: 0px;\n  left: 50%;\n  bottom: 0;\n  border: 4px solid transparent;\n  border-bottom: 0;\n  border-top: 4px solid #f7f7f7;\n  transform: translate(-50%, 100%);\n  z-index: 10000;\n}\n/* Tooltip item name */\n/* Tooltip item value */\n/* .cg-tooltip-item-value */\n/* Tooltip item value */\n.cg-tooltip-item-unit {\n  text-transform: none;\n}\n\n.cg-tooltip-item-name {\n    text-transform: capitalize;\n    white-space: nowrap;\n    vertical-align: middle;\n    font-size: 13px;\n}\n.cg-tooltip-row {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  white-space: pre-wrap;\n  font-size: 12px;\n  line-height: 100%;\n  margin: 1px 0;\n}\n.cg-tooltip-title {\n  font-size: 13px;\n  height: 14px;\n  text-transform: capitalize;\n}\n.cg-tooltip-title .cg-tooltip-symbol {\n  margin-right: 0 !important;\n}\n.cg-tooltip-title-name {\n  vertical-align: middle;\n}\n.cg-tooltip-row + .cg-tooltip-row {\n  margin-top: 4px;\n}\n.cg-tooltip-row.cg-tooltip-title + .cg-tooltip-row {\n  margin-top: 5px;\n}\n.cg-tooltip-item-value + .cg-tooltip-item-unit {\n    margin-left: 1px;\n}\n/* Tooltip symbol */\n.cg-tooltip-symbol-cell {\n  display: inline-flex;\n  min-width: 13px; /* 10px size + 3px margin */\n}\n.cg-tooltip-symbol {\n  margin-right: 3px;\n  background-color: transparent;\n  display: block;\n}\n.cg-tooltip-symbol > img {\n  display: block;\n}\n.cg-tooltip-list-cell {\n  display: inline-flex;\n}\n.cg-tooltip-list-symbol {\n  display: block;\n  margin-right: 3px;\n  width: 6px;\n  height: 6px;\n  vertical-align: middle;\n  border-radius: 50%;\n  border: 1px solid rgba(0,0,0,.4);\n}\n.cg-tooltip-symbol-legacy {\n  border-radius: 4px;\n  margin-right: 5px;\n  height: 8px;\n  width: 8px;\n  display: inline-block;\n}\n.cg-tooltip-title-legacy {\n  font-weight: 900;\n}\n\n/* Tooltip symbol circle */\n.cg-tooltip-symbol.circle {\n  height: 10px;\n  width: 10px;\n  display: inline-block;\n  border-radius: 50%;\n  border: 1px solid rgba(0,0,0,.4);\n}\n/* Tooltip symbol line */\n.cg-tooltip-symbol.line {\n    height: 10px;\n    width: 10px;\n    display: inline-block;\n    transform: scale(1.2, 0.2);\n}\n/* Tooltip symbol diamond */\n.cg-tooltip-symbol.diamond {\n    height: 10px;\n    width: 10px;\n    display: inline-block;\n    transform: rotate(45deg);\n    border-radius: 0px;\n}\n/* Tooltip symbol square */\n.cg-tooltip-symbol.square {\n    height: 10px;\n    width: 10px;\n    display: inline-block;\n    border-radius: 0px;\n    border: 1px solid rgba(0,0,0,.4);\n}\n\n","lang":"css"},"children":[]}]}]},{"$$mdtype":"Tag","name":"iframe","attributes":{"src":"https://dc2-documentation.s3.amazonaws.com/documentation/slb-docs-test/5.0/examples/vue/tutorials/index.html#/Schematics/DeviatedSchematicsWidget/deviatedSchematicsWidget?section=widgetInitialization&extract=true","width":"100%","height":"1288.5px","style":{"border":"none"}},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-initialization","__idx":2},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/Schematics/DeviatedSchematicsWidget/deviatedSchematicsWidget#dataInitialization"},"children":["#"]}," Data Initialization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two objects are required to instantiate an instance of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeviatedSchematicsWidget"]},":"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["elements"]}," object, which is an object containing ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/doc/classes/geotoolkit.schematics.data.wellboredata.wellboredata.html"},"children":["WellBoreData"]}," to draw the well schematic. Here we will use data from a separate file, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wellboredata.json"]}," and create a new WellBoreData object."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trajectory"]}," object created by the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/doc/classes/geotoolkit.deviation.trajectory2d.trajectory2d.html"},"children":["Trajectory2d"]}," constructor."]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"changing-settings","__idx":3},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/Schematics/DeviatedSchematicsWidget/deviatedSchematicsWidget#changingSettings"},"children":["#"]}," Changing Settings"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Options can be provided to the widget either as a property in the initial constructor, or by using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setOptions()"]}," function after the widget object has been initialized. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#/doc/classes/geotoolkit.schematics.widgets.deviatedschematicswidget.deviatedschematicswidget.html"},"children":["DeviatedSchematicWidget"]}," for a full list of settings that can be changed."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[]}]},"headings":[{"value":"Deviated Schematics Widget","id":"deviated-schematics-widget","depth":1},{"value":"Widget Initialization","id":"widget-initialization","depth":3},{"value":"Data Initialization","id":"data-initialization","depth":3},{"value":"Changing Settings","id":"changing-settings","depth":3}],"frontmatter":{"title":"Deviated Schematics Widget","seo":{"title":"Deviated Schematics Widget"}},"lastModified":"2026-02-11T19:54:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/geotoolkit/tutorials/schematics/deviated-schematics-widget","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}