Skip to content

LogViewer: Replace uniform stride decimation with LTTB algorithm #14353

Description

@DonLakeFlyer

Problem

The _syncSeriesWithSelection function in src/AnalyzeView/LogViewer/LogViewerChart.qml uses uniform stride decimation to reduce data to _maxChartPointsPerField (6000) points:

const sampleStep = Math.max(1, Math.ceil(points.length / _maxChartPointsPerField))

Uniform stride sampling can miss peaks and troughs between sampled points, causing the rendered chart to look flat or smoothed when the actual data has sharp spikes or valleys.

Solution

Implement the Largest Triangle Three Buckets (LTTB) algorithm for downsampling. LTTB selects points that best preserve the visual shape of the data within the same point budget. It is specifically designed for time-series chart decimation and produces far more visually accurate results than uniform stride at the same number of output points.

Reference: Steinarsson (2013) — Downsampling Time Series for Visual Representation
JavaScript implementation reference: https://github.com/sveinn-steinarsson/flot-downsample

Files

  • src/AnalyzeView/LogViewer/LogViewerChart.qml — replace stride loop in _syncSeriesWithSelection with LTTB

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions