visualizer-cli

Crates.iovisualizer-cli
lib.rsvisualizer-cli
version0.1.3
sourcesrc
created_at2021-03-26 18:56:08.901096
updated_at2021-03-26 23:30:00.467485
descriptionShows a visualization of supported values in a new window.
homepage
repositoryhttps://github.com/hediet/rust-visualizer/
max_upload_size
id373933
size4,302,787
Henning Dieterichs (hediet)

documentation

README

Visualizer CLI

A tool to visualize data. See this playground for which data can be visualized.

Based on @hediet/visualization which also powers the Debug Visualizer extension for VS Code.

Best for debugging algorithms. Not suited to visualize large datasets. Requires WebView 2 on Windows.

Installation

cargo install visualizer-cli

Example: Visualize A Directed Graph

cat data.json | visualize

With data.json:

{
    "$schema": "https://hediet.github.io/visualization/docs/visualization-data-schema.json",
    "kind": { "graph": true },
    "nodes": [
        { "id": "1", "label": "1" },
        { "id": "2", "label": "2", "color": "orange" },
        { "id": "3", "label": "3" }
    ],
    "edges": [
        { "from": "1", "to": "2", "color": "red" },
        { "from": "1", "to": "3" }
    ]
}

Screenshot

Example: Visualize A 3D Plot

cat data.json | visualize

With data.json:

{
    "$schema": "https://hediet.github.io/visualization/docs/visualization-data-schema.json",
    "kind": {
        "plotly": true
    },
    "data": [
        {
            "type": "mesh3d",
            "x": [ 0, 0, 0, ... ],
            "y": [ 0, 1, 2, ... ],
            "z": [ 0, 0.84, 0.9, ... ]
        }
    ]
}

Screenshot

API / Rust Usage

See the visualizer crate.

Architecture

This CLI uses Tauri/WRY to host a webview which loads @hediet/visualization.

Commit count: 11

cargo fmt