gVisOrgChart not displaying child nodes - r

I have been trying to plot a gVisOrgChart but some child nodes are not visible in the final output even though they exist in the data. Is there a maximum size of characters that child nodes can hold in the Output ?
I have tried adjusting the width of the nodes as well but still not able to visualize the complete output.
I have described the data and output in the below link:
https://github.com/mages/googleVis/issues/84

Related

Anylogic: How to create an agent graph in the Main agent?

In my Anylogic model I have an agent population (terminals) of 4 agents with the time measurement shown below. I want to make a graph of this end.distribution.
If I create a graph in that agent tab and run the model, the graph will always appear within my GIS Map in the Main agent, which makes it unreadable. Thus, I want to create the graph within the Main agent tab. However, when I make the graph in the Main agent with this histogram data: terminals(0).end.distribution, I receive this error: Index 0 out of bounds for length 0, while there are 4 agents and this reference to terminals(0) does work in a tab of another agent population. Does anybody know how to make it work?
Your issue is an initialisation-order one: your histograms initialises themselves before the embedded agents they are referring to for their data are created (and so you get the error).
There are various ways to control the initialisation order but the 'correct' solution here (irrespective of initialisation order) is to use a replicated Histogram chart, where each replication 'links' to the appropriate Terminal agent to get its data (and so will only exist when the respective Terminal agent exists in its population).
This also means you only 'code' the histogram once, and it will dynamically adjust to create as many histograms as you have agents (which is what you would typically always want).
(The expression for the X coordinate of the replicated chart will depend on how wide it is. In my case, the chart is positioned at x=40 and is 300 wide, so I make each replication 350 apart to leave a 50 gap between.)
See help section AnyLogic Help > 2D and 3D Animation > Shape Replication for more details on replication (a very powerful capability applicable to several different types of element).

How can I adjust the position of tip labels relative to tree tips on a phylogenetic tree?

I am trying to create a figure of a map of a continuous trait onto a phylogenetic tree using the ape and phytools packages in R for a publication. An example code of what I am trying to produce is as follows:
library("ape")
library("phytools")
orig_tree<-rtree(n=350)
plot(orig_tree)
values<-data.frame("residuals"=runif(350,min=-1,max=1),row.names=orig_tree$tip.label)
values<-setNames(values$residuals,rownames(values))
residualsignalfit<-fastAnc(orig_tree,values,vars=TRUE,CI=TRUE)
obj<-contMap(orig_tree,values,plot=FALSE)
plot(obj,type="fan",fsize=.1,lwd=0.5)
The only difference is the terminal of the branches are all the same length because they are all living taxa, but this works well enough to illustrate the problem I am having. I have a large number of taxa in this tree, and as a result I have to shrink the text down fairly small using the fsize= argument to make them legible. However, as you can see from the example code, doing so causes the ends of each species name to be obscured by the outline for the phylogenetic tree. I have tried removing the outline but it makes the heatmap of the phylogeny very hard to read. I have been unable to find any way to reduce the thickness of the outline, it seems to be automatically generated.
I also tried adding the cex command to plot(obj...), but it has no effect on the produced tree at all.
What I am trying to figure out how to do is how to position the tip labels in order to make them more legible and not covered up by the outline for the tree. I cannot simply add a space in front of each terminal using the dplyr mutate function or something like that because the position of the taxon name is not always consistent, sometimes the left side of the name is attached to the tip and other times it is the right side. I have tried not plotting the data as a fan, but this ends up creating a figure with a huge amount of dead space due to the fact I have some very deep splits within the tree (basically plotting the figure as a right-facing tree results in half of the figure being dead space because my taxa diverged in the Mesozoic but only speciated after the K-T boundary).
Instead of shrinking the text down, you can scale the tree up. You can export the plot as image with a specific width and height. Setting both to 20 should make all tip labels legible.
Something like
setEPS()
postscript("output.eps", width = 20, height = 20)
plot(obj,type="fan",lwd=0.5)
dev.off()
This saves the plot to output.eps instead of showing it in the default viewer. So it is not restricted by the screen size. You still need to fiddle around with the best values of lwd and fsize, but in my experience it is much easier, when you have a big canvas.
Edit: Sorry, the unit of width and height is inches not pixels. So rather set it to 10 or 20.

Dynamic plot with hovering popups in R

I am trying to find a way to have a dynamic plot (for the moment I use plotly) in which if you keep the mouse over a certain point it is calling a routine which is showing something, e.g. a photo that is referring to that specific data point. An example is to have the MNIST data-set clustered in 2 dimensions (e.g. using t-SNE) and when you go over the points with the pointer you see the actual digit which stays for that point.

When does Zabbix display graph lines connected?

When Zabbix graphs show items with missing values, the graph line is shown interrupted:
In my eyes this shall show visually that there aren't any values between 5:25 and 5:55. This seems completely correct.
But I have another graph where the line between the values before and after the gap are displayed connected:
Both graphs are using different items (but in this case the same or similiar values). Both items don't have values from about 5:25 to 5:55. Both graphs are equally configured - as far as I can see...
What is the difference? Why is the second line displayed connected?
I also tried different draw styles (Line, filled region etc.) as described in Zabbix docu Custom graphs - always the same. Zabbix seems to have some other criteria to decide if the graph should be shown connected or interrupted.
This depends on item type, item interval configuration and the graph width.
item type - for trapper items, a line will always be drawn from one value to the next, and a straight line to the graph edge
item interval configuration and graph width - depending on how frequently the values are collected, how many are missing and how long the gap would be pixel-wise
Note that I said "item interval configuration" - flexible intervals and item scheduling can affect this in other, sometimes quite obscure, ways.

Neo4j Node Visualization

In Neo4j, using .grass-style files to set the appearance of nodes and relationships, how can one pick a certain style for a node with multiple labels?
Since .grass-files define the visual style of a graph item by linking a certain label to a certain style the obvious question arises:
How to deal with a graph item with multiple labels?
Say, I have the following:
.grass file (pseudo-syntax):
for label "User" use color=red
for label "computer" use color=blue
graph (abstracted):
node John has Label "user"
node Mac has Label "computer"
node Robot has Labels "user" and "computer"
This obviously colors nodes John and Mike red and blue respectively.
But what about the node Robot?
In my particular problem I have a number of nodes with 2 labels each. One of these 2 labels, LabelA is common among all nodes and the other one differs from node to node. What I want is, to use the .grass style of the other-labels-style for my nodes - what it does is, i uses LabelA for all nodes to style them.
After strugeling with this issue for quite some time I give up.
Does anyone has any clue?
This is not an answer to my question but it is a work-around that finally helped me and might also help other people out there.
Assuming I have all relevant styles defined in a .grass files (one for each label) I simply post-process my graph once it is loaded in my Neo4j browser.
This means, that I delete all those labels from my nodes which are blocking the style I need for the nodes leaving only this single label which gives me my required style.
Sure, this is quite unhandy and not optimal but it's the only attempt I found.
I will not mark this as answer since maybe someone will have a more appropriate idea ...

Resources