#pragma once
#include "Plottable.h"
#include "../axis/Axis.h"
namespace renderive {
struct Frequency_Trace_Properties {
    Pen pen{Color::yellow()};
};
namespace detail {
class LIB_DECL Frequency_Trace_Control : public Plottable_State<Frequency_Trace_Properties> {
public:
    Frequency_Trace_Control(const Frequency_Trace_Properties& properties, renderive_Owner<Time_Axis> time_axis, renderive_Owner<Axis> value_axis);
    ~Frequency_Trace_Control() override;
    void append_sample(int tick, double value);
    void append_sample(Time_Of_Day time, double value);
    [[nodiscard]] std::size_t sample_count() const;
    [[nodiscard]] std::size_t rendered_point_count() const;
protected:
    void prepare_frame(const Prepare_Render_Context& context) override;
    void paint(Painter& painter, const Paint_Render_Context& context) override;
private:
    struct Impl;
    void publish() override;
};
}
using Frequency_Trace = detail::Attach_Plottable<detail::Frequency_Trace_Control, Frequency_Trace_Properties>;
}
