Skip to content

Instantly share code, notes, and snippets.

let options =
Options(
sankey =
Sankey (
node =
Node(
label = Label(fontSize = 50)
)
)
)
#nowarn "211"
#I "."
#I "../Deedle/lib/net40"
#I "../Deedle.1.0.7/lib/net40"
#I "../Deedle.RPlugin/lib/net40"
#I "../Deedle.RPlugin.1.0.7/lib/net40"
#I "../FSharp.Charting/lib/net40"
#I "../FSharp.Charting.0.90.10/lib/net40"
#I "../FSharp.Data/lib/net40"
#I "../FSharp.Data.2.2.0/lib/net40"
@TahaHachana
TahaHachana / ThrottlingAgent.fs
Last active August 26, 2020 05:00
An F# agent for throttling the number of concurrently executing asynchronous workflows. The default limit is 5 concurrent tasks. The agent also supports pausing and resuming work.
open System
open System.Collections.Concurrent
// Messages received by the throttling agent
type Message =
| Work
| Start of AsyncReplyChannel<unit>
| Pause
| Resume
| Quit
#load """..\packages\XPlot.GoogleCharts.1.1.6\XPlot.GoogleCharts.fsx"""
#load """..\packages\Deedle.1.0.6\Deedle.fsx"""
#r """..\packages\XPlot.GoogleCharts.Deedle.0.6.1\Lib\Net45\XPlot.GoogleCharts.Deedle.dll"""
open Deedle
open XPlot.GoogleCharts
open XPlot.GoogleCharts.Deedle
let msftCsv = Frame.ReadCsv(__SOURCE_DIRECTORY__ + "/MSFT.csv")
let fbCsv = Frame.ReadCsv(__SOURCE_DIRECTORY__ + "/FB.csv")
#r "PresentationCore.dll"
#r "PresentationFramework.dll"
#r "System.Xaml.dll"
#r "WindowsBase.dll"
#load "../packages/XPlot.GoogleCharts.1.0.1/XPlot.GoogleCharts.fsx"
open System.Windows
open System.Windows.Controls
open XPlot.GoogleCharts
#load "../packages/XPlot.GoogleCharts.1.0.1/XPlot.GoogleCharts.fsx"
open XPlot.GoogleCharts
let data =
[
"Global", "", 0, 0
"America", "Global", 0, 0
"Europe", "Global", 0, 0
"Asia", "Global", 0, 0
#load "../packages/XPlot.GoogleCharts.1.0.1/XPlot.GoogleCharts.fsx"
open XPlot.GoogleCharts
let salary =
[
"Mike", 10000
"Jim", 8000
"Alice", 12500
"Bob", 7000
#load "../packages/XPlot.GoogleCharts.1.0.1/XPlot.GoogleCharts.fsx"
open System
open XPlot.GoogleCharts
let timeline =
[
"Washington", DateTime(1789, 4, 29), DateTime(1797, 3, 3)
"Adams", DateTime(1797, 3, 3), DateTime(1801, 3, 3)
"Jefferson", DateTime(1801, 3, 3), DateTime(1809, 3, 3)
#load "../packages/XPlot.GoogleCharts.1.0.1/XPlot.GoogleCharts.fsx"
open XPlot.GoogleCharts
let options =
Options(
title = "The decline of 'The 39 Steps'",
vAxis = Axis(title = "Accumulated Rating"),
isStacked = true
)
#load "../packages/XPlot.GoogleCharts.1.0.1/XPlot.GoogleCharts.fsx"
open XPlot.GoogleCharts
let options =
Options(
title = "Age vs. Weight comparison",
hAxis = Axis(title = "Age", minValue = 0, maxValue = 15),
vAxis = Axis(title = "Weight", minValue = 0, maxValue = 15)
)