force-graph
Advanced tools
Comparing version 1.39.2 to 1.40.0
@@ -1170,2 +1170,10 @@ 'use strict'; | ||
}, | ||
linkPointerAreaPaint: { | ||
onChange: function onChange(paintFn, state) { | ||
state.shadowGraph.linkCanvasObject(!paintFn ? null : function (link, ctx, globalScale) { | ||
return paintFn(link, link.__indexColor, ctx, globalScale); | ||
}); | ||
}, | ||
triggerUpdate: false | ||
}, | ||
linkLabel: { | ||
@@ -1172,0 +1180,0 @@ "default": 'name', |
@@ -113,2 +113,4 @@ interface GraphData { | ||
emitParticle(link: LinkObject): ChainableInstance; | ||
linkPointerAreaPaint(): CanvasPointerAreaPaintFn<LinkObject>; | ||
linkPointerAreaPaint(renderFn: CanvasPointerAreaPaintFn<LinkObject>): ChainableInstance; | ||
@@ -115,0 +117,0 @@ // Render control |
@@ -1159,2 +1159,10 @@ import { select } from 'd3-selection'; | ||
}, | ||
linkPointerAreaPaint: { | ||
onChange: function onChange(paintFn, state) { | ||
state.shadowGraph.linkCanvasObject(!paintFn ? null : function (link, ctx, globalScale) { | ||
return paintFn(link, link.__indexColor, ctx, globalScale); | ||
}); | ||
}, | ||
triggerUpdate: false | ||
}, | ||
linkLabel: { | ||
@@ -1161,0 +1169,0 @@ "default": 'name', |
{ | ||
"name": "force-graph", | ||
"version": "1.39.2", | ||
"version": "1.40.0", | ||
"description": "2D force-directed graph rendered on HTML5 canvas", | ||
@@ -44,7 +44,7 @@ "unpkg": "dist/force-graph.min.js", | ||
"bezier-js": "^4.0.3", | ||
"canvas-color-tracker": "^1.1.3", | ||
"d3-array": "^2.12.0", | ||
"canvas-color-tracker": "^1.1.4", | ||
"d3-array": "^2.12.1", | ||
"d3-drag": "^2.0.0", | ||
"d3-force-3d": "^2.3.0", | ||
"d3-scale": "^3.2.3", | ||
"d3-force-3d": "^2.3.2", | ||
"d3-scale": "^3.2.4", | ||
"d3-scale-chromatic": "^2.0.0", | ||
@@ -58,13 +58,14 @@ "d3-selection": "^2.0.0", | ||
"devDependencies": { | ||
"@babel/core": "^7.13.10", | ||
"@babel/core": "^7.13.14", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.13.8", | ||
"@babel/preset-env": "^7.13.10", | ||
"@babel/preset-env": "^7.13.12", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^17.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"postcss": "^8.2.9", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.41.4", | ||
"rollup": "^2.44.0", | ||
"rollup-plugin-dts": "^3.0.1", | ||
"rollup-plugin-postcss": "^3.1.8", | ||
"rollup-plugin-postcss": "^4.0.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
@@ -71,0 +72,0 @@ "typescript": "^4.2.3" |
@@ -176,2 +176,3 @@ force-graph | ||
| <b>nodePointerAreaPaint</b>([<i>fn</i>]) | Callback function for painting a canvas area used to detect node pointer interactions. The provided paint color uniquely identifies the node and should be used to perform drawing operations on the provided canvas context. This painted area will not be visible, but instead be used to detect pointer interactions with the node. The callback function has the signature: `.nodePointerAreaPaint(<node>, <color>, <canvas context>, <current global scale>)`. | *default interaction area is a circle centered on the node and sized according to `val`.* | | ||
| <b>linkPointerAreaPaint</b>([<i>fn</i>]) | Callback function for painting a canvas area used to detect link pointer interactions. The provided paint color uniquely identifies the link and should be used to perform drawing operations on the provided canvas context. This painted area will not be visible, but instead be used to detect pointer interactions with the link. The callback function has the signature: `.linkPointerAreaPaint(<link>, <color>, <canvas context>, <current global scale>)`. | *default interaction area is a straight line between the source and target nodes.* | | ||
| <b>enableNodeDrag</b>([<i>boolean</i>]) | Getter/setter for whether to enable the user interaction to drag nodes by click-dragging. If enabled, every time a node is dragged the simulation is re-heated so the other nodes react to the changes. Only applicable if enablePointerInteraction is `true`. | `true` | | ||
@@ -178,0 +179,0 @@ | <b>enableZoomInteraction</b>([<i>boolean</i>]) | Getter/setter for whether to enable zooming user interactions. | `true` | |
@@ -158,2 +158,7 @@ import { select as d3Select } from 'd3-selection'; | ||
}, triggerUpdate: false }, | ||
linkPointerAreaPaint: { onChange(paintFn, state) { | ||
state.shadowGraph.linkCanvasObject(!paintFn ? null : | ||
(link, ctx, globalScale) => paintFn(link, link.__indexColor, ctx, globalScale) | ||
); | ||
}, triggerUpdate: false }, | ||
linkLabel: { default: 'name', triggerUpdate: false }, | ||
@@ -160,0 +165,0 @@ linkHoverPrecision: { default: 4, triggerUpdate: false }, |
@@ -113,2 +113,4 @@ export interface GraphData { | ||
emitParticle(link: LinkObject): ChainableInstance; | ||
linkPointerAreaPaint(): CanvasPointerAreaPaintFn<LinkObject>; | ||
linkPointerAreaPaint(renderFn: CanvasPointerAreaPaintFn<LinkObject>): ChainableInstance; | ||
@@ -115,0 +117,0 @@ // Render control |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
226
6347233
14
15957
Updatedcanvas-color-tracker@^1.1.4
Updatedd3-array@^2.12.1
Updatedd3-force-3d@^2.3.2
Updatedd3-scale@^3.2.4