How to implement a JUNG graph with mixed (directed and undirected) edges? - jung

I have a GraphML file with both directed and un-directed edges. I want to read this file into a JUNG graph, but I can't find an appropriate implementation that would support graphs of mixed edge-types. Is there such an implementation? Or, any hints to implement one myself? Thanks.

http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/graph/package-summary.html
Either SparseGraph or SparseMultigraph should do.

Related

Import/export or store/restore xShapes in LibreOffice/OpenOffice Draw via API

I want – as the title says – extract programmatically a shape from a Draw document through the api interface. Beside I want to import such a shape into a document as well.
I saw some predefined shapes in XML form and the document is stored as XML structure as well. Is there a known way to anybody out there to allow the storage and load of one shape?
What is this good for?
I want to, for example, enable the programmatic deletion of objects. But to enable the undo/redo functionalities I need to “store” the deleted shape. Beyond that this would allow me to add user-defined objects programmatically, e.g. arrow heads, UML structures or unicorns.
Thanks in advance for any ideas,
J
P.S.: I work with LibreOffice Version: 5.2.1.2 . Access the interface through C# (so java and C++ would do it as well) but any ideas are welcome.
I'm not entirely sure what you are trying to do, but here are some ideas:
Instead of deleting an XShape, you could use the dispatcher to Cut it. That will store it in the clipboard, so if it needs to be added back then the dispatcher can Paste it, as long as no other copy or cut was performed.
To create a shape, see the example at https://wiki.openoffice.org/wiki/Documentation/DevGuide/Drawings/Shapes. This code will look different depending on what kind of shape it is. It sounds like you are asking for one code listing that will programmatically create any type of shape, but I do not think it is that easy.
Instead of using the UNO API, you could programmatically modify the XML files, which may make it easier to store and work with any shape. Be sure to use an XML parsing library, not just regular expressions.

How to Measure Distance and Area using Openlayers3 with GeoExt3 and ExtJs6?

I need to add the measurement tool for my GIS Portal.Is anyone know how to measure distance and area in Openlayers3 with GeoExt3 and ExtJs6?
Thanks in Advance.
There is an example that shows how to implement a measure tool in OpenLayers 3, see:
http://openlayers.org/en/latest/examples/measure.html
How such a tool is implemented greatly depends on the application itself and the other libraries available around it. For example, you're using GeoExt3 and ExtJS6. You could create the tool as a GeoExt3 component and contribute it with Pull Request. See: https://geoext.github.io/geoext3/ (Now: Get Involved!)

Neo4j results as png file

The neo4j browser can be used to view and export the result of a cypher query as an image. Is there a way to do this using the REST/Java or any other API interface?
I can probably get the result as a Json and visualize the result using linkurious but the inbuilt neo4j visualization is better for my purpose.
Any ideas?
Thanks!
There are a large number of options. Coming at it from the REST API, there are a few client packages available. One is RNeo4j for R. The README for the package includes a section on visualization. See that here

Custom Node images for neo4j visualization?

I need an open-source solution for visualizing a neo4j graph in a web application. I'm looking at alchemy.js, and it seems pretty cool. What I'd ultimately like to do is use icons for different node types, instead of just different colors. Is there a way to do that with alchemy.js? If so, how? If not, is there a different open-source toolkit that would enable this? Obviously, KeyLines does it, but it's far from open-source.
Thanks!
You can also check out linkurious.js which is open source, based on sigma.js and afaik has customizable images.

In a GeoJson file, how do I combine features (states) into a single feature (region)

I'm drawing a map of the US with D3. Problem is the design on the project has changed and I need to draw regions as a whole instead of the individual states. I can't for the life of me find any good info on how to combine state features into a single region feature.
I'm assuming the gdal is the right tool for the job, but I can't seem to find how to do this.
The tutorial Mike T posted is a great resource, but it didn't solve the specific problem I had.
What I finally discovered is that when you're using topojson there is a topojson.merge method to combine multiple paths into a single path.
Follow this tutorial to convert a Shapefile into GeoJSON, then to TopoJSON, then to a D3 project. There is even an example of US (counties?) included with the project.

Resources