New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

d3-layout-circle-graph

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-layout-circle-graph - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

demo-with-range.png

2

bower.json

@@ -32,3 +32,3 @@ {

},
"version": "1.0.0"
"version": "1.1.0"
}

@@ -12,2 +12,3 @@ (function(d3) {

var nodeMap;
var range = Math.PI * 2;
var nodeKeyAccessor = function(n) {

@@ -63,6 +64,14 @@ return n.name;

range: function(r) {
if (typeof r === 'number') {
range = r;
return layout;
}
return range;
},
nodes: function (nodes) {
nodeMap = {};
var numNodes = nodes.length;
var radianSeparation = (2 * Math.PI) / numNodes;
var radianSeparation = range / numNodes;
var halfSeparation = radianSeparation / 2;

@@ -113,2 +122,18 @@ nodes.forEach(function(n, i) {

var to = nodeMap[ edgeTargetKeyAccessor(e) ];
if (!from) {
console.error('d3.layout.circleGraph: Could not find source from given edge.',
' nodeMap: ', nodeMap,
' edge: ', e,
' edgeSourceKeyAccessor: ', edgeSourceKeyAccessor.toString()
);
throw new Error('d3.layout.circleGraph: Could not find source from given edge.');
}
if (!to) {
console.error('d3.layout.circleGraph: Could not find target from given edge.',
' nodeMap: ', nodeMap,
' edge: ', e,
' edgeTargetKeyAccessor: ', edgeTargetKeyAccessor.toString()
);
throw new Error('d3.layout.circleGraph: Could not find target from given edge.');
}
if (from !== to) {

@@ -115,0 +140,0 @@ coords.push(

{
"name": "d3-layout-circle-graph",
"version": "1.0.0",
"version": "1.1.0",
"description": "A d3 layout generator for visualizing a graph using a circle of nodes and chords connecting them",

@@ -5,0 +5,0 @@ "main": "circleGraph.js",

@@ -121,1 +121,11 @@ d3.layout.circleGraph

### `circleGraph.range([number])`
Sets or gets the "range" in radians of a complete circle within which the nodes should be evenly distributed. Default is `Math.PI * 2` (which represents the complete circle).
For example, calling `circleGraph.range(Math.PI * 3/2)` on the demo will result in this:
<img src="demo-with-range.png" width="400" alt="screenshot of demo with range()">
> **WARNING:** This must be called _before_ `.nodes()` gets called.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc