Bar Chart baseline. (#2621)

Bar Chart ready.
This commit is contained in:
Andrés N. Robalino
2020-09-30 13:27:52 -05:00
committed by GitHub
parent 892a416211
commit a56abb6502
16 changed files with 803 additions and 136 deletions

View File

@ -54,7 +54,7 @@ fn summarizes_by_values() {
| get rusty_at
| histogram
| where value == "Estados Unidos"
| get occurrences
| get count
| echo $it
"#
));
@ -93,20 +93,19 @@ fn help() {
}
#[test]
fn occurrences() {
fn count() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo "[{"bit":1},{"bit":0},{"bit":0},{"bit":0},{"bit":0},{"bit":0},{"bit":0},{"bit":1}]"
| from json
echo [[bit]; [1] [0] [0] [0] [0] [0] [0] [1]]
| histogram bit
| sort-by occurrences
| sort-by count
| reject frequency
| to json
"#
));
let bit_json = r#"[{"bit":"1","occurrences":2,"percentage":"33.33%"},{"bit":"0","occurrences":6,"percentage":"100.00%"}]"#;
let bit_json = r#"[{"bit":"1","count":2,"percentage":"33.33%"},{"bit":"0","count":6,"percentage":"100.00%"}]"#;
assert_eq!(actual.out, bit_json);
}