2

Context

If I enter the following:

#r "nuget:Deedle"
#r "nuget:FSharp.Charting"

open System
open Deedle
open FSharp.Charting

let dates = [ 
    DateTime(2013, 1, 1);
    DateTime(2013, 1, 4);
    DateTime(2013, 1, 8); ]

let values = [ 10.0; 20.0; 30.0 ]

let first = Series(dates, values)

which are the first few steps from the following:

https://fslab.org/Deedle/tutorial.html

into an F# dotnet interactive notebook, first doesn't appear to render anything:

enter image description here

Question

What's a good way to get Deedle values to render nicely in dotnet interactive?

dharmatech
  • 8,979
  • 8
  • 42
  • 88

2 Answers2

2

I get decent looking output if I set the format to plain text:

let first = Series(dates, values)

Formatter.SetPreferredMimeTypesFor(typeof<obj>, "text/plain")
Formatter.Register(fun (x:obj) (writer: TextWriter) -> fprintfn writer "%120A" x )

first

Output is:

series [ 1/1/2013 12:00:00 AM => 10; 1/4/2013 12:00:00 AM => 20; 1/8/2013 12:00:00 AM => 30]

You can try it out here.

Brian Berns
  • 15,499
  • 2
  • 30
  • 40
1

See the following project:

https://github.com/WalternativE/Deedle.DotNet.Interactive.Extension

Note that it currently appears to require the insiders version of the vscode .NET Interactive plugin.

dharmatech
  • 8,979
  • 8
  • 42
  • 88