Class: Tiler::Widgets::Meter

Inherits:
Tiler::Widget show all
Defined in:
lib/tiler/widgets/meter.rb

Instance Attribute Summary

Attributes inherited from Tiler::Widget

#config, #panel

Class Method Summary collapse

Methods inherited from Tiler::Widget

#data, #empty?, #initialize, #label, #partial, #query_class, supports_palette_config?

Constructor Details

This class inherits a constructor from Tiler::Widget

Class Method Details

.example_configObject



57
58
59
# File 'lib/tiler/widgets/meter.rb', line 57

def self.example_config
  { "value_column" => "cpu", "aggregation" => "last", "min" => 0, "max" => 100, "suffix" => "%" }
end

.example_payloadObject



61
62
63
# File 'lib/tiler/widgets/meter.rb', line 61

def self.example_payload
  { "cpu" => 64 }
end

.example_previewObject



65
66
67
68
# File 'lib/tiler/widgets/meter.rb', line 65

def self.example_preview
  { "value" => 64, "min" => 0, "max" => 100, "prefix" => nil, "suffix" => "%",
    "color" => nil }
end

.supports_color_config?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/tiler/widgets/meter.rb', line 70

def self.supports_color_config?
  true
end