plotcli-py 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. CLAUDE.md +51 -0
  2. LICENSE +21 -0
  3. PKG-INFO +358 -0
  4. README.md +340 -0
  5. main.py +6 -0
  6. plotcli-original/.Rbuildignore +18 -0
  7. plotcli-original/.github/workflows/deploy_docs.yml +43 -0
  8. plotcli-original/.gitignore +46 -0
  9. plotcli-original/DESCRIPTION +25 -0
  10. plotcli-original/NAMESPACE +60 -0
  11. plotcli-original/NEWS.md +112 -0
  12. plotcli-original/R/ascii_escape.r +13 -0
  13. plotcli-original/R/canvas.r +586 -0
  14. plotcli-original/R/class_functions.r +114 -0
  15. plotcli-original/R/geom_registry.r +1376 -0
  16. plotcli-original/R/ggplotcli.r +234 -0
  17. plotcli-original/R/ggplotcli_helpers.r +1099 -0
  18. plotcli-original/R/helper_functions.r +351 -0
  19. plotcli-original/R/plotcli.r +963 -0
  20. plotcli-original/R/plotcli_grid.r +1 -0
  21. plotcli-original/R/plotcli_wrappers.r +416 -0
  22. plotcli-original/R/zzz.r +15 -0
  23. plotcli-original/README.md +192 -0
  24. plotcli-original/docs/ascii.png +0 -0
  25. plotcli-original/docs/bar.png +0 -0
  26. plotcli-original/docs/block.png +0 -0
  27. plotcli-original/docs/boxplot.png +0 -0
  28. plotcli-original/docs/density.png +0 -0
  29. plotcli-original/docs/facet.png +0 -0
  30. plotcli-original/docs/facet_grid.png +0 -0
  31. plotcli-original/docs/generate_png.sh +137 -0
  32. plotcli-original/docs/heatmap.png +0 -0
  33. plotcli-original/docs/histogram.png +0 -0
  34. plotcli-original/docs/line.png +0 -0
  35. plotcli-original/docs/noborder.png +0 -0
  36. plotcli-original/docs/scatter.png +0 -0
  37. plotcli-original/docs/showcase.R +182 -0
  38. plotcli-original/inst/doc/ggplotcli.R +231 -0
  39. plotcli-original/inst/doc/ggplotcli.Rmd +329 -0
  40. plotcli-original/inst/doc/ggplotcli.html +1078 -0
  41. plotcli-original/inst/doc/plotcli_class.R +98 -0
  42. plotcli-original/inst/doc/plotcli_class.Rmd +121 -0
  43. plotcli-original/inst/doc/plotcli_class.html +564 -0
  44. plotcli-original/inst/doc/plotcli_wrappers.R +35 -0
  45. plotcli-original/inst/doc/plotcli_wrappers.Rmd +62 -0
  46. plotcli-original/inst/doc/plotcli_wrappers.html +546 -0
  47. plotcli-original/man/AsciiCanvas.Rd +116 -0
  48. plotcli-original/man/BlockCanvas.Rd +132 -0
  49. plotcli-original/man/BrailleCanvas.Rd +146 -0
  50. plotcli-original/man/Canvas.Rd +492 -0
  51. plotcli-original/man/GeomRegistry.Rd +9 -0
  52. plotcli-original/man/add_legend_to_output.Rd +12 -0
  53. plotcli-original/man/braille_dot_bit.Rd +29 -0
  54. plotcli-original/man/braille_set_dot.Rd +21 -0
  55. plotcli-original/man/bresenham.Rd +27 -0
  56. plotcli-original/man/build_plot_output.Rd +28 -0
  57. plotcli-original/man/build_plot_output_v2.Rd +41 -0
  58. plotcli-original/man/cat_plot_matrix.Rd +17 -0
  59. plotcli-original/man/cbind.plotcli.Rd +19 -0
  60. plotcli-original/man/cbind_plots.Rd +17 -0
  61. plotcli-original/man/color_to_term.Rd +18 -0
  62. plotcli-original/man/create_canvas.Rd +21 -0
  63. plotcli-original/man/create_panel_scales.Rd +29 -0
  64. plotcli-original/man/create_scales.Rd +27 -0
  65. plotcli-original/man/dot-geom_registry.Rd +16 -0
  66. plotcli-original/man/draw_border.Rd +12 -0
  67. plotcli-original/man/draw_grid.Rd +12 -0
  68. plotcli-original/man/extract_legend_info.Rd +12 -0
  69. plotcli-original/man/extract_plot_labels.Rd +12 -0
  70. plotcli-original/man/extract_plot_style.Rd +12 -0
  71. plotcli-original/man/format_axis_label.Rd +18 -0
  72. plotcli-original/man/format_four_chars.Rd +21 -0
  73. plotcli-original/man/geom_area_handler.Rd +12 -0
  74. plotcli-original/man/geom_bar_handler.Rd +12 -0
  75. plotcli-original/man/geom_boxplot_handler.Rd +13 -0
  76. plotcli-original/man/geom_density_handler.Rd +12 -0
  77. plotcli-original/man/geom_histogram_handler.Rd +12 -0
  78. plotcli-original/man/geom_hline_handler.Rd +12 -0
  79. plotcli-original/man/geom_line_handler.Rd +12 -0
  80. plotcli-original/man/geom_path_handler.Rd +12 -0
  81. plotcli-original/man/geom_point_handler.Rd +12 -0
  82. plotcli-original/man/geom_rect_handler.Rd +12 -0
  83. plotcli-original/man/geom_segment_handler.Rd +12 -0
  84. plotcli-original/man/geom_smooth_handler.Rd +12 -0
  85. plotcli-original/man/geom_text_handler.Rd +12 -0
  86. plotcli-original/man/geom_vline_handler.Rd +12 -0
  87. plotcli-original/man/get_color_hue.Rd +18 -0
  88. plotcli-original/man/get_data_subset.Rd +23 -0
  89. plotcli-original/man/get_facet_info.Rd +18 -0
  90. plotcli-original/man/get_geom_handler.Rd +17 -0
  91. plotcli-original/man/get_term_colors.Rd +21 -0
  92. plotcli-original/man/ggplotcli.Rd +83 -0
  93. plotcli-original/man/init_color_mapping.Rd +15 -0
  94. plotcli-original/man/is_braille.Rd +20 -0
  95. plotcli-original/man/is_geom_registered.Rd +17 -0
  96. plotcli-original/man/list_registered_geoms.Rd +14 -0
  97. plotcli-original/man/make_colored.Rd +23 -0
  98. plotcli-original/man/make_unique_names.Rd +20 -0
  99. plotcli-original/man/normalize_data.Rd +27 -0
  100. plotcli-original/man/pclib.Rd +48 -0
  101. plotcli-original/man/pclibx.Rd +46 -0
  102. plotcli-original/man/pclid.Rd +44 -0
  103. plotcli-original/man/pclih.Rd +50 -0
  104. plotcli-original/man/pclil.Rd +48 -0
  105. plotcli-original/man/pclis.Rd +48 -0
  106. plotcli-original/man/pixel_to_braille.Rd +23 -0
  107. plotcli-original/man/plotcli.Rd +598 -0
  108. plotcli-original/man/plotcli_bar.Rd +48 -0
  109. plotcli-original/man/plotcli_box.Rd +46 -0
  110. plotcli-original/man/plotcli_density.Rd +44 -0
  111. plotcli-original/man/plotcli_histogram.Rd +50 -0
  112. plotcli-original/man/plotcli_line.Rd +48 -0
  113. plotcli-original/man/plotcli_options.Rd +18 -0
  114. plotcli-original/man/plotcli_scatter.Rd +48 -0
  115. plotcli-original/man/plus-.plotcli.Rd +19 -0
  116. plotcli-original/man/rbind.plotcli.Rd +19 -0
  117. plotcli-original/man/rbind_plots.Rd +17 -0
  118. plotcli-original/man/register_geom.Rd +21 -0
  119. plotcli-original/man/remove_color_codes.Rd +21 -0
  120. plotcli-original/man/render_faceted_plot.Rd +25 -0
  121. plotcli-original/man/render_single_panel.Rd +12 -0
  122. plotcli-original/man/safe_aes_name.Rd +18 -0
  123. plotcli-original/tests/testthat/test-new-geoms.R +136 -0
  124. plotcli-original/tests/testthat/test-plotcli.R +69 -0
  125. plotcli-original/tests/testthat.R +4 -0
  126. plotcli-original/vignettes/ggplotcli.Rmd +329 -0
  127. plotcli-original/vignettes/plotcli_class.R +98 -0
  128. plotcli-original/vignettes/plotcli_class.Rmd +121 -0
  129. plotcli-original/vignettes/plotcli_wrappers.R +35 -0
  130. plotcli-original/vignettes/plotcli_wrappers.Rmd +62 -0
  131. plotcli.egg-info/PKG-INFO +11 -0
  132. plotcli.egg-info/SOURCES.txt +7 -0
  133. plotcli.egg-info/dependency_links.txt +1 -0
  134. plotcli.egg-info/entry_points.txt +3 -0
  135. plotcli.egg-info/top_level.txt +1 -0
  136. plotcli.py +978 -0
  137. plotcli_py-0.1.0.dist-info/METADATA +358 -0
  138. plotcli_py-0.1.0.dist-info/RECORD +143 -0
  139. plotcli_py-0.1.0.dist-info/WHEEL +4 -0
  140. plotcli_py-0.1.0.dist-info/entry_points.txt +2 -0
  141. plotcli_py-0.1.0.dist-info/licenses/LICENSE +21 -0
  142. pyproject.toml +31 -0
  143. uv.lock +8 -0
@@ -0,0 +1,17 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/geom_registry.r
3
+ \name{is_geom_registered}
4
+ \alias{is_geom_registered}
5
+ \title{Check if a Geom is Registered}
6
+ \usage{
7
+ is_geom_registered(geom_name)
8
+ }
9
+ \arguments{
10
+ \item{geom_name}{Name of the geom}
11
+ }
12
+ \value{
13
+ Logical
14
+ }
15
+ \description{
16
+ Check if a Geom is Registered
17
+ }
@@ -0,0 +1,14 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/geom_registry.r
3
+ \name{list_registered_geoms}
4
+ \alias{list_registered_geoms}
5
+ \title{List Registered Geoms}
6
+ \usage{
7
+ list_registered_geoms()
8
+ }
9
+ \value{
10
+ Character vector of registered geom names
11
+ }
12
+ \description{
13
+ List Registered Geoms
14
+ }
@@ -0,0 +1,23 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/helper_functions.r
3
+ \name{make_colored}
4
+ \alias{make_colored}
5
+ \title{Make colored text}
6
+ \usage{
7
+ make_colored(x, color = NULL)
8
+ }
9
+ \arguments{
10
+ \item{x}{The text string to be colored.}
11
+
12
+ \item{color}{The color to be applied to the text. If NULL, the color codes will be removed.}
13
+ }
14
+ \value{
15
+ A colored text string or a text string with color codes removed.
16
+ }
17
+ \description{
18
+ This function applies a specified color to a given text string.
19
+ }
20
+ \examples{
21
+ make_colored("Hello, world!", "blue")
22
+ make_colored("Hello, world!", NULL)
23
+ }
@@ -0,0 +1,20 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/helper_functions.r
3
+ \name{make_unique_names}
4
+ \alias{make_unique_names}
5
+ \title{Make unique names}
6
+ \usage{
7
+ make_unique_names(names)
8
+ }
9
+ \arguments{
10
+ \item{names}{A character vector of names.}
11
+ }
12
+ \value{
13
+ A character vector of unique names.
14
+ }
15
+ \description{
16
+ This function takes a vector of names and ensures that each name is unique by appending a number if necessary.
17
+ }
18
+ \examples{
19
+ make_unique_names(c("apple", "apple", "banana", "apple"))
20
+ }
@@ -0,0 +1,27 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/helper_functions.r
3
+ \name{normalize_data}
4
+ \alias{normalize_data}
5
+ \title{Normalize data}
6
+ \usage{
7
+ normalize_data(data, data_min, data_max, plot_range)
8
+ }
9
+ \arguments{
10
+ \item{data}{The data to be normalized.}
11
+
12
+ \item{data_min}{The minimum value of the data.}
13
+
14
+ \item{data_max}{The maximum value of the data.}
15
+
16
+ \item{plot_range}{The range to normalize the data to.}
17
+ }
18
+ \value{
19
+ The normalized data.
20
+ }
21
+ \description{
22
+ This function normalizes the given data to a specified plot range.
23
+ }
24
+ \examples{
25
+ normalize_data(c(1, 2, 3, 4, 5), 1, 5, 10)
26
+ normalize_data(c(10, 20, 30, 40, 50), 10, 50, 100)
27
+ }
@@ -0,0 +1,48 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/plotcli_wrappers.r
3
+ \name{pclib}
4
+ \alias{pclib}
5
+ \title{Short version of plotcli_bar}
6
+ \usage{
7
+ pclib(
8
+ y,
9
+ x = NULL,
10
+ plot_width = getOption("plotcli.plot_width", 80),
11
+ plot_height = getOption("plotcli.plot_height", 40),
12
+ x_label = "x",
13
+ y_label = "y",
14
+ color = NULL,
15
+ braille = getOption("plotcli.braille", TRUE),
16
+ name = "barplot",
17
+ ...
18
+ )
19
+ }
20
+ \arguments{
21
+ \item{y}{A numeric vector of values}
22
+
23
+ \item{x}{A vector of categories}
24
+
25
+ \item{plot_width}{Width of the plot (default: 80)}
26
+
27
+ \item{plot_height}{Height of the plot (default: 40)}
28
+
29
+ \item{x_label}{Label for the x-axis (default: "x")}
30
+
31
+ \item{y_label}{Label for the y-axis (default: "y")}
32
+
33
+ \item{color}{Color of the plot elements (default: NULL)}
34
+
35
+ \item{braille}{Use Braille characters for the plot (default: TRUE)}
36
+
37
+ \item{name}{Name of the plot element (default: "barplot")}
38
+
39
+ \item{...}{Additional arguments passed to the plotcli$new() function}
40
+ }
41
+ \description{
42
+ Short version of plotcli_bar function.
43
+ }
44
+ \examples{
45
+ x <- 1:5
46
+ y <- c(10, 15, 8, 12, 6)
47
+ pclib(x, y)
48
+ }
@@ -0,0 +1,46 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/plotcli_wrappers.r
3
+ \name{pclibx}
4
+ \alias{pclibx}
5
+ \title{Short version of plotcli_box}
6
+ \usage{
7
+ pclibx(
8
+ y,
9
+ plot_width = getOption("plotcli.plot_width", 80),
10
+ plot_height = getOption("plotcli.plot_height", 40),
11
+ x_label = "x",
12
+ y_label = "y",
13
+ color = NULL,
14
+ braille = getOption("plotcli.braille", TRUE),
15
+ name = "boxplot",
16
+ ...
17
+ )
18
+ }
19
+ \arguments{
20
+ \item{y}{A list of numeric vectors of values}
21
+
22
+ \item{plot_width}{Width of the plot (default: 80)}
23
+
24
+ \item{plot_height}{Height of the plot (default: 40)}
25
+
26
+ \item{x_label}{Label for the x-axis (default: "x")}
27
+
28
+ \item{y_label}{Label for the y-axis (default: "y")}
29
+
30
+ \item{color}{Color of the plot elements (default: NULL)}
31
+
32
+ \item{braille}{Use Braille characters for the plot (default: TRUE)}
33
+
34
+ \item{name}{Name of the plot element (default: "boxplot")}
35
+
36
+ \item{...}{Additional arguments passed to the plotcli$new() function}
37
+
38
+ \item{x}{A vector of categories}
39
+ }
40
+ \description{
41
+ Short version of plotcli_box function.
42
+ }
43
+ \examples{
44
+ y <- rnorm(50, mean = 0)
45
+ pclib(y)
46
+ }
@@ -0,0 +1,44 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/plotcli_wrappers.r
3
+ \name{pclid}
4
+ \alias{pclid}
5
+ \title{Short version of plotcli_density}
6
+ \usage{
7
+ pclid(
8
+ x,
9
+ plot_width = getOption("plotcli.plot_width", 80),
10
+ plot_height = getOption("plotcli.plot_height", 40),
11
+ x_label = "x",
12
+ y_label = "Density",
13
+ color = NULL,
14
+ braille = getOption("plotcli.braille", TRUE),
15
+ name = "density",
16
+ ...
17
+ )
18
+ }
19
+ \arguments{
20
+ \item{x}{A numeric vector of values}
21
+
22
+ \item{plot_width}{Width of the plot (default: 80)}
23
+
24
+ \item{plot_height}{Height of the plot (default: 40)}
25
+
26
+ \item{x_label}{Label for the x-axis (default: "x")}
27
+
28
+ \item{y_label}{Label for the y-axis (default: "Density")}
29
+
30
+ \item{color}{Color of the plot elements (default: NULL)}
31
+
32
+ \item{braille}{Use Braille characters for the plot (default: TRUE)}
33
+
34
+ \item{name}{Name of the plot element (default: "density")}
35
+
36
+ \item{...}{Additional arguments passed to the plotcli$new() function}
37
+ }
38
+ \description{
39
+ Short version of plotcli_density function.
40
+ }
41
+ \examples{
42
+ x <- rnorm(100)
43
+ pclid(x)
44
+ }
@@ -0,0 +1,50 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/plotcli_wrappers.r
3
+ \name{pclih}
4
+ \alias{pclih}
5
+ \title{Short version of plotcli_histogram}
6
+ \usage{
7
+ pclih(
8
+ x,
9
+ plot_width = getOption("plotcli.plot_width", 80),
10
+ plot_height = getOption("plotcli.plot_height", 40),
11
+ x_label = "x",
12
+ y_label = "Frequency",
13
+ color = NULL,
14
+ braille = getOption("plotcli.braille", TRUE),
15
+ bin_width = NULL,
16
+ ylim = NULL,
17
+ name = "histogram",
18
+ ...
19
+ )
20
+ }
21
+ \arguments{
22
+ \item{x}{A numeric vector of values}
23
+
24
+ \item{plot_width}{Width of the plot (default: 80)}
25
+
26
+ \item{plot_height}{Height of the plot (default: 40)}
27
+
28
+ \item{x_label}{Label for the x-axis (default: "x")}
29
+
30
+ \item{y_label}{Label for the y-axis (default: "Frequency")}
31
+
32
+ \item{color}{Color of the plot elements (default: NULL)}
33
+
34
+ \item{braille}{Use Braille characters for the plot (default: TRUE)}
35
+
36
+ \item{bin_width}{Width of the bins (default: NULL)}
37
+
38
+ \item{ylim}{y limits (default: NULL)}
39
+
40
+ \item{name}{Name of the plot element (default: "histogram")}
41
+
42
+ \item{...}{Additional arguments passed to the plotcli$new() function}
43
+ }
44
+ \description{
45
+ Short version of plotcli_histogram function.
46
+ }
47
+ \examples{
48
+ x <- rnorm(100)
49
+ pclih(x)
50
+ }
@@ -0,0 +1,48 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/plotcli_wrappers.r
3
+ \name{pclil}
4
+ \alias{pclil}
5
+ \title{Short version of plotcli_line}
6
+ \usage{
7
+ pclil(
8
+ y,
9
+ x = NULL,
10
+ plot_width = getOption("plotcli.plot_width", 80),
11
+ plot_height = getOption("plotcli.plot_height", 40),
12
+ x_label = "x",
13
+ y_label = "y",
14
+ color = NULL,
15
+ braille = getOption("plotcli.braille", TRUE),
16
+ name = "line",
17
+ ...
18
+ )
19
+ }
20
+ \arguments{
21
+ \item{y}{A numeric vector of y values}
22
+
23
+ \item{x}{A numeric vector of x values}
24
+
25
+ \item{plot_width}{Width of the plot (default: 80)}
26
+
27
+ \item{plot_height}{Height of the plot (default: 40)}
28
+
29
+ \item{x_label}{Label for the x-axis (default: "x")}
30
+
31
+ \item{y_label}{Label for the y-axis (default: "y")}
32
+
33
+ \item{color}{Color of the plot elements (default: NULL)}
34
+
35
+ \item{braille}{Use Braille characters for the plot (default: TRUE)}
36
+
37
+ \item{name}{Name of the plot element (default: "line")}
38
+
39
+ \item{...}{Additional arguments passed to the plotcli$new() function}
40
+ }
41
+ \description{
42
+ Short version of plotcli_line function.
43
+ }
44
+ \examples{
45
+ x <- 1:10
46
+ y <- x^2
47
+ pclil(x, y)
48
+ }
@@ -0,0 +1,48 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/plotcli_wrappers.r
3
+ \name{pclis}
4
+ \alias{pclis}
5
+ \title{Short version of plotcli_scatter}
6
+ \usage{
7
+ pclis(
8
+ y,
9
+ x = NULL,
10
+ plot_width = getOption("plotcli.plot_width", 80),
11
+ plot_height = getOption("plotcli.plot_height", 40),
12
+ x_label = "x",
13
+ y_label = "y",
14
+ color = NULL,
15
+ braille = getOption("plotcli.braille", TRUE),
16
+ name = "scatter",
17
+ ...
18
+ )
19
+ }
20
+ \arguments{
21
+ \item{y}{A numeric vector of y values}
22
+
23
+ \item{x}{A numeric vector of x values}
24
+
25
+ \item{plot_width}{Width of the plot (default: 80)}
26
+
27
+ \item{plot_height}{Height of the plot (default: 40)}
28
+
29
+ \item{x_label}{Label for the x-axis (default: "x")}
30
+
31
+ \item{y_label}{Label for the y-axis (default: "y")}
32
+
33
+ \item{color}{Color of the plot elements (default: NULL)}
34
+
35
+ \item{braille}{Use Braille characters for the plot (default: TRUE)}
36
+
37
+ \item{name}{Name of the plot element (default: "scatter")}
38
+
39
+ \item{...}{Additional arguments passed to the plotcli$new() function}
40
+ }
41
+ \description{
42
+ Short version of plotcli_scatter function.
43
+ }
44
+ \examples{
45
+ x <- rnorm(100)
46
+ y <- rnorm(100)
47
+ pclis(x, y)
48
+ }
@@ -0,0 +1,23 @@
1
+ % Generated by roxygen2: do not edit by hand
2
+ % Please edit documentation in R/helper_functions.r
3
+ \name{pixel_to_braille}
4
+ \alias{pixel_to_braille}
5
+ \title{Convert pixel coordinates to Braille cell and dot position}
6
+ \usage{
7
+ pixel_to_braille(px, py, canvas_rows, canvas_cols)
8
+ }
9
+ \arguments{
10
+ \item{px}{Pixel x coordinate (1-based)}
11
+
12
+ \item{py}{Pixel y coordinate (1-based, from top)}
13
+
14
+ \item{canvas_rows}{Number of character rows in canvas}
15
+
16
+ \item{canvas_cols}{Number of character columns in canvas}
17
+ }
18
+ \value{
19
+ List with cell_row, cell_col, dot_row, dot_col
20
+ }
21
+ \description{
22
+ Convert pixel coordinates to Braille cell and dot position
23
+ }