Class: DrawioDsl::Schema::Element
- Defined in:
- lib/drawio_dsl/schema/element.rb
Overview
Elements represents some kind of shape such as a Square, Circle, Callout, Actor, etc.
Direct Known Subclasses
Actor, Actor2, Callout, Callout2, Callout3, Callout4, Circle, Cloud, Container, Container2, Container3, Container4, Cross, Database, DbJson, Diamond, Document, Ellipse, EmbedCol200, EmbedCol50, EmbedRow, Envelop, Face, Group, Hexagon, Interface, Klass, Note, Process, Rectangle, Rectangle2, Square, Step, Tick, Todo, Triangle
Constant Summary
Constants included from Formatters::Factory
Formatters::Factory::FORMATTERS
Instance Attribute Summary
Attributes inherited from Shape
#fill_color, #font_color, #glass, #gradient, #h, #html, #rounded, #shadow, #sketch, #stroke_color, #style_modifiers, #theme, #title, #value, #w, #white_space, #x, #y
Attributes inherited from Node
#classification, #id, #key, #nodes, #page, #parent
Class Method Summary collapse
Instance Method Summary collapse
-
#apply_defaults(args) ⇒ Object
def initialize(page, **args) args = :anchor super(page, **args) end.
- #default_configuration ⇒ Object
Methods inherited from Shape
#add_base_modifiers, #as_xml, #bg_theme_palette, configure_shape, #debug, #draw_element, #draw_line, #format, #initialize, #shape_defaults, #style, #theme_palette, #to_h
Methods included from Formatters::Factory
Methods inherited from Node
#add_node, #debug, #debug_detail, #debug_row, #initialize, #root?, #to_h
Constructor Details
This class inherits a constructor from DrawioDsl::Schema::Shape
Class Method Details
.configure_as(key) ⇒ Object
8 9 10 |
# File 'lib/drawio_dsl/schema/element.rb', line 8 def configure_as(key) configure_shape(key, :element) end |
Instance Method Details
#apply_defaults(args) ⇒ Object
def initialize(page, **args)
args[:classification] = :anchor
super(page, **args)
end
18 19 20 21 22 23 24 25 |
# File 'lib/drawio_dsl/schema/element.rb', line 18 def apply_defaults(args) super(args) @fill_color = args[:fill_color] || theme_palette.fill_color @stroke_color = args[:stroke_color] || theme_palette.stroke_color @gradient = args[:gradient] || theme_palette.gradient @font_color = args[:font_color] || theme_palette.font_color end |
#default_configuration ⇒ Object
27 28 29 |
# File 'lib/drawio_dsl/schema/element.rb', line 27 def default_configuration KConfig.configuration.drawio.shape.default_element end |