
#include <iostream>
#include <vector>

#include "histogram.h"
#include "text.h"
#include "histogram_internal.h"


#include "svg.h"
using namespace std;

struct Input
{
    vector<double> numbers;
    size_t bin_count{};
    size_t number_count;//количество чисел
};



Input
input_data()
{


    Input in;

    cerr << "Kol-vo chisel -> ";
    cin >> in.number_count;
    //  vector <double> numbers(number_count);//вектор с количсетвом эл. number_count
    in.numbers.resize(in.number_count);

    cerr << "Vvedite chisla:";
    cout << endl;//заполнение вектора
    for (size_t i = 0; i < in.number_count; i++)
    {
        cin >> in.numbers[i];
        //cout<<endl;
    }

    cerr << "vvedite kolvo bins -> ";
    cin >> in.bin_count;
    return in;
}



int main()
{
    size_t number_count;//количество чисел

    Input in = input_data();
    auto bins = make_histogram(in.numbers, in.bin_count);
    //  show_histogram_text(bins, in.bin_count);
    show_histogram_svg(bins, in.number_count);
    return 0;
    //  size_t bin_count;//количество корзин

    //  vector<size_t> bins(bin_count);

}




