From 02a956568db19e740886bc24f6bb6c5d54049456 Mon Sep 17 00:00:00 2001 From: TabolinIA Date: Sun, 26 May 2024 23:09:49 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D0=B9=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 5 ++++- svg.cpp | 4 ++-- svg.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index b6d8290..767f1f2 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,8 @@ #include "histogram.h" #include "text.h" #include "svg.h" +#include + using namespace std; @@ -38,7 +40,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