From 807cdaea6592e2f72eee68976c0d32bbd0b52601 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Sun, 31 Dec 2017 12:12:24 -0800 Subject: [PATCH 1/2] Add type info in data passed to voyager --- src/DataVoyager.jl | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/DataVoyager.jl b/src/DataVoyager.jl index 35d35ac..18f49fe 100644 --- a/src/DataVoyager.jl +++ b/src/DataVoyager.jl @@ -26,6 +26,8 @@ end row_output = Expr(:block) + format_strings = String[] + for (i,v) in enumerate(col_names) if i>1 push!(row_output.args, :(print(buf, ", "))) @@ -39,9 +41,17 @@ end else push!(row_output.args, :(print(buf, "\"", row[$i],"\""))) end + + actual_format_spec = "String" + if col_types[i] <: Number || (col_types[i] <: DataValue && eltype(col_types[i]) <: Number) + actual_format_spec = "number" + end + push!(format_strings, "\"$(col_names[i])\": \"$actual_format_spec\"") end - quote + format_string = join(format_strings, ",") + + r = quote buf = IOBuffer() print(buf, "{\"values\":[") for (i,row) in enumerate(it) @@ -53,10 +63,16 @@ end $(row_output) print(buf, "}") end - print(buf, "]}") + print(buf, "],") + print(buf, "\"format\":{\"parse\":{") + print(buf, $format_string) + print(buf, "}}") + print(buf, "}") return String(take!(buf)) end + # println(r) + return r end function (v::Voyager)(source) @@ -66,6 +82,8 @@ function (v::Voyager)(source) data = format_iterable_table_as_json(it) + # println(data) + jsdata = Blink.JSString(data) @js v.w voyagerInstance.updateData($jsdata) From 0bda98c8d633c25a64e3fa1d4cc352485f3a6bd6 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Sun, 31 Dec 2017 12:26:38 -0800 Subject: [PATCH 2/2] Run CI only on julia 0.6 --- .travis.yml | 1 - appveyor.yml | 2 -- 2 files changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cbd28b1..bc422dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ os: - osx julia: - 0.6 - - nightly notifications: email: false git: diff --git a/appveyor.yml b/appveyor.yml index d064b8c..6e3ee8f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,8 +2,6 @@ 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)