@webviz/well-log-viewer 0.0.1-alpha.1 → 0.0.1-alpha.3
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.
- package/dist/SyncLogViewer.js +3 -4
- package/dist/SyncLogViewer.js.map +1 -1
- package/dist/components/WellLogView.js +5 -5
- package/dist/components/WellLogView.js.map +1 -1
- package/dist/demo/example-data/welllog_template_2.json +167 -167
- package/dist/demo/example-data/wellpick_colors.json +1 -1
- package/dist/demo/example-data/wellpicks.json +179 -179
- package/package.json +32 -5
- package/dist/Intro.stories.mdx +0 -59
- package/dist/package.json +0 -21
- package/src/Intro.stories.mdx +0 -59
- package/src/MapAndWellLogViewer.stories.jsx +0 -147
- package/src/MapAndWellLogViewer.test.tsx +0 -26
- package/src/MapAndWellLogViewer.tsx +0 -473
- package/src/SyncLogViewer.stories.jsx +0 -361
- package/src/SyncLogViewer.test.tsx +0 -41
- package/src/SyncLogViewer.tsx +0 -1188
- package/src/WellLogViewer.png +0 -0
- package/src/WellLogViewer.stories.jsx +0 -169
- package/src/WellLogViewer.test.tsx +0 -53
- package/src/WellLogViewer.tsx +0 -439
- package/src/WellLogViewer_performance.test.tsx +0 -78
- package/src/__snapshots__/MapAndWellLogViewer.test.tsx.snap +0 -365
- package/src/__snapshots__/SyncLogViewer.test.tsx.snap +0 -510
- package/src/__snapshots__/WellLogViewer.test.tsx.snap +0 -552
- package/src/components/AxisSelector.test.tsx +0 -50
- package/src/components/AxisSelector.tsx +0 -49
- package/src/components/ColorTableTypes.ts +0 -9
- package/src/components/InfoPanel.test.tsx +0 -58
- package/src/components/InfoPanel.tsx +0 -144
- package/src/components/InfoTypes.ts +0 -17
- package/src/components/LocalMenus.tsx +0 -336
- package/src/components/PlotDialog.tsx +0 -419
- package/src/components/Scroller.stories.jsx +0 -80
- package/src/components/Scroller.test.tsx +0 -22
- package/src/components/Scroller.tsx +0 -173
- package/src/components/TrackDialog.tsx +0 -217
- package/src/components/WellLogSpacer.tsx +0 -483
- package/src/components/WellLogTemplateTypes.ts +0 -65
- package/src/components/WellLogTypes.ts +0 -53
- package/src/components/WellLogView.stories.jsx +0 -84
- package/src/components/WellLogView.test.tsx +0 -52
- package/src/components/WellLogView.tsx +0 -2063
- package/src/components/WellLogViewWithScroller.stories.jsx +0 -69
- package/src/components/WellLogViewWithScroller.test.tsx +0 -47
- package/src/components/WellLogViewWithScroller.tsx +0 -179
- package/src/components/ZoomSlider.stories.jsx +0 -52
- package/src/components/ZoomSlider.test.tsx +0 -28
- package/src/components/ZoomSlider.tsx +0 -86
- package/src/components/__snapshots__/AxisSelector.test.tsx.snap +0 -28
- package/src/components/__snapshots__/InfoPanel.test.tsx.snap +0 -103
- package/src/components/__snapshots__/Scroller.test.tsx.snap +0 -13
- package/src/components/__snapshots__/WellLogView.test.tsx.snap +0 -54
- package/src/components/__snapshots__/WellLogViewWithScroller.test.tsx.snap +0 -270
- package/src/components/__snapshots__/ZoomSlider.test.tsx.snap +0 -50
- package/src/components/styles.scss +0 -106
- package/src/custom.d.ts +0 -13
- package/src/demo/example-data/volve_logs.json +0 -689617
- package/src/demo/example-data/welllog_template_2.json +0 -196
- package/src/demo/example-data/wellpick_colors.json +0 -156
- package/src/demo/example-data/wellpicks.json +0 -186
- package/src/index.ts +0 -8
- package/src/utils/axes.ts +0 -26
- package/src/utils/color-table.ts +0 -153
- package/src/utils/deepcopy.ts +0 -3
- package/src/utils/edit-track.tsx +0 -40
- package/src/utils/fill-info.ts +0 -224
- package/src/utils/gradientfill-plot-legend.ts +0 -177
- package/src/utils/gradientfill-plot.ts +0 -203
- package/src/utils/graph/factory.ts +0 -15
- package/src/utils/legend/common.ts +0 -153
- package/src/utils/log-viewer.ts +0 -209
- package/src/utils/minmax.ts +0 -126
- package/src/utils/pattern.tsx +0 -50
- package/src/utils/stack/stack-legend.ts +0 -100
- package/src/utils/tracks.ts +0 -1559
- package/tsconfig.json +0 -8
package/src/utils/pattern.tsx
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export interface PatternsTable {
|
|
4
|
-
patternSize: number;
|
|
5
|
-
patternImages: string[];
|
|
6
|
-
patternNames?: string[];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function patternId(uid: number, index: number): string {
|
|
10
|
-
return "pattern" + uid + "_" + index;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function createPattern(
|
|
14
|
-
uid: number,
|
|
15
|
-
index: number,
|
|
16
|
-
patternsTable: PatternsTable
|
|
17
|
-
): ReactNode {
|
|
18
|
-
const patternSize = patternsTable.patternSize;
|
|
19
|
-
const patternImage = patternsTable.patternImages[index];
|
|
20
|
-
const id = patternId(uid, index);
|
|
21
|
-
return (
|
|
22
|
-
<pattern
|
|
23
|
-
key={id}
|
|
24
|
-
id={id}
|
|
25
|
-
width={patternSize}
|
|
26
|
-
height={patternSize}
|
|
27
|
-
patternUnits="userSpaceOnUse"
|
|
28
|
-
>
|
|
29
|
-
<image
|
|
30
|
-
width={patternSize}
|
|
31
|
-
height={patternSize}
|
|
32
|
-
href={patternImage}
|
|
33
|
-
/>
|
|
34
|
-
</pattern>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function createDefs(
|
|
39
|
-
uid: number,
|
|
40
|
-
patternsTable?: PatternsTable
|
|
41
|
-
): ReactNode {
|
|
42
|
-
if (!patternsTable) return null;
|
|
43
|
-
return (
|
|
44
|
-
<defs key="defs">
|
|
45
|
-
{patternsTable.patternImages.map((_value: string, index: number) =>
|
|
46
|
-
createPattern(uid, index, patternsTable)
|
|
47
|
-
)}
|
|
48
|
-
</defs>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { select } from "d3";
|
|
2
|
-
/* Missed exports from "@equinor/videx-wellog !!! */
|
|
3
|
-
// eslint-disable-next-line
|
|
4
|
-
declare type D3Selection = any; //import { D3Selection } from "@equinor/videx-wellog/dist/common/interfaces';
|
|
5
|
-
import {
|
|
6
|
-
LegendBounds,
|
|
7
|
-
LegendConfig,
|
|
8
|
-
LegendOnUpdateFunction,
|
|
9
|
-
} from "@equinor/videx-wellog/dist/utils/legend-helper";
|
|
10
|
-
import { setAttrs } from "@equinor/videx-wellog";
|
|
11
|
-
|
|
12
|
-
import { StackedTrack } from "@equinor/videx-wellog";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Callback when legend needs to be updated
|
|
16
|
-
*
|
|
17
|
-
* The implementation is similar to onUpdateLegend() from videx-wellog/src/tracks/scale/common.ts
|
|
18
|
-
*/
|
|
19
|
-
function onUpdateLegend(
|
|
20
|
-
elm: D3Selection,
|
|
21
|
-
bounds: LegendBounds,
|
|
22
|
-
track: StackedTrack
|
|
23
|
-
): void {
|
|
24
|
-
const lg = select(elm);
|
|
25
|
-
|
|
26
|
-
//if (!track.extent) return;
|
|
27
|
-
|
|
28
|
-
const { horizontal, label, abbr } = track.options;
|
|
29
|
-
//const [min, max] = track.extent;
|
|
30
|
-
//const span = Math.round((max - min) * 2) / 2;
|
|
31
|
-
|
|
32
|
-
const { height: h, width: w, top } = bounds;
|
|
33
|
-
|
|
34
|
-
const textSize = Math.min(
|
|
35
|
-
12 * /*decrease a litle:*/ 0.9,
|
|
36
|
-
w * 0.22 * /*decrease a litle:*/ 0.9
|
|
37
|
-
);
|
|
38
|
-
const lsp = textSize * 0.1;
|
|
39
|
-
|
|
40
|
-
const x = horizontal ? h : w / 2;
|
|
41
|
-
|
|
42
|
-
const y0 = horizontal ? w / 2 + 2 * (textSize + lsp) : top + h;
|
|
43
|
-
const y3 = y0 - textSize / 1.2;
|
|
44
|
-
const y2 = y3 - textSize + lsp;
|
|
45
|
-
const y1 = y2 - textSize - lsp;
|
|
46
|
-
|
|
47
|
-
const g = lg.select(".scale-legend");
|
|
48
|
-
const lbl = g.select("text.scale-title");
|
|
49
|
-
setAttrs(lbl, {
|
|
50
|
-
transform: `translate(${x},${y1})`,
|
|
51
|
-
"font-size": `${textSize}px`,
|
|
52
|
-
fill: "black",
|
|
53
|
-
});
|
|
54
|
-
lbl.text(abbr || label || "???");
|
|
55
|
-
|
|
56
|
-
const val = g.select("text.scale-range");
|
|
57
|
-
setAttrs(val, {
|
|
58
|
-
transform: `translate(${x},${y2})`,
|
|
59
|
-
"font-size": `${textSize}px`,
|
|
60
|
-
});
|
|
61
|
-
//val.text(Number.isNaN(span) ? '-' : span);
|
|
62
|
-
|
|
63
|
-
const unit = g.select("text.scale-units");
|
|
64
|
-
setAttrs(unit, {
|
|
65
|
-
transform: `translate(${x},${y3})`,
|
|
66
|
-
"font-size": `${textSize / 1.2}px`,
|
|
67
|
-
});
|
|
68
|
-
//unit.text(track.options.units || 'units');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Config object required for stacked track config in order to add legend
|
|
73
|
-
*
|
|
74
|
-
* The implementation is similar to scaleLegendConfig from videx-wellog/src/tracks/scale/common.ts
|
|
75
|
-
*/
|
|
76
|
-
export const stackLegendConfig: LegendConfig = {
|
|
77
|
-
elementType: "svg",
|
|
78
|
-
getLegendRows: () => 2,
|
|
79
|
-
onInit: (elm, track, updateTrigger) => {
|
|
80
|
-
track.legendUpdate = updateTrigger;
|
|
81
|
-
|
|
82
|
-
const lg = select(elm);
|
|
83
|
-
lg.selectAll("g.scale-legend").remove();
|
|
84
|
-
|
|
85
|
-
const g = lg.append("g").attr("class", "scale-legend");
|
|
86
|
-
|
|
87
|
-
g.append("text")
|
|
88
|
-
.classed("scale-title", true)
|
|
89
|
-
.attr("font-weight", /*"600" decrease a litle: */ "400")
|
|
90
|
-
.style("text-anchor", "middle");
|
|
91
|
-
|
|
92
|
-
g.append("text")
|
|
93
|
-
.attr("class", "scale-range")
|
|
94
|
-
.style("text-anchor", "middle");
|
|
95
|
-
g.append("text")
|
|
96
|
-
.attr("class", "scale-units")
|
|
97
|
-
.style("text-anchor", "middle");
|
|
98
|
-
},
|
|
99
|
-
onUpdate: onUpdateLegend as LegendOnUpdateFunction,
|
|
100
|
-
};
|