{"id":15031283,"url":"https://github.com/cuprous-au/vega-view","last_synced_at":"2026-03-10T11:34:18.511Z","repository":{"id":253044260,"uuid":"822169842","full_name":"cuprous-au/vega-view","owner":"cuprous-au","description":"Display nushell tables using Vega Lite in a webview.","archived":false,"fork":false,"pushed_at":"2024-09-06T00:37:44.000Z","size":881,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-07T13:47:49.844Z","etag":null,"topics":["nushell","plotting","rust","rustlang","vega","webview"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuprous-au.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-30T13:26:40.000Z","updated_at":"2025-08-07T10:32:31.000Z","dependencies_parsed_at":"2025-04-09T20:41:45.393Z","dependency_job_id":"df3a932e-5fa6-46a9-8114-5e52c43c8963","html_url":"https://github.com/cuprous-au/vega-view","commit_stats":null,"previous_names":["cuprous-au/vega-view"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cuprous-au/vega-view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuprous-au%2Fvega-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuprous-au%2Fvega-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuprous-au%2Fvega-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuprous-au%2Fvega-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuprous-au","download_url":"https://codeload.github.com/cuprous-au/vega-view/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuprous-au%2Fvega-view/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30332375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nushell","plotting","rust","rustlang","vega","webview"],"created_at":"2024-09-24T20:15:21.757Z","updated_at":"2026-03-10T11:34:13.496Z","avatar_url":"https://github.com/cuprous-au.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vega view\n\nDisplay [nushell](https://www.nushell.sh) tables using [Vega Lite](https://vega.github.io/vega-lite/) in a webview. Not to be confused with the [Vega View API](https://vega.github.io/vega/docs/api/view/). \n\n## Build\n\nThis is a rust project so [rust up](https://rustup.rs)! The supporting scripts require nushell, [install here](https://www.nushell.sh/#get-nu). Next, download the Vega prerequisites:\n\n```\nnu download-vega.nu\n```\n\nThe executable, `vega-view`, can now be built:\n\n```\ncargo build --release\n```\n\nTo run `vega-view` a webview component must be present.  You probably already have one as part of your platform but check the [platform specific notes for the wry project](https://github.com/tauri-apps/wry?tab=readme-ov-file#platform-specific-notes).  (This project uses wry.) \n\n## Usage\n\nFirst run `nu` then: \n\n```nushell\nuse vega.nu                   # load the vega nushell module.                    \nvega view \u003cspec\u003e              # visualize the input with a vega-lite specification\nvega bar \u003cvalue\u003e              # a specification for a bar graph\nvega series \u003cvalue\u003e \u003ctime\u003e    # a specification for a time series plot\nvega scatter \u003cvalue\u003e \u003cdomain\u003e # a specification for a scatter plot\nvega flip                     # exchange the x and y axes of a specification\n```\n\nFor example, the following nushell script will visualize the `b` column of the table in `example.json`:\n\n```nushell\nuse vega.nu\nlet spec = vega bar b\nlet data = open example.json\n$data | vega view $spec\n```\n\nThis produces a single bar with height representing the sum of the `b` column in the data.  A more interesting bar graph would divide the data up into categories. Identifying the category fields and putting it as a one-liner:\n\n```nushell\nopen example.json | vega view (vega bar b --category=t --subcategory=a)\n```\n\nWith nushell's excellent data handling abilities you can equally easily visualize CSV, SQLite, JSON and other data sources.  You can write your own specification or use one of the built in ones below.  \n\n## Bar Graph\n\nA vega-lite specification for a bar graph.\n\n![Bar Graph](screenshots/bar-example.png)\n\nUsage:\n```\n  \u003e bar {flags} \u003cvalue\u003e \n```\nFlags:\n```\n  --category \u003cString\u003e - field to discriminate different bars\n  --subcategory \u003cString\u003e - field to discriminate stacked bar sections\n  --aggregate \u003cString\u003e - how to combine values for a bar or bar section (default: 'sum')\n```\nParameters:\n```\n  value \u003cstring\u003e: field name for the bar height\n```\n\nExample:\n\n```nushell\nopen example.json | vega view --title \"Stacked Bar Example\" (vega bar b --category=t --subcategory=a)\n```\n\n## Time Series Plot\n\nA vega-lite specification for a time series plot.\n\n![Series Plot](screenshots/series-example.png)\n\nUsage:\n```\n  \u003e series {flags} \u003cvalue\u003e \u003ctime\u003e \n```\n\nFlags:\n```\n  --category \u003cString\u003e - field to discriminate different series\n  --area - render as a stacked area plot\n```\n\nParameters:\n```\n  value \u003cstring\u003e: field name for the series values\n  time \u003cstring\u003e: field for time values\n```\n\nExample:\n```nushell\nopen example.json | vega view --title \"Time Series Example\" (vega series b t --category a)\n```\n\n## Scatter Plot\n\nA vega-lite specification for a scatter plot.\n\n![Scatter Plot](screenshots/scatter-example.png)\n\nUsage:\n```\n  \u003e scatter {flags} \u003cvalue\u003e \u003cdomain\u003e \n```\n\nFlags:\n```\n  --category \u003cString\u003e - field for the category of the point in the plot\n```\n\nParameters:\n```\n  value \u003cstring\u003e: field name for the y coodinate of a point in the  plot\n  domain \u003cstring\u003e: field for the x coodinate of a point in the plot\n```\n\nExample:\n\n```nushell\nopen example.json | vega view --title \"Scatter Plot Example\" (vega scatter b t --category a)\n```\n\n## Writing a Specification\n\nThe [vega-lite gallery](https://vega.github.io/vega-lite/examples/)  is a good place to start when developing a visualization.  You can adapt one of these specifications by changing the field names to match your data.  You can omit the `data` section of the specification.\n\n## View Options\n\nThe `vega view` nushell command takes several options controlling how it displaya a Vega visualization of the input data in a window. (We have seen the `--title` option in the examples above.)\n\nUsage:\n```\n  \u003e view {flags} \u003cspec\u003e \n```\n\nFlags:\n```\n  --title \u003cString\u003e - title for the window (default: 'Vega View')\n  --width \u003cNumber\u003e - width of the window (default: 1000)\n  --height \u003cNumber\u003e - height of the window (default: 800)\n  -h, --help - Display the help message for this command\n```\n\nParameters:\n```  \nspec \u003crecord\u003e: a vega-lite specification\n```\n\n## The `vega-view`  Executable\n\nThe `vega-view` executable creates and controls the webview.   The `vega view` nushell command wraps the executable and takes care of conversions from nushell tables.  The wrapper locates the executable via the environment variable `$env.vega_view_bin`.  \n\nIt is possible to use `vega-view` directly without the nushell scripting.  By default JSON data is supplied on the standard input and a JSON vega-lite specification is given as an argument. Ensure that the data url in the specification is `/data`.  ie:\n\n\n```\n{\n  ...\n  data: { url: '/data' }, \n  ...  \n}\n```\n\nThe full command is:\n\n```\nUsage: vega-view [OPTIONS] \u003cSPEC\u003e\n\nArguments:\n  \u003cSPEC\u003e  vega-lite specification for this visualization\n\nOptions:\n      --page \u003cPAGE\u003e      file containing a HTML template for the page\n      --script \u003cSCRIPT\u003e  file containing javascript used in the page\n      --data \u003cDATA\u003e      file containing data to visualize (default is stdin)\n      --title \u003cTITLE\u003e    The window title\n      --width \u003cWIDTH\u003e    The window width\n      --height \u003cHEIGHT\u003e  The window height\n  -h, --help             Print help\n  ```\n\n  # LICENSE\n\n Material derived from the Vega project including vega-all.js is Copyright (c) 2024, University of Washington Interactive Data Lab.  See VEGA-LICENSE.\n\n All other material is Copyright (c) 2024 Cuprous Pty Ltd Australia.  See LICENSE.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuprous-au%2Fvega-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuprous-au%2Fvega-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuprous-au%2Fvega-view/lists"}