How to use TableView in a browser?

The documentation of TableView shows how to show a (large) table in a Blink window:

julia> using TableView, Blink, DataFrames
julia> w = Blink.Window()
julia> body!(w, showtable(DataFrame(rand(100,100), :auto)))

This is nice, but I’ll like to show the table in my normal browser (Firefox) in stead.

How do I do that?

Hey,
Did you try with Mux.jl ?
I cannot guarantee it, but most of my Blink apps also work with Mux.
But I don’t use TableView.
If you are using jupyterlab, you can find a widget to explore .csv.

1 Like

Quick example with Mux:

using Mux, DataFrames, TableView

function myapp(req; table)
  return showtable(table)
end

df1 = DataFrame(rand(10,5), :auto)

@app r = (
  Mux.defaults,
  page("/mytable", req -> myapp(req; table=df1)),
  Mux.notfound());

serve(r, 2429)

Then open your browser to http://localhost:2429/mytable

3 Likes

FWIW, under Windows 11, the default browser can be launched fine from Julia with:

run(`explorer http://localhost:2429/mytable`)

although this command issues an error message…

EDIT:
As per this other post, a clean way to open the webpage (or other files) with OS’s default application is to use the DefaultApplication.jl package

1 Like

Thanks a lot @jd-foster . This looks great!

1 Like