Graph-Layout-Aesthetic

 view release on metacpan or  search on metacpan

MinEdgeIntersect.xs  view on Meta::CPAN

        aglo_point_inc(DIMENSIONS, &gradient[p21*DIMENSIONS], force_delta);
        aglo_point_inc(DIMENSIONS, &gradient[p22*DIMENSIONS], force_delta);
    }
}

define_aesth(min_edge_intersect) {
    aglo_unsigned i, j;
    aglo_edge_record p, q;
    aglo_graph graph = state->graph;

    /* all 4 endpoints are distinct */
    /* i p */
    /* i j q */
    for (i=0;i<graph->vertices;i++)
        for (p=graph->edge_table[i];p;p=p->next)
            if (i < p->tail)
                for (j=i+1;j<graph->vertices;j++)
                    if (j != p->tail)
                        for (q=graph->edge_table[j];q;q=q->next)
                            if (j < q->tail && p->tail != q->tail)
                                ae_intersection(state, gradient, private,

MinEdgeIntersect2.xs  view on Meta::CPAN

        aglo_point_inc(DIMENSIONS, &gradient[p21 * DIMENSIONS], delta);
        aglo_point_inc(DIMENSIONS, &gradient[p22 * DIMENSIONS], delta);
    }
}

define_aesth(min_edge_intersect2) {
    aglo_unsigned i, j;
    aglo_edge_record p, q;
    aglo_graph graph = state->graph;

    /* all 4 endpoints are distinct */
    /* i p */
    /* i j q */
    for (i=0;i<graph->vertices;i++)
        for (p=graph->edge_table[i];p;p=p->next)
            if (i < p->tail)
                for (j=i+1;j<graph->vertices;j++)
                    if (j != p->tail)
                        for (q=graph->edge_table[j];q;q=q->next)
                            if (j < q->tail && p->tail != q->tail)
                                ae_intersection(state, gradient, private,

lib/Graph/Layout/Aesthetic/Force.pm  view on Meta::CPAN


Nodes connected to each other by an edge attract each other with force d**2

=item L<Graph::Layout::Aesthetic::Force::NodeRepulsion|Graph::Layout::Aesthetic::Force::NodeRepulsion>

Nodes repel each other with a force 1/d

=item L<Graph::Layout::Aesthetic::Force::NodeEdgeRepulsion|Graph::Layout::Aesthetic::Force::NodeEdgeRepulsion>

Nodes repel from the nearest point on the line through an edge
if that point is between the endpoints of the edge. Magnitude 1/d.

=item L<Graph::Layout::Aesthetic::Force::MinEdgeIntersect|Graph::Layout::Aesthetic::Force::MinEdgeIntersect>

Crossed edge midpoints repel each other with a constant magnitude of 1.
Only works in 2 dimensions.

=item L<Graph::Layout::Aesthetic::Force::MinEdgeIntersect2|Graph::Layout::Aesthetic::Force::MinEdgeIntersect2>

Crossed edge midpoints repel each other with a force d.
Only works in 2 dimensions.

lib/Graph/Layout/Aesthetic/Force/NodeEdgeRepulsion.pm  view on Meta::CPAN

  $aglo = Graph::Layout::Aesthetic->new($topology);
  $aglo->add_force("NodeEdgeRepulsion", 1);

=head1 DESCRIPTION

This module provides an aesthetic force for use by the
L<Graph::Layout::Aesthetic package|Graph::Layout::Aesthetic>. It's normally
implicitly loaded by using L<add_force|Graph::Layout::Aesthetic/add_force>.

The aesthetic force is that it tries to not place nodes close to edges. It does
this by imagining a line through the edge endpoints and finding the point on
the line closest to the node under consideration. If this point is between the
two edge endpoints there is a force between them that's the inverse of their
distance.

=head1 METHODS

This class inherits from
L<Graph::Layout::Aesthetic::Force|Graph::Layout::Aesthetic::Force> and adds
no methods of its own.

=head1 EXPORT



( run in 0.509 second using v1.01-cache-2.11-cpan-2b1a40005be )