#12816: Documentation and list of Graph functions
--------------------------------+-------------------------------------------
       Reporter:  ncohen        |         Owner:  jason, ncohen, rlm
           Type:  enhancement   |        Status:  needs_info        
       Priority:  major         |     Milestone:  sage-5.0          
      Component:  graph theory  |    Resolution:                    
       Keywords:                |   Work issues:                    
Report Upstream:  N/A           |     Reviewers:  David Coudert     
        Authors:                |     Merged in:                    
   Dependencies:  12743         |      Stopgaps:                    
--------------------------------+-------------------------------------------

Comment (by dcoudert):

 A better solution is to use csv-table
 ([http://docutils.sourceforge.net/docs/ref/rst/directives.html#table]).
 Bellow is an example for graph.py

 {{{
 **Graph basic operations:**

 .. csv-table::
     :class: contentstable
     :header: "Methods", "Description"
     :widths: 50, 50
     :delim: |

     :meth:`~Graph.write_to_eps` | Writes a plot of the graph to
 ``filename`` in ``eps`` format.
     :meth:`~Graph.to_undirected` | Since the graph is already undirected,
 simply returns a copy of itself.
     :meth:`~Graph.to_directed` | Returns a directed version of the graph.
     :meth:`~Graph.sparse6_string` | Returns the sparse6 representation of
 the graph as an ASCII string.
     :meth:`~Graph.graph6_string` | Returns the graph6 representation of
 the graph as an ASCII string.
     :meth:`~Graph.bipartite_sets` | Returns `(X,Y)` where X and Y are the
 nodes in each bipartite set of graph.
     :meth:`~Graph.bipartite_color` | Returns a dictionary with vertices as
 the keys and the color class as the values.
     :meth:`~Graph.is_directed` | Since graph is undirected, returns False.

 **Distances:**

 .. csv-table::
     :class: contentstable
     :header: "Methods", "Description"
     :widths: 50, 50
     :delim: |

     :meth:`~Graph.centrality_closeness` | Returns the closeness centrality
 (1/average distance to all vertices)
     :meth:`~Graph.centrality_degree` | Returns the degree centrality
     :meth:`~Graph.centrality_betweenness` | Returns the betweenness
 centrality

 **Graph properties:**

 .. csv-table::
     :class: contentstable
     :header: "Methods", "Description"
     :widths: 50, 50
     :delim: |

     :meth:`~Graph.is_prime` | Tests whether the current graph is prime.
     :meth:`~Graph.is_split` | Returns ``True`` if the graph is a Split
 graph, ``False`` otherwise.
     :meth:`~Graph.is_triangle_free` | Returns whether ``self`` is
 triangle-free
     :meth:`~Graph.is_bipartite` | Returns True if graph G is bipartite,
 False if not.
     :meth:`~Graph.is_line_graph` | Tests wether the graph is a line graph.
     :meth:`~Graph.is_odd_hole_free` | Tests whether ``self`` contains an
 induced odd hole.
     :meth:`~Graph.is_even_hole_free` | Tests whether ``self`` contains an
 induced even hole.
 }}}

 The output is better, but we have another issue to solve.

 In the original graph.html file produced when building the documentation,
 we have:
 * <table border="1" class="docutils">

 Using the ''':class: contentstable''' directive, I obtain:
 * <table border="1" class="contentstable docutils">

 But then the produced table is of width '''90%'''.
 Also, the ultimate solution would be to add in file
 '''doc/output/html/en/reference/_static/basic.css'''
 an entry like
 {{{
 table.fullwidthtable {
     width: 100%;
 }
 }}}
 and then to use the directive ''':class: fullwidthtable'''. Other options
 like center can also be added.

 However, I don't know how to add such stuff into the basic.css file...


 I think this is the best way to do it. Furthermore, it is much easier to
 use/maintain that the simple table solution.

 D.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12816#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to