https://github.com/queryverse/datavoyager.jl
Julia wrapper for the Voyager data exploration tool
https://github.com/queryverse/datavoyager.jl
julia queryverse voyage
Last synced: 4 months ago
JSON representation
Julia wrapper for the Voyager data exploration tool
- Host: GitHub
- URL: https://github.com/queryverse/datavoyager.jl
- Owner: queryverse
- License: other
- Created: 2017-12-31T06:19:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-29T03:33:32.000Z (over 1 year ago)
- Last Synced: 2024-06-11T20:23:28.317Z (11 months ago)
- Topics: julia, queryverse, voyage
- Language: JavaScript
- Size: 2.95 MB
- Stars: 127
- Watchers: 6
- Forks: 11
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE.md
Awesome Lists containing this project
README
# DataVoyager
[](http://www.repostatus.org/#active)
[](https://travis-ci.org/queryverse/DataVoyager.jl)
[](https://ci.appveyor.com/project/queryverse/datavoyager-jl/branch/master)
[](http://codecov.io/github/queryverse/DataVoyager.jl?branch=master)## Overview
This package provides julia integration for the [Voyager](https://github.com/vega/voyager) data exploration tool.
## Getting Started
DataVoyager.jl can be used for data exploration. It can help you visualize and understand any data that is in a tabular format.
You can install the package at the Pkg REPL-mode with:
````julia
(v1.0) pkg> add DataVoyager
````## Exploring data
You create a new voyager window by calling ``Voyager``:
````julia
using DataVoyagerv = Voyager()
````By itself this is not very useful, the next step is to load some data into voyager. Lets assume your data is in a ``DataFrame``:
````julia
using DataFrames, DataVoyagerdata = DataFrame(a=rand(100), b=randn(100))
v = Voyager(data)
````You can also use the pipe to load data into voyager:
````julia
using DataFrames, DataVoyagerdata = DataFrame(a=rand(100), b=randn(100))
v = data |> Voyager()
````With a more interesting data source
```julia
using VegaDatasets, DataVoyagerv = dataset("cars") |> Voyager()
```You can load any [IterableTables.jl](https://github.com/queryverse/IterableTables.jl) source into voyager, i.e. not just ``DataFrame``s. For example, you can load some data from a CSV file with [CSVFiles.jl](https://github.com/queryverse/CSVFiles.jl), filter them with [Query.jl](https://github.com/queryverse/Query.jl) and then visualize the result with voyager:
````julia
using FileIO, CSVFiles, Query, DataVoyagerv = load("data.csv") |> @filter(_.age>30) |> Voyager()
````
In this example the data is streamed directly into voyager and at no point is any ``DataFrame`` allocated.## Extracting plots
You can also access a plot that you have created in the voyager UI from julia, for example to save the plot to disc.
You can access the currently active plot in a given voyager window ``v`` with the brackets syntax:
````julia
using VegaDatasets, DataVoyager, VegaLitev = dataset("cars") |> Voyager()
plot1 = v[]
````At this point ``plot1`` will hold a standard [VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl) plot object. You can use the normal [VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl) functions to display such a plot, or save it to disc:
````julia
display(plot1)plot1 |> save("figure1.pdf")
````A useful pattern here is to save the plot as a vega-lite JSON file to disc, without the data:
````julia
using VegaDatasets, DataVoyager, VegaLitev = dataset("cars") |> Voyager()
# Now create the plot in the UI
v[] |> save("figure1.vegalite")
````At a later point you can then load this figure specification again, but pipe new data into it:
````julia
using VegaLite, VegaDatasetsdataset("cars") |> load("figure1.vegalite")
````