usps_flags 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +22 -11
  3. data/.travis.yml +1 -1
  4. data/Gemfile.lock +5 -2
  5. data/README.md +6 -0
  6. data/lib/usps_flags.rb +35 -44
  7. data/lib/usps_flags/config.rb +89 -87
  8. data/lib/usps_flags/core.rb +44 -42
  9. data/lib/usps_flags/core/ensign.rb +53 -49
  10. data/lib/usps_flags/core/field.rb +96 -92
  11. data/lib/usps_flags/core/footer.rb +9 -5
  12. data/lib/usps_flags/core/headers.rb +58 -48
  13. data/lib/usps_flags/core/icons.rb +11 -7
  14. data/lib/usps_flags/core/icons/anchor.rb +62 -56
  15. data/lib/usps_flags/core/icons/binoculars.rb +21 -15
  16. data/lib/usps_flags/core/icons/lighthouse.rb +28 -22
  17. data/lib/usps_flags/core/icons/star.rb +21 -15
  18. data/lib/usps_flags/core/icons/trident.rb +136 -127
  19. data/lib/usps_flags/core/icons/trident_parts/hashes.rb +62 -55
  20. data/lib/usps_flags/core/icons/trumpet.rb +34 -28
  21. data/lib/usps_flags/core/pennant.rb +50 -46
  22. data/lib/usps_flags/core/trident_spec.rb +135 -131
  23. data/lib/usps_flags/core/trident_specs.rb +11 -7
  24. data/lib/usps_flags/core/trident_specs/base.rb +36 -26
  25. data/lib/usps_flags/core/trident_specs/circle.rb +36 -30
  26. data/lib/usps_flags/core/trident_specs/delta.rb +41 -30
  27. data/lib/usps_flags/core/trident_specs/header.rb +56 -50
  28. data/lib/usps_flags/core/trident_specs/horizontal.rb +80 -0
  29. data/lib/usps_flags/core/trident_specs/long.rb +41 -25
  30. data/lib/usps_flags/core/trident_specs/overlay.rb +40 -0
  31. data/lib/usps_flags/core/trident_specs/short.rb +30 -156
  32. data/lib/usps_flags/core/trident_specs/vertical.rb +108 -0
  33. data/lib/usps_flags/core/tridents.rb +54 -50
  34. data/lib/usps_flags/core/us.rb +40 -44
  35. data/lib/usps_flags/core/wheel.rb +7 -3
  36. data/lib/usps_flags/errors.rb +25 -23
  37. data/lib/usps_flags/generate.rb +111 -107
  38. data/lib/usps_flags/generate/flag.rb +160 -157
  39. data/lib/usps_flags/generate/generator_methods.rb +139 -0
  40. data/lib/usps_flags/generate/helper_methods.rb +88 -0
  41. data/lib/usps_flags/helpers.rb +163 -165
  42. data/lib/usps_flags/helpers/builders.rb +92 -85
  43. data/lib/usps_flags/helpers/spec_arrows.rb +127 -123
  44. data/lib/usps_flags/helpers/valid_flags.rb +45 -41
  45. data/lib/usps_flags/rational.rb +35 -0
  46. data/spec/usps_flags/config_spec.rb +17 -10
  47. data/spec/usps_flags/core_spec.rb +31 -31
  48. data/spec/usps_flags/generate_spec.rb +76 -73
  49. data/spec/usps_flags/helpers_spec.rb +8 -8
  50. data/spec/usps_flags/rational_spec.rb +17 -0
  51. data/spec/usps_flags_spec.rb +19 -21
  52. data/usps_flags.gemspec +7 -6
  53. metadata +34 -10
  54. data/lib/rational.rb +0 -39
  55. data/lib/usps_flags/generate/private.rb +0 -199
  56. data/spec/rational_spec.rb +0 -19
@@ -4,11 +4,15 @@
4
4
  #
5
5
  # These methods should never need to be called directly.
6
6
  # @private
7
- module USPSFlags::Core::TridentSpecs
8
- require 'usps_flags/core/trident_specs/base'
9
- require 'usps_flags/core/trident_specs/header'
10
- require 'usps_flags/core/trident_specs/short'
11
- require 'usps_flags/core/trident_specs/delta'
12
- require 'usps_flags/core/trident_specs/long'
13
- require 'usps_flags/core/trident_specs/circle'
7
+ class USPSFlags
8
+ class Core
9
+ module TridentSpecs
10
+ require 'usps_flags/core/trident_specs/base'
11
+ require 'usps_flags/core/trident_specs/header'
12
+ require 'usps_flags/core/trident_specs/short'
13
+ require 'usps_flags/core/trident_specs/delta'
14
+ require 'usps_flags/core/trident_specs/long'
15
+ require 'usps_flags/core/trident_specs/circle'
16
+ end
17
+ end
14
18
  end
@@ -4,36 +4,46 @@
4
4
  #
5
5
  # This class should never need to be called directly.
6
6
  # @private
7
- class USPSFlags::Core::TridentSpecs::Base
8
- SA = USPSFlags::Helpers::SpecArrows
9
- BF = USPSFlags::Config::BASE_FLY
10
- BH = USPSFlags::Config::BASE_HOIST
11
-
12
- def initialize(options = {})
13
- @config = options[:config]
14
- @box_top = options[:bt]
15
- @box_bottom = options[:bb]
16
- @box_left = options[:bl]
17
- @box_right = options[:br]
18
- @fly = options[:fly]
19
- @unit = options[:unit]
20
- @heading = options[:heading]
21
- end
7
+ class USPSFlags
8
+ class Core
9
+ module TridentSpecs
10
+ class Base
11
+ require 'usps_flags/core/trident_specs/vertical'
12
+ require 'usps_flags/core/trident_specs/horizontal'
13
+ require 'usps_flags/core/trident_specs/overlay'
14
+
15
+ SA = USPSFlags::Helpers::SpecArrows
16
+ BF = USPSFlags::Config::BASE_FLY
17
+ BH = USPSFlags::Config::BASE_HOIST
18
+
19
+ def initialize(options = {})
20
+ @config = options[:config]
21
+ @box_top = options[:bt]
22
+ @box_bottom = options[:bb]
23
+ @box_left = options[:bl]
24
+ @box_right = options[:br]
25
+ @fly = options[:fly]
26
+ @unit = options[:unit]
27
+ @heading = options[:heading]
28
+ end
22
29
 
23
- private
30
+ private
24
31
 
25
- def output(name, x_offset, key)
26
- body = block_given? ? yield : (boundary_box + right + left)
32
+ def output(name, x_offset, key)
33
+ body = block_given? ? yield : (boundary_box + right + left)
27
34
 
28
- <<~SVG
29
- <!-- #{name} Trident -->
30
- <g transform="translate(#{BF * x_offset / 80},#{BH * 9 / 32})"><g transform="scale(0.7)">
31
- #{@heading}
35
+ <<~SVG
36
+ <!-- #{name} Trident -->
37
+ <g transform="translate(#{BF * x_offset / 80},#{BH * 9 / 32})"><g transform="scale(0.7)">
38
+ #{@heading}
32
39
 
33
- #{USPSFlags::Core::Icons::Trident.new(key).svg}
40
+ #{USPSFlags::Core::Icons::Trident.new(key).svg}
34
41
 
35
- #{body}
36
- </g></g>
37
- SVG
42
+ #{body}
43
+ </g></g>
44
+ SVG
45
+ end
46
+ end
47
+ end
38
48
  end
39
49
  end
@@ -4,41 +4,47 @@
4
4
  #
5
5
  # This class should never need to be called directly.
6
6
  # @private
7
- class USPSFlags::Core::TridentSpecs::Circle < USPSFlags::Core::TridentSpecs::Long
8
- def p
9
- output('Circle', 23, :stf)
10
- end
7
+ class USPSFlags
8
+ class Core
9
+ module TridentSpecs
10
+ class Circle < USPSFlags::Core::TridentSpecs::Long
11
+ def p
12
+ output('Circle', 23, :stf)
13
+ end
11
14
 
12
- private
15
+ private
13
16
 
14
- def right
15
- <<~SVG
16
- <!-- Right -->
17
- #{inner_diameter} <!-- Inner circle diameter -->
18
- #{outer_diameter} <!-- Outer circle diameter -->
19
- #{circle_to_bottom} <!-- Circle to bottom -->
20
- SVG
21
- end
17
+ def right
18
+ <<~SVG
19
+ <!-- Right -->
20
+ #{inner_diameter} <!-- Inner circle diameter -->
21
+ #{outer_diameter} <!-- Outer circle diameter -->
22
+ #{circle_to_bottom} <!-- Circle to bottom -->
23
+ SVG
24
+ end
22
25
 
23
- def inner_diameter
24
- <<~SVG
25
- #{SA.vertical(@box_right + @config[:bar_width], @box_top + @config[:crossbar_from_top] + @config[:bar_width] * 2, @box_top + @config[:crossbar_from_top] + @config[:width], pointer_top: @config[:center_point], pointer_bottom: @config[:center_point], fly: @fly, unit: @unit)} <!-- Inner circle diameter -->
26
- SVG
27
- end
26
+ def inner_diameter
27
+ <<~SVG
28
+ #{SA.vertical(@box_right + @config[:bar_width], @box_top + @config[:crossbar_from_top] + @config[:bar_width] * 2, @box_top + @config[:crossbar_from_top] + @config[:width], pointer_top: @config[:center_point], pointer_bottom: @config[:center_point], fly: @fly, unit: @unit)} <!-- Inner circle diameter -->
29
+ SVG
30
+ end
28
31
 
29
- def outer_diameter
30
- <<~SVG
31
- #{SA.vertical(@box_right + @config[:bar_width], @box_top + @config[:crossbar_from_top] + @config[:width], @box_top + @config[:crossbar_from_top] + @config[:bar_width] + @config[:width], pointer_bottom: outer_box_right, fly: @fly, unit: @unit)} <!-- Outer circle diameter -->
32
- SVG
33
- end
32
+ def outer_diameter
33
+ <<~SVG
34
+ #{SA.vertical(@box_right + @config[:bar_width], @box_top + @config[:crossbar_from_top] + @config[:width], @box_top + @config[:crossbar_from_top] + @config[:bar_width] + @config[:width], pointer_bottom: outer_box_right, fly: @fly, unit: @unit)} <!-- Outer circle diameter -->
35
+ SVG
36
+ end
34
37
 
35
- def outer_box_right
36
- @config[:center_point] + @config[:bar_width] / 2
37
- end
38
+ def outer_box_right
39
+ @config[:center_point] + @config[:bar_width] / 2
40
+ end
38
41
 
39
- def circle_to_bottom
40
- <<~SVG
41
- #{SA.vertical(@box_right + @config[:bar_width], @box_top + @config[:crossbar_from_top] + @config[:bar_width] + @config[:width], @box_bottom, pointer_bottom: @box_right, fly: @fly, unit: @unit)} <!-- Circle to bottom -->
42
- SVG
42
+ def circle_to_bottom
43
+ <<~SVG
44
+ #{SA.vertical(@box_right + @config[:bar_width], @box_top + @config[:crossbar_from_top] + @config[:bar_width] + @config[:width], @box_bottom, pointer_bottom: @box_right, fly: @fly, unit: @unit)} <!-- Circle to bottom -->
45
+ SVG
46
+ end
47
+ end
48
+ end
43
49
  end
44
50
  end
@@ -4,41 +4,52 @@
4
4
  #
5
5
  # This class should never need to be called directly.
6
6
  # @private
7
- class USPSFlags::Core::TridentSpecs::Delta < USPSFlags::Core::TridentSpecs::Base
8
- def p
9
- output('Delta', 5, :d)
10
- end
7
+ class USPSFlags
8
+ class Core
9
+ module TridentSpecs
10
+ class Delta < USPSFlags::Core::TridentSpecs::Base
11
+ def p
12
+ output('Delta', 5, :d)
13
+ end
11
14
 
12
- private
15
+ private
13
16
 
14
- def boundary_box
15
- <<~SVG
16
- <!-- Boundary box -->
17
- <rect x="#{@box_left}" y="#{@box_top}" width="#{@box_right - @box_left}" height="#{BH * 5 / 8}" stroke="#666666" stroke-width="#{BF / 600}" stroke-dasharray="15, 15" fill="none" />
18
- SVG
19
- end
17
+ def boundary_box
18
+ <<~SVG
19
+ <!-- Boundary box -->
20
+ <rect x="#{@box_left}" y="#{@box_top}" width="#{@box_right - @box_left}" height="#{BH * 5 / 8}" stroke="#666666" stroke-width="#{BF / 600}" stroke-dasharray="15, 15" fill="none" />
21
+ SVG
22
+ end
20
23
 
21
- def right
22
- <<~SVG
23
- <!-- Right -->
24
- #{gap_height} <!-- Delta gap height -->
25
- #{SA.vertical(@box_right + @config[:bar_width], @box_bottom - @config[:delta_from_bottom] - @config[:bar_width], @box_bottom - @config[:delta_from_bottom], pointer_bottom: @box_right, fly: @fly, unit: @unit)} <!-- Delta width -->
26
- #{SA.vertical(@box_right + @config[:bar_width], @box_bottom - @config[:delta_from_bottom], @box_bottom, pointer_bottom: @box_right, fly: @fly, unit: @unit)} <!-- Delta to bottom -->
27
- SVG
28
- end
24
+ def right
25
+ <<~SVG
26
+ <!-- Right -->
27
+ #{gap_height} <!-- Delta gap height -->
28
+ #{SA.vertical(@box_right + @config[:bar_width], @box_bottom - @config[:delta_from_bottom] - @config[:bar_width], @box_bottom - @config[:delta_from_bottom], pointer_bottom: @box_right, fly: @fly, unit: @unit)} <!-- Delta width -->
29
+ #{SA.vertical(@box_right + @config[:bar_width], @box_bottom - @config[:delta_from_bottom], @box_bottom, pointer_bottom: @box_right, fly: @fly, unit: @unit)} <!-- Delta to bottom -->
30
+ SVG
31
+ end
29
32
 
30
- def gap_height
31
- SA.vertical(@box_right + @config[:bar_width], gap_height_top, @box_bottom - @config[:delta_from_bottom] - @config[:bar_width], pointer_top: @config[:center_point], pointer_bottom: @config[:center_point] + @config[:delta_gap_width], fly: @fly, unit: @unit)
32
- end
33
+ def gap_height
34
+ SA.vertical(
35
+ @box_right + @config[:bar_width], gap_height_top,
36
+ @box_bottom - @config[:delta_from_bottom] - @config[:bar_width],
37
+ pointer_top: @config[:center_point], pointer_bottom: @config[:center_point] + @config[:delta_gap_width],
38
+ fly: @fly, unit: @unit
39
+ )
40
+ end
33
41
 
34
- def gap_height_top
35
- @box_bottom - @config[:delta_from_bottom] - @config[:bar_width] - @config[:delta_gap_height]
36
- end
42
+ def gap_height_top
43
+ @box_bottom - @config[:delta_from_bottom] - @config[:bar_width] - @config[:delta_gap_height]
44
+ end
37
45
 
38
- def left
39
- <<~SVG
40
- <!-- Left -->
41
- #{SA.vertical(@box_left - @config[:bar_width] * 1.5, @box_top, @box_bottom, pointer_top: @box_left, pointer_bottom: @box_left, label_offset: -BF / 30, label_offset_y: -BF * 2 / 11, label_align: "middle", fly: @fly, unit: @unit)} <!-- Boundary height -->
42
- SVG
46
+ def left
47
+ <<~SVG
48
+ <!-- Left -->
49
+ #{SA.vertical(@box_left - @config[:bar_width] * 1.5, @box_top, @box_bottom, pointer_top: @box_left, pointer_bottom: @box_left, label_offset: -BF / 30, label_offset_y: -BF * 2 / 11, label_align: 'middle', fly: @fly, unit: @unit)} <!-- Boundary height -->
50
+ SVG
51
+ end
52
+ end
53
+ end
43
54
  end
44
55
  end
@@ -4,62 +4,68 @@
4
4
  #
5
5
  # This class should never need to be called directly.
6
6
  # @private
7
- class USPSFlags::Core::TridentSpecs::Header < USPSFlags::Core::TridentSpecs::Base
8
- def initialize(options = {})
9
- @fly = options[:fly]
10
- @fly_fraction = options[:fly_fraction]
11
- @hoist = options[:hoist]
12
- @hoist_fraction = options[:hoist_fraction]
13
- @unit_text = options[:unit_text]
14
- @scaled_border = options[:scaled_border]
15
- end
7
+ class USPSFlags
8
+ class Core
9
+ module TridentSpecs
10
+ class Header < USPSFlags::Core::TridentSpecs::Base
11
+ def initialize(options = {})
12
+ @fly = options[:fly]
13
+ @fly_fraction = options[:fly_fraction]
14
+ @hoist = options[:hoist]
15
+ @hoist_fraction = options[:hoist_fraction]
16
+ @unit_text = options[:unit_text]
17
+ @scaled_border = options[:scaled_border]
18
+ end
16
19
 
17
- def p
18
- <<~SVG
19
- #{field}
20
+ def p
21
+ <<~SVG
22
+ #{field}
20
23
 
21
- #{heading}
22
- #{units}
23
- SVG
24
- end
24
+ #{heading}
25
+ #{units}
26
+ SVG
27
+ end
25
28
 
26
- private
29
+ private
27
30
 
28
- def field
29
- <<~SVG
30
- <!-- Field -->
31
- #{USPSFlags::Core.field}
32
- SVG
33
- end
31
+ def field
32
+ <<~SVG
33
+ <!-- Field -->
34
+ #{USPSFlags::Core.field}
35
+ SVG
36
+ end
34
37
 
35
- def heading
36
- <<~SVG
37
- <!-- Specification Heading Information -->
38
- <g>
39
- <style><![CDATA[tspan.heading{font-size: 50%;}]]></style>
40
- <text x="#{BF / 2}" y="#{BH * 3 / 40}" font-family="sans-serif" font-size="#{BH / 20}px" font-weight="bold" fill="#041E42" text-anchor="middle">United States Power Squadrons<tspan class="heading" dy ="-#{BH / 50}">®</tspan></text>
41
- </g>
42
- <text x="#{BF / 2}" y="#{BH / 8}" font-family="sans-serif" font-size="#{BH / 30}px" fill="#041E42" text-anchor="middle">Officer Flag Trident Specification</text>
43
- <text x="#{BF / 2}" y="#{BH * 2 / 11}" font-family="sans-serif" font-size="#{BH / 40}px" fill="#041E42" text-anchor="middle">All measurements are relative to a field with</text>
44
- SVG
45
- end
38
+ def heading
39
+ <<~SVG
40
+ <!-- Specification Heading Information -->
41
+ <g>
42
+ <style><![CDATA[tspan.heading{font-size: 50%;}]]></style>
43
+ <text x="#{BF / 2}" y="#{BH * 3 / 40}" font-family="sans-serif" font-size="#{BH / 20}px" font-weight="bold" fill="#041E42" text-anchor="middle">United States Power Squadrons<tspan class="heading" dy ="-#{BH / 50}">®</tspan></text>
44
+ </g>
45
+ <text x="#{BF / 2}" y="#{BH / 8}" font-family="sans-serif" font-size="#{BH / 30}px" fill="#041E42" text-anchor="middle">Officer Flag Trident Specification</text>
46
+ <text x="#{BF / 2}" y="#{BH * 2 / 11}" font-family="sans-serif" font-size="#{BH / 40}px" fill="#041E42" text-anchor="middle">All measurements are relative to a field with</text>
47
+ SVG
48
+ end
46
49
 
47
- def units
48
- <<~SVG
49
- <g>
50
- <style><![CDATA[tspan.title{font-size: #{USPSFlags::Config::FRACTION_SCALE * 9 / 10}%;}]]></style>
51
- <text x="#{BF / 2}" y="#{BH * 4 / 19}" font-family="sans-serif" font-size="#{BH / 40}px" fill="#041E42" text-anchor="middle">fly of #{@fly} <tspan class="title">#{@fly_fraction}</tspan> #{@unit_text} and hoist of #{@hoist} <tspan class="title">#{@hoist_fraction}</tspan> #{@unit_text}.</text>
52
- </g>
53
- <text x="#{BF / 2}" y="#{BH / 4}" font-family="sans-serif" font-size="#{BH / 40}px" fill="#041E42" text-anchor="middle">Measurements not specified are the same as on the short trident.</text>
54
- #{scaled_border if @scaled_border}
55
- SVG
56
- end
50
+ def units
51
+ <<~SVG
52
+ <g>
53
+ <style><![CDATA[tspan.title{font-size: #{USPSFlags::Config::FRACTION_SCALE * 9 / 10}%;}]]></style>
54
+ <text x="#{BF / 2}" y="#{BH * 4 / 19}" font-family="sans-serif" font-size="#{BH / 40}px" fill="#041E42" text-anchor="middle">fly of #{@fly} <tspan class="title">#{@fly_fraction}</tspan> #{@unit_text} and hoist of #{@hoist} <tspan class="title">#{@hoist_fraction}</tspan> #{@unit_text}.</text>
55
+ </g>
56
+ <text x="#{BF / 2}" y="#{BH / 4}" font-family="sans-serif" font-size="#{BH / 40}px" fill="#041E42" text-anchor="middle">Measurements not specified are the same as on the short trident.</text>
57
+ #{scaled_border if @scaled_border}
58
+ SVG
59
+ end
57
60
 
58
- def scaled_border
59
- <<~SVG
60
- <!-- Flag border scaled to spec trident size -->
61
- <rect x="#{BF * 0.41}" y="#{BH * 0.38}" width="#{BF}" height="#{BH}" transform="scale(0.7)" style="fill: none; stroke: #E0E0E0; stroke-width: 5px;" />
62
- <text x="#{BF * 0.64}" y="#{BH * 0.96}" font-family="sans-serif" font-size="#{BH / 60}px" fill="#CCCCCC" text-anchor="middle">Scale size of a flag.</text>
63
- SVG
61
+ def scaled_border
62
+ <<~SVG
63
+ <!-- Flag border scaled to spec trident size -->
64
+ <rect x="#{BF * 0.41}" y="#{BH * 0.38}" width="#{BF}" height="#{BH}" transform="scale(0.7)" style="fill: none; stroke: #E0E0E0; stroke-width: 5px;" />
65
+ <text x="#{BF * 0.64}" y="#{BH * 0.96}" font-family="sans-serif" font-size="#{BH / 60}px" fill="#CCCCCC" text-anchor="middle">Scale size of a flag.</text>
66
+ SVG
67
+ end
68
+ end
69
+ end
64
70
  end
65
71
  end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: false
2
+
3
+ # Core SVG data for the trident specification sheet.
4
+ #
5
+ # This class should never need to be called directly.
6
+ # @private
7
+ class USPSFlags
8
+ class Core
9
+ module TridentSpecs
10
+ module Horizontal
11
+ # This module defined no public methods
12
+ def _; end
13
+
14
+ private
15
+
16
+ def bottom
17
+ <<~SVG
18
+ <!-- Bottom -->
19
+ #{bottom_bar_width} <!-- Bar width -->
20
+ #{bottom_hash_width} <!-- Hash width -->
21
+ #{Base::SA.horizontal(@box_bottom + @config[:bar_width] * 4, @box_left, @box_right, pointer_left: @box_bottom, pointer_right: @box_bottom, fly: @fly, unit: @unit)} <!-- Boundary width -->
22
+ SVG
23
+ end
24
+
25
+ def bottom_bar_width
26
+ Base::SA.horizontal(
27
+ @box_bottom + @config[:bar_width], @config[:center_point] - @config[:bar_width] / 2,
28
+ @config[:center_point] + @config[:bar_width] / 2,
29
+ pointer_left: @box_bottom, pointer_right: @box_bottom, fly: @fly, unit: @unit
30
+ )
31
+ end
32
+
33
+ def bottom_hash_width
34
+ Base::SA.horizontal(
35
+ @box_bottom + @config[:bar_width] * 2.5, @config[:center_point] - @config[:hash_width] / 2,
36
+ @config[:center_point] + @config[:hash_width] / 2,
37
+ pointer_left: bottom_hash_width_pointer_left, pointer_right: bottom_hash_width_pointer_right,
38
+ fly: @fly, unit: @unit
39
+ )
40
+ end
41
+
42
+ def bottom_hash_width_pointer_left
43
+ @box_top + @config[:bar_width] * 4 + @config[:center_point_height] + @config[:side_spike_height]
44
+ end
45
+
46
+ def bottom_hash_width_pointer_right
47
+ @box_top + @config[:bar_width] * 4 + @config[:center_point_height] + @config[:side_spike_height]
48
+ end
49
+
50
+ def top
51
+ <<~SVG
52
+ <!-- Top -->
53
+ #{top_side_point_width} <!-- Side point width -->
54
+ #{top_main_point_width} <!-- Main point width -->
55
+ SVG
56
+ end
57
+
58
+ def top_side_point_width
59
+ Base::SA.horizontal(
60
+ @box_top - @config[:bar_width], @box_left, @box_left + @config[:bar_width] * 3 / 2,
61
+ pointer_left: @box_top, pointer_right: @box_top + @config[:bar_width] * 4 / 5 + @config[:side_point_height],
62
+ label_offset: -Base::BF / 60, fly: @fly, unit: @unit
63
+ )
64
+ end
65
+
66
+ def top_main_point_width
67
+ Base::SA.horizontal(
68
+ @box_top - @config[:bar_width] * 2.5, top_main_point_top, @config[:center_point] + @config[:bar_width],
69
+ pointer_left: @box_top + @config[:center_point_height], fly: @fly, unit: @unit,
70
+ pointer_right: @box_top + @config[:center_point_height], label_offset: -Base::BF / 60
71
+ )
72
+ end
73
+
74
+ def top_main_point_top
75
+ @config[:center_point] - @config[:bar_width]
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end