@neo4j-nvl/react 1.2.0 → 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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to NVL will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
4
 
5
+ ## [1.2.1] - 2026-07-28
6
+
7
+ This 1.2.1 patch release contains several fixes and accessibility improvements.
8
+
9
+ ### Added
10
+ * Outline when the canvas is focused while using the keyboard interaction handlers.
11
+
12
+ ### Changed
13
+ * Renamed links in README from Explore to Neo4j Bloom.
14
+
15
+ ### Fixed
16
+ * Aligned padding on svg and png export.
17
+ * Aligned start behaviour of box and lasso select interaction handlers.
18
+ * Fixed static image wrapper React component returning incorrect height when using SVG format.
19
+ * Fixed self-referencing relationship captions being misplaced on downward curves.
20
+
5
21
  ## [1.2.0] - 2026-05-27
6
22
 
7
23
  This 1.2.0 release introduces a new keyboard interaction handler and SVG support for the static image wrapper React component. It also includes several performance improvements for clustering and text/icon rendering, as well as several bug fixes.
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 and Explore(powered by 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).
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
 
@@ -9,9 +9,15 @@ export interface BasicReactWrapperProps {
9
9
  nodes: Node[];
10
10
  /** The rels of the graph of type Relationship[] */
11
11
  rels: Relationship[];
12
- /** The layout, can be 'forceDirected' or 'hierarchical' */
12
+ /**
13
+ * The layout, can be 'forceDirected' or 'hierarchical'
14
+ * @deprecated Use the layout property in nvlOptions instead. This property will be removed in a future version.
15
+ */
13
16
  layout?: Layout;
14
- /** Options for the current layout */
17
+ /**
18
+ * Options for the current layout
19
+ * @deprecated Use the layoutOptions property in nvlOptions instead. This property will be removed in a future version.
20
+ */
15
21
  layoutOptions?: LayoutOptions;
16
22
  /** an Object containing functions for callbacks on certain actions */
17
23
  nvlCallbacks?: ExternalCallbacks;
@@ -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 / window.devicePixelRatio}px`;
28
- div.style.height = `${height / window.devicePixelRatio}px`;
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.1",
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.1",
40
+ "@neo4j-nvl/interaction-handlers": "1.2.1",
41
41
  "lodash": "4.18.1"
42
42
  },
43
43
  "peerDependencies": {