SPB Git

spb/metrika Public

Stata-class statistics, GPU-accelerated by Apple Silicon. Native Swift — no Electron, no Python runtime, no compromises.

Swift 92.4% HTML 3.3% R 3% Shell 1.3%
1.1 KB · 44 lines swift
Raw Blame History
1//2//  PlotSpec.swift3//  Metrika4//5//  Author:  Simon-Pierre Boucher6//  Contact: contact@spboucher.ai7//  Copyright © 2026 Simon-Pierre Boucher. All rights reserved.8//910import ZQData1112/// Backend-neutral plot description produced by `graph` commands. The app13/// layer renders it with Swift Charts, or the Metal point renderer once14/// the series crosses ~1M points (CLAUDE.md §7).15public struct ZQPlotSpec: Equatable, Sendable {16    public enum Kind: String, Equatable, Sendable {17        case scatter, line, histogram, kdensity18    }1920    public struct Series: Equatable, Sendable {21        public var label: String22        public var x: [Double]23        public var y: [Double]2425        public init(label: String, x: [Double], y: [Double]) {26            self.label = label27            self.x = x28            self.y = y29        }30    }3132    public var kind: Kind33    public var xLabel: String34    public var yLabel: String35    public var series: [Series]3637    public init(kind: Kind, xLabel: String, yLabel: String, series: [Series]) {38        self.kind = kind39        self.xLabel = xLabel40        self.yLabel = yLabel41        self.series = series42    }43}44