@imfusion/sdk-react 1.2.1-dev.2.g5376b6ff → 1.2.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.
- package/README.md +14 -4
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
# ImFusion Web SDK React Bindings
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
React components and hooks for using the ImFusion Web SDK in React applications. This package
|
|
4
|
+
provides a canvas, SDK lifecycle components, and hooks for working with medical image data.
|
|
5
|
+
It builds on [@imfusion/sdk](https://www.npmjs.com/package/@imfusion/sdk).
|
|
6
|
+
|
|
7
|
+
Documentation: [docs.imfusion.com/websdk](https://docs.imfusion.com/websdk).
|
|
3
8
|
|
|
4
9
|
## Getting Started
|
|
5
10
|
|
|
11
|
+
Install both packages in your React application:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @imfusion/sdk @imfusion/sdk-react
|
|
15
|
+
```
|
|
16
|
+
|
|
6
17
|
Wrap your app with `ImFusionProvider`, add a canvas, and use the lifecycle components:
|
|
7
18
|
|
|
8
19
|
```tsx
|
|
@@ -31,11 +42,10 @@ function App() {
|
|
|
31
42
|
Inside `ImFusionReady`, use hooks to interact with the SDK:
|
|
32
43
|
|
|
33
44
|
```tsx
|
|
34
|
-
import {
|
|
45
|
+
import { useDataLoader, useData } from '@imfusion/sdk-react';
|
|
35
46
|
|
|
36
47
|
function Viewer() {
|
|
37
|
-
const
|
|
38
|
-
const { loadFileFromUrl, isLoading, progress } = useDataLoader();
|
|
48
|
+
const { loadFileFromUrl, isLoading } = useDataLoader();
|
|
39
49
|
const datasets = useData();
|
|
40
50
|
|
|
41
51
|
return (
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imfusion/sdk-react",
|
|
3
|
-
"version": "1.2.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "React bindings for ImFusion Web SDK",
|
|
5
|
+
"homepage": "https://docs.imfusion.com/websdk",
|
|
5
6
|
"author": "ImFusion GmbH",
|
|
6
7
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
7
8
|
"publishConfig": {
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"LICENSE.txt"
|
|
30
31
|
],
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"@imfusion/sdk": "1.2.1
|
|
33
|
+
"@imfusion/sdk": "1.2.1",
|
|
33
34
|
"react": ">=18"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|