Network visualization that constrains nodes within a shapefile polygonOutput shapefile for the igraph network in RConvert a shapefile from polygons to points?Coloring a Shapefile Polygons in MatlabR: Plotting points from a .gdb file over polygons in a shapefileShapefile with multiple shapes but only one polygonHow to get polygons of a shapefile containing centroids of polygons from another shapefile in R?Close a spatial line into a polygon using a shapefileHow to loop through polygons in a shapefile in r?R visNetwork + igraph weighted network visualization with visEdgesFilter shapefile polygons by area
The grades of the students in a class
A conjectural trigonometric identity
Security measures that could plausibly last 150+ years?
Difference between HCD and CID collision induced dissociations?
Return last number in sub-sequences in a list of integers
Is the EU really banning "toxic propellants" in 2020? How is that going to work?
What does the USDA zone range mean?
How can a class have multiple methods without breaking the single responsibility principle
"DDoouubbllee ssppeeaakk!!"
"Fewer errors means better products" or "Fewer errors mean better products"?
Why have both: BJT and FET transistors on IC output?
Best Ergonomic Design for a handheld ranged weapon
How to gracefully excuse yourself from a meeting due to emergencies such as a restroom break?
How to get Planck length in meters to 6 decimal places
Why do MS SQL Server SEQUENCEs not have an ORDER parameter like Oracle?
Applying for mortgage when living together but only one will be on the mortgage
Conflict between senior and junior members
Can the additional attack from a Samurai's Rapid Strike have advantage?
UX writing: When to use "we"?
How to trick a fairly simplistic kill-counter?
describing weighing an object in hand
Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?
Is there anyway to harden soft braised carrots?
Should 2FA be enabled on service accounts?
Network visualization that constrains nodes within a shapefile polygon
Output shapefile for the igraph network in RConvert a shapefile from polygons to points?Coloring a Shapefile Polygons in MatlabR: Plotting points from a .gdb file over polygons in a shapefileShapefile with multiple shapes but only one polygonHow to get polygons of a shapefile containing centroids of polygons from another shapefile in R?Close a spatial line into a polygon using a shapefileHow to loop through polygons in a shapefile in r?R visNetwork + igraph weighted network visualization with visEdgesFilter shapefile polygons by area
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to create a network visualization of contact tracing data, but constraining groups of nodes by GIS coordinates or loosely within a shape file polygon.
Ideally this would be within ggplot2 framework so I can integrate with other mapping, but if there are igraph or other solutions I'd be happy as well.
Example contact network from the ggnetwork vignette distributing the nodes using force-directed algorithm.
library(network)
library(sna)
library(ggnetwork)
n <- network(rgraph(10, tprob = 0.2), directed = FALSE)
n %v% "family" <- sample(letters[1:3], 10, replace = TRUE)
n %v% "importance" <- sample(1:3, 10, replace = TRUE)
e <- network.edgecount(n)
set.edge.attribute(n, "type", sample(letters[24:26], e, replace = TRUE))
set.edge.attribute(n, "day", sample(1:3, e, replace = TRUE))
ggplot(n, aes(x = x, y = y, xend = xend, yend = yend)) +
geom_edges(color = "black") +
geom_nodes(color = "black", size = 8) +
geom_nodetext(aes(color = family, label = LETTERS[ vertex.names ]),
fontface = "bold") +
theme_blank()
Looking under the hood a bit:
ggnetwork(n)
x y family importance na.x vertex.names xend yend day
1 0.9716994 0.2514118 b 3 FALSE 1 0.9716994 0.2514118 NA
2 0.2287786 0.3320298 a 3 FALSE 2 0.2287786 0.3320298 NA
3 1.0000000 0.6549319 c 3 FALSE 3 1.0000000 0.6549319 NA
4 0.6364260 0.6691008 b 2 FALSE 4 0.6364260 0.6691008 NA
5 0.5913509 0.2442173 b 3 FALSE 5 0.5913509 0.2442173 NA
6 0.2744755 0.7079372 c 2 FALSE 6 0.2744755 0.7079372 NA
7 0.4569772 1.0000000 a 3 FALSE 7 0.4569772 1.0000000 NA
8 0.0000000 0.5340600 a 2 FALSE 8 0.0000000 0.5340600 NA
9 0.8101132 0.0000000 b 1 FALSE 9 0.8101132 0.0000000 NA
10 0.8281340 0.3730087 c 2 FALSE 10 0.8281340 0.3730087 NA
17 0.0000000 0.5340600 a 2 FALSE 8 0.2287786 0.3320298 1
21 0.0000000 0.5340600 a 2 FALSE 8 0.2744755 0.7079372 2
41 0.2744755 0.7079372 c 2 FALSE 6 0.2287786 0.3320298 3
51 0.2744755 0.7079372 c 2 FALSE 6 0.6364260 0.6691008 3
61 0.4569772 1.0000000 a 3 FALSE 7 0.6364260 0.6691008 2
71 0.4569772 1.0000000 a 3 FALSE 7 0.2744755 0.7079372 2
81 0.5913509 0.2442173 b 3 FALSE 5 0.9716994 0.2514118 3
91 0.5913509 0.2442173 b 3 FALSE 5 0.2287786 0.3320298 3
101 0.5913509 0.2442173 b 3 FALSE 5 0.6364260 0.6691008 3
11 0.6364260 0.6691008 b 2 FALSE 4 1.0000000 0.6549319 3
12 0.8101132 0.0000000 b 1 FALSE 9 0.5913509 0.2442173 2
13 0.8101132 0.0000000 b 1 FALSE 9 0.9716994 0.2514118 2
14 0.8281340 0.3730087 c 2 FALSE 10 0.9716994 0.2514118 3
15 0.8281340 0.3730087 c 2 FALSE 10 0.6364260 0.6691008 2
16 0.8281340 0.3730087 c 2 FALSE 10 0.8101132 0.0000000 3
18 1.0000000 0.6549319 c 3 FALSE 3 0.9716994 0.2514118 2
na.y type
1 NA <NA>
2 NA <NA>
3 NA <NA>
4 NA <NA>
5 NA <NA>
6 NA <NA>
7 NA <NA>
8 NA <NA>
9 NA <NA>
10 NA <NA>
17 FALSE z
21 FALSE z
41 FALSE z
51 FALSE y
61 FALSE y
71 FALSE y
81 FALSE y
91 FALSE y
101 FALSE x
11 FALSE x
12 FALSE z
13 FALSE z
14 FALSE z
15 FALSE y
16 FALSE z
18 FALSE z
I imagine that I could randomize the x/y pairs within each polygon (e.g. splancs::csr or sp::spsample), but obviously the output would be a mess of lines and points.
Is it possible to use a force directed algorithm to distribute groups of nodes algorithmically within certain constraints of coordinates?
r gis igraph visnetwork ggnetwork
add a comment |
I'm trying to create a network visualization of contact tracing data, but constraining groups of nodes by GIS coordinates or loosely within a shape file polygon.
Ideally this would be within ggplot2 framework so I can integrate with other mapping, but if there are igraph or other solutions I'd be happy as well.
Example contact network from the ggnetwork vignette distributing the nodes using force-directed algorithm.
library(network)
library(sna)
library(ggnetwork)
n <- network(rgraph(10, tprob = 0.2), directed = FALSE)
n %v% "family" <- sample(letters[1:3], 10, replace = TRUE)
n %v% "importance" <- sample(1:3, 10, replace = TRUE)
e <- network.edgecount(n)
set.edge.attribute(n, "type", sample(letters[24:26], e, replace = TRUE))
set.edge.attribute(n, "day", sample(1:3, e, replace = TRUE))
ggplot(n, aes(x = x, y = y, xend = xend, yend = yend)) +
geom_edges(color = "black") +
geom_nodes(color = "black", size = 8) +
geom_nodetext(aes(color = family, label = LETTERS[ vertex.names ]),
fontface = "bold") +
theme_blank()
Looking under the hood a bit:
ggnetwork(n)
x y family importance na.x vertex.names xend yend day
1 0.9716994 0.2514118 b 3 FALSE 1 0.9716994 0.2514118 NA
2 0.2287786 0.3320298 a 3 FALSE 2 0.2287786 0.3320298 NA
3 1.0000000 0.6549319 c 3 FALSE 3 1.0000000 0.6549319 NA
4 0.6364260 0.6691008 b 2 FALSE 4 0.6364260 0.6691008 NA
5 0.5913509 0.2442173 b 3 FALSE 5 0.5913509 0.2442173 NA
6 0.2744755 0.7079372 c 2 FALSE 6 0.2744755 0.7079372 NA
7 0.4569772 1.0000000 a 3 FALSE 7 0.4569772 1.0000000 NA
8 0.0000000 0.5340600 a 2 FALSE 8 0.0000000 0.5340600 NA
9 0.8101132 0.0000000 b 1 FALSE 9 0.8101132 0.0000000 NA
10 0.8281340 0.3730087 c 2 FALSE 10 0.8281340 0.3730087 NA
17 0.0000000 0.5340600 a 2 FALSE 8 0.2287786 0.3320298 1
21 0.0000000 0.5340600 a 2 FALSE 8 0.2744755 0.7079372 2
41 0.2744755 0.7079372 c 2 FALSE 6 0.2287786 0.3320298 3
51 0.2744755 0.7079372 c 2 FALSE 6 0.6364260 0.6691008 3
61 0.4569772 1.0000000 a 3 FALSE 7 0.6364260 0.6691008 2
71 0.4569772 1.0000000 a 3 FALSE 7 0.2744755 0.7079372 2
81 0.5913509 0.2442173 b 3 FALSE 5 0.9716994 0.2514118 3
91 0.5913509 0.2442173 b 3 FALSE 5 0.2287786 0.3320298 3
101 0.5913509 0.2442173 b 3 FALSE 5 0.6364260 0.6691008 3
11 0.6364260 0.6691008 b 2 FALSE 4 1.0000000 0.6549319 3
12 0.8101132 0.0000000 b 1 FALSE 9 0.5913509 0.2442173 2
13 0.8101132 0.0000000 b 1 FALSE 9 0.9716994 0.2514118 2
14 0.8281340 0.3730087 c 2 FALSE 10 0.9716994 0.2514118 3
15 0.8281340 0.3730087 c 2 FALSE 10 0.6364260 0.6691008 2
16 0.8281340 0.3730087 c 2 FALSE 10 0.8101132 0.0000000 3
18 1.0000000 0.6549319 c 3 FALSE 3 0.9716994 0.2514118 2
na.y type
1 NA <NA>
2 NA <NA>
3 NA <NA>
4 NA <NA>
5 NA <NA>
6 NA <NA>
7 NA <NA>
8 NA <NA>
9 NA <NA>
10 NA <NA>
17 FALSE z
21 FALSE z
41 FALSE z
51 FALSE y
61 FALSE y
71 FALSE y
81 FALSE y
91 FALSE y
101 FALSE x
11 FALSE x
12 FALSE z
13 FALSE z
14 FALSE z
15 FALSE y
16 FALSE z
18 FALSE z
I imagine that I could randomize the x/y pairs within each polygon (e.g. splancs::csr or sp::spsample), but obviously the output would be a mess of lines and points.
Is it possible to use a force directed algorithm to distribute groups of nodes algorithmically within certain constraints of coordinates?
r gis igraph visnetwork ggnetwork
It is comparatively easy to add arbitrary boundaries to a force directed layout (just don't move a node that attempts to "escape" its "frame"). In fact, Fruchterman and Reingold, the authors of what is now commonly referred to as the "spring layout" algorithm, explicitly discuss this point in their original paper. However, this will almost certainly require a custom implementation of the FR algorithm (or any other force directed layout algorithm).
– Paul Brodersen
Apr 1 at 14:58
add a comment |
I'm trying to create a network visualization of contact tracing data, but constraining groups of nodes by GIS coordinates or loosely within a shape file polygon.
Ideally this would be within ggplot2 framework so I can integrate with other mapping, but if there are igraph or other solutions I'd be happy as well.
Example contact network from the ggnetwork vignette distributing the nodes using force-directed algorithm.
library(network)
library(sna)
library(ggnetwork)
n <- network(rgraph(10, tprob = 0.2), directed = FALSE)
n %v% "family" <- sample(letters[1:3], 10, replace = TRUE)
n %v% "importance" <- sample(1:3, 10, replace = TRUE)
e <- network.edgecount(n)
set.edge.attribute(n, "type", sample(letters[24:26], e, replace = TRUE))
set.edge.attribute(n, "day", sample(1:3, e, replace = TRUE))
ggplot(n, aes(x = x, y = y, xend = xend, yend = yend)) +
geom_edges(color = "black") +
geom_nodes(color = "black", size = 8) +
geom_nodetext(aes(color = family, label = LETTERS[ vertex.names ]),
fontface = "bold") +
theme_blank()
Looking under the hood a bit:
ggnetwork(n)
x y family importance na.x vertex.names xend yend day
1 0.9716994 0.2514118 b 3 FALSE 1 0.9716994 0.2514118 NA
2 0.2287786 0.3320298 a 3 FALSE 2 0.2287786 0.3320298 NA
3 1.0000000 0.6549319 c 3 FALSE 3 1.0000000 0.6549319 NA
4 0.6364260 0.6691008 b 2 FALSE 4 0.6364260 0.6691008 NA
5 0.5913509 0.2442173 b 3 FALSE 5 0.5913509 0.2442173 NA
6 0.2744755 0.7079372 c 2 FALSE 6 0.2744755 0.7079372 NA
7 0.4569772 1.0000000 a 3 FALSE 7 0.4569772 1.0000000 NA
8 0.0000000 0.5340600 a 2 FALSE 8 0.0000000 0.5340600 NA
9 0.8101132 0.0000000 b 1 FALSE 9 0.8101132 0.0000000 NA
10 0.8281340 0.3730087 c 2 FALSE 10 0.8281340 0.3730087 NA
17 0.0000000 0.5340600 a 2 FALSE 8 0.2287786 0.3320298 1
21 0.0000000 0.5340600 a 2 FALSE 8 0.2744755 0.7079372 2
41 0.2744755 0.7079372 c 2 FALSE 6 0.2287786 0.3320298 3
51 0.2744755 0.7079372 c 2 FALSE 6 0.6364260 0.6691008 3
61 0.4569772 1.0000000 a 3 FALSE 7 0.6364260 0.6691008 2
71 0.4569772 1.0000000 a 3 FALSE 7 0.2744755 0.7079372 2
81 0.5913509 0.2442173 b 3 FALSE 5 0.9716994 0.2514118 3
91 0.5913509 0.2442173 b 3 FALSE 5 0.2287786 0.3320298 3
101 0.5913509 0.2442173 b 3 FALSE 5 0.6364260 0.6691008 3
11 0.6364260 0.6691008 b 2 FALSE 4 1.0000000 0.6549319 3
12 0.8101132 0.0000000 b 1 FALSE 9 0.5913509 0.2442173 2
13 0.8101132 0.0000000 b 1 FALSE 9 0.9716994 0.2514118 2
14 0.8281340 0.3730087 c 2 FALSE 10 0.9716994 0.2514118 3
15 0.8281340 0.3730087 c 2 FALSE 10 0.6364260 0.6691008 2
16 0.8281340 0.3730087 c 2 FALSE 10 0.8101132 0.0000000 3
18 1.0000000 0.6549319 c 3 FALSE 3 0.9716994 0.2514118 2
na.y type
1 NA <NA>
2 NA <NA>
3 NA <NA>
4 NA <NA>
5 NA <NA>
6 NA <NA>
7 NA <NA>
8 NA <NA>
9 NA <NA>
10 NA <NA>
17 FALSE z
21 FALSE z
41 FALSE z
51 FALSE y
61 FALSE y
71 FALSE y
81 FALSE y
91 FALSE y
101 FALSE x
11 FALSE x
12 FALSE z
13 FALSE z
14 FALSE z
15 FALSE y
16 FALSE z
18 FALSE z
I imagine that I could randomize the x/y pairs within each polygon (e.g. splancs::csr or sp::spsample), but obviously the output would be a mess of lines and points.
Is it possible to use a force directed algorithm to distribute groups of nodes algorithmically within certain constraints of coordinates?
r gis igraph visnetwork ggnetwork
I'm trying to create a network visualization of contact tracing data, but constraining groups of nodes by GIS coordinates or loosely within a shape file polygon.
Ideally this would be within ggplot2 framework so I can integrate with other mapping, but if there are igraph or other solutions I'd be happy as well.
Example contact network from the ggnetwork vignette distributing the nodes using force-directed algorithm.
library(network)
library(sna)
library(ggnetwork)
n <- network(rgraph(10, tprob = 0.2), directed = FALSE)
n %v% "family" <- sample(letters[1:3], 10, replace = TRUE)
n %v% "importance" <- sample(1:3, 10, replace = TRUE)
e <- network.edgecount(n)
set.edge.attribute(n, "type", sample(letters[24:26], e, replace = TRUE))
set.edge.attribute(n, "day", sample(1:3, e, replace = TRUE))
ggplot(n, aes(x = x, y = y, xend = xend, yend = yend)) +
geom_edges(color = "black") +
geom_nodes(color = "black", size = 8) +
geom_nodetext(aes(color = family, label = LETTERS[ vertex.names ]),
fontface = "bold") +
theme_blank()
Looking under the hood a bit:
ggnetwork(n)
x y family importance na.x vertex.names xend yend day
1 0.9716994 0.2514118 b 3 FALSE 1 0.9716994 0.2514118 NA
2 0.2287786 0.3320298 a 3 FALSE 2 0.2287786 0.3320298 NA
3 1.0000000 0.6549319 c 3 FALSE 3 1.0000000 0.6549319 NA
4 0.6364260 0.6691008 b 2 FALSE 4 0.6364260 0.6691008 NA
5 0.5913509 0.2442173 b 3 FALSE 5 0.5913509 0.2442173 NA
6 0.2744755 0.7079372 c 2 FALSE 6 0.2744755 0.7079372 NA
7 0.4569772 1.0000000 a 3 FALSE 7 0.4569772 1.0000000 NA
8 0.0000000 0.5340600 a 2 FALSE 8 0.0000000 0.5340600 NA
9 0.8101132 0.0000000 b 1 FALSE 9 0.8101132 0.0000000 NA
10 0.8281340 0.3730087 c 2 FALSE 10 0.8281340 0.3730087 NA
17 0.0000000 0.5340600 a 2 FALSE 8 0.2287786 0.3320298 1
21 0.0000000 0.5340600 a 2 FALSE 8 0.2744755 0.7079372 2
41 0.2744755 0.7079372 c 2 FALSE 6 0.2287786 0.3320298 3
51 0.2744755 0.7079372 c 2 FALSE 6 0.6364260 0.6691008 3
61 0.4569772 1.0000000 a 3 FALSE 7 0.6364260 0.6691008 2
71 0.4569772 1.0000000 a 3 FALSE 7 0.2744755 0.7079372 2
81 0.5913509 0.2442173 b 3 FALSE 5 0.9716994 0.2514118 3
91 0.5913509 0.2442173 b 3 FALSE 5 0.2287786 0.3320298 3
101 0.5913509 0.2442173 b 3 FALSE 5 0.6364260 0.6691008 3
11 0.6364260 0.6691008 b 2 FALSE 4 1.0000000 0.6549319 3
12 0.8101132 0.0000000 b 1 FALSE 9 0.5913509 0.2442173 2
13 0.8101132 0.0000000 b 1 FALSE 9 0.9716994 0.2514118 2
14 0.8281340 0.3730087 c 2 FALSE 10 0.9716994 0.2514118 3
15 0.8281340 0.3730087 c 2 FALSE 10 0.6364260 0.6691008 2
16 0.8281340 0.3730087 c 2 FALSE 10 0.8101132 0.0000000 3
18 1.0000000 0.6549319 c 3 FALSE 3 0.9716994 0.2514118 2
na.y type
1 NA <NA>
2 NA <NA>
3 NA <NA>
4 NA <NA>
5 NA <NA>
6 NA <NA>
7 NA <NA>
8 NA <NA>
9 NA <NA>
10 NA <NA>
17 FALSE z
21 FALSE z
41 FALSE z
51 FALSE y
61 FALSE y
71 FALSE y
81 FALSE y
91 FALSE y
101 FALSE x
11 FALSE x
12 FALSE z
13 FALSE z
14 FALSE z
15 FALSE y
16 FALSE z
18 FALSE z
I imagine that I could randomize the x/y pairs within each polygon (e.g. splancs::csr or sp::spsample), but obviously the output would be a mess of lines and points.
Is it possible to use a force directed algorithm to distribute groups of nodes algorithmically within certain constraints of coordinates?
r gis igraph visnetwork ggnetwork
r gis igraph visnetwork ggnetwork
edited Mar 27 at 1:05
micturalgia
asked Mar 26 at 22:59
micturalgiamicturalgia
1001 gold badge2 silver badges11 bronze badges
1001 gold badge2 silver badges11 bronze badges
It is comparatively easy to add arbitrary boundaries to a force directed layout (just don't move a node that attempts to "escape" its "frame"). In fact, Fruchterman and Reingold, the authors of what is now commonly referred to as the "spring layout" algorithm, explicitly discuss this point in their original paper. However, this will almost certainly require a custom implementation of the FR algorithm (or any other force directed layout algorithm).
– Paul Brodersen
Apr 1 at 14:58
add a comment |
It is comparatively easy to add arbitrary boundaries to a force directed layout (just don't move a node that attempts to "escape" its "frame"). In fact, Fruchterman and Reingold, the authors of what is now commonly referred to as the "spring layout" algorithm, explicitly discuss this point in their original paper. However, this will almost certainly require a custom implementation of the FR algorithm (or any other force directed layout algorithm).
– Paul Brodersen
Apr 1 at 14:58
It is comparatively easy to add arbitrary boundaries to a force directed layout (just don't move a node that attempts to "escape" its "frame"). In fact, Fruchterman and Reingold, the authors of what is now commonly referred to as the "spring layout" algorithm, explicitly discuss this point in their original paper. However, this will almost certainly require a custom implementation of the FR algorithm (or any other force directed layout algorithm).
– Paul Brodersen
Apr 1 at 14:58
It is comparatively easy to add arbitrary boundaries to a force directed layout (just don't move a node that attempts to "escape" its "frame"). In fact, Fruchterman and Reingold, the authors of what is now commonly referred to as the "spring layout" algorithm, explicitly discuss this point in their original paper. However, this will almost certainly require a custom implementation of the FR algorithm (or any other force directed layout algorithm).
– Paul Brodersen
Apr 1 at 14:58
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367378%2fnetwork-visualization-that-constrains-nodes-within-a-shapefile-polygon%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367378%2fnetwork-visualization-that-constrains-nodes-within-a-shapefile-polygon%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It is comparatively easy to add arbitrary boundaries to a force directed layout (just don't move a node that attempts to "escape" its "frame"). In fact, Fruchterman and Reingold, the authors of what is now commonly referred to as the "spring layout" algorithm, explicitly discuss this point in their original paper. However, this will almost certainly require a custom implementation of the FR algorithm (or any other force directed layout algorithm).
– Paul Brodersen
Apr 1 at 14:58