aboutsummarylogtreecommitdiffstats
path: root/graph.h
diff options
context:
space:
mode:
authorAntony Kellermann2018-03-18 16:32:45 -0400
committerAntony Kellermann2018-03-18 16:32:45 -0400
commitc28c674e72bc38369f43524570458ab7f51835c2 (patch)
tree15f09a3d07fd382d71c10e2a0d6db4d4fa29c18d /graph.h
parent75bdbf3b5c5670891f515f61fd0ba2a21f55a48f (diff)
downloadaur-c28c674e72bc38369f43524570458ab7f51835c2.tar.gz
Implemented panning left and right for graphing and minor UI changes
Diffstat (limited to 'graph.h')
-rw-r--r--graph.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/graph.h b/graph.h
index abffdc2c83ba..fa383e928b40 100644
--- a/graph.h
+++ b/graph.h
@@ -15,16 +15,24 @@
#define COLS_SPACING 12
#define DAYS_TO_BUSINESS_DAYS_RATIO (29.0/20.0)
-#include <stdio.h>
#include <stdlib.h>
#include <ncurses.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
#include "api.h"
+int zoom_months[] = {60, 48, 36, 24, 12, 9, 6, 3, 1};
+
+int zoom_change_x_months[] = {12, 12, 12, 12, 12, 3, 3, 3, 2};
+
/**
- * Main input loop
- * Entering the key UP or DOWN will zoom in or out one level
+ * -- Main input loop for graphing --
+ *
+ * Initially prints a five-year graph of the given security. The user may input keystrokes to manipulate the graph
+ * Valid keystrokes:
+ * q: Quits program
+ * UP: increase zoom level by one and moves start date forward by one year, three months, or two months.
+ * DOWN: decreases zoom level by one and moves start date backward by one year, three months, or two months.
+ * LEFT: moves start date backward by one year, three months, or one month.
+ * RIGHT: moves start date forward by one year, three months, or one month.
* @param ticker_name_string symbol
*/
void graph_main(const char* ticker_name_string);
@@ -33,8 +41,9 @@ void graph_main(const char* ticker_name_string);
* Prints out a NCurses based graph given an array of daily close prices.
* x-axis -- close price
* y-axis -- date
- * @param points daily close prices
- * @param start_time the starting date
+ * @param points daily close prices of past five years
+ * @param start_time the starting date of prices to print
+ * @param zoom the zoom level
*/
void graph_print(const double* points, struct tm* start_time, int zoom);