46 using namespace ftxui;
47 using namespace std::chrono_literals;
51 std::string reset_position;
52 for (
int i = 0;; ++i) {
54 auto document = hbox({
56 graph(std::ref(my_graph)),
62 graph(std::ref(my_graph)) | color(Color::BlueLight),
64 graph(std::ref(my_graph)) | color(Color::RedLight),
66 graph(std::ref(my_graph)) | color(Color::YellowLight),
72 const int min_width = 40;
73 document |= size(HEIGHT, GREATER_THAN, min_width);
75 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
76 Render(screen, document);
77 std::cout << reset_position;
79 reset_position = screen.ResetPosition();
81 const auto sleep_time = 0.03s;
82 std::this_thread::sleep_for(sleep_time);