Skip to content

Commit

Permalink
prepare for 0.0.22 release (#103)
Browse files Browse the repository at this point in the history
* prepare for 0.0.22 release

* Update README.md
  • Loading branch information
alexhallam authored Oct 18, 2021
1 parent f5ee2c1 commit dacd4d1
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 9 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
0.0.22 (2021-10-18)
==================

Thanks to @Lireer and @rlewicki for the fantastic contributions in this release 🎉

* **Feature 1** Color negative numbers [PR #98](https://github.com/alexhallam/tv/pull/98)
* **Feature 2** Parse `\t` as tab delimiter [PR #99](https://github.com/alexhallam/tv/pull/99)
* **Feature 3** Check file extensions to choose a delimiter [PR #100](https://github.com/alexhallam/tv/pull/100)
* **Feature 4** Use atty to omit text coloring and decorations [PR #95](https://github.com/alexhallam/tv/pull/95).

Along with these new features came additional tests.

Since [PR #98](https://github.com/alexhallam/tv/pull/98) was a aesthetic change it was also added as an additional parameter to be tweaked with a config file.

0.0.21 (2021-10-09)
==================

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Unlicense/MIT"
name = "tidy-viewer"
readme = "README.md"
repository = "https://github.com/alexhallam/tv"
version = "0.0.21"
version = "0.0.22"

[package.metadata.deb]
assets = [
Expand Down
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ tv titanic.csv

> The first three digits represent > 99.9% the value of a number. -- GNU-R Pillar
Choosing the sigfigs amounts to how much of the value of a number is desired. The table below shows an example calculation with variable sigfigs.

| sigfigs | value | sigfiged_value | %value_of_the_number_explained_by_sigfiged_vale |
|---------|--------|----------------|:-----------------------------------------------:|
| 1 | 0.1119 | 0.1 | >89% |
| 2 | 0.1119 | 0.11 | >98% |
| 3 | 0.1119 | 0.111 | >99% |

`tv` uses the same significant figure (sigfig) rules that the R package `pillar` uses.

The purpose of the sigfig rules in `tv` is to guide the eye to the most important information in a number. This section defines terms and the decision tree used in the calculation of the final value displayed.
Expand Down Expand Up @@ -287,13 +295,13 @@ For information on dotfile configuration see `tv --help`. This allows users to s
`tv --help`

```txt
tv 0.0.20
tv 0.0.22
Tidy Viewer (tv) is a csv pretty printer that uses column styling to maximize viewer enjoyment.✨✨📺✨✨
Example Usage:
wget https://raw.githubusercontent.com/tidyverse/ggplot2/master/data-raw/diamonds.csv
tv diamonds.csv
cat diamonds.csv | head -n 35 | tv
Configuration File Support:
An example config is printed to make it easy to copy/paste to `tv.toml`.
The config (tv.toml) location is dependent on OS:
Expand All @@ -319,13 +327,15 @@ Tidy Viewer (tv) is a csv pretty printer that uses column styling to maximize vi
#meta_color = [64, 179, 162]
## header_color = [R,G,B] color for column headers
#header_color = [232, 168, 124]
## std_color = [R,G,B] color for standard cell data values
## std_color = [R,G,B] color for standard cell data values
#std_color = [133, 205, 202]
## na_color = [R,G,B] color for NA values
#na_color = [226, 125, 95]
## neg_num_color = [R,G,B] color for negative values
#neg_num_color = [226, 125, 95]
USAGE:
tidy-viewer [FLAGS] [OPTIONS] [FILE]
tv [FLAGS] [OPTIONS] [FILE]
FLAGS:
-d, --debug-mode Print object details to make it easier for the maintainer to find and resolve bugs.
Expand All @@ -343,7 +353,7 @@ OPTIONS:
An input of (5)uncolor will remove color properties. Note that colors will make it difficult to pipe output
to other utilities.The default value of (0) is reserved to make config/option coloring logic easier.
[default: 0]
-s, --delimiter <delimiter> The delimiter separating the columns. [default: ,]
-s, --delimiter <delimiter> The delimiter separating the columns.
-f, --footer <footer> Add a footer to your tv. Example 'footer info' [default: NA]
-l, --lower-column-width <lower-column-width>
The lower (minimum) width of columns. Must be 2 or larger. [default: 2]
Expand All @@ -354,7 +364,6 @@ OPTIONS:
ARGS:
<FILE> File to process
```
# Inspiration

Expand Down
Binary file added img/config_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/long_double.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/na_comprehension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/pigeon-racing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/sigs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/starwars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ use toml;
#std_color = [133, 205, 202]
## na_color = [R,G,B] color for NA values
#na_color = [226, 125, 95]
## neg_num_color = [R,G,B] color for negative values
#neg_num_color = [226, 125, 95]
"
)]
struct Cli {
Expand Down Expand Up @@ -138,6 +140,7 @@ fn main() {
header_color: toml::value::Array,
std_color: toml::value::Array,
na_color: toml::value::Array,
neg_num_color: toml::value::Array,
}

let base_dir = BaseDirs::new();
Expand Down Expand Up @@ -296,6 +299,12 @@ fn main() {
(None, false) => nord_na_color,
(None, true) => na_color,
};
let neg_num_color = match (&config, is_color_defined) {
(Some(x), false) => get_color_from_config(&x.clone().neg_num_color),
(Some(_x), true) => neg_num_color,
(None, false) => nord_neg_num_color,
(None, true) => neg_num_color,
};

// colname reader
let reader_result = build_reader(&opt);
Expand Down

0 comments on commit dacd4d1

Please sign in to comment.