@webviz/well-completions-plot 0.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/WellCompletionsPlot.css +6 -0
  2. package/dist/WellCompletionsPlot.d.ts +9 -0
  3. package/dist/WellCompletionsPlot.js +28 -0
  4. package/dist/WellCompletionsPlot.js.map +1 -0
  5. package/dist/components/CompletionsPlot.d.ts +11 -0
  6. package/dist/components/CompletionsPlot.js +65 -0
  7. package/dist/components/CompletionsPlot.js.map +1 -0
  8. package/dist/components/StratigraphyPlot.d.ts +10 -0
  9. package/dist/components/StratigraphyPlot.js +14 -0
  10. package/dist/components/StratigraphyPlot.js.map +1 -0
  11. package/dist/components/TooltipProvider.d.ts +17 -0
  12. package/dist/components/TooltipProvider.js +33 -0
  13. package/dist/components/TooltipProvider.js.map +1 -0
  14. package/dist/components/WellsPlot.d.ts +12 -0
  15. package/dist/components/WellsPlot.js +43 -0
  16. package/dist/components/WellsPlot.js.map +1 -0
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.js +3 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/types/dataTypes.d.ts +66 -0
  21. package/dist/types/dataTypes.js +46 -0
  22. package/dist/types/dataTypes.js.map +1 -0
  23. package/dist/types/layoutTypes.d.ts +16 -0
  24. package/dist/types/layoutTypes.js +2 -0
  25. package/dist/types/layoutTypes.js.map +1 -0
  26. package/dist/utils/layoutUtils.d.ts +2 -0
  27. package/dist/utils/layoutUtils.js +22 -0
  28. package/dist/utils/layoutUtils.js.map +1 -0
  29. package/dist/utils/stringUtil.d.ts +5 -0
  30. package/dist/utils/stringUtil.js +8 -0
  31. package/dist/utils/stringUtil.js.map +1 -0
  32. package/dist/utils/stringUtil.test.d.ts +1 -0
  33. package/dist/utils/stringUtil.test.js +13 -0
  34. package/dist/utils/stringUtil.test.js.map +1 -0
  35. package/package.json +29 -0
@@ -0,0 +1,6 @@
1
+ .WellCompletionsPlot {
2
+ display: flex;
3
+ flex: 1;
4
+ height: 80%;
5
+ padding: 8px;
6
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { PlotData } from "./types/dataTypes";
3
+ import "./WellCompletionsPlot.css";
4
+ export interface WellCompletionsPlotProps {
5
+ id: string;
6
+ timeSteps: string[];
7
+ plotData: PlotData;
8
+ }
9
+ export declare const WellCompletionsPlot: React.FC<WellCompletionsPlotProps>;
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import { useResizeDetector } from "react-resize-detector";
3
+ import { TooltipProvider } from "./components/TooltipProvider";
4
+ import { CompletionsPlot } from "./components/CompletionsPlot";
5
+ import { createLayout } from "./utils/layoutUtils";
6
+ import { StratigraphyPlot } from "./components/StratigraphyPlot";
7
+ import { WellsPlot } from "./components/WellsPlot";
8
+ import "./WellCompletionsPlot.css";
9
+ const padding = { left: 80, right: 50, top: 70, bottom: 50 };
10
+ /* eslint-disable react/display-name */
11
+ /* eslint-disable react/prop-types */
12
+ export const WellCompletionsPlot = React.memo((props) => {
13
+ const { width, height, ref } = useResizeDetector({
14
+ refreshMode: "debounce",
15
+ refreshRate: 50,
16
+ refreshOptions: { trailing: true },
17
+ });
18
+ const layout = width !== undefined && height !== undefined
19
+ ? createLayout(width, height, padding)
20
+ : undefined;
21
+ return (React.createElement(TooltipProvider, null,
22
+ React.createElement("div", { ref: ref, id: props.id, className: "WellCompletionsPlot", "data-tip": true, "data-for": "plot-tooltip" }, layout && props.plotData && (React.createElement("svg", { id: `${props.id}-svg-context`, width: width, height: height, style: { position: "relative" } },
23
+ React.createElement(StratigraphyPlot, { data: props.plotData.stratigraphy, layout: layout, padding: padding }),
24
+ React.createElement(WellsPlot, { timeSteps: props.timeSteps, plotData: props.plotData, layout: layout, padding: padding }),
25
+ props.plotData && (React.createElement(CompletionsPlot, { plotData: props.plotData, layout: layout, padding: padding })))))));
26
+ });
27
+ WellCompletionsPlot.displayName = "WellCompletionsPlot";
28
+ //# sourceM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CAEvB,cAAc,IAEtB,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,CACzB,6BACI,EAAE,EAAE,GAAG,KAAK,CAAC,EAAE,cAAc,EAC7B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;YAE/B,oBAAC,gBAAgB,IACb,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,EACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAClB;YACF,oBAAC,SAAS,IACN,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAClB;YACD,KAAK,CAAC,QAAQ,IAAI,CACf,oBAAC,eAAe,IACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GAClB,CACL,CACC,CACT,CACC,CACQ,CACrB,CAAC;AACN,CAAC,CAAC,CAAC;AAEP,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,11 @@
1
+
2
+ import React from "react";
3
+ import { PlotData } from "../types/dataTypes";
4
+ import { Padding, PlotLayout } from "../types/layoutTypes";
5
+ interface CompletionsPlotProps {
6
+ plotData: PlotData;
7
+ layout: PlotLayout;
8
+ padding: Padding;
9
+ }
10
+ export declare const CompletionsPlot: React.FC<CompletionsPlotProps>;
11
+ export {};
@@ -0,0 +1,65 @@
1
+ /* eslint-disable react-hooks/exhaustive-deps */ // remove when ready to fix these.
2
+ import React from "react";
3
+ import { useTooltip } from "./TooltipProvider";
4
+ const CompletionTooltipContent = (props) => {
5
+ return (React.createElement("table", { style: { color: "#fff" } },
6
+ React.createElement("tbody", null, [
7
+ ["Well name", props.wellName],
8
+ ["Stratigraphy", props.zoneName],
9
+ ["Open", props.completionData.open],
10
+ ["Shut", props.completionData.shut],
11
+ [
12
+ "Kh Mean",
13
+ `${props.completionData.khMean.toFixed(props.decimalPlaces)}${props.khUnit}`,
14
+ ],
15
+ [
16
+ "Kh Min",
17
+ `${props.completionData.khMin.toFixed(props.decimalPlaces)}${props.khUnit}`,
18
+ ],
19
+ [
20
+ "Kh Max",
21
+ `${props.completionData.khMax.toFixed(props.decimalPlaces)}${props.khUnit}`,
22
+ ],
23
+ ].map(([key, value]) => (React.createElement("tr", { key: `tooltip-${key}-${value}` },
24
+ React.createElement("td", null,
25
+ React.createElement("b", null, key)),
26
+ React.createElement("td", null, value)))))));
27
+ };
28
+ CompletionTooltipContent.displayName = "CompletionTooltipContent";
29
+ /* eslint-disable react/prop-types */
30
+ export const CompletionsPlot = (props) => {
31
+ const { setContent } = useTooltip();
32
+ const decimalPlaces = props.plotData.units.kh.decimalPlaces;
33
+ const khUnit = props.plotData.units.kh.unit.length > 0
34
+ ? ` ${props.plotData.units.kh.unit}`
35
+ : "";
36
+ const wellWidth = props.layout.xExtent / Math.max(props.plotData.wells.length, 1);
37
+ const barHeight = props.layout.yExtent / Math.max(props.plotData.stratigraphy.length, 1);
38
+ const onMouseMove = React.useCallback(function onMouseOver(e, well, completion) {
39
+ const zoneName = props.plotData.stratigraphy[Math.floor((e.nativeEvent.offsetY - props.padding.top) / barHeight)].name;
40
+ setContent(() => (React.createElement(CompletionTooltipContent, { zoneName: zoneName, wellName: well.name, completionData: completion, khUnit: khUnit, decimalPlaces: decimalPlaces })));
41
+ }, [setContent, props.plotData.stratigraphy, barHeight]);
42
+ const onMouseOut = React.useCallback(function onMouseOut() {
43
+ setContent(() => null);
44
+ }, [setContent]);
45
+ return (React.createElement("g", null, props.plotData.wells.map((well, i) => {
46
+ return (React.createElement("g", { transform: `translate(${props.padding.left + (i + 0.5) * wellWidth}, ${0})`, key: `well-${well.name}-completions` }, well.completions.map((completion, j) => {
47
+ const start = completion.zoneIndex;
48
+ const end = j === well.completions.length - 1
49
+ ? props.plotData.stratigraphy.length
50
+ : well.completions[j + 1].zoneIndex;
51
+ const totalWidth = completion.open + completion.shut;
52
+ return (React.createElement("g", { key: `well-${well.name}-completions-${j}` },
53
+ React.createElement("rect", { key: `well-${well.name}-completions-${j}-shut-left`, transform: `translate(${-totalWidth * wellWidth * 0.25}, ${start * barHeight +
54
+ props.padding.top})`, width: (completion.shut * wellWidth) / 4, height: barHeight * (end - start), fill: "#f00", onMouseMove: (e) => onMouseMove(e, well, completion), onMouseOut: onMouseOut }),
55
+ React.createElement("rect", { key: `well-${well.name}-completions-${j}-open`, transform: `translate(${-completion.open * wellWidth * 0.25}, ${start * barHeight +
56
+ props.padding.top})`, width: (completion.open * wellWidth) / 2, height: barHeight * (end - start), fill: "#111", onMouseMove: (e) => onMouseMove(e, well, completion), onMouseOut: onMouseOut }),
57
+ React.createElement("rect", { key: `well-${well.name}-completions-${j}-shut-right`, transform: `translate(${(totalWidth - completion.shut) *
58
+ wellWidth *
59
+ 0.25}, ${start * barHeight +
60
+ props.padding.top})`, width: (completion.shut * wellWidth) / 4, height: barHeight * (end - start), fill: "#f00", onMouseMove: (e) => onMouseMove(e, well, completion), onMouseOut: onMouseOut })));
61
+ })));
62
+ })));
63
+ };
64
+ CompletionsPlot.displayName = "CompletionsPlot";
65
+ //# sourceMappingURL=CompletionsPlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompletionsPlot.js","sourceRoot":"","sources":["../../src/components/CompletionsPlot.tsx"],"names":[],"mappings":"AAAA,gDAAgD,CAAC,kCAAkC;AAEnF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAW/C,MAAM,wBAAwB,GAA4C,CACtE,KAAoC,EACtC,EAAE;IACA,OAAO,CACH,+BAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QAC3B,mCACK;YACG,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC;YAC7B,CAAC,cAAc,E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,IAAI,gBAAgB,CAAC,OAAO,EAC9C,SAAS,EAAE,aACP,CAAC,UAAU,CAAC,IAAI,GAAG,SAAS,GAAG,IACnC,KACI,KAAK,GAAG,SAAS;wBACjB,KAAK,CAAC,OAAO,CAAC,GAClB,GAAG,EACH,KAAK,EACD,CAAC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,EAErC,MAAM,EAAE,SAAS,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CACf,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,EAEpC,UAAU,EAAE,UAAU,GACxB;gBACF,8BACI,GAAG,EAAE,QAAQ,IAAI,CAAC,IAAI,gBAAgB,CAAC,aAAa,EACpD,SAAS,EAAE,aACP,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC;wBAC9B,SAAS;wBACT,IACJ,KACI,KAAK,GAAG,SAAS;wBACjB,KAAK,CAAC,OAAO,CAAC,GAClB,GAAG,EACH,KAAK,EACD,CAAC,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,EAErC,MAAM,EAAE,SAAS,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CACf,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,EAEpC,UAAU,EAAE,UAAU,GACxB,CACF,CACP,CAAC;QACN,CAAC,CAAC,CACF,CACP,CAAC;IACN,CAAC,CAAC,CACF,CACP,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { Zone } from "../types/dataTypes";
3
+ import { Padding, PlotLayout } from "../types/layoutTypes";
4
+ interface StratigraphyPlotProps {
5
+ data: Zone[];
6
+ layout: PlotLayout;
7
+ padding: Padding;
8
+ }
9
+ export declare const StratigraphyPlot: React.FC<StratigraphyPlotProps>;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ const shortenName = (str) => str.length >= 13 ? "..." + str.substring(str.length - 10, str.length) : str;
3
+ /* eslint-disable react/prop-types */
4
+ export const StratigraphyPlot = React.memo((props) => {
5
+ const barHeight = props.layout.yExtent / Math.max(props.data.length, 1);
6
+ return (React.createElement("g", null, props.data.map((zone, i) => {
7
+ return (React.createElement("g", { transform: `translate(0,${props.padding.top + i * barHeight})`, key: `zone-${zone.name}` },
8
+ React.createElement("rect", { transform: `translate(${props.padding.left}, 0)`, width: props.layout.xExtent, height: barHeight, fill: zone.color }),
9
+ React.createElement("title", null, zone.name),
10
+ React.createElement("text", { style: { fontSize: "11px" }, textAnchor: "end", x: props.padding.left - 4, y: barHeight / 2, dy: ".35em", fontFamily: "sans-serif" }, shortenName(zone.name))));
11
+ })));
12
+ });
13
+ StratigraphyPlot.displayName = "StratigraphyPlot";
14
+ //# sourceMappingURL=StratigraphyPlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StratigraphyPlot.js","sourceRoot":"","sources":["../../src/components/StratigraphyPlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAChC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAChF,qCAAqC;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAoC,KAAK,CAAC,IAAI,CACvE,CAAC,KAA4B,EAAE,EAAE;IAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAExE,OAAO,CACH,+BACK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACxB,OAAO,CACH,2BACI,SAAS,EAAE,eACP,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,SAC5B,GAAG,EACH,GAAG,EAAE,QAAQ,IAAI,CAAC,IAAI,EAAE;YAExB,8BACI,SAAS,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,IAAI,MAAM,EAChD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAC3B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,IAAI,CAAC,KAAK,GAClB;YACF,mCAAQ,IAAI,CAAC,IAAI,CAAS;YAC1B,8BACI,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAC3B,UAAU,EAAC,KAAK,EAChB,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,EACzB,CAAC,EAAE,SAAS,GAAG,CAAC,EAChB,EAAE,EAAE,OAAO,EACX,UAAU,EAAE,YAAY,IAEvB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CACpB,CACP,CACP,CAAC;IACN,CAAC,CAAC,CACF,CACP,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ /**
3
+ * A tooltip provider for React components.
4
+ *
5
+ * Children of this provider can use the hook useTooltip to
6
+ * access setContent method which accepts a React component
7
+ * that will be displayed in the tooltip. Hiding the tooltip is
8
+ * done with setContent(null)
9
+ */
10
+ declare const TooltipProvider: React.FC<PropsWithChildren<unknown>>;
11
+ /**
12
+ * A hook for displaying tooltips
13
+ */
14
+ declare const useTooltip: () => {
15
+ setContent: React.Dispatch<React.SetStateAction<React.FC | null>>;
16
+ };
17
+ export { TooltipProvider, useTooltip };
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import ReactTooltip from "react-tooltip";
3
+ const TooltipContext = React.createContext({
4
+ setContent: () => null,
5
+ });
6
+ /**
7
+ * A tooltip provider for React components.
8
+ *
9
+ * Children of this provider can use the hook useTooltip to
10
+ * access setContent method which accepts a React component
11
+ * that will be displayed in the tooltip. Hiding the tooltip is
12
+ * done with setContent(null)
13
+ */
14
+ const TooltipProvider = ({ children, }) => {
15
+ // State
16
+ const [Content, setContent] = React.useState(null);
17
+ const value = React.useMemo(() => ({
18
+ setContent,
19
+ }), [setContent]);
20
+ return (React.createElement(TooltipContext.Provider, { value: value },
21
+ children,
22
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
+ // @ts-expect-error
24
+ React.createElement(ReactTooltip, { id: "plot-tooltip", getContent: () => Content })));
25
+ };
26
+ /**
27
+ * A hook for displaying tooltips
28
+ */
29
+ const useTooltip = () => {
30
+ return React.useContext(TooltipContext);
31
+ };
32
+ export { TooltipProvider, useTooltip };
33
+ //# sourceMappingURL=TooltipProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipProvider.js","sourceRoot":"","sources":["../../src/components/TooltipProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAEvC;IACC,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI;CACzB,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,eAAe,GAAyC,CAAC,EAC3D,QAAQ,GACiB,EAAE,EAAE;IAC7B,QAAQ;IACR,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAkB,IAAI,CAAC,CAAC;IAEpE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACvB,GAAG,EAAE,CAAC,CAAC;QACH,UAAU;KACb,CAAC,EACF,CAAC,UAAU,CAAC,CACf,CAAC;IAEF,OAAO,CACH,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;QAChC,QAAQ;QAEL,6DAA6D;QAC7D,mBAAmB;QACnB,oBAAC,YAAY,IAAC,EAAE,EAAC,cAAc,EAAC,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,GAAI,CAE3C,CAC7B,CAAC;AACN,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,GAAG,GAEjB,EAAE;IACA,OAAO,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+
2
+ import React from "react";
3
+ import { PlotData } from "../types/dataTypes";
4
+ import { Padding, PlotLayout } from "../types/layoutTypes";
5
+ interface WellsPlotProps {
6
+ timeSteps: string[];
7
+ plotData: PlotData;
8
+ layout: PlotLayout;
9
+ padding: Padding;
10
+ }
11
+ export declare const WellsPlot: React.FC<WellsPlotProps>;
12
+ export {};
@@ -0,0 +1,43 @@
1
+ /* eslint-disable react-hooks/exhaustive-deps */ // remove when ready to fix these.
2
+ import React from "react";
3
+ import { SortBy, SortByEnumToStringMapping, } from "../types/dataTypes";
4
+ import { capitalizeFirstLetter } from "../utils/stringUtil";
5
+ import { useTooltip } from "./TooltipProvider";
6
+ const WellTooltipContent = (props) => {
7
+ return (React.createElement("table", { style: { color: "#fff" } },
8
+ React.createElement("tbody", null,
9
+ React.createElement("tr", { key: `well-tooltip-${props.name}-earliest-comp` },
10
+ React.createElement("td", null,
11
+ React.createElement("b", null, SortByEnumToStringMapping[SortBy.CompletionDate])),
12
+ React.createElement("td", null, props.earliestCompDate)),
13
+ Object.entries(props.attributes).map(([key, value]) => (React.createElement("tr", { key: `well-tooltip-${name}-${key}` },
14
+ React.createElement("td", null,
15
+ React.createElement("b", null, capitalizeFirstLetter(key))),
16
+ React.createElement("td", null, value || "Undefined")))))));
17
+ };
18
+ WellTooltipContent.displayName = "WellTooltipContent";
19
+ /* eslint-disable react/prop-types */
20
+ export const WellsPlot = (props) => {
21
+ const { setContent } = useTooltip();
22
+ const wellWidth = props.layout.xExtent / Math.max(props.plotData.wells.length, 1);
23
+ const barHeight = props.layout.yExtent / Math.max(props.plotData.stratigraphy.length, 1);
24
+ const onMouseOver = React.useCallback(function onMouseOver(well) {
25
+ setContent(() => (React.createElement(WellTooltipContent, { name: well.name, earliestCompDate: props.timeSteps[well.earliestCompDateIndex], attributes: well.attributes })));
26
+ }, [setContent, props.timeSteps]);
27
+ const onMouseOut = React.useCallback(function onMouseOut() {
28
+ setContent(() => null);
29
+ }, [setContent]);
30
+ return (React.createElement("g", null, props.plotData.wells.map((well, i) => {
31
+ const lastCompletion = Array.from(well.completions)
32
+ .reverse()
33
+ .find((comp) => comp.open + comp.shut > 0);
34
+ const height = lastCompletion
35
+ ? (lastCompletion.zoneIndex + 1) * barHeight
36
+ : 0;
37
+ return (React.createElement("g", { transform: `translate(${props.padding.left + (i + 0.5) * wellWidth},0)`, key: `well-${well.name}` },
38
+ React.createElement("text", { style: { fontSize: "9px" }, textAnchor: "start", transform: `translate(0,${props.padding.top - 10}) rotate(-60)`, x: 0, y: 0, dy: ".35em", fontFamily: "sans-serif", onMouseOver: () => onMouseOver(well), onMouseOut: onMouseOut }, well.name),
39
+ React.createElement("rect", { transform: `translate(0,${props.padding.top - 4})`, width: 0.5, height: height + 4, fill: "#111" })));
40
+ })));
41
+ };
42
+ WellsPlot.displayName = "WellsPlot";
43
+ //# sourceMappingURL=WellsPlot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WellsPlot.js","sourceRoot":"","sources":["../../src/components/WellsPlot.tsx"],"names":[],"mappings":"AAAA,gDAAgD,CAAC,kCAAkC;AAEnF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EA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AAK,EAAE,EAC1B,UAAU,EAAC,OAAO,EAClB,SAAS,EAAE,eACP,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,EACxB,eAAe,EACf,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,EAAE,EAAE,OAAO,EACX,UAAU,EAAE,YAAY,EACxB,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EACpC,UAAU,EAAE,UAAU,IAErB,IAAI,CAAC,IAAI,CACP;YACP,8BACI,SAAS,EAAE,eAAe,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,EAClD,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,MAAM,GAAG,CAAC,EAClB,IAAI,EAAE,MAAM,GACd,CACF,CACP,CAAC;IACN,CAAC,CAAC,CACF,CACP,CAAC;AACN,CAAC,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { WellCompletionsPlot } from "./WellCompletionsPlot";
2
+ export { AttributeTypePropType, SortBy, SortByEnumToStringMapping, SortDirection, UnitsPropType, WellInfoPropType, ZonePropTypes, } from "./types/dataTypes";
3
+ export type { AttributeType, CompletionPlotData, PlotData, Units, WellInfo, WellPlotData, Zone, } from "./types/dataTypes";
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { WellCompletionsPlot } from "./WellCompletionsPlot";
2
+ export { AttributeTypePropType, SortBy, SortByEnumToStringMapping, SortDirection, UnitsPropType, WellInfoPropType, ZonePropTypes, } from "./types/dataTypes";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACH,qBAAqB,EACrB,MAAM,EACN,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,GAChB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,66 @@
1
+ import PropTypes from "prop-types";
2
+ import React from "react";
3
+ export type AttributeType = string | number | boolean | undefined;
4
+ export declare enum SortDirection {
5
+ Ascending = "Ascending",
6
+ Descending = "Descending"
7
+ }
8
+ export declare enum SortBy {
9
+ Name = "well name",
10
+ StratigraphyDepth = "stratigraphy depth",
11
+ CompletionDate = "earliest comp date"
12
+ }
13
+ export declare const SortByEnumToStringMapping: {
14
+ "well name": string;
15
+ "stratigraphy depth": string;
16
+ "earliest comp date": string;
17
+ };
18
+ export interface Zone {
19
+ name: string;
20
+ color: string;
21
+ subzones?: Zone[];
22
+ }
23
+ export interface WellInfo {
24
+ name: string;
25
+ earliestCompDateIndex: number;
26
+ attributes: Record<string, AttributeType>;
27
+ }
28
+ interface UnitInfo {
29
+ unit: string;
30
+ decimalPlaces: number;
31
+ }
32
+ export interface Units {
33
+ kh: UnitInfo;
34
+ }
35
+ export interface CompletionPlotData {
36
+ zoneIndex: number;
37
+ open: number;
38
+ shut: number;
39
+ khMean: number;
40
+ khMin: number;
41
+ khMax: number;
42
+ }
43
+ export interface WellPlotData extends WellInfo {
44
+ completions: CompletionPlotData[];
45
+ }
46
+ export interface PlotData {
47
+ stratigraphy: Zone[];
48
+ wells: WellPlotData[];
49
+ units: Units;
50
+ }
51
+ export declare const ZonePropTypes: PropTypes.Validator<NonNullable<PropTypes.InferProps<React.WeakValidationMap<Zone>>>>;
52
+ export declare const AttributeTypePropType: PropTypes.Requireable<NonNullable<string | number | boolean | null | undefined>>;
53
+ export declare const WellInfoPropType: PropTypes.Requireable<PropTypes.InferProps<{
54
+ name: PropTypes.Validator<string>;
55
+ earliestCompDateIndex: PropTypes.Validator<number>;
56
+ attributes: PropTypes.Validator<{
57
+ [x: string]: NonNullable<string | number | boolean | null | undefined> | null | undefined;
58
+ }>;
59
+ }>>;
60
+ export declare const UnitsPropType: PropTypes.Requireable<PropTypes.InferProps<{
61
+ kh: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
62
+ unit: PropTypes.Validator<string>;
63
+ decimalPlaces: PropTypes.Validator<number>;
64
+ }>>>;
65
+ }>>;
66
+ export {};
@@ -0,0 +1,46 @@
1
+ import PropTypes from "prop-types";
2
+ export var SortDirection;
3
+ (function (SortDirection) {
4
+ SortDirection["Ascending"] = "Ascending";
5
+ SortDirection["Descending"] = "Descending";
6
+ })(SortDirection || (SortDirection = {}));
7
+ export var SortBy;
8
+ (function (SortBy) {
9
+ SortBy["Name"] = "well name";
10
+ SortBy["StratigraphyDepth"] = "stratigraphy depth";
11
+ SortBy["CompletionDate"] = "earliest comp date";
12
+ })(SortBy || (SortBy = {}));
13
+ export const SortByEnumToStringMapping = {
14
+ [SortBy.Name]: "Well name",
15
+ [SortBy.StratigraphyDepth]: "Stratigraphy depth",
16
+ [SortBy.CompletionDate]: "Earliest comp date",
17
+ };
18
+ // --------------------------- PropTypes ---------------------------------------
19
+ const ZoneShape = {
20
+ name: PropTypes.string.isRequired,
21
+ color: PropTypes.string.isRequired,
22
+ };
23
+ // Note: This is a solution for recursive definition for subzones, as subzones is an optional array of ZoneShape.
24
+ // - Object.assign() resolves the issue of subzones being optional.
25
+ // - PropTypes.arrayOf(PropTypes.shape(ZoneShape).isRequired) resolves the issue of subzones being recursive.
26
+ Object.assign(ZoneShape, {
27
+ subzones: PropTypes.arrayOf(PropTypes.shape(ZoneShape).isRequired),
28
+ });
29
+ export const ZonePropTypes = PropTypes.shape(ZoneShape).isRequired;
30
+ export const AttributeTypePropType = PropTypes.oneOfType([
31
+ PropTypes.string,
32
+ PropTypes.number,
33
+ PropTypes.bool,
34
+ ]);
35
+ export const WellInfoPropType = PropTypes.shape({
36
+ name: PropTypes.string.isRequired,
37
+ earliestCompDateIndex: PropTypes.number.isRequired,
38
+ attributes: PropTypes.objectOf(AttributeTypePropType).isRequired,
39
+ });
40
+ export const UnitsPropType = PropTypes.shape({
41
+ kh: PropTypes.shape({
42
+ unit: PropTypes.string.isRequired,
43
+ decimalPlaces: PropTypes.number.isRequired,
44
+ }).isRequired,
45
+ });
46
+ //# sourceMappingURL=dataTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataTypes.js","sourceRoot":"","sources":["../../src/types/dataTypes.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,0CAAyB,CAAA;AAC7B,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IACd,4BAAkB,CAAA;IAClB,kDAAwC,CAAA;IACxC,+CAAqC,CAAA;AACzC,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW;IAC1B,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,oBAAoB;IAChD,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,oBAAoB;CAChD,CAAC;AAyCF,iFAAiF;AAEjF,MAAM,SAAS,GAAkC;IAC7C,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACjC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACrC,CAAC;AAEF,iHAAiH;AACjH,mEAAmE;AACnE,6GAA6G;AAC7G,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;IACrB,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC;CACrE,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC;AAEnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC,SAAS,CAAC;IACrD,SAAS,CAAC,MAAM;IAChB,SAAS,CAAC,MAAM;IAChB,SAAS,CAAC,IAAI;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC,KAAK,CAAC;IAC5C,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACjC,qBAAqB,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClD,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,UAAU;CACnE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC;IACzC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC;QAChB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QACjC,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;KAC7C,CAAC,CAAC,UAAU;CAChB,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface PlotLayout {
2
+ width: number;
3
+ height: number;
4
+ xRange: [number, number];
5
+ yRange: [number, number];
6
+ xExtent: number;
7
+ yExtent: number;
8
+ topLeft: [number, number];
9
+ bottomRight: [number, number];
10
+ }
11
+ export interface Padding {
12
+ left: number;
13
+ right: number;
14
+ top: number;
15
+ bottom: number;
16
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=layoutTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutTypes.js","sourceRoot":"","sources":["../../src/types/layoutTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { Padding, PlotLayout } from "../types/layoutTypes";
2
+ export declare function createLayout(width: number, height: number, padding?: Padding): PlotLayout;
@@ -0,0 +1,22 @@
1
+ export function createLayout(width, height, padding = { bottom: 0, top: 0, left: 0, right: 0 }) {
2
+ const xRange = [padding.left, width - padding.right];
3
+ const yRange = [height - padding.bottom, padding.top];
4
+ const xExtent = Math.abs(xRange[0] - xRange[1]);
5
+ const yExtent = Math.abs(yRange[0] - yRange[1]);
6
+ const topLeft = [padding.left, padding.top];
7
+ const bottomRight = [
8
+ width - padding.right,
9
+ height - padding.bottom,
10
+ ];
11
+ return {
12
+ width: width,
13
+ height: height,
14
+ xRange: xRange,
15
+ yRange: yRange,
16
+ xExtent: xExtent,
17
+ yExtent: yExtent,
18
+ topLeft: topLeft,
19
+ bottomRight: bottomRight,
20
+ };
21
+ }
22
+ //# sourceMappingURL=layoutUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutUtils.js","sourceRoot":"","sources":["../../src/utils/layoutUtils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CACxB,KAAa,EACb,MAAc,EACd,UAAmB,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;IAE3D,MAAM,MAAM,GAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,MAAM,GAAqB,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACxE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,OAAO,GAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAqB;QAClC,KAAK,GAAG,OAAO,CAAC,KAAK;QACrB,MAAM,GAAG,OAAO,CAAC,MAAM;KAC1B,CAAC;IAEF,OAAO;QACH,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,WAAW;KAC3B,CAAC;AACN,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * capitalize the first letter in the given name
3
+ * @param name
4
+ */
5
+ export declare const capitalizeFirstLetter: (name: string) => string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * capitalize the first letter in the given name
3
+ * @param name
4
+ */
5
+ export const capitalizeFirstLetter = (name) => {
6
+ return name.length === 0 ? name : name[0].toUpperCase() + name.slice(1);
7
+ };
8
+ //# sourceMappingURL=stringUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringUtil.js","sourceRoot":"","sources":["../../src/utils/stringUtil.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAU,EAAE;IAC1D,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { capitalizeFirstLetter } from "./stringUtil";
2
+ describe("capitalize the first letter", () => {
3
+ it("should capitalize the first letter", () => {
4
+ expect(capitalizeFirstLetter("a")).toEqual("A");
5
+ expect(capitalizeFirstLetter("ABC")).toEqual("ABC");
6
+ expect(capitalizeFirstLetter("aBC")).toEqual("ABC");
7
+ expect(capitalizeFirstLetter("hello world")).toEqual("Hello world");
8
+ });
9
+ it("should do nothing if string is empty", () => {
10
+ expect(capitalizeFirstLetter("")).toEqual("");
11
+ });
12
+ });
13
+ //# sourceMappingURL=stringUtil.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringUtil.test.js","sourceRoot":"","sources":["../../src/utils/stringUtil.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpD,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpD,MAAM,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@webviz/well-completions-plot",
3
+ "version": "0.0.1-alpha.1",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "transpile": "tsc --project ./tsconfig.json",
12
+ "copy-files": "copyfiles --up 1 \"src/**/*.css\" dist/",
13
+ "build": "git clean -xdff dist && npm run transpile && npm run copy-files",
14
+ "test_perf": "jest _performance",
15
+ "test_correctness": "jest --coverage --testPathIgnorePatterns='_performance'",
16
+ "test": "jest --coverage",
17
+ "test:update": "npm test -- --u",
18
+ "test:watch": "npm test -- --watch"
19
+ },
20
+ "author": "Equinor <opensource@equinor.com>",
21
+ "license": "MPL-2.0",
22
+ "dependencies": {
23
+ "react-resize-detector": "^9.1.0",
24
+ "react-tooltip": "^4.2.21"
25
+ },
26
+ "volta": {
27
+ "node": "16.18.1"
28
+ }
29
+ }