Skip to content
magic visualization
Branch: master
Clone or download
Soren Macbeth
Soren Macbeth 1.0.1 release
- bump vega to 3.0.7
Latest commit 4623ca1 Nov 2, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dev update deps and project Mar 25, 2017
doc prep 1.0.0 release Nov 1, 2017
resources/public vg 3 and vl2 betas Jul 14, 2017
src new vegaEmbed Nov 1, 2017
.gitignore update ignores Apr 8, 2016
README.md 1.0.1 release Nov 2, 2017
project.clj 1.0.1 release Nov 2, 2017

README.md

vizard

Magic Visualization

Overview

vizard is a tiny client/server library meant to enable REPL-based data visualization in the browser.

Usage

Add vizard to your leiningen project dependencies

[yieldbot/vizard "1.0.1"]

In a repl:

    (require '[vizard [core :refer :all] [lite :as lite]])

    (start-plot-server!)

    (defn group-data [& names]
        (apply concat (for [n names]
        (map-indexed (fn [i x] {:x i :y x :col n}) (take 20 (repeatedly #(rand-int 100)))))))

Now send some plots off. Here is a stacked bar plot:

  (def stacked-bar (p! (lite/lite {:mark "bar"
                                   :encoding {:x {:field "x"
                                                  :type "ordinal"}
                                              :y {:aggregate "sum"
                                                  :field "y"
                                                  :type "quantitative"}
                                              :color {:field "col"
                                                      :type "nominal"}}}
                                  (group-data "foo" "bar" "baz" "buh" "bunk" "dunk"))))

Which should look something like this in when rendered in the browser:

bar

Here's a multiple series line plot:

  (def multi-line (p! (lite/lite {:mark "line"
                                  :encoding {:x {:field "x"
                                                 :type "ordinal"}
                                             :y {:field "y"
                                                 :type "quantitative"}
                                             :color {:field "col"
                                                     :type "nominal"}}}
                                 (group-data "foo" "bar" "baz" "buh" "bunk" "dunk"))))

Which should look about like this:

line

Local Development

First, start up figwheel

  (do-it-fools!)

License

Copyright © 2017 Yieldbot, Inc.

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

You can’t perform that action at this time.