how to visualize nodes using in igraph - igraph

I have to visualize a network and I am using igraph.
Each of my vertices has an attribute that groups vertices into clusters. I would like to layout the graph according to the links, but I would also retain the attribute grouping, so that, for instance, vertices with a label "a" does not get mixed with vertices with label "b".
Is there any option other than tkplot() and manually adjust the result, retrieve the coordinates and plot the final result?

Here you can find two solutions: either to set the between-cluster and within-cluster edge weights, and apply a spring force layout; or iterate over clusters, and apply layout.norm() to set each cluster to a specific area of the plot.

Related

Get elements inside applied cutplanes autodesk forge

I am using Forge's viewer.setCutPlanes() function to set the cutplanes along with levels, so it will apply the cutplanes horizontally to cut the model level wise. I have two Vector4, as planes, I pass these two planes to the setCutPlanes() function. Now I want to get all elements those are inside the cutplanes, which means, only those elements which are visible in viewer after applying the cutplanes. How can I achieve that?
You could use the Viewer APIs to iterate through the geometry fragments of all objects in your design, get their bounding boxes, and check whether they're between your clipping planes. The process of obtaining the geometry bounds is explained in this blog post: https://forge.autodesk.com/blog/working-2d-and-3d-scenes-and-geometry-forge-viewer.
You can also re-use the 'window selection' example (https://forge.autodesk.com/blog/custom-window-selection-forge-viewer-part-iii) and switch the 8 frustum points to the section plane points.

Bounding areas and restrictions for geolocalizing

I'm trying to restraint an area to verify that certain points are correctly geolocalized. I have .klm files with the boundaries of the areas and also the coordinates of the points I'm trying to verify. I wonder If there is a way to combine this in code in a way the code itself identifies which points are inside the poligon and which aren't.

Extracting data from shapefile for polygon

I am working on my masters thesis trying to determine habitat prefrences for wild turkeys. I have polygon shapefiles which represent areas that turkeys used during different breeding periods. These polygons are all circular and vary from 300m to 1500m radius.
I have data to be extracted in the form of polygon shapefiles that I need to extract for each of the above mentioned areas. For example, one of my habitat data shapefiles maps out areas that were burned. This is a polygon shapefile with 100% coverage. The shapefile has an attribute Y_N_U where Y= yes, N=no and U=unknown. For each of my used circles I need to extract how much area was burned, not burned, and is unknown (can be in actual meters squared or % of the area .
Thanks for the help.
I would use union tool and union all the layers together.
Use select by attribute to and delete the polygons except for your target area (habitat polys).
Use dissolve tool on the above layer and run it with the "Y_N_U" attribute and the FID field of the habitat poly selected.
Then create a new field such as "Area_sqmeter". Run calculate geometry on that field - choose square meter for the unit.
Use the select by attribute tool under the selection button on top.
After this select the area you want. Right click on layer's name in the table of contents. Go down to the "data" tab and when it expands, click on "extract data". Be sure to choose to extract what is selected and extract it to a new file geo database.
Then you can edit it from there at your heart's desire while the original is still there.

Many adjacent polygons, want to convert polygons to paths and remove resultant duplicate paths

I have a json file with 80ish adjacent counties, represented as individual polygons. Each county, as expected, shares borders with other counties.
I'd like to convert each of those polygons to paths, creating paths symbolizing the borders of every county. At this point, I'd be left with many overlapping or duplicate paths where counties shared borders.
I'd like to find a systematic way to delete these overlapping paths so each line representing a border is only displayed once. By doing so, I'll be able to style the borders individually to fix a problem described in a previous question.
Does such a thing exist? I'm aware of the possibility of deleting shared borders in Illustrator, but many of the county polygons share borders with 3+ other counties, making this incredibly tedious.
Thanks.
So, I eventually tackled this problem using ArcMap. My steps:
Create a shapefile from the json I was using and load into ArcMap
Import the shapefile into a geodatabase
Put the file into a feature dataset
Create a topology (right click on Feature Dataset > New > Topology)
Add a rule to the topology against overlapping lines
Find all errors (overlapping lines)
Use the error inspector to select each overlapping line and Subtract (right click on error) one of the lines
Took me about 5 minutes to do remove a hundred or so.

Library to generate heat map map overlay based off point values not point densities

I have a set of data points where each point is expressed as a lat/lng. Each of these points has a value associated with it that changes over time. I would like to produce a heatmap animation overlay on top of a map that reflects this change in value over time. Note: I am fine with producing a series of static "snapshots" and piecing them together frame-by-frame into an animation, so the heatmap library itself does not have to support animation.
My first attempt was to use the HeatMapLayer which is a part of the Google Maps visualization library. However as per the question Heatmap based on average weights and not on the number of data points, it would seem that this particular visualization library insists on weighing the density of points in determining what color to use surrounding a given point.
I am after a solution that only considers the value of the points rather than the density. To give an example, assume one wanted to visualize the ambient temperature of a city over time, but there were more thermometers installed in some parts of the city than others. You wouldn't want a small area with many thermometers installed to show up red just because there were many thermometers - you'd want it to show up red only if it was hot there.
Basically, I want a single color for each of my points that reflects the intensity of the point's value, and then a gradient spatial transition between any two point's colors. It doesn't have to be Google Maps - the key criteria is just i) must base colors off point values not point densities ii) must overlay on top of a map and iii) ideally has a programming abstraction that talks in terms of lat/lng's, rather than requiring manual conversion to e.g. Euclidean space.
global tempsYou can do this with multiple:
gmaps.symbol_layer
and then just layer them up:
fig_gmap.add_layer(red_markers)
fig_gmap.add_layer(yellow_markers)
fig_gmap.add_layer(green_markers)
fig_gmap.add_layer(blue_markers)
I haven't been able to successfully pass a value that gives me a good temp color for the heat maps, just always get some variation on the density thing, which is a one trick pony. It would be nice having a way to do this and animate the marker icon without java.
Maybe you should try heatmap.js. It has a plugin for Google Maps: http://www.patrick-wied.at/static/heatmapjs/plugin-gmaps-layer.html
This library uses datasets made of coordinates and values. I think it will behave the way you described.