EdgeShapeFunction

EdgeShapeFunction

is an option and annotation for Graph and related functions that specifies a function to use to generate primitives for rendering each edge.

Details

  • The following option settings can be used:
  • Automaticthe default edge function
    Nonedo not render edges
    "name"a named edge function
    funca general edge function
    {vivj->efij,}use edge function efij for edge vivj
    {pattiefi,}use edge function efi for edges matching the pattern patti
  • The wrapper Annotation[vw,EdgeShapeFunction->f] can be used when creating graphs in functions such as Graph etc.
  • Use ResourceData["EdgeShapeFunction"] to get a list of all named edge functions.
  • EdgeShapeFunction->func specifies that each edge should be rendered with the primitives provided by func[{{x1,y1},{x2,y2},},vw], where {{x1,y1},{x2,y2},} are line segments and vw is the edge.

Examples

open allclose all

Basic Examples  (4)

Draw edges using a predefined edge function:

Specify an edge function for an individual edge:

Combine with a different default edge function:

Use an Annotation wrapper to specify individual edge functions:

Draw edges by running a program:

Scope  (10)

EdgeShapeFunction Specification  (7)

EdgeShapeFunction can be used for general graphs:

Matrix graphs:

Special graphs:

Random graphs:

Use EdgeShapeFunction in an Annotation wrapper:

EdgeShapeFunction works with patterns:

EdgeShapeFunction can be combined with EdgeStyle:

EdgeShapeFunction has higher priority than EdgeStyle:

EdgeShapeFunction Gallery  (3)

Get a list of built-in settings for EdgeShapeFunction:

Undirected edges including the basic line:

Lines with different glyphs on the edges:

Directed edges including solid arrows:

Line arrows:

Open arrows:

Possible Issues  (1)

Using Rule to indicate edges does not work:

Use parentheses to get correct parsing:

Wolfram Research (2010), EdgeShapeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeShapeFunction.html.

Text

Wolfram Research (2010), EdgeShapeFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeShapeFunction.html.

CMS

Wolfram Language. 2010. "EdgeShapeFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EdgeShapeFunction.html.

APA

Wolfram Language. (2010). EdgeShapeFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeShapeFunction.html

BibTeX

@misc{reference.wolfram_2024_edgeshapefunction, author="Wolfram Research", title="{EdgeShapeFunction}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeShapeFunction.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_edgeshapefunction, organization={Wolfram Research}, title={EdgeShapeFunction}, year={2010}, url={https://reference.wolfram.com/language/ref/EdgeShapeFunction.html}, note=[Accessed: 22-December-2024 ]}