From 02248a46752a75c0079e6456d5b399140d610b0a Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Tue, 27 Apr 2021 17:41:54 +0200 Subject: [PATCH 01/17] Create CompatHelper.yml --- .github/workflows/CompatHelper.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/CompatHelper.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 0000000..7784f24 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,26 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "2" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} From 2e0b8f768283efd0be03fcc7ecbe8c312ca4ea56 Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Tue, 27 Apr 2021 17:43:16 +0200 Subject: [PATCH 02/17] Update TagBot.yml --- .github/workflows/TagBot.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0..f49313b 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,11 +1,15 @@ name: TagBot on: - schedule: - - cron: 0 * * * * + issue_comment: + types: + - created + workflow_dispatch: jobs: TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} From 3908589df97a917992aceedce6518857e0b1265d Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Tue, 27 Apr 2021 20:36:51 +0200 Subject: [PATCH 03/17] Create CI.yml --- .github/workflows/CI.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..0b5c05a --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,68 @@ +name: CI +on: + pull_request: + branches: + - master + push: + branches: + - master + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.0' + - '1' + - 'nightly' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info +# docs: +# name: Documentation +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - uses: julia-actions/setup-julia@v1 +# with: +# version: '1' +# - run: | +# julia --project=docs -e ' +# using Pkg +# Pkg.develop(PackageSpec(path=pwd())) +# Pkg.instantiate()' +# - run: | +# julia --project=docs -e ' +# using Documenter: doctest +# using MYPACKAGE +# doctest(MYPACKAGE)' # change MYPACKAGE to the name of your package +# - run: julia --project=docs docs/make.jl +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} From 7b0a13ed93eccaf2363fd1d58a128df5a82924b9 Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Tue, 27 Apr 2021 20:39:25 +0200 Subject: [PATCH 04/17] Switch to GitHub Actions --- .travis.yml | 16 ---------------- README.md | 2 +- appveyor.yml | 47 ----------------------------------------------- 3 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 703e2a4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: julia -os: - - linux - - osx -julia: - - 1.0 - - 1.1 - - 1.2 - - 1.3 - - 1.4 - - nightly -matrix: - allow_failures: - - julia: nightly -notifications: - email: false diff --git a/README.md b/README.md index fc8f1b7..53980b2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TableView -[![Build Status](https://travis-ci.org/JuliaComputing/TableView.jl.svg?branch=master)](https://travis-ci.org/JuliaComputing/TableView.jl) +[![CI](https://github.com/JuliaComputing/TableView.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/JuliaComputing/TableView.jl/actions/workflows/CI.yml) TableView.jl is an [ag-grid](https://www.ag-grid.com/) based table viewer built on [WebIO.jl](https://github.com/JuliaGizmos/WebIO.jl). It can display arbitrarily large tables by lazy-loading additional data when scrolling (this is the default for datasets with more than 10k rows). diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index eaf4bc4..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -environment: - matrix: - - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe" - - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" - - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" - - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" - -## uncomment the following lines to allow failures on nightly julia -## (tests will run but not make your overall status red) -#matrix: -# allow_failures: -# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" -# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" -# If there's a newer build queued for the same PR, cancel this one - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - throw "There are newer queued builds for this pull request, failing early." } -# Download most recent Julia Windows binary - - ps: (new-object net.webclient).DownloadFile( - $env:JULIA_URL, - "C:\projects\julia-binary.exe") -# Run installer silently, output to C:\projects\julia - - C:\projects\julia-binary.exe /S /D=C:\projects\julia - -build_script: -# Need to convert from shallow to complete for Pkg.clone to work - - IF EXIST .git\shallow (git fetch --unshallow) - - C:\projects\julia\bin\julia -e "versioninfo(); - Pkg.clone(pwd(), \"TableView\"); Pkg.build(\"TableView\")" - -test_script: - - C:\projects\julia\bin\julia -e "Pkg.test(\"TableView\")" From aec86f62e1e0beb20f30f92d788c93abbc2dc16f Mon Sep 17 00:00:00 2001 From: Ran Gal Date: Wed, 5 May 2021 11:59:06 -0700 Subject: [PATCH 05/17] =?UTF-8?q?The=20user=20can=20now=20supply=20a=20cal?= =?UTF-8?q?lback=20function=20that=20will=20be=20called=20just=20before=20?= =?UTF-8?q?rendering=20the=20table,=20allowing=20changes=20in=20the=20colu?= =?UTF-8?q?mns=20definitions=20(disable=20sorting,=20make=20read-only,=20r?= =?UTF-8?q?emove=20from=20display=20etc.).=20It=20the=20future=20we=20can?= =?UTF-8?q?=20store=20the=20=E2=80=9Cdom=E2=80=9D=20node=20in=20options=20?= =?UTF-8?q?to=20allow=20the=20user=20to=20change=20that=20too.=20we=20had?= =?UTF-8?q?=20to=20remove=20the=20callback=20function=20entry=20from=20opt?= =?UTF-8?q?ions=20dictionary=20as=20it=20cause=20the=20JS=20serilization?= =?UTF-8?q?=20process=20to=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TableView.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TableView.jl b/src/TableView.jl index aa3fd7b..b3987aa 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -190,6 +190,10 @@ function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}(); ) ) + # allow a user to modify some of the table settings using a call back function supplied in the options argument + # we need to remove the callback function key from options as it cause the JS serilization process to fail + haskey(options, :userCallbackFunc) && ((options[:userCallbackFunc])(options) ; delete!(options, :userCallbackFunc)) + showfun = async ? _showtable_async! : _showtable_sync! showfun(w, schema, names, types, rows, coldefs, tablelength, id, options) From c7349160ea6f15395b21450bd59a2ed4f4e1bf72 Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Wed, 12 May 2021 13:49:32 +0200 Subject: [PATCH 06/17] various API tweaks --- Project.toml | 4 ++-- ag-grid.version | 2 +- src/TableView.jl | 45 ++++++++++++++++++++++++++++----------------- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Project.toml b/Project.toml index 8e7d87b..41b86ca 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TableView" uuid = "40c74d1a-b44c-5b06-a7c1-6cbea58ea978" -version = "0.6.8" +version = "0.7.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -14,7 +14,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] JSExpr = "0.4, 0.5" JSON = "0.18, 0.19, 0.20, 0.21" -Observables = "0.2,0.3" +Observables = "0.2, 0.3, 0.4" Tables = "1" WebIO = "0.8" julia = "0.7, 1" diff --git a/ag-grid.version b/ag-grid.version index 2c0a9e3..baa90a6 100644 --- a/ag-grid.version +++ b/ag-grid.version @@ -1 +1 @@ -25.0.0 +25.2.0 diff --git a/src/TableView.jl b/src/TableView.jl index b3987aa..7d8a9f8 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -47,20 +47,28 @@ end showtable(table::AbstractMatrix; kwargs...) = showtable(Tables.table(table); kwargs...) """ - showtable(table; dark = false, height = :auto, width = "100%", cell_changed = nothing) + showtable(table; options::Dict{Symbol, Any} = Dict{Symbol, Any}(), option_mutator! = identity, + dark = false, height = :auto, width = "100%", cell_changed = nothing) Return a `WebIO.Scope` that displays the provided `table`. Optional arguments: - - `dark`: Switch to a dark theme. - - `title`: Displayed above the table if non-empty; - - `height`/`width`: CSS attributes specifying the output height and with. - - `cell_changed`: Either `nothing` or a function that takes a single argument with the fields - `"new"`, `"old"`, `"row"`, and `"col"`. This function is called whenever the - user edits a table field. Note that all values will be strings, so you need to - do the necessary conversions yourself. + - `options`: Directly passed to agGrid's `Grid` constructor. Refer to the + [documentation](https://www.ag-grid.com/documentation/) for more info. + - `options_mutator!`: Runs on the `options` dictionary populated by TableView and allows for + customizing the grid (at your own risk -- you can break the package by + supplying invalid options). + - `dark`: Switch to a dark theme. + - `title`: Displayed above the table if non-empty; + - `height`/`width`: CSS attributes specifying the output height and with. + - `cell_changed`: Either `nothing` or a function that takes a single argument with the fields + `"new"`, `"old"`, `"row"`, and `"col"`. This function is called whenever the + user edits a table field. Note that all values will be strings, so you need to + do the necessary conversions yourself. """ -function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}(); +function showtable(table; + options::Dict{Symbol, Any} = Dict{Symbol, Any}(), + option_mutator! = identity, dark::Bool = false, title::String = "", height = :auto, @@ -190,19 +198,20 @@ function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}(); ) ) - # allow a user to modify some of the table settings using a call back function supplied in the options argument - # we need to remove the callback function key from options as it cause the JS serilization process to fail - haskey(options, :userCallbackFunc) && ((options[:userCallbackFunc])(options) ; delete!(options, :userCallbackFunc)) - + + showfun = async ? _showtable_async! : _showtable_sync! - showfun(w, schema, names, types, rows, coldefs, tablelength, id, options) + showfun(w, schema, types, rows, tablelength, id, options, option_mutator!) - w + return w end -function _showtable_sync!(w, schema, names, types, rows, coldefs, tablelength, id, options) +function _showtable_sync!(w, schema, types, rows, tablelength, id, options, option_mutator!) options[:rowData] = JSONText(table2json(schema, rows, types)) + + option_mutator!(options) + license = get(ENV, "AG_GRID_LICENSE_KEY", nothing) handler = @js function (RowNumberRenderer, agGrid) @var gridOptions = $options @@ -219,7 +228,7 @@ function _showtable_sync!(w, schema, names, types, rows, coldefs, tablelength, i onimport(w, handler) end -function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength, id, options) +function _showtable_async!(w, schema, types, rows, tablelength, id, options, option_mutator!) rowparams = Observable(w, "rowparams", Dict("startRow" => 1, "endRow" => 100, "successCallback" => @js v -> nothing)) @@ -246,6 +255,8 @@ function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength, ) license = get(ENV, "AG_GRID_LICENSE_KEY", nothing) + option_mutator!(options) + handler = @js function (RowNumberRenderer, agGrid) @var gridOptions = $options @var el = document.getElementById($id) From 89763672c627fd216c7ad63fa914b61bd106556c Mon Sep 17 00:00:00 2001 From: pdeffebach <23196228+pdeffebach@users.noreply.github.com> Date: Mon, 31 May 2021 19:05:21 -0400 Subject: [PATCH 07/17] Update docstring so list displays properly Try `? showtable` on `master` and the same on this branch. Just a small fix to make it render better. --- src/TableView.jl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/TableView.jl b/src/TableView.jl index 7d8a9f8..757ee22 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -53,18 +53,19 @@ showtable(table::AbstractMatrix; kwargs...) = showtable(Tables.table(table); kwa Return a `WebIO.Scope` that displays the provided `table`. Optional arguments: - - `options`: Directly passed to agGrid's `Grid` constructor. Refer to the - [documentation](https://www.ag-grid.com/documentation/) for more info. - - `options_mutator!`: Runs on the `options` dictionary populated by TableView and allows for - customizing the grid (at your own risk -- you can break the package by - supplying invalid options). - - `dark`: Switch to a dark theme. - - `title`: Displayed above the table if non-empty; - - `height`/`width`: CSS attributes specifying the output height and with. - - `cell_changed`: Either `nothing` or a function that takes a single argument with the fields - `"new"`, `"old"`, `"row"`, and `"col"`. This function is called whenever the - user edits a table field. Note that all values will be strings, so you need to - do the necessary conversions yourself. + +- `options`: Directly passed to agGrid's `Grid` constructor. Refer to the + [documentation](https://www.ag-grid.com/documentation/) for more info. +- `options_mutator!`: Runs on the `options` dictionary populated by TableView and allows for + customizing the grid (at your own risk -- you can break the package by + supplying invalid options). +- `dark`: Switch to a dark theme. +- `title`: Displayed above the table if non-empty; +- `height`/`width`: CSS attributes specifying the output height and with. +- `cell_changed`: Either `nothing` or a function that takes a single argument with the fields + `"new"`, `"old"`, `"row"`, and `"col"`. This function is called whenever the + user edits a table field. Note that all values will be strings, so you need to + do the necessary conversions yourself. """ function showtable(table; options::Dict{Symbol, Any} = Dict{Symbol, Any}(), From 80345b15971630a9a19baf3d88c897db426e032a Mon Sep 17 00:00:00 2001 From: Ben Baumgold Date: Thu, 3 Jun 2021 20:09:49 +0100 Subject: [PATCH 08/17] add default is_javascript_safe() function --- Project.toml | 2 +- src/TableView.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 41b86ca..b77c5db 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TableView" uuid = "40c74d1a-b44c-5b06-a7c1-6cbea58ea978" -version = "0.7.0" +version = "0.7.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/TableView.jl b/src/TableView.jl index 757ee22..aa2fb42 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -274,6 +274,10 @@ function _showtable_async!(w, schema, types, rows, tablelength, id, options, opt onimport(w, handler) end +function _is_javascript_safe(x) + false +end + function _is_javascript_safe(x::Integer) min_safe_int = -(Int64(2)^53-1) max_safe_int = Int64(2)^53-1 From 6874a8b02458f302bcddc78d0387fcd9c1189d87 Mon Sep 17 00:00:00 2001 From: Ben Baumgold Date: Thu, 3 Jun 2021 20:06:23 -0400 Subject: [PATCH 09/17] simplify and add comment --- src/TableView.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/TableView.jl b/src/TableView.jl index aa2fb42..881dd19 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -274,9 +274,8 @@ function _showtable_async!(w, schema, types, rows, tablelength, id, options, opt onimport(w, handler) end -function _is_javascript_safe(x) - false -end +# By default all objects must use repr or sprint +_is_javascript_safe(x::Real) = false function _is_javascript_safe(x::Integer) min_safe_int = -(Int64(2)^53-1) From 884ec407b10a5260a9ced1d27f3490686d17907c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 5 Jun 2021 00:20:50 +0000 Subject: [PATCH 10/17] CompatHelper: bump compat for "JSExpr" to "1" --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b77c5db..3f4ad4e 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] -JSExpr = "0.4, 0.5" +JSExpr = "0.4, 0.5, 1" JSON = "0.18, 0.19, 0.20, 0.21" Observables = "0.2, 0.3, 0.4" Tables = "1" From 5bf83fca50a36cff6ebd1546acc1578532f3b4dc Mon Sep 17 00:00:00 2001 From: Ben Baumgold <4933671+baumgold@users.noreply.github.com> Date: Mon, 21 Nov 2022 11:12:33 -0500 Subject: [PATCH 11/17] bump Observables compat --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b77c5db..6c5e9c3 100644 --- a/Project.toml +++ b/Project.toml @@ -14,7 +14,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] JSExpr = "0.4, 0.5" JSON = "0.18, 0.19, 0.20, 0.21" -Observables = "0.2, 0.3, 0.4" +Observables = "0.2, 0.3, 0.4, 0.5" Tables = "1" WebIO = "0.8" julia = "0.7, 1" From 7f5d2985482faf76517af35f68f749e12bbcc978 Mon Sep 17 00:00:00 2001 From: Ben Baumgold Date: Mon, 21 Nov 2022 12:53:21 -0500 Subject: [PATCH 12/17] fix tests --- test/runtests.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 3948cab..0edf890 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,11 +20,12 @@ end @test showtable(nttable) isa WebIO.Scope end @testset "inf, nan, and missing serializing" begin - rows = Tables.table([NaN Inf -Inf 0 missing]) names = [:a, :b, :c, :d, :e] + rows = Tables.table([NaN Inf -Inf 0 missing]; header=names) types = vcat([Float64 for _ in 1:4], [Missing]) Base.show(io::IO, x::Missing) = print(io, "test_missing") - json = TableView.table2json(Tables.Schema(names, types), rows, types) + schema = Tables.Schema(names, types) + json = TableView.table2json(schema, Tables.rows(rows), types) firstrow = JSON.parse(json)[1] @test firstrow["a"] == "NaN" @test firstrow["b"] == "Inf" @@ -33,20 +34,22 @@ end @test firstrow["e"] == "test_missing" end @testset "large integers" begin - rows = Tables.table([2^52 2^53 2^54]) names = [:a, :b, :c] + rows = Tables.table([2^52 2^53 2^54]; header=names) types = [Int64 for _ in 1:3] - json = TableView.table2json(Tables.Schema(names, types), rows, types) + schema = Tables.Schema(names, types) + json = TableView.table2json(schema, Tables.rows(rows), types) firstrow = JSON.parse(json)[1] @test firstrow["a"] == 4503599627370496 @test firstrow["b"] == "9007199254740992" @test firstrow["c"] == "18014398509481984" end @testset "large floats" begin - rows = Tables.table([1.0e50 1.0e100]) names = [:a, :b] + rows = Tables.table([1.0e50 1.0e100]; header=names) types = [Float64, Float64] - json = TableView.table2json(Tables.Schema(names, types), rows, types) + schema = Tables.Schema(names, types) + json = TableView.table2json(schema, Tables.rows(rows), types) firstrow = JSON.parse(json)[1] @test firstrow["a"] == "1.0e50" @test firstrow["b"] == "1.0e100" From 112b6c1872045b78ad5c276848f511be2ede67d7 Mon Sep 17 00:00:00 2001 From: Ben Baumgold Date: Mon, 21 Nov 2022 13:00:26 -0500 Subject: [PATCH 13/17] remove failing Julia v1.0 from CI matrix --- .github/workflows/CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0b5c05a..b930fec 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,6 @@ jobs: fail-fast: false matrix: version: - - '1.0' - '1' - 'nightly' os: From 8b78efbaf39f6ef325257f3bd20abfeda79fcd02 Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Mon, 21 Nov 2022 20:20:17 +0100 Subject: [PATCH 14/17] v0.7.2 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6c5e9c3..d983611 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TableView" uuid = "40c74d1a-b44c-5b06-a7c1-6cbea58ea978" -version = "0.7.1" +version = "0.7.2" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" From 277e52ab74a75e3747d5af36c88e6834aa63736b Mon Sep 17 00:00:00 2001 From: Ben Baumgold <4933671+baumgold@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:28:27 -0400 Subject: [PATCH 15/17] upgrade ag-grid version --- ag-grid.version | 2 +- deps/build.jl | 9 +++------ src/TableView.jl | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ag-grid.version b/ag-grid.version index baa90a6..4f3a069 100644 --- a/ag-grid.version +++ b/ag-grid.version @@ -1 +1 @@ -25.2.0 +30.0.2 diff --git a/deps/build.jl b/deps/build.jl index 3e42890..9478e16 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -8,10 +8,7 @@ ag_grid_base = joinpath(@__DIR__, "ag-grid-$(version)", "ag-grid.js") isfile(ag_grid_base) || download("https://cdn.jsdelivr.net/npm/ag-grid-$(distribution)@$(version)/dist/ag-grid-$(distribution).min.noStyle.js", ag_grid_base) ag_grid_base_style = joinpath(@__DIR__, "ag-grid-$(version)", "ag-grid.css") -isfile(ag_grid_base_style) || download("https://cdn.jsdelivr.net/npm/ag-grid-$(distribution)@$(version)/dist/styles/ag-grid.css", ag_grid_base_style) +isfile(ag_grid_base_style) || download("https://cdn.jsdelivr.net/npm/ag-grid-$(distribution)@$(version)/styles/ag-grid.css", ag_grid_base_style) -ag_grid_light = joinpath(@__DIR__, "ag-grid-$(version)", "ag-grid-light.css") -isfile(ag_grid_light) || download("https://cdn.jsdelivr.net/npm/ag-grid-$(distribution)@$(version)/dist/styles/ag-theme-balham.css", ag_grid_light) - -ag_grid_dark = joinpath(@__DIR__, "ag-grid-$(version)", "ag-grid-dark.css") -isfile(ag_grid_dark) || download("https://cdn.jsdelivr.net/npm/ag-grid-$(distribution)@$(version)/dist/styles/ag-theme-balham-dark.css", ag_grid_dark) +ag_grid_light = joinpath(@__DIR__, "ag-grid-$(version)", "ag-theme-balham.css") +isfile(ag_grid_light) || download("https://cdn.jsdelivr.net/npm/ag-grid-$(distribution)@$(version)/styles/ag-theme-balham.css", ag_grid_light) diff --git a/src/TableView.jl b/src/TableView.jl index 881dd19..b85b23e 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -11,7 +11,7 @@ const ag_grid_imports = [] function __init__() version = readchomp(joinpath(@__DIR__, "..", "ag-grid.version")) empty!(ag_grid_imports) - for f in ["ag-grid.js", "ag-grid.css", "ag-grid-light.css", "ag-grid-dark.css"] + for f in ["ag-grid.js", "ag-grid.css", "ag-theme-balham.css"] push!(ag_grid_imports, normpath(joinpath(@__DIR__, "..", "deps", "ag-grid-$(version)", f))) end pushfirst!(ag_grid_imports, normpath(joinpath(@__DIR__, "rowNumberRenderer.js"))) From ed4bf42e1d766b096d24a659b43ddc292c83116f Mon Sep 17 00:00:00 2001 From: Ben Baumgold <4933671+baumgold@users.noreply.github.com> Date: Wed, 21 Jun 2023 16:37:44 -0400 Subject: [PATCH 16/17] customizable async threshold --- src/TableView.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TableView.jl b/src/TableView.jl index 881dd19..057c0bd 100644 --- a/src/TableView.jl +++ b/src/TableView.jl @@ -74,7 +74,8 @@ function showtable(table; title::String = "", height = :auto, width = "100%", - cell_changed = nothing + cell_changed = nothing, + async_threshold = 10_000, ) rows = Tables.rows(table) it_sz = Base.IteratorSize(rows) @@ -110,7 +111,7 @@ function showtable(table; types = schema.types end - async = tablelength === nothing || tablelength > 10_000 + async = tablelength === nothing || tablelength > async_threshold w = Scope(imports = ag_grid_imports) From a3a3172fed89260b779d79f22c901ed74d96b90d Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Mon, 1 Jul 2024 16:09:44 +0200 Subject: [PATCH 17/17] v0.8.0 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 68f5ff3..ec90109 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "TableView" uuid = "40c74d1a-b44c-5b06-a7c1-6cbea58ea978" -version = "0.7.2" +version = "0.8.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"