let () = let svg = Svg.new_svg_document ~width:480 ~height:180 () in Svg.add_rect svg ~x:0 ~y:0 ~width:480 ~height:180 ~fill:"#fff" ~stroke:"#000" ~stroke_width:2.0 () ; Svg.add_line svg ~x1:45 ~y1:45 ~x2:410 ~y2:45 ~stroke:"#000" ~stroke_width:1.0 () ; Svg.add_line svg ~x1:45 ~y1:135 ~x2:370 ~y2:135 ~stroke:"#000" ~stroke_width:1.0 () ; Svg.add_line svg ~x1:55 ~y1:35 ~x2:55 ~y2:145 ~stroke:"#000" ~stroke_width:1.0 () ; Svg.add_circle svg ~cx:120.0 ~cy:45.0 ~r:5.6 ~fill:"none" ~stroke:"#000" ~stroke_width:1.5 () ; Svg.add_text svg ~x:120 ~y:35 ~text:"C" ~font_size:"14px" ~fill:"#000" () ; Svg.add_circle svg ~cx:98.0 ~cy:135.0 ~r:5.6 ~fill:"none" ~stroke:"#000" ~stroke_width:1.5 () ; Svg.add_text svg ~x:92 ~y:155 ~text:"A" ~font_size:"14px" ~fill:"#000" () ; Svg.add_circle svg ~cx:320.0 ~cy:45.0 ~r:5.6 ~fill:"none" ~stroke:"#000" ~stroke_width:1.5 () ; Svg.add_text svg ~x:322 ~y:35 ~text:"D" ~font_size:"14px" ~fill:"#000" () ; Svg.add_circle svg ~cx:238.0 ~cy:135.0 ~r:5.6 ~fill:"none" ~stroke:"#000" ~stroke_width:1.5 () ; Svg.add_text svg ~x:232 ~y:155 ~text:"B" ~font_size:"14px" ~fill:"#000" () ; Svg.add_circle svg ~cx:128.0 ~cy:135.0 ~r:5.6 ~fill:"none" ~stroke:"#f00" ~stroke_width:1.5 () ; Svg.add_circle svg ~cx:178.0 ~cy:45.0 ~r:5.6 ~fill:"none" ~stroke:"#0d0" ~stroke_width:1.6 () ; let m_def, start_marker, end_marker = Svg.make_marker ~marker_size:(10, 10) ~ref_pos:(5, 5) ~frag:begin let frag = Svg.new_fragment () in Svg.add_polygon frag ~points:[(2, 1); (8, 5); (2, 9)] ~fill:"black" (); (frag) end in Svg.add_defs svg [m_def]; let _ = start_marker in Svg.add_line svg ~x1:128 ~y1:135 ~x2:174 ~y2:53 ~stroke:"#333" ~stroke_width:1.2 ~attrs:[end_marker] (); Svg.finish_svg svg; Svg.print_svg_document svg; ;;