// // PlotSpec.swift // Metrika // // Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // Copyright © 2026 Simon-Pierre Boucher. All rights reserved. // import ZQData /// Backend-neutral plot description produced by `graph` commands. The app /// layer renders it with Swift Charts, or the Metal point renderer once /// the series crosses ~1M points (CLAUDE.md §7). public struct ZQPlotSpec: Equatable, Sendable { public enum Kind: String, Equatable, Sendable { case scatter, line, histogram, kdensity } public struct Series: Equatable, Sendable { public var label: String public var x: [Double] public var y: [Double] public init(label: String, x: [Double], y: [Double]) { self.label = label self.x = x self.y = y } } public var kind: Kind public var xLabel: String public var yLabel: String public var series: [Series] public init(kind: Kind, xLabel: String, yLabel: String, series: [Series]) { self.kind = kind self.xLabel = xLabel self.yLabel = yLabel self.series = series } }