Moved function for obtaining all extension IDs from the data base into the SqlConnector.
This commit is contained in:
parent
658364fc54
commit
14cf5c4ad6
|
@ -63,4 +63,13 @@ module SqlConnector =
|
|||
} |> Seq.filter (fun (date, download) -> date.IsSome && download.IsSome)
|
||||
|> Seq.map (fun (date, download) -> (System.DateTime.Parse(date.Value),
|
||||
download.Value))
|
||||
|> Seq.toArray
|
||||
|> Seq.toArray
|
||||
|
||||
let getAllExtIds (ctx:ExtensionDbType) =
|
||||
query {
|
||||
for ext in ctx.Main.Extension do
|
||||
select ext.Extid
|
||||
} |> Seq.distinct
|
||||
|> Seq.choose id
|
||||
|> Seq.toList
|
||||
|
|
@ -20,6 +20,10 @@
|
|||
|
||||
#I "../../packages/FSharp.Data/lib/net40"
|
||||
#r "FSharp.Data.dll"
|
||||
|
||||
#load "../../packages/FsLab/Themes/DefaultWhite.fsx"
|
||||
#load "../../packages/FsLab/FsLab.fsx"
|
||||
|
||||
open Deedle
|
||||
open FSharp.Data
|
||||
open XPlot.GoogleCharts
|
||||
|
@ -29,28 +33,15 @@ open XPlot.GoogleCharts.Deedle
|
|||
#r "LogicalHacking.ExtensionDsLab.dll"
|
||||
open LogicalHacking.ExtensionDsLab.Archive.SqlConnector
|
||||
|
||||
#load "../../packages/FsLab/Themes/DefaultWhite.fsx"
|
||||
#load "../../packages/FsLab/FsLab.fsx"
|
||||
|
||||
let ctx = getCtx None Auto
|
||||
let chartDownloads extIds = (List.map (fun e -> (series (getDownloads ctx e))) extIds)
|
||||
|> Chart.Line
|
||||
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|
||||
|> Chart.WithLabels extIds
|
||||
|
||||
let exts =
|
||||
ctx.Main.Extension
|
||||
|> Seq.map(fun c -> c.Extid)
|
||||
|> Seq.distinct
|
||||
|> Seq.toList
|
||||
|
||||
let ExtIds = ["aaagbdompnfgjaokopkpaceijcapjdde"
|
||||
"aaahoedfmconkhncmkajlkallgnkjibh"
|
||||
"aaahpjmadckbgmdbflcgblcnimbpfefg"
|
||||
"aaaidlpoefeeklbhpndokmfipimojimj"
|
||||
"aaaikdbhdiebhdogngakgnmjgpkpcmln"
|
||||
]
|
||||
|
||||
let x = (List.map (fun e -> (series (getDownloads ctx e))) ExtIds)
|
||||
|> Chart.Line
|
||||
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|
||||
|> Chart.WithLabels ExtIds
|
||||
chartDownloads (List.take 5 (getAllExtIds ctx))
|
||||
|
||||
let extData =
|
||||
query {for x in ctx.Main.Extension do
|
||||
|
|
Loading…
Reference in New Issue