Class: Ruflet::UI::Controls::RufletComponents::PieChartControl
- Defined in:
- lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb
Constant Summary collapse
- TYPE =
"piechart".freeze
- WIRE =
"PieChart".freeze
- KEYWORDS =
[:width, :height, :sections, :sections_space, :center_space_radius, :tooltip, :on_event].freeze
Constants inherited from Control
Control::HOST_EXPANDED_TYPES, Control::SCHEMA_METADATA_CACHE
Instance Attribute Summary
Attributes inherited from Control
#children, #id, #props, #runtime_page, #type, #wire_id
Instance Method Summary collapse
-
#initialize(id: nil, width: nil, height: nil, sections: nil, sections_space: nil, center_space_radius: nil, tooltip: nil, on_event: nil) ⇒ PieChartControl
constructor
A new instance of PieChartControl.
Methods inherited from Control
#attach_handler, #emit, generate_id, #has_handler?, #merge_props, #on, #to_patch
Constructor Details
#initialize(id: nil, width: nil, height: nil, sections: nil, sections_space: nil, center_space_radius: nil, tooltip: nil, on_event: nil) ⇒ PieChartControl
Returns a new instance of PieChartControl.
171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb', line 171 def initialize(id: nil, width: nil, height: nil, sections: nil, sections_space: nil, center_space_radius: nil, tooltip: nil, on_event: nil) props = {} props[:width] = width unless width.nil? props[:height] = height unless height.nil? props[:sections] = sections unless sections.nil? props[:sections_space] = sections_space unless sections_space.nil? props[:center_space_radius] = center_space_radius unless center_space_radius.nil? props[:tooltip] = tooltip unless tooltip.nil? props[:on_event] = on_event unless on_event.nil? super(type: TYPE, id: id, **props) end |