45 using namespace ftxui;
46 using namespace std::chrono_literals;
50 std::string reset_position;
51 for (
int i = 0;; ++i) {
53 auto document = hbox({
55 graph(std::ref(my_graph)),
61 graph(std::ref(my_graph)) |
color(Color::BlueLight),
63 graph(std::ref(my_graph)) |
color(Color::RedLight),
65 graph(std::ref(my_graph)) |
color(Color::YellowLight),
71 const int min_width = 40;
72 document |= size(HEIGHT, GREATER_THAN, min_width);
74 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
75 Render(screen, document);
76 std::cout << reset_position;
78 reset_position = screen.ResetPosition();
80 const auto sleep_time = 0.03s;
81 std::this_thread::sleep_for(sleep_time);