#include <iostream>
#include <vector>
#include "histogram.h"
#include "text.h"
#include <string>
#include <sstream>
struct Input{
    std::vector<double> numbers;
    size_t bin_count{};
};

Input input_data(std::istream& in) {
    size_t number_count;
    std::cerr << "Enter number count: ";
    in >> number_count;

    std::cerr << "Enter numbers: \n";
    Input result;
    result.numbers.resize(number_count);
    for (size_t i = 0; i < number_count; ++i) {
        in >> result.numbers[i];
    }

    std::cerr << "Enter bucket: ";
    in >> result.bin_count;

    return result;
};

using namespace std;

int main() {
    Input in = input_data(std::cin);
    auto bins = make_histogram(in.numbers, in.bin_count);
    show_histogram_svg(bins);
    return 0;
}
