Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not display "Loading assets" feedback when isRenderedCallback exists #1882

Merged
merged 5 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ export interface SubsurfaceViewerProps {
getCameraPosition?: (input: ViewStateType) => void;

/**
* Will be called after all layers have rendered data.
* Will be called while layers are processed to rendered data.
* @param progress vlaue between 0 and 100.
*/
isRenderedCallback?: (arg: boolean) => void;
onRenderingProgress?: (progress: number) => void;

onDragStart?: (info: PickingInfo, event: MjolnirGestureEvent) => void;
onDragEnd?: (info: PickingInfo, event: MjolnirGestureEvent) => void;
Expand Down Expand Up @@ -143,7 +144,7 @@ const SubsurfaceViewer: React.FC<SubsurfaceViewerProps> = ({
selection,
getTooltip,
getCameraPosition,
isRenderedCallback,
onRenderingProgress,
onDragStart,
onDragEnd,
triggerResetMultipleWells,
Expand Down Expand Up @@ -228,7 +229,7 @@ const SubsurfaceViewer: React.FC<SubsurfaceViewerProps> = ({
getTooltip={getTooltip}
cameraPosition={cameraPosition}
getCameraPosition={getCameraPosition}
isRenderedCallback={isRenderedCallback}
onRenderingProgress={onRenderingProgress}
onDragStart={onDragStart}
onDragEnd={onDragEnd}
triggerHome={triggerHome}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,52 @@ exports[`Test Map component snapshot test 1`] = `
style="width: 100px; height: 4px; border: 2px solid; display: inline-block; margin-left: 3px;"
/>
</div>
<div>
<svg
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="c0"
height="48"
preserveAspectRatio="xMidYMid meet"
role="progressbar"
viewBox="24 24 48 48"
width="48"
>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"
stroke-dasharray="138.23007675795088"
stroke-linecap="round"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
</svg>
<output
class="c1"
>
Loading 0%
</output>
<br />
Loading assets...
<div
style="display: flex; align-items: flex-end; justify-content: right; position: absolute; height: 90%; width: 90%; bottom: 10px; right: 10px; z-index: 200;"
>
<div>
<svg
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="c0"
height="48"
preserveAspectRatio="xMidYMid meet"
role="progressbar"
viewBox="24 24 48 48"
width="48"
>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"
stroke-dasharray="138.23007675795088"
stroke-linecap="round"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
</svg>
<output
class="c1"
>
Loading 0%
</output>
<br />
Loading assets...
</div>
</div>
</div>
`;
Expand Down Expand Up @@ -134,48 +138,52 @@ exports[`Test Map component snapshot test with edited data 1`] = `
style="width: 100px; height: 4px; border: 2px solid; display: inline-block; margin-left: 3px;"
/>
</div>
<div>
<svg
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="c0"
height="48"
preserveAspectRatio="xMidYMid meet"
role="progressbar"
viewBox="24 24 48 48"
width="48"
>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"
stroke-dasharray="138.23007675795088"
stroke-linecap="round"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
</svg>
<output
class="c1"
>
Loading 0%
</output>
<br />
Loading assets...
<div
style="display: flex; align-items: flex-end; justify-content: right; position: absolute; height: 90%; width: 90%; bottom: 10px; right: 10px; z-index: 200;"
>
<div>
<svg
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="c0"
height="48"
preserveAspectRatio="xMidYMid meet"
role="progressbar"
viewBox="24 24 48 48"
width="48"
>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"
stroke-dasharray="138.23007675795088"
stroke-linecap="round"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
</svg>
<output
class="c1"
>
Loading 0%
</output>
<br />
Loading assets...
</div>
</div>
</div>
`;
Expand Down Expand Up @@ -224,48 +232,52 @@ exports[`Test Map component snapshot test with invalid array length 1`] = `
style="width: 100px; height: 4px; border: 2px solid; display: inline-block; margin-left: 3px;"
/>
</div>
<div>
<svg
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="c0"
height="48"
preserveAspectRatio="xMidYMid meet"
role="progressbar"
viewBox="24 24 48 48"
width="48"
>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"
stroke-dasharray="138.23007675795088"
stroke-linecap="round"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
</svg>
<output
class="c1"
>
Loading 0%
</output>
<br />
Loading assets...
<div
style="display: flex; align-items: flex-end; justify-content: right; position: absolute; height: 90%; width: 90%; bottom: 10px; right: 10px; z-index: 200;"
>
<div>
<svg
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="c0"
height="48"
preserveAspectRatio="xMidYMid meet"
role="progressbar"
viewBox="24 24 48 48"
width="48"
>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
<circle
class=""
cx="48"
cy="48"
fill="none"
r="22"
stroke="var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"
stroke-dasharray="138.23007675795088"
stroke-linecap="round"
stroke-width="4"
style="stroke: 138.230; stroke-dashoffset: 138.230px;"
/>
</svg>
<output
class="c1"
>
Loading 0%
</output>
<br />
Loading assets...
</div>
</div>
</div>
`;
Loading