#pragma once

#include "Point.h"

#include <string>
#include <vector>

class TextSpan
{
public:
	enum class Type
	{
		PLAIN,
		EQUATION
	};

	TextSpan(const std::string& content, Type type = Type::PLAIN)
		: mType(type),
		mContent(content)
	{

	}

private:
	Type mType{ Type::PLAIN };
	std::string mContent;
};

class PlotCaption
{
public:
	PlotCaption() = default;

	void setContent(const std::string& plainContent)
	{
		mContent = { plainContent };
	}

	void setContent(const std::vector<TextSpan>& content)
	{
		mContent = content;
	}

private:
	std::vector<TextSpan> mContent;
};

class PlotSeries
{
public:
	PlotSeries(const std::string& label = {})
		: mLabel(label)
	{

	}

	void setData(const std::vector<Point>& data)
	{
		mData = data;
	}

private:
	std::string mLabel;
	std::vector<Point> mData;
};

class Plot
{
public:
	Plot() = default;

	void setXAxisCaption(const std::string& caption)
	{
		mXAxisCaption.setContent(caption);
	}

	void setYAxisCaption(const std::string& caption)
	{
		mYAxisCaption.setContent(caption);
	}

	void addSeries(const PlotSeries& series)
	{
		mSeries.push_back(series);
	}

private:
	PlotCaption mXAxisCaption;
	PlotCaption mYAxisCaption;
	std::vector<PlotSeries> mSeries;
};