Skip to content

Commit 6a9a9be

Browse files
authored
chore: Enhance documentation for FragmentsManager usage (#671)
Added documentation on utilizing the FragmentsManager component and its advantages.
1 parent 434996a commit 6a9a9be

File tree

1 file changed

+4
-0
lines changed
  • packages/core/src/fragments/FragmentsManager

1 file changed

+4
-0
lines changed

packages/core/src/fragments/FragmentsManager/example.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ components.get(OBC.Grids).create(world);
4848
/* MD
4949
### ✨ Utilizing the FragmentsManager Component
5050
Great! With the base viewer setup complete, let's dive into using the FragmentsManager component. This component serves as a convenient wrapper around the core FragmentsModels class from the `@thatopen/fragments` library. One of the key advantages of using Fragments in That Open Engine is its worker-based architecture, which offloads most operations (data retrieval, visibility management, color adjustments, etc.) to a separate thread. This ensures that the app remains responsive during processing. To get started, the first step is to specify the URL of the Fragments worker:
51+
52+
:::info Which Fragments Class Should You Use?
53+
When using the Components libraries, you should not use FragmentsModels directly. Instead, always use FragmentsManager. FragmentsManager is designed to integrate Fragments with the Components ecosystem, ensuring compatibility with pre-built features (such as Highlighter, Measurement, and more). Using FragmentsModels directly when Components are involved may cause these features to not work correctly with the loaded fragments!
54+
:::
5155
*/
5256

5357
// One option, if you prefer not to rely on an external worker file,

0 commit comments

Comments
 (0)