From ceeac734e711d32a5a3ed6006f00ac0e6531bd31 Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:26:08 +0300 Subject: [PATCH 1/7] Fix crash on edit scale track title --- .../src/components/WellLogView.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx index 01cda323b..de12567f6 100644 --- a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx +++ b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx @@ -1649,6 +1649,16 @@ class WellLogView return this.props.horizontal ? 3 : 5 /*some default value*/; } } + _forceUpdateTitleTooltips() : void { // workaround to refresh tooltips in videx wellog component + if(!this.container) return; + const elements = this.container.getElementsByClassName("track-title"); + for (const element of elements) { + if(element.textContent) + element.setAttribute("title",element.textContent); + //const title=element.getAttribute("title"); + //console.log(title); + } + } scrollTrackBy(delta: number): void { this.setState((state: Readonly) => ({ @@ -1769,7 +1779,12 @@ class WellLogView } _editTrack(track: Track, templateTrack: TemplateTrack): void { - if (templateTrack.plots && templateTrack.plots[0].type === "stacked") { + const titleCompare=track.options.label?.localeCompare(templateTrack.title) + + if (templateTrack.plots && + templateTrack.plots[0] && + templateTrack.plots[0].type === "stacked" + ) { addOrEditStackedTrack( this, track as StackedTrack, @@ -1786,6 +1801,8 @@ class WellLogView false ); } + if(titleCompare) // workaround to refresh tooltips in videx wellog component + this._forceUpdateTitleTooltips(); this.onTemplateChanged(); } From 7462ded9f2171f98d1120080ee65bb0e40db489f Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:23:27 +0300 Subject: [PATCH 2/7] format source code --- .../src/components/WellLogView.tsx | 23 +++++++++++-------- .../well-log-viewer/src/utils/tracks.ts | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx index 1bfb5ce44..1bc283f9f 100644 --- a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx +++ b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx @@ -1652,12 +1652,13 @@ class WellLogView return this.props.horizontal ? 3 : 5 /*some default value*/; } } - _forceUpdateTitleTooltips() : void { // workaround to refresh tooltips in videx wellog component - if(!this.container) return; + _forceUpdateTitleTooltips(): void { + // workaround to refresh tooltips in videx wellog component + if (!this.container) return; const elements = this.container.getElementsByClassName("track-title"); for (const element of elements) { - if(element.textContent) - element.setAttribute("title",element.textContent); + if (element.textContent) + element.setAttribute("title", element.textContent); //const title=element.getAttribute("title"); //console.log(title); } @@ -1782,10 +1783,13 @@ class WellLogView } _editTrack(track: Track, templateTrack: TemplateTrack): void { - const titleCompare=track.options.label?.localeCompare(templateTrack.title) + const titleCompare = track.options.label?.localeCompare( + templateTrack.title + ); - if (templateTrack.plots && - templateTrack.plots[0] && + if ( + templateTrack.plots && + templateTrack.plots[0] && templateTrack.plots[0].type === "stacked" ) { addOrEditStackedTrack( @@ -1804,8 +1808,9 @@ class WellLogView false ); } - if(titleCompare) // workaround to refresh tooltips in videx wellog component - this._forceUpdateTitleTooltips(); + if (titleCompare) + // workaround to refresh tooltips in videx wellog component + this._forceUpdateTitleTooltips(); this.onTemplateChanged(); } diff --git a/typescript/packages/well-log-viewer/src/utils/tracks.ts b/typescript/packages/well-log-viewer/src/utils/tracks.ts index 4f830adee..652b2b73a 100644 --- a/typescript/packages/well-log-viewer/src/utils/tracks.ts +++ b/typescript/packages/well-log-viewer/src/utils/tracks.ts @@ -510,7 +510,7 @@ function updateGraphTrackScale(track: GraphTrack): void { if (!track.options.scale) track.options.scale = "linear"; } - if (track.plots.length) { + if (track.plots?.length) { const plot = track.plots[0]; track.options.domain = plot.options.domain as Domain; } From 1ebd02dc08767444bc436412b9b7f3039bea4891 Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:21:20 +0300 Subject: [PATCH 3/7] fix printing readout header when wellog data is missed --- .../src/components/DefaultSyncLogViewerLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/packages/well-log-viewer/src/components/DefaultSyncLogViewerLayout.tsx b/typescript/packages/well-log-viewer/src/components/DefaultSyncLogViewerLayout.tsx index 498c6a3a2..2847218f1 100644 --- a/typescript/packages/well-log-viewer/src/components/DefaultSyncLogViewerLayout.tsx +++ b/typescript/packages/well-log-viewer/src/components/DefaultSyncLogViewerLayout.tsx @@ -23,7 +23,7 @@ export function defaultSidePanel(parent: SyncLogViewer): JSX.Element { (welllog: WellLog, iWellLog: number) => ( From 2d32deaeb1854edf115fc300adb90ea97b1f75f7 Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:53:57 +0300 Subject: [PATCH 4/7] Update Scroller.stories.tsx --- .../well-log-viewer/src/components/Scroller.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx b/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx index 32216da1f..b0a0d6b9e 100644 --- a/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx +++ b/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx @@ -70,7 +70,7 @@ const Template = (args) => { ", Y=" + y.toFixed(2) ); - args.onScroll(x, y); // for storybook addon Actions Tab + args.onScroll?(x, y); // for storybook addon Actions Tab }} >
From 62339578a2559b39895f6dd75bab2ff13677ca36 Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:54:17 +0300 Subject: [PATCH 5/7] Update Scroller.stories.tsx --- .../well-log-viewer/src/components/Scroller.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx b/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx index b0a0d6b9e..1f92dbc28 100644 --- a/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx +++ b/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx @@ -70,7 +70,7 @@ const Template = (args) => { ", Y=" + y.toFixed(2) ); - args.onScroll?(x, y); // for storybook addon Actions Tab + args.onScroll?.(x, y); // for storybook addon Actions Tab }} >
From 006e5a3bc202d083caff9aa8ad8f7597f41857f8 Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:57:50 +0300 Subject: [PATCH 6/7] Update Scroller.stories.tsx --- .../well-log-viewer/src/components/Scroller.stories.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx b/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx index 1f92dbc28..387fcc05d 100644 --- a/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx +++ b/typescript/packages/well-log-viewer/src/components/Scroller.stories.tsx @@ -12,8 +12,8 @@ const ComponentCode = '
\r\n' + " { \r\n" + - " el.zoom(10, 10); \r\n" + - " el.scrollTo(0.2, 0.2); \r\n" + + " el?.zoom(10, 10); \r\n" + + " el?.scrollTo(0.2, 0.2); \r\n" + " }} \r\n" + " onScroll={(x, y) => { \r\n" + " setInfo( \r\n" + @@ -60,8 +60,8 @@ const Template = (args) => {
{ - el.zoom(10, 10); - el.scrollTo(0.2, 0.2); + el?.zoom(10, 10); + el?.scrollTo(0.2, 0.2); }} onScroll={(x, y) => { setInfo( From b736f8c5d33713639e323c6cb882cbdf1825a2c2 Mon Sep 17 00:00:00 2001 From: Vladimir-Kokin <86053741+Vladimir-Kokin@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:45:14 +0300 Subject: [PATCH 7/7] Update WellLogView.tsx --- .../well-log-viewer/src/components/WellLogView.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx index 6826d6e5c..2f51d7f7f 100644 --- a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx +++ b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx @@ -1738,17 +1738,6 @@ class WellLogView element.setAttribute("title", element.textContent); } } - _forceUpdateTitleTooltips(): void { - // workaround to refresh tooltips in videx wellog component - if (!this.container) return; - const elements = this.container.getElementsByClassName("track-title"); - for (const element of elements) { - if (element.textContent) - element.setAttribute("title", element.textContent); - //const title=element.getAttribute("title"); - //console.log(title); - } - } scrollTrackBy(delta: number): void { this.setState((state: Readonly) => ({