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

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()

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •