Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
/ VegaHub Public archive

A SignalR Hub Utility for data scientists to push Vega charts from F# Interactive

License

Notifications You must be signed in to change notification settings

panesofglass/VegaHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3c61fe5 · Jul 10, 2014

History

66 Commits
Jan 18, 2014
Jan 27, 2014
Jan 27, 2014
May 25, 2014
May 25, 2014
May 25, 2014
Jan 18, 2014
May 25, 2014
Aug 9, 2013
Feb 13, 2014
Jan 27, 2014
Jan 19, 2014
Jul 10, 2014
May 25, 2014
May 25, 2014

Repository files navigation

VegaHub

A SignalR Hub Utility for data scientists to push Vega charts from F# Interactive

Current Status

Build Status

Proof-of-Concept

Available charts

  • bar
  • colorBar
  • force
  • scatterplot

Building

Run build.bat to download NuGet.exe and build the solution. You can find samples in the samples folder.

#r "..\build\VegaHub.dll"

open System
open VegaHub
open VegaHub.Grammar
open VegaHub.Basics

let disposable = Vega.connect "http://localhost:8081" __SOURCE_DIRECTORY__

// Simulate real-time updates
let rand = Random(42)

let rec loop data iter = async {
    let data' = List.append data [ (data.Length, rand.Next(0, 100)) ]
    // Warning: mutation!   
    Basics.bar data' ((fun x -> fst x |> string), (fun x -> snd x |> float)) |> Vega.send
    do! Async.Sleep 100
    if iter = 0 then () else
    return! loop data' <| iter - 1
}

loop [] 25 |> Async.RunSynchronously

disposable.Dispose()