Can timeline and network models be combined? - vis.js

I am looking to outline a set of nodes that are created over time, and related to each other. D3 has a way to render nodes over time, and I could try to add links to this model.
https://bl.ocks.org/mbostock/6526445e2b44303eebf21da3b6627320
I'd like to use vis.js for this... where I distribute nodes based on their time of creation, and connect them to each other based on their relationships.
Then, asking for the impossible, I will ask that one cannot move them on the X axis but can move them on the Y-axis, to be able to analyze what is going on...
Any pointers are welcome.

I would add this as a comment but I dont have a high enough reputation. I saw a similar question where the user was wanting to combine the timeline and graph2d module together. I hope it can help point you in the right direction.
How to draw line graph on timeline using visjs?

Related

Need to outline several contiguous areas on map

I am working with maps that are based upon the lot and block survey system. So, for example, my house could be a parcel identified by block 34, lot 2. For every block, there are usually multiple lots and they are all within the same contiguous area. My users can query for block and lot, and the map will zoom in and display that exact block/lot and outline it. What they want to do is to show all lots for a specified block and draw an outline around the entire block.
I can use the JavaScript API and QueryTask execute() method to get all of the lots/features for a block. However, I do not know if there is a way to aggregate the feature data such that I can calculate and draw a border surrounding them all.
I have tried the executeForExtent() method and it works, but the extent, of course, is a rectangle, which means that while the outline will encompass all of the lots, the edges will have partials of other blocks and lots.
I know it's possible because I have seen it, but I do not have access to that code or the folks who developed it.
Does anybody know of a way to create an outline such as the one I'm describing?
TIA
I think you're looking for a way to calculate a convex hull which you can do with the geometry engine in the ArcGIS API for JavaScript. See https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#convexHull
Update: or maybe better the union method as suggested by #cabesuon in a comment below. Same basic principle - use the GeometryEngine :)

JavaFX Game Issues with wall boundaries

I am having trouble getting my simple JavaFX Maze Game to work. I just wanted to do this to test how much I knew, and I have gotten almost to the end.
All I want to do now is see if there is a way for me to combine all of the Rectangle2D Boundaries into a single bounding shape for me to do collision detection with.
Right now, I have maze walls set up like
this, and I have to check for collision against every single one of the wall objects, which I have contained in a list.
What I want to know is there anyway of turning that into a single shape that I can check collision against. That would make my job so much easier when it comes to finishing my game.
EDIT 1: The red boxes in the image are just there to represent the Rectangle2D bounding boxes. They will not actually be there in the final product.
EDIT 2: All of these have been created using a simple black square sprite, and all of the bounding Rectangle2D boxes are using the javafx.geometry package, not the javafx.scene.shape package.
Any help would be appreciated. Thanks in advance!
Do you mean union many shapes into one?
Thanks to the help of the comment thread on Powercoder's answer, I was able to get it figured out. Instead of using javafx.geometry classes, I was able to switch to javafx.scene.shape classes, which allowed me to finish everything I was trying to do.
Here is my old code: https://pastebin.com/1DBXuq79
and here is my new code: https://pastebin.com/uXTrcsZ2
For anybody who wants to compare and figure out how I changed it.

cytoscape: Dagre-layout prevent nodes from laying on edges

I am using cytoscapejs with dagre layout (https://github.com/cytoscape/cytoscape.js-dagre). I am very happy with this extension, however, there is one problem I am struggling with. In particular, I would like to prevent that nodes are allowed to lay over edges. Because of that, there are some examples where one cannot distinguish between an edge from a node to a successor and an edge from the successor of the particular node to the succeeding node. There is also an open issue regarding this misbehavior (https://github.com/cytoscape/cytoscape.js/issues/1078)
I allready tried out other curve-style layouts such as 'segments' and 'haystack' but unfortunately without success.
Does anyone of you have an idea how to do that?
Thanks in advance
Andy
You'd have to convert the points that Dagre gives you into segment values. You could put those values in .scratch() to be used in a mapper.
See https://github.com/cytoscape/cytoscape.js-dagre/issues/5
There are a lot of things in the queue for Cytoscape and the extensions, but unfortunately time and resources are constrained and this feature request is relatively low priority. You're welcome to make a pull request on the extension if you'd like to use the feature.
Thanks

I want to create some very specific heatmaps. Can it be done?

First of all, I'd like to explain what I want to achieve.
Imagine that I own a leaflet drop business. I cover a city, which is divided into 10 sections.
I want to leaflet-drop those 10 sections systematically, and have a heatmap that shows when they were last done (ie, if an area was done just last week, it would show up as green, but if it was done 6 months ago, it would be red.)
However, occasionally, I would do additional leaflet drops within the area, that I wouldn't want to be included in the data above - these would then show up on the heatmap in, say, blue.
I've been looking at OpenLayers, and it seems like it can do what I want - but I'm not really that technical, so need advice. OpenLayers has the ability to select specific areas with a polygon tool, which is exactly what I need - but how can I input this data, which will change frequently?
I currently monitor coverage of the territories with an Excel spreadsheet, but would like this heatmap system in addition to that.
So - any ideas?
Heck, for a tool for you to use yourself, you could use a drawing package like Inkscape. Scan a map of the area, paste that in, draw polygons for the areas you care about, and then every time you do a drop, change the colour of the polygon.
OpenLayers is generally used by software developers to aggregate geospatial/map data from various sources into web applications used by many users. OpenLayers can do what you want but not without writing a fair amount of JavaScript code. You might be looking more for a tool like ESRI's ArcCatalog, although it is probably too powerful for your needs.
I did a quick google search of "best map drawing tools" and found SmartDraw, for example. I have no affiliation with SmartDraw, nor do I know if it's any good, but it seems like this type of software would be more suited to your needs.
For what you say would be more useful a desktop tool as e.g. http://www.qgis.org/ (is open source and free)

How to draw 50 routes on a map and still be able to discern between all 50?

I have been working on this idea of how to plot about 50 routes on a google map at a time. In previous applications I have identified about 10 different routes at a time via the polyline color. I stopped at that point because the routes started to draw over top of eachother and you couldn't really tell the difference via colors very well.
I'm sure others have had to tackle this issue before. I have been thinking about this for quite sometime, but haven't had any good ideas. Any suggestions or advice would be greatly appreciated. Thanks.
***Update per comments below
The more I can plot the better the main draw back is being able to discern between the different plotted routes. This is part of the requirements for a project that I will be working on at some point in the future for a customer. Basically, the want to be able to cycle through routes at a glance see intersections on these routes, things of that nature, but it doesn't do them a whole lot of good if you can discern between 10 and there is 40 more on the map.
**Also, not a mobile app or for the visually impaired.
First off, you need to know your user. What route would they be most concerned with. This is important because this allows you to group these routes. Grouping is vital when you handle a lot of data because it allows the user to differentiate what is needed and what is not needed.
Some ways of Grouping could include toll routes, first 10 fastest routes, scenic routes, highway roads, route through major cities, routes by fast food chains. I hope you are getting the picture by now.
Yes, you could use 50 different colors or lines. But when it comes to that a lot of data,it is just not practical or useful at all to you or the user. This will also make the application ugly and frustrating when a user can't understand the map because of data overload.
There are multiple interesting ways you can handle this. Everything from different colors, alphas (opacity) to different types of lines (dashed, wavy, thick, thin). There are also different effects you could do to combine the routes.
Now to the important part. You can make your map all pretty and categorized well. But what will make ur application stand out from others is how you allow the user to choose a route from multiple ones. If you ever used Google earth/ directions and can change the route on the fly by clicking the road is pretty sharp and intuitive if you ask me or if you want to scroll through the routes by selecting then by sliding could be done well also.
Also, how do you change the categorized material? Bring up a menu? display a dialog? etc. There is a lot of things you can do here.
I hope this helps

Resources