Sha256: 248c33b97edee99a982b14f0be253929ff857367dbe63c81385ffb8ad80a78a7

Contents?: true

Size: 1.89 KB

Versions: 3

Compression:

Stored size: 1.89 KB

Contents

KManager.action :styled_shapes do
  action do

    DrawioDsl::Drawio
      .init(k_builder, on_exist: :write, on_action: :execute)
      .diagram(theme: :style_06)
      .page('Style-Plain', margin_left: 0, margin_top: 0) do
        grid_layout(wrap_at: 5)

        KConfig.configuration.drawio.shapes.members.each do |shape|
          next if shape == :shape

          send(shape, title: shape.to_s, shape: shape)
        end
      end
      .page('Style-Shadow', shadow: 1, margin_left: 0, margin_top: 0) do
        grid_layout(wrap_at: 5)

        KConfig.configuration.drawio.shapes.members.each do |shape|
          next if shape == :shape

          send(shape, title: shape.to_s, shape: shape)
        end
      end
      .page('Style-Rounded', rounded: 1, margin_left: 0, margin_top: 0) do
        grid_layout(wrap_at: 5)

        KConfig.configuration.drawio.shapes.members.each do |shape|
          next if shape == :shape

          send(shape, title: shape.to_s, shape: shape)
        end
      end
      .page('Style-Glass', glass: 1, margin_left: 0, margin_top: 0) do
        grid_layout(wrap_at: 5)

        KConfig.configuration.drawio.shapes.members.each do |shape|
          next if shape == :shape

          send(shape, title: shape.to_s, shape: shape)
        end
      end
      .page('Style-Sketch', sketch: 1, margin_left: 0, margin_top: 0) do
        grid_layout(wrap_at: 5)

        KConfig.configuration.drawio.shapes.members.each do |shape|
          next if shape == :shape

          send(shape, title: shape.to_s, shape: shape)
        end
      end
      .cd(:spec)
      .osave('.samples/20-styled-shapes.drawio')
      .cd(:docs)
      .export_svg('samples/styles-plain', page: 1)
      .export_svg('samples/styles-shadow', page: 2)
      .export_svg('samples/styles-rounded', page: 3)
      .export_svg('samples/styles-glass', page: 4)
      .export_svg('samples/styles-sketch', page: 5)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
drawio_dsl-0.8.8 .builders/generators/sample_diagrams/20-styles.rb
drawio_dsl-0.8.7 .builders/generators/sample_diagrams/20-styles.rb
drawio_dsl-0.8.6 .builders/generators/sample_diagrams/20-styles.rb