Liking cljdoc? Tell your friends :D

criterium.viewer.common-charts.autocorrelation

Chart specifications for ACF (Autocorrelation Function) plots.

Provides:

  • Vega-Lite point charts for graphical viewers (:portal, :kindly)
  • ASCII bar chart rendering for text viewers (:print, :pprint)

Both chart types show autocorrelation coefficients for all lags, with severity-based coloring and threshold visualization.

Chart specifications for ACF (Autocorrelation Function) plots.

Provides:
- Vega-Lite point charts for graphical viewers (:portal, :kindly)
- ASCII bar chart rendering for text viewers (:print, :pprint)

Both chart types show autocorrelation coefficients for all lags,
with severity-based coloring and threshold visualization.
raw docstring

acf->chart-dataclj

(acf->chart-data acf-data)

Transform ACF analysis data to chart data format.

Takes autocorrelation analysis result for a metric path. Returns vector of maps: [{:lag k :acf rₖ :severity "none"} ...]

Parameters: acf-data - autocorrelation analysis result with :acf map and :effective-sample-size

Transform ACF analysis data to chart data format.

Takes autocorrelation analysis result for a metric path.
Returns vector of maps: [{:lag k :acf rₖ :severity "none"} ...]

Parameters:
  acf-data - autocorrelation analysis result with :acf map and
             :effective-sample-size
sourceraw docstring

acf-plot-vega-specclj

(acf-plot-vega-spec acf-data chart-options)

Build complete Vega-Lite spec for ACF plot.

Takes autocorrelation analysis data for a single metric and chart options.

Parameters: acf-data - autocorrelation analysis result with :acf, :effective-sample-size, etc. chart-options - map with :width, :height, :title, :min-severity (optional) :min-severity - if provided, returns nil unless at least one lag has severity at or above this level (:none, :minor, :moderate, :severe)

Returns Vega-Lite spec map, or nil if suppressed by min-severity threshold.

Build complete Vega-Lite spec for ACF plot.

Takes autocorrelation analysis data for a single metric and chart options.

Parameters:
  acf-data - autocorrelation analysis result with :acf,
             :effective-sample-size, etc.
  chart-options - map with :width, :height, :title, :min-severity (optional)
    :min-severity - if provided, returns nil unless at least one lag has
                    severity at or above this level
                    (:none, :minor, :moderate, :severe)

Returns Vega-Lite spec map, or nil if suppressed by min-severity threshold.
sourceraw docstring

acf-point-layerclj

(acf-point-layer chart-data)

Create point layer for ACF values.

Returns Vega-Lite layer spec with points colored by severity.

Create point layer for ACF values.

Returns Vega-Lite layer spec with points colored by severity.
sourceraw docstring

has-severity-at-or-above?clj

(has-severity-at-or-above? lag-severities min-severity)

Check if any lag has severity at or above the given threshold.

Parameters: lag-severities - map of lag -> severity keyword min-severity - minimum severity to check for (:none, :minor, :moderate, :severe)

Returns true if any lag meets or exceeds the threshold.

Check if any lag has severity at or above the given threshold.

Parameters:
  lag-severities - map of lag -> severity keyword
  min-severity - minimum severity to check for
                 (:none, :minor, :moderate, :severe)

Returns true if any lag meets or exceeds the threshold.
sourceraw docstring

lag-1-threshold-colorsclj

Blue tones for lag-1 threshold lines.

Blue tones for lag-1 threshold lines.
sourceraw docstring

other-lag-threshold-colorsclj

Gray tones for other-lag threshold lines.

Gray tones for other-lag threshold lines.
sourceraw docstring

period-annotation-layerclj

(period-annotation-layer acf-data chart-data)

Create text annotation layer for detected period.

Returns Vega-Lite layer spec with text mark at the period lag, or nil if no period.

Create text annotation layer for detected period.

Returns Vega-Lite layer spec with text mark at the period lag, or nil
if no period.
sourceraw docstring

render-ascii-acf-plotclj

(render-ascii-acf-plot {:keys [acf effective-sample-size lag-severities
                               thresholds]}
                       metric-label
                       opts)

Render ASCII ACF plot for a single metric as a string.

Shows autocorrelation coefficients as bidirectional ASCII bar charts. Returns nil if no lags meet the min-severity threshold.

Parameters: acf-data - map with :acf, :effective-sample-size, :lag-severities, :thresholds metric-label - string label for the metric opts - options map: :min-severity - minimum severity to display (default :moderate) :bar-width - half-width of bar in characters (default 15) :header-fn - fn [metric-label n] -> header string :indent - string prefix for continuation lines

Render ASCII ACF plot for a single metric as a string.

Shows autocorrelation coefficients as bidirectional ASCII bar charts.
Returns nil if no lags meet the min-severity threshold.

Parameters:
  acf-data     - map with :acf, :effective-sample-size,
                 :lag-severities, :thresholds
  metric-label - string label for the metric
  opts         - options map:
    :min-severity   - minimum severity to display (default :moderate)
    :bar-width      - half-width of bar in characters (default 15)
    :header-fn      - fn [metric-label n] -> header string
    :indent         - string prefix for continuation lines
sourceraw docstring

severity-color-scaleclj

Vega-Lite color scale for severity.

Vega-Lite color scale for severity.
sourceraw docstring

severity-colorsclj

Color palette for ACF bar severity levels.

Color palette for ACF bar severity levels.
sourceraw docstring

severity-orderclj

Canonical ordering of severity levels for consistent legend display.

Canonical ordering of severity levels for consistent legend display.
sourceraw docstring

severity-rankclj

Numeric ranking for severity comparison. Higher = more severe.

Numeric ranking for severity comparison. Higher = more severe.
sourceraw docstring

threshold-rule-layersclj

(threshold-rule-layers chart-data thresholds)

Create horizontal rule layers for crossed threshold lines.

Shows lag-1 thresholds in blue tones and other-lag thresholds in gray tones. Only shows thresholds that are actually crossed by at least one data point.

Parameters: chart-data - vector of {:lag :acf :severity} maps thresholds - map with :lag-1 and :other threshold maps (from analysis)

Returns vector of Vega-Lite layer specs.

Create horizontal rule layers for crossed threshold lines.

Shows lag-1 thresholds in blue tones and other-lag thresholds in gray tones.
Only shows thresholds that are actually crossed by at least one data point.

Parameters:
  chart-data - vector of {:lag :acf :severity} maps
  thresholds - map with :lag-1 and :other threshold maps (from analysis)

Returns vector of Vega-Lite layer specs.
sourceraw docstring

zero-line-layerclj

(zero-line-layer)

Create horizontal rule at y=0 for reference.

Create horizontal rule at y=0 for reference.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close