#pragma once

// Renders a 2D line plot using ImPlot con ejes pineados (ver viz/plot_static.h).
// Call within an ImGui frame (inside fn::run_app render callback).
// height > 0: altura del plot en pixeles (default 200) — explicita para
//   evitar feedback loops con contenedores AutoResizeY.
void line_plot(const char* title, const float* xs, const float* ys, int count,
               float height = 200.0f);
void line_plot(const char* title, const double* xs, const double* ys, int count,
               float height = 200.0f);

// Fixed Y-range overloads — pinea Y a [y_min, y_max] para series con dominio
// conocido (ej. 0-100 en CPU%/RAM%). v1.2.
void line_plot(const char* title, const float* xs, const float* ys, int count,
               float y_min, float y_max, float height = 200.0f);
void line_plot(const char* title, const double* xs, const double* ys, int count,
               double y_min, double y_max, float height = 200.0f);

// Fixed XY-range overloads — pinea BOTH X y Y. Util para ventanas temporales
// fijas (ej. ultimos 5 min de CPU%): xs en [0, WINDOW] y ys en [0, 100]. El
// plot NO se aplasta al variar count. v1.3.
void line_plot(const char* title, const float* xs, const float* ys, int count,
               float x_min, float x_max, float y_min, float y_max,
               float height = 200.0f);
void line_plot(const char* title, const double* xs, const double* ys, int count,
               double x_min, double x_max, double y_min, double y_max,
               float height = 200.0f);
