Class: Tiler::Widgets::NumberWithDelta

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

Instance Attribute Summary

Attributes inherited from Tiler::Widget

#config, #panel

Class Method Summary collapse

Methods inherited from Tiler::Widget

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

Constructor Details

This class inherits a constructor from Tiler::Widget

Class Method Details

.example_previewObject



80
81
82
83
84
85
86
87
# File 'lib/tiler/widgets/number_with_delta.rb', line 80

def self.example_preview
  {
    "value" => 142, "previous" => 100, "delta" => 42.0, "pct" => 42.0,
    "label" => "Sample metric", "aggregation" => "count",
    "time_window" => "24h", "direction" => "up",
    "spark" => [ 96, 97, 97, 98, 98, 99, 98.7 ], "color" => nil
  }
end

.supports_color_config?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/tiler/widgets/number_with_delta.rb', line 89

def self.supports_color_config?
  true
end