7 deleted 4 characters in body
source | link

StreamStyle glyph "Pointer" can be made to look the same as the desired shape, so we can use

f[w_: .05][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w, 
  GlyphControlFunction -> (1 - #&), PlotPoints -> 300][Line @ pts] 

to generate the desired Graphics primitive:

Graphics[{Red,f[][{{1, 0}, {3, 1}}]}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyphGraphics`Glyphs`GlyphData[g, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

StreamStyle glyph "Pointer" can be made to look the same as the desired shape, so we can use

f[w_: .05][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w, 
  GlyphControlFunction -> (1 - #&), PlotPoints -> 300][Line @ pts] 

to generate the desired Graphics primitive:

Graphics[{Red,f[][{{1, 0}, {3, 1}}]}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

StreamStyle glyph "Pointer" can be made to look the same as the desired shape, so we can use

f[w_: .05][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w, 
  GlyphControlFunction -> (1 - #&), PlotPoints -> 300][Line @ pts] 

to generate the desired Graphics primitive:

Graphics[{Red,f[][{{1, 0}, {3, 1}}]}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

6 added 90 characters in body
source | link

StreamStyle glyph "Pointer" looks very similarcan be made to look the same as the desired shape, so we can use

f[w_: .2][pts_]05][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w][Line@pts]w, 
  GlyphControlFunction -> (1 - #&), PlotPoints -> 300][Line @ pts] 

to generate the desired Graphics primitive:

Graphics@f[][Graphics[{Red,f[][{{1, 0}, {3,2 1}}]}]

enter image description hereenter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

StreamStyle glyph "Pointer" looks very similar, so we can use

f[w_:.2][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w][Line@pts] 

to generate the desired Graphics primitive:

Graphics@f[][{{1,0},{3,2}}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

StreamStyle glyph "Pointer" can be made to look the same as the desired shape, so we can use

f[w_: .05][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w, 
  GlyphControlFunction -> (1 - #&), PlotPoints -> 300][Line @ pts] 

to generate the desired Graphics primitive:

Graphics[{Red,f[][{{1, 0}, {3, 1}}]}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

5 deleted 20 characters in body
source | link

StreamStyle glyph "Pointer" looks very similar, so we can use

f[w_:.2][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w][Line@pts] 

to generate the desired Graphics primitive:

Graphics@f[][{{1,0},{3,2}}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[glyph_glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[glyphGraphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(glyphg /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[glyph_glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(glyphg /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

StreamStyle glyph "Pointer" looks very similar, so we can use

f[w_:.2][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w][Line@pts] 

to generate the desired Graphics primitive:

Graphics@f[][{{1,0},{3,2}}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[glyph_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][
    Line[(glyph /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[glyph_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(glyph /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

StreamStyle glyph "Pointer" looks very similar, so we can use

f[w_:.2][pts_] := Graphics`Glyphs`GlyphData["Pointer", GlyphWidth -> w][Line@pts] 

to generate the desired Graphics primitive:

Graphics@f[][{{1,0},{3,2}}]

enter image description here

The function glyph below is slightly more general than f above in that other built-in glyph functions (such as "Drop", "Dart", etc) can be used as the first argument if desired.

ClearAll[glyph]
glyph[g_: "Pointer", w_: .1] := Graphics`Glyphs`GlyphData[g, GlyphWidth -> w][
    Line[(g /. {"Drop" -> Reverse, _ :> Identity})@#]] &;  

Examples:

SeedRandom[1]
rg = RandomGraph[{20, 30}];
SetProperty[rg, {EdgeShapeFunction -> glyph[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}]

enter image description here

The same idea can be used to have curved versions using the above function in combination with GraphElementData["CurvedArc"]:

ClearAll[glyph2]
glyph2[g_: "Pointer", w_: .1, curv_: .5] := Module[{bf = BezierFunction @@ 
   (GraphElementData[{"CurvedArc", "Curvature" -> curv}][(g /. 
      {"Drop" -> Reverse, _ :> Identity})@#, ##2])}, 
  {Graphics`Glyphs`GlyphData[glyph, GlyphWidth -> w][Line[bf /@ Subdivide[10]]]}] &; 

SetProperty[rg, {EdgeShapeFunction -> glyph2[], VertexSize -> .3, 
  EdgeStyle -> Directive[Opacity[.5], Black], ImageSize -> 500}] 

enter image description here

Further examples:

SeedRandom[1] 
Graphics[{Opacity[.5], RandomColor[], glyph["Pointer", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]] 

enter image description here

Graphics[{Opacity[.5], RandomColor[], glyph["Drop", RandomReal[{1, 10}]]@#} & /@ 
  RandomInteger[100, {50, 2, 2}]]  

enter image description here

SeedRandom[123]
Graphics[{Opacity[.5], RandomColor[], glyph2["Pointer", RandomReal[{1, 10}]]@#} & /@
   RandomInteger[100, {20, 3, 2}]]   

enter image description here

4 edited body
source | link
3 deleted 31 characters in body
source | link
2 added 238 characters in body
source | link
1
source | link