ea 0.6.30 → 0.6.31
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.
- checksums.yaml +4 -4
- data/lib/ea/sources/qea/diagram_builder.rb +10 -5
- data/lib/ea/sources/qea/relationship_builder.rb +19 -8
- data/lib/ea/svg/ea_emitter/marker/arrow_path.rb +9 -0
- data/lib/ea/svg/ea_emitter/marker/diamond.rb +39 -29
- data/lib/ea/svg/ea_emitter/marker/open_triangle.rb +7 -2
- data/lib/ea/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da25cfb5a4f0690b2b73df2d3c12fe3cd042c96fe6aab67d07e2c8871868feaf
|
|
4
|
+
data.tar.gz: 8be40d4bb501b904f1ba2609446d332ea260f3d04a831528d213d6747e352dfa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 271180e45139ae7e67a63a66a9fd78c8311edd379ee73f3a5ab9241f7b43d1be737bffca276e0585473f0294f1f557d3ff46fb254cdd105b8b6526ffb052fd36
|
|
7
|
+
data.tar.gz: 63856efa026109bf92d89468c10e6325f9a2f411e4f49217335667b590842d1b5f8f0f860f17c3527bb57236a3d096729ae411a9c3166c4f4efbb169db30eea0
|
|
@@ -247,10 +247,15 @@ module Ea
|
|
|
247
247
|
# renders as a straight line between the two element edges,
|
|
248
248
|
# with SourceRole labels and appropriate markers.
|
|
249
249
|
#
|
|
250
|
-
#
|
|
251
|
-
#
|
|
252
|
-
#
|
|
253
|
-
|
|
250
|
+
# Dependency AND Generalization phantoms draw: Main/
|
|
251
|
+
# 9FCDB717 renders 12 of 13 model dependencies among the
|
|
252
|
+
# placed packages (the 13th suppressed by the diagram's
|
|
253
|
+
# single Hidden link row); All/F209CE4B renders all 11
|
|
254
|
+
# row-less generalizations as white triangles. A Hidden
|
|
255
|
+
# link row suppresses; absence of a row does not.
|
|
256
|
+
PHANTOM_CONNECTOR_TYPES = %w[Association Aggregation Dependency
|
|
257
|
+
Generalization].freeze
|
|
258
|
+
PHANTOM_DOUBLE_BACK_TYPES = %w[Dependency].freeze
|
|
254
259
|
|
|
255
260
|
def phantom_connectors(diagram_row, explicit_connectors)
|
|
256
261
|
placed_ids = placed_object_ids_on(diagram_row.diagram_id)
|
|
@@ -308,7 +313,7 @@ module Ea
|
|
|
308
313
|
target_stereotype: conn.deststereotype,
|
|
309
314
|
waypoints: waypoints,
|
|
310
315
|
label_boxes: DEFAULT_LABEL_BOXES,
|
|
311
|
-
style: {},
|
|
316
|
+
style: PHANTOM_DOUBLE_BACK_TYPES.include?(conn.connector_type) ? { direct: true } : {},
|
|
312
317
|
hidden: false,
|
|
313
318
|
has_geometry_offsets: false
|
|
314
319
|
)
|
|
@@ -62,9 +62,8 @@ module Ea
|
|
|
62
62
|
target_multiplicity_upper: parse_upper(row.destcard),
|
|
63
63
|
source_multiplicity_raw: raw_card(row.sourcecard),
|
|
64
64
|
target_multiplicity_raw: raw_card(row.destcard),
|
|
65
|
-
source_aggregation:
|
|
66
|
-
|
|
67
|
-
target_aggregation: aggregation_from(row.destaccess),
|
|
65
|
+
source_aggregation: source_aggregation_for(row),
|
|
66
|
+
target_aggregation: aggregation_from(row.destisaggregate),
|
|
68
67
|
source_navigable: navigable?(row.sourceaccess, row.direction,
|
|
69
68
|
:source),
|
|
70
69
|
target_navigable: navigable?(row.destaccess, row.direction, :target)
|
|
@@ -112,15 +111,27 @@ module Ea
|
|
|
112
111
|
end
|
|
113
112
|
end
|
|
114
113
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
# EA stores the aggregate end in t_connector.SourceIsAggregate/
|
|
115
|
+
# DestIsAggregate (0 none, 1 shared, 2 composite) — NOT in
|
|
116
|
+
# DestAccess, which carries the accessibility string
|
|
117
|
+
# ("Public"). The connector TYPE only implies a source-side
|
|
118
|
+
# aggregation when the flags are silent (legacy
|
|
119
|
+
# Connector_Type encoding).
|
|
120
|
+
def aggregation_from(flag_value)
|
|
121
|
+
case flag_value.to_i
|
|
122
|
+
when 1 then "shared"
|
|
123
|
+
when 2 then "composite"
|
|
120
124
|
else "none"
|
|
121
125
|
end
|
|
122
126
|
end
|
|
123
127
|
|
|
128
|
+
def source_aggregation_for(row)
|
|
129
|
+
flagged = aggregation_from(row.sourceisaggregate)
|
|
130
|
+
return flagged if flagged != "none"
|
|
131
|
+
|
|
132
|
+
ConnectorRelationshipMap.source_aggregation_for(row.connector_type)
|
|
133
|
+
end
|
|
134
|
+
|
|
124
135
|
def navigable?(_access, direction, end_label)
|
|
125
136
|
# EA's navigability is messy. Treat unspecified direction
|
|
126
137
|
# as bidirectional, "Source -> Destination" as target-only
|
|
@@ -16,6 +16,15 @@ module Ea
|
|
|
16
16
|
|
|
17
17
|
def self.specs_for(connector, source, target, before_target,
|
|
18
18
|
after_source, relationship: nil)
|
|
19
|
+
# EA draws the navigability arrow on directed
|
|
20
|
+
# associations AND aggregations (333EFCCF: 6 aggregations
|
|
21
|
+
# render diamond + path arrow); Direction
|
|
22
|
+
# "Unspecified"/empty draws a plain line (EC670ED5: the
|
|
23
|
+
# single Unspecified association is arrowless;
|
|
24
|
+
# C852CC42/TransferNode: 9 Unspecified all arrowless).
|
|
25
|
+
direction = connector.direction.to_s
|
|
26
|
+
return [] if direction.empty? || direction == "Unspecified"
|
|
27
|
+
|
|
19
28
|
return bidirectional_specs(source, target, before_target,
|
|
20
29
|
after_source) if bidirectional?(connector)
|
|
21
30
|
|
|
@@ -4,49 +4,59 @@ module Ea
|
|
|
4
4
|
module Svg
|
|
5
5
|
module EaEmitter
|
|
6
6
|
module Marker
|
|
7
|
-
# Diamond marker at the whole end of an aggregation
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
# diagram
|
|
17
|
-
#
|
|
7
|
+
# Diamond marker at the whole end of an aggregation, plus a
|
|
8
|
+
# navigability arrow apexing at the diamond's line-side tip.
|
|
9
|
+
#
|
|
10
|
+
# WHOLE-END SELECTION: EA flags the whole end either through
|
|
11
|
+
# t_connector.DestAccess (1 shared / 2 composite -> whole at
|
|
12
|
+
# the TARGET; corpus-verified 333EFCCF: PersonalRight_E is
|
|
13
|
+
# the DestAccess=2 end and every diamond sits there) or
|
|
14
|
+
# through the Connector_Type itself ("Aggregation"/
|
|
15
|
+
# "Composition" -> whole at the SOURCE; basic.qea's
|
|
16
|
+
# composition diagram). DestAccess wins when both appear.
|
|
17
|
+
# Without relationship data the direction heuristic applies
|
|
18
|
+
# ("Destination -> Source" -> whole at target).
|
|
19
|
+
#
|
|
20
|
+
# ARROW: dest-flagged aggregations draw a base-12 height-15
|
|
21
|
+
# open arrow stacked on the diamond tip pointing into the
|
|
22
|
+
# whole (333EFCCF: 6 diamonds + 6 path arrows). Type-inferred
|
|
23
|
+
# source-side aggregations draw the diamond only (basic.qea:
|
|
24
|
+
# 17 diamonds, 0 arrows).
|
|
18
25
|
class Diamond < Kind
|
|
19
26
|
def self.handles?(effective_type)
|
|
20
27
|
effective_type == "Aggregation" || effective_type == "Composition"
|
|
21
28
|
end
|
|
22
29
|
|
|
23
30
|
def self.specs_for(connector, source, target, before_target, after_source, relationship: nil)
|
|
24
|
-
|
|
25
|
-
whole_anchor =
|
|
26
|
-
whole_base =
|
|
31
|
+
whole_at_target = whole_at_target?(connector, relationship)
|
|
32
|
+
whole_anchor = whole_at_target ? target : source
|
|
33
|
+
whole_base = whole_at_target ? before_target : after_source
|
|
27
34
|
specs = [Registry::Spec.new(shape: :diamond,
|
|
28
35
|
anchor: whole_anchor,
|
|
29
36
|
base: whole_base)]
|
|
30
|
-
return specs unless
|
|
37
|
+
return specs unless whole_at_target
|
|
31
38
|
|
|
32
|
-
part_anchor = whole_end_at_source ? target : source
|
|
33
|
-
part_base = whole_end_at_source ? before_target : after_source
|
|
34
39
|
specs << Registry::Spec.new(shape: :arrow,
|
|
35
|
-
anchor:
|
|
36
|
-
base:
|
|
40
|
+
anchor: whole_anchor,
|
|
41
|
+
base: whole_base)
|
|
37
42
|
specs
|
|
38
43
|
end
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
def self.whole_at_target?(connector, relationship)
|
|
46
|
+
return true if dest_flagged?(relationship)
|
|
47
|
+
return false if source_flagged?(relationship)
|
|
48
|
+
|
|
49
|
+
!whole_end_at_source?(connector)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def self.dest_flagged?(relationship)
|
|
53
|
+
relationship &&
|
|
54
|
+
%w[shared composite].include?(relationship.target_aggregation.to_s)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def self.source_flagged?(relationship)
|
|
58
|
+
relationship &&
|
|
59
|
+
%w[shared composite].include?(relationship.source_aggregation.to_s)
|
|
50
60
|
end
|
|
51
61
|
end
|
|
52
62
|
end
|
|
@@ -14,14 +14,19 @@ module Ea
|
|
|
14
14
|
# the diagram's generalizations use polygons.
|
|
15
15
|
class OpenTriangle < Kind
|
|
16
16
|
def self.handles?(effective_type)
|
|
17
|
-
%w[Generalization Realization Dependency
|
|
17
|
+
%w[Generalization Realization Realisation Dependency
|
|
18
|
+
InformationFlow NoteLink].include?(effective_type)
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
def self.specs_for(connector, source, target, before_target, after_source, relationship: nil)
|
|
21
22
|
whole_end_at_source = whole_end_at_source?(connector)
|
|
22
23
|
anchor = whole_end_at_source ? target : source
|
|
23
24
|
base = whole_end_at_source ? before_target : after_source
|
|
24
|
-
shape = effective_type?(connector)
|
|
25
|
+
shape = if %w[Dependency InformationFlow].include?(effective_type?(connector))
|
|
26
|
+
:dependency_arrow
|
|
27
|
+
else
|
|
28
|
+
:triangle
|
|
29
|
+
end
|
|
25
30
|
[Registry::Spec.new(shape: shape, anchor: anchor, base: base)]
|
|
26
31
|
end
|
|
27
32
|
|
data/lib/ea/version.rb
CHANGED