in reply to Finding the best spot to put a label in a graph
As you say, aesthetic locations may not always work. As a first try after that failure, I would identify the set of lines coming into a vertex, compute the angles between neigboring lines, and pick the neighboring lines with the largest angle between them to nestle the label into. Given the angle and the size of the bounding box, it is a simple matter of geometry to determine how far away the bounding box should be from the vertex so that it does not intersect each line. I'd expect the center of the bounding box would lie close to the bisector of the two lines.
-Mark
|
|---|