Tell us what works and what could be better. We read every submission.
@ant1j·5 public vizzes
This example demonstrates a text-to-NATO-alphabet converter. It takes user input—either from command-line arguments or an interactive prompt—and maps each alphanumeric character to its corresponding NATO phonetic word, separating them with hyphens. The output displays the fully spelled phonetic sequence, including a special `[SPACE]` token for spaces and bracketed fallbacks for unsupported symbols. The implementation uses a Python dictionary for the phonetic mapping and the `sys.argv` list for command-line input handling.
This example shows how to add a quantile-based categorical column to a data.table in R. The code uses the `data.table` package’s `setDT` and `:=` syntax to create a new `quartile` column by applying `cut` to the `value` column, with breaks defined by `quantile` at 0%, 25%, 50%, 75%, and 100% probabilities. The `right = FALSE` argument assigns values to intervals closed on the left, and labels `1:4` mark the four quartile groups. The result is a modified data.table where each row is assigned a quartile number based on its value’s position in the distribution.
This example displays every ColorBrewer color scale as a clickable palette, with each scale reduced to its highest-class swatches. Clicking a palette prints that scale’s hexadecimal colors to the browser console. The page loads the colorbrewer.v1.min.js dataset and renders the palettes using D3 v3’s data join, appending span elements with inline background-color styles. It relies on d3.entries, d3.keys, and d3.descending to parse and sort the color values.
This example shows how GNU Parallel distributes the processing of a large text file across multiple CPU cores. The visualization maps the input stream through a pipeline, highlighting the chunks that match the pattern “foo” as they are filtered by the `grep` command. The code uses the `parallel` command with `--pipe --block 2M` to split the data into 2-megabyte blocks, which are then processed concurrently. The rendering displays the block boundaries and matches in real time, using a simple custom canvas-based layout to depict the file’s contents and the parallel task execution.
This example uses an awk script to count distinct values in every column of a CSV file, writing each column’s unique entries and their occurrence counts to a separate output CSV named after the original file and column header. The script first extracts the header row to create per-column output files, then iterates over all subsequent rows, tallying values in a two-dimensional associative array keyed by field name and value. In the END block, it splits those keys to write the final counts. The awk code relies on built-in features like the `FS` field separator, the `split` function, and the `SUBSEP` separator for array keys.