diff --git a/main.cpp b/main.cpp index b6d8290..4b39ff6 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include "histogram.h" #include "text.h" #include "svg.h" +#include using namespace std; @@ -38,7 +39,8 @@ input_data(istream& in, bool prompt) { int main() { - auto in = input_data(cin); + curl_global_init(CURL_GLOBAL_ALL); + auto in = input_data(cin, true); auto bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins); return 0; diff --git a/svg.cpp b/svg.cpp index c5e9af9..43508ea 100644 --- a/svg.cpp +++ b/svg.cpp @@ -30,7 +30,7 @@ void svg_rect(double x, double y, double width, double height, string stroke = " void -show_histogram_svg(const vector& bins, size_t user_block_width) { +show_histogram_svg(const vector& bins) { const auto IMAGE_WIDTH = 400; const auto IMAGE_HEIGHT = 300; @@ -38,7 +38,7 @@ show_histogram_svg(const vector& bins, size_t user_block_width) { const auto TEXT_BASELINE = 20; const auto TEXT_WIDTH = 50; const auto BIN_HEIGHT = 30; - const auto BLOCK_WIDTH = user_block_width; + const auto BLOCK_WIDTH = 15; const size_t MAX_WIDTH = IMAGE_WIDTH - TEXT_WIDTH - 1; diff --git a/svg.h b/svg.h index 04f0f6c..adca9a4 100644 --- a/svg.h +++ b/svg.h @@ -1,6 +1,6 @@ #ifndef SVG_H_INCLUDED #define SVG_H_INCLUDED void -show_histogram_svg(const std::vector& bins, size_t user_block_width); +show_histogram_svg(const std::vector& bins); #endif // SVG_H_INCLUDED