Extending DataViewer to support more data formats

DataViewer.recurse_intoFunction
recurse_into(x) -> Bool

Tells whether x is some form of "container" that can be recursed into, or a "leaf" data.

source
DataViewer.filetypeFunction
filetype(fname::String)

Get the file type associated to a file named fname, according to its extension.

source
filetype(v::Val)

Get the file type associated to the name extension given by v = Val(Symbol(extension)).

Example

julia> filetype(Val(Symbol(".jld2")))
JLD2File
source
DataViewer.open_datafileFunction
open_datafile(fun, fname, ftype)

Load the data contained in fname, which should be stored using the format described by ftype. Apply fun on the loaded data. This function guarantees that the file stays open as long as needed, but is closed before the function returns.

Example

julia> ftype = filetype(Val(Symbol(".jld2")))
JLD2File

julia> open_datafile("sample.jld2", ftype) do data
           println(typeof(data))
       end
Dict
source
DataViewer.graphic_reprFunction
(options, repr) = graphic_repr(x)

If x supports one or more graphical representation(s), options is a non-empty Vector{RepresentationOption}. In that case, calling repr(options[i].param) should produce the graphical representation corresponding to the i-th entry in the list.

source
DataViewer.get_dataFunction
get_data(container, path)

Get the piece of data stored in container under path.

get_data(container, (a, b, b))

should be more or less equivalent to

container[a][b][c]
source
DataViewer.pretty_reprFunction
pretty_repr(x) -> String

Return a pretty textual representation of x. By default it is based on show, but can be customized as needed.

source