@neo4j-nvl/react 1.2.0-d04ab70e → 1.2.0-d5d70e90
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Neo4j Visualization Library
|
|
2
2
|
|
|
3
|
-
Welcome to the Neo4j Visualization Library, NVL for short. NVL is a collection of libraries that can be used to build custom graph visualizations like those used in [Neo4j Bloom
|
|
3
|
+
Welcome to the Neo4j Visualization Library, NVL for short. NVL is a collection of libraries that can be used to build custom graph visualizations like those used in [Neo4j Bloom](https://neo4j.com/product/bloom/). NVL is written in TypeScript and can be used in any JavaScript project. This package contains React components that make it easier to use NVL within a React application. If you want to use NVL with a framework other than React or want to build your own React wrapper, you can do so by using the [NVL base library](https://www.npmjs.com/package/@neo4j-nvl/base).
|
|
4
4
|
|
|
5
5
|
## Consuming the library
|
|
6
6
|
|
|
@@ -24,8 +24,8 @@ export const StaticPictureWrapper = ({ nodes, rels, nvlOptions = {}, width = 500
|
|
|
24
24
|
const [imgSrc, setImgSrc] = useState();
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
const div = document.createElement('div');
|
|
27
|
-
div.style.width = `${width
|
|
28
|
-
div.style.height = `${height
|
|
27
|
+
div.style.width = `${width}px`;
|
|
28
|
+
div.style.height = `${height}px`;
|
|
29
29
|
const myNvl = new NVL(div, nodes, rels, nvlOptions, {
|
|
30
30
|
onLayoutDone: () => {
|
|
31
31
|
myNvl.fit(myNvl.getNodes().map((n) => n.id));
|
|
@@ -53,5 +53,5 @@ export const StaticPictureWrapper = ({ nodes, rels, nvlOptions = {}, width = 500
|
|
|
53
53
|
};
|
|
54
54
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
55
|
}, [nodes, rels, width, height, format]);
|
|
56
|
-
return imgSrc !== undefined ? _jsx("img", { src: imgSrc, width: width, height: height, alt: "Graph" }) : null;
|
|
56
|
+
return imgSrc !== undefined ? (_jsx("img", { src: imgSrc, width: width, height: height, style: { display: 'block', width, height, objectFit: 'contain' }, alt: "Graph" })) : null;
|
|
57
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/react",
|
|
3
|
-
"version": "1.2.0-
|
|
3
|
+
"version": "1.2.0-d5d70e90",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"homepage": "https://neo4j.com/docs/nvl/current/",
|
|
6
6
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"react-dom": "19.2.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@neo4j-nvl/base": "1.2.0-
|
|
40
|
-
"@neo4j-nvl/interaction-handlers": "1.2.0-
|
|
39
|
+
"@neo4j-nvl/base": "1.2.0-d5d70e90",
|
|
40
|
+
"@neo4j-nvl/interaction-handlers": "1.2.0-d5d70e90",
|
|
41
41
|
"lodash": "4.18.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|