From d63ca8309fc5a87f355f77e81298833ce5cfaff9 Mon Sep 17 00:00:00 2001 From: TabolinIA Date: Sun, 2 Jun 2024 19:29:23 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20=D1=81=20?= =?UTF-8?q?=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 4 +++- svg.cpp | 4 ++-- svg.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) 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