Graphとその関連関数のオプションかつ注釈で,各辺の描画のためのプリミティブの生成に使う関数を指定する.
EdgeShapeFunction
Graphとその関連関数のオプションかつ注釈で,各辺の描画のためのプリミティブの生成に使う関数を指定する.
詳細
- EdgeShapeFunctionは辺のルーターとしても知られている.
- EdgeShapeFunctionは,通常,頂点を接続する経路の視覚的外観を制御するために使われる.
- 使用可能なオプション設定
-
Automatic デフォルトの辺関数 None 辺は描画しない "nfunc" 名前付きの辺関数 func 一般的な辺関数 {vivj->efij,…} 辺 vivjに辺関数 efijを使う {pattiefi,…} パターン pattiと一致する辺に辺関数 efiを使う - EdgeShapeFunction->func は,各辺が func[{{x1,y1},{x2,y2},…},vw]で与えられるプリミティブによって描画されるように指定する.ただし,{{x1,y1},{x2,y2},…}は線分で vw は辺である.
- 3Dでは,EdgeShapeFunction->func は各頂点が func[{{x1,y1,z1},{x2,y2,z2},…},vw]で与えられるプリミティブで描画されるように指定する.ただし,{{x1,y1,z1},{x2,y2,z2},…}は線分で vw は辺である.
- 辺関数 func には次の名前付き引数を使うことができる.
-
#Coordinates 線分{{x1,y1}, …} #Edge 辺 vw - ResourceData["EdgeShapeFunction"]を使ってすべての名前付き辺関数"nfunc"のリストが取得できる.
- Graph等の関数でグラフを構築する際は,ラッパーAnnotation[vw,EdgeShapeFunction->f]を使うことができる.
例題
すべて開く すべて閉じる例 (4)
Graph[{12, 23, 31}, EdgeShapeFunction -> {{"HalfFilledArrow", "ArrowSize" -> .1}}]Graph[{12, 23, 31}, EdgeShapeFunction -> {12 -> {"HalfFilledArrow", "ArrowSize" -> .1}}]Graph[{12, 23, 31}, EdgeShapeFunction -> {12 -> "HalfFilledArrow", "CarvedArrow"}]Annotationラッパーを使って個別の辺関数を指定する:
Graph[{Annotation[12, EdgeShapeFunction -> {"CarvedArrow", "ArrowSize" -> .1}], 23, 31}]ef[pts_List, e_] :=
Block[{s = 0.015, g = [image]}, {Arrowheads[{{s, 0.33, g}, {s, 0.67, g}}], Arrow[pts]}]Graph[{12, 23, 31}, EdgeShapeFunction -> ef]スコープ (10)
EdgeShapeFunction指定 (7)
EdgeShapeFunctionは一般的なグラフに使うことができる:
{Graph[{12, 23, 31}, EdgeShapeFunction -> "CarvedArrow"], PathGraph[Range[25], EdgeShapeFunction -> "CarvedArrow"]}AdjacencyGraph[{{0, 1, 0}, {0, 0, 1}, {1, 0, 0}}, EdgeShapeFunction -> "CarvedArrow"]{PetersenGraph[5, 2, EdgeShapeFunction -> "CarvedArrow"], GridGraph[{3, 3}, EdgeShapeFunction -> "CarvedArrow"]}RandomGraph[UniformGraphDistribution[10, 20], EdgeShapeFunction -> "CarvedArrow"]Annotationラッパーの中でEdgeShapeFunctionを使う:
Graph[{Annotation[12, EdgeShapeFunction -> "CarvedArrow"], 23, 31}]HighlightGraph[GridGraph[{2, 3}], Annotation[13, EdgeShapeFunction -> "CarvedArrow"]]EdgeShapeFunctionはパターンを使うことができる:
CompleteGraph[5, EdgeShapeFunction -> {_2 -> "CarvedArrow"}]EdgeShapeFunctionはEdgeStyleと組み合せることができる:
Graph[{12, 23, 31}, EdgeStyle -> Blue, EdgeShapeFunction -> (Line[#1]&)]EdgeShapeFunctionはEdgeStyleより優先順位が高い:
Graph[{12, 23, 31}, EdgeStyle -> Blue, EdgeShapeFunction -> ({Red, Line[#1]}&)]EdgeShapeFunctionギャラリー (3)
EdgeShapeFunctionの組込み設定のリストを得る:
ResourceData["EdgeShapeFunction"]Graph[{12, 23, 31}, EdgeShapeFunction -> "Line"]Table[Graph[{12, 23, 31}, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, {"BoxLine", "DiamondLine", "DotLine"}}]Table[Graph[{12, 23, 31}, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, ResourceData["EdgeShapeFunction", "FilledArrow"]}]Table[Graph[{12, 23, 31}, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, ResourceData["EdgeShapeFunction", "UnfilledArrow"]}]Table[Graph[{12, 23, 31}, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, ResourceData["EdgeShapeFunction", "CarvedArrow"]}]考えられる問題 (1)
Ruleを使って辺を示そうとしてもうまくいかない:
Graph[{1 -> 2, 2 -> 3, 3 -> 1}, EdgeShapeFunction -> {1 -> 2 -> "CarvedArrow"}]1 -> 2 -> "CarvedArrow"//FullForm(1 -> 2) -> "CarvedArrow"//FullFormGraph[{1 -> 2, 2 -> 3, 3 -> 1}, EdgeShapeFunction -> {(1 -> 2) -> "CarvedArrow"}]関連するガイド
-
▪
- グラフのスタイル付け,ラベル付け,配置 ▪
- グラフの特性 ▪
- グラフのアノテーション ▪
- グラフの可視化
テキスト
Wolfram Research (2010), EdgeShapeFunction, Wolfram言語関数, https://reference.wolfram.com/language/ref/EdgeShapeFunction.html (2026年に更新).
CMS
Wolfram Language. 2010. "EdgeShapeFunction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. 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_2026_edgeshapefunction, author="Wolfram Research", title="{EdgeShapeFunction}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeShapeFunction.html}", note=[Accessed: 14-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_edgeshapefunction, organization={Wolfram Research}, title={EdgeShapeFunction}, year={2026}, url={https://reference.wolfram.com/language/ref/EdgeShapeFunction.html}, note=[Accessed: 14-September-2026]}