View Source Coda.Behaviour.Analytics behaviour (coda v0.1.0)

Behaviour, macro and functions for Explorer.DataFrame analytics

Summary

Types

@type data_frame() :: Explorer.DataFrame.t()
@type data_frame_stats() :: %{
  album: %{count: integer()},
  artist: %{count: integer()},
  datetime: %{count: integer()},
  id: %{count: integer()},
  name: %{count: integer()},
  year: %{count: integer(), max: integer(), min: integer()}
}
@type facets() :: {top_facets(), top_facets_stats()}
@type options() :: Keyword.t()
@type top_facets() :: Explorer.DataFrame.t()
@type top_facets_stats() :: %{required(integer()) => data_frame()}

Callbacks

@callback data_frame([{:format, atom()}]) :: {:ok, data_frame()} | {:error, term()}
Link to this callback

data_frame_stats(data_frame)

View Source
@callback data_frame_stats(data_frame()) :: data_frame_stats()
Link to this callback

sample_albums(data_frame, options)

View Source
@callback sample_albums(data_frame(), options()) :: facets()
Link to this callback

sample_artists(data_frame, options)

View Source
@callback sample_artists(data_frame(), options()) :: facets()
Link to this callback

sample_tracks(data_frame, options)

View Source
@callback sample_tracks(data_frame(), options()) :: facets()
Link to this callback

top_albums(data_frame, options)

View Source
@callback top_albums(data_frame(), options()) :: facets()
Link to this callback

top_artists(data_frame, options)

View Source
@callback top_artists(data_frame(), options()) :: facets()
Link to this callback

top_tracks(data_frame, options)

View Source
@callback top_tracks(data_frame(), options()) :: facets()