drawio_dsl 0.8.2 → 0.8.3
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/.builders/.data/shapes.json +175 -9
- data/.builders/blueprint/shapes.rb +86 -4
- data/.builders/generators/project-plan.rb +10 -4
- data/.builders/generators/sample_diagrams/35-ids-and-arrows.rb +16 -6
- data/CHANGELOG.md +7 -0
- data/docs/project-plan/project.drawio +64 -46
- data/docs/project-plan/project_done.svg +1 -1
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/docs/samples/styles-glass.svg +1 -1
- data/docs/samples/styles-rounded.svg +1 -1
- data/docs/samples/styles-sketch.svg +1 -1
- data/lib/drawio_dsl/configuration_shapes.rb +1 -1
- data/lib/drawio_dsl/schema/shapes/shape.rb +19 -0
- data/lib/drawio_dsl/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +1 -1
@@ -92,7 +92,7 @@ module DrawioDsl
|
|
92
92
|
todo: ShapeDefaults.new(type: :todo, x: 0, category: :element, y: 0, w: 300, h: 60, style_modifiers: ''),
|
93
93
|
face: ShapeDefaults.new(type: :face, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.basic.smiley'),
|
94
94
|
triangle: ShapeDefaults.new(type: :triangle, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'triangle'),
|
95
|
-
line: ShapeDefaults.new(type: :line, x: 0, category: :line, y: 0, w: 50, h: 50, style_modifiers: 'edgeStyle=
|
95
|
+
line: ShapeDefaults.new(type: :line, x: 0, category: :line, y: 0, w: 50, h: 50, style_modifiers: 'edgeStyle=none;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0'),
|
96
96
|
embed_row: ShapeDefaults.new(type: :embed_row, x: 0, category: :element, y: 0, w: 200, h: 40, style_modifiers: 'shape=partialRectangle;collapsible=0;dropTarget=0;pointerEvents=0;top=0;left=0;bottom=1;right=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest'),
|
97
97
|
embed_col50: ShapeDefaults.new(type: :embed_col50, x: 0, category: :element, y: 0, w: 50, h: 40, style_modifiers: 'shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;fontStyle=1;overflow=hidden'),
|
98
98
|
embed_col200: ShapeDefaults.new(type: :embed_col200, x: 0, category: :element, y: 0, w: 150, h: 40, style_modifiers: 'shape=partialRectangle;connectable=0;top=0;left=0;bottom=0;right=0;align=left;spacingLeft=6;overflow=hidden')
|
@@ -47,6 +47,9 @@ module DrawioDsl
|
|
47
47
|
attr_accessor :h
|
48
48
|
attr_accessor :style_modifiers
|
49
49
|
|
50
|
+
attr_accessor :source
|
51
|
+
attr_accessor :target
|
52
|
+
|
50
53
|
def initialize(page, **args, &block)
|
51
54
|
args[:classification] = :shape
|
52
55
|
super(page, **args)
|
@@ -83,6 +86,9 @@ module DrawioDsl
|
|
83
86
|
@h = args[:h] || shape_defaults.h
|
84
87
|
@style_modifiers = args[:style_modifiers] || shape_defaults.style_modifiers
|
85
88
|
|
89
|
+
@source = args[:source]
|
90
|
+
@target = args[:target]
|
91
|
+
|
86
92
|
@fill_color = args[:fill_color] || (category == :text ? nil : theme_palette.fill_color)
|
87
93
|
@stroke_color = args[:stroke_color] || (category == :text ? nil : theme_palette.stroke_color)
|
88
94
|
@gradient = args[:gradient] || (category == :text ? nil : theme_palette.gradient)
|
@@ -113,11 +119,24 @@ module DrawioDsl
|
|
113
119
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
114
120
|
|
115
121
|
def as_xml(xml)
|
122
|
+
log.error category
|
123
|
+
log.error type
|
124
|
+
draw_element(xml) if category == :element
|
125
|
+
draw_line(xml) if category == :line
|
126
|
+
end
|
127
|
+
|
128
|
+
def draw_element(xml)
|
116
129
|
xml.mxCell(id: id, value: value, style: style, vertex: 1, parent: parent&.id) do
|
117
130
|
xml.mxGeometry(x: x, y: y, width: w, height: h, as: 'geometry')
|
118
131
|
end
|
119
132
|
end
|
120
133
|
|
134
|
+
def draw_line(xml)
|
135
|
+
xml.mxCell(id: id, value: value, style: style, parent: parent&.id, source: source, target: target, edge: 1) do
|
136
|
+
xml.mxGeometry(relative: 1, as: 'geometry')
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
121
140
|
def to_h
|
122
141
|
result = {
|
123
142
|
id: id,
|
data/lib/drawio_dsl/version.rb
CHANGED
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "drawio_dsl",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.3",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "drawio_dsl",
|
9
|
-
"version": "0.8.
|
9
|
+
"version": "0.8.3",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.1",
|
data/package.json
CHANGED