OPNET getting current nodes height - opnet

I am using OPNET 15, with tmm,
Looking for a way to print the node current height (from sea level)
any known function to use in the C code, or other way? didnt find no help on the web or documentary

Height is a attribute of a node. op_ima_attr_get() can get the height value of a node. It is very easy.

Related

Is it possible to position the leaf nodes one below the other instead of next to each other?

I use d3-org-chart and I wonder if it's possible to position the bottommost elements below each other instead of on the same level:
There are some exposed variables that can be adjusted but I couldn't find a property that would do the job.
If this feature isn't build-in, would it be possible to achieve this via adding a function using vanilla d3.js? I would we very happy for hints or recommendations how to tackle this.
Yes draw the paths end of the svg and align leaf nodes to bottom of the svg

D3js text too small

I made a simple tree structure and displayed it using D3.js. When nodes become too many, it's impossible to see any text.
Fig1 Fig2
I could make an image out of the svg, then render it instead of displaying the tree by d3js and finally using a magnifier to zoom in. I don't know if it can actually work; is there a better and working way to do it?
Well first of all I would recomend placing your lable below the nodes rather than to the right as that will win you some space back but that won't really solve your problem.
I would recomend either making your tree colapse by node
or defining the space between the nodes as a function of how many children there are. For this, you will need to recursively count the children in your tree. You can see how to do that in an answer I gave here
There are likely other solutions but those are the two that jump out at me as the best.

Keep a node in same position despite force layout rest all nodes can be part of force layout

How can I keep a particular node in same location ? I mean I run force layout tick moves nodes around but I want a particular node to stay at same position despite force layout ?
Which version are you using d3 v3 or v4?
In d3 v3, setting fixed = true will ensure that the node is in place. Make sure, that the node has correct x, y values or let the simulation run so that nodes will stabilize before setting fixed = true.
In v4, setting fx and fy properties of the nodes to the coordinate will ensure that the node doesn't move from that coordinate.
Check documentation for more info:
https://github.com/d3/d3-force/blob/master/README.md#simulation_nodes
setting fixed = true solved the issue.

What does cluster.size do in D3JS?

I am trying to create a graph based on Mike Bostock's Heirarchical Edge Bundling(here is the gist). I need to make my JSON look as readme-flare-imports.json looks, but I can't figure out what "size" is. I read the API and it didn't seem to help me. Also, it will be a dynamic JSON file based on a mySQL database, so I won't be able to set the size myself. Is anybody able to clear things up for me as to what it is or how I may be able to determine what the size should be? Thank you in advance!
cluster.size determines how large of an area the cluster will take up. You pass values to it like so
// The angle
var x = 360;
// The radius
var y = window.height / 2;
cluster.size([x, y])
x will determine how much of a circle the cluster will use to branch out children. A value of 360 will use the entire circle to display all values. A value of 180 will only use half the circle to branch out values.
y will determine how wide the circle will become in any single direction, i.e., the radius of the circle.
In the Heirarchical Edge Bundling example, I believe the size attribute in the json file is ignored as I could not find anything in the code that cared about it.

Can I auto-fit the width of Graphviz nodes using dot?

Please does anyone know if there's a way to make Graphviz's dot program (note: not neato, although I'd also be somewhat interested in answers for that) auto-fit the width of nodes to accommodate the labels I specify? At the moment I have this
digraph
{
node [shape=record];
n [label="This is a very long caption"];
}
but the node ends up too small to accommodate the caption:
I found an option called fixedsize, which in theory I should be able to set to false in order to make the nodes expand to fit their labels:
http://www.graphviz.org/doc/info/attrs.html#d:fixedsize
Unfortunately, it doesn't work, as this gives me the same result:
digraph
{
node [shape=record, fixedsize=false];
n [label="This is a very long caption"];
}
Any ideas please?
The node label width in your example actually does auto-fit when using dot.
fixedsize=false (default) and any given value for width however should yield the given value for width if the output format is dot:
Note also that, if the output format is dot, the value given to width
will be the final value.
There may be a problem with your version of graphviz - did you try using a recent version?

Resources