View Source Backpex.Metric behaviour (Backpex v0.8.2)
Behaviour implemented by all metrics.
Metrics are info boxes for your resources displaying key indicators prominently on the index view in your application. An example could be to show the current total of all orders received today. You may create your own metrics by implementing this behaviour.
Summary
Callbacks
Used to render the metric as a heex template on the index views.
Functions
Builds string of css classes for basic metric box
Determine if metrics are visible for given live_resource.
Callbacks
@callback query(query :: Ecto.Queryable.t(), select :: any(), repo :: Ecto.Repo.t()) :: Ecto.Schema.t() | term() | nil
@callback render(assigns :: map()) :: %Phoenix.LiveView.Rendered{ caller: term(), dynamic: term(), fingerprint: term(), root: term(), static: term() }
Used to render the metric as a heex template on the index views.
Functions
Builds string of css classes for basic metric box
Determine if metrics are visible for given live_resource.