How can I get exact height of a letter? I need a height of a given letter, not a height of font (tmHeight). For example, for little "p" the height is less than tmHeight.
Thank you.
Related
By default there is a lot of space between the text of the label and the boundary of the node. How to reduce that spacing? This would usually be called padding but pad means something else for the graphviz - the overall spacing between the graph and the boundary of the figure. What is the name of the attribute?
You are probably looking for margin, but be also aware of height and width which actually specify min-height and min-width
example
digraph G {
node[shape=rect]
A
"B0123456789\n0\n1"
"C0123456789\n0\n1"[margin=0]
}
I tried everything, but I still can't solve this problem without brute force:
I get N blocks with a known height and width. I can rotate them (height become width and width become height) and I have to build the tallest possible pyramid from them (of course I can change the order of blocks).
The problem is that you can't put a block of width X onto a block with width smaller than X.
EDIT:
The problem is, that you can't put a block onto a block of the same width.
Any ideas?
What I understand reading your problem statement and comments is that you want to build tallest pyramid with width from bottom to top in decreasing order.
If this is the case, then what we can do is simply the following steps:
Loop over blocks and swap width and height only if width > height.
Now, sort the array of blocks in decreasing order of width which is the order used for stacking blocks from bottom to top in pyramid.
Answer is summation of all heights.
Note: step -2 is only needed if you want to display order of blocks
from bottom to top in pyramid.
(this should probably be in another community but I couldn't find how to move the question)
I was told for an SVG I have that one of the transformations in it is an illegal or invalid transformation. I believe I have found the offending transformation and am trying to understand what it did.
The transformation is:
<image transform="matrix(0.773723,0,0,0,860,182)" width="137" height="2" xlink:href="someImage.png" />
From my understanding, the SVG notation of the matrix (0.773723,0,0,0,860,182) is the equivalent of (pretend its one big bracket not 3 on each side):
[.773723,0,0860]
[0,0,182 ]
[0,0,1 ]
My research has lead me to believe I am to use the width and height after the matrix, convert it into matrix notation and multiply the two to understand how it was transformed. If that is correct, I'm trying to understand how to convert the height and width to the matrix notation []. If it is not correct, any pointers in the right direction would be greatly appreciated!
That looks like a legal transform (technically). but it's incorporating a 0% vertical scale: that "0" in the fourth position of the matrix, so it's making your element disappear. Height and width are the "before" height and width, not the "after" height and width. You can't specify absolute dimensions in a matrix, just scaling factor. (You can specify offset or translate in absolute dimensions).
http://jsfiddle.net/BhrpA/1/embedded/result/
Why does the graph not extend the full 789px? (width of the black container div)
The SVG element is 789 but there is 100px or so of black space at the far right.
Thanks!
Your x-domain isn't set up correctly. Since arrays are 0 based, your maximum index is length-1 not length. So if you change it to:
x=d3.scale.linear().domain([0,data.length-1]).range([0,w])
You'll see that it now goes the full length as expected.
Other then creating a dummy NSScroller and incrementally decreasing it's height until usableParts returns 0, is there any easy way to determine what the minimum height of a vertical scrollbar should be so that usableParts will not return NSNoScrollerParts?
What I need to be able to do is limit the height of my window based, in part, on whether or not a vertical scrollbar will have usable parts.