From 5d8862bc86c27e8bac4e0a97c9fceec73c8eecd6 Mon Sep 17 00:00:00 2001 From: Johannes Boehm Date: Mon, 1 Jan 2024 13:44:20 +0100 Subject: [PATCH 1/2] fix bufsize issue, export functions --- src/KeplerGL.jl | 8 ++++---- src/config.jl | 12 ++++++------ src/layers/polygon.jl | 8 +++++--- src/layers/trip.jl | 5 ++++- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/KeplerGL.jl b/src/KeplerGL.jl index 1539af6..5146cd7 100644 --- a/src/KeplerGL.jl +++ b/src/KeplerGL.jl @@ -22,7 +22,10 @@ using Base64 ## ############################################################################## -export KeplerGLMap, make_static_config #, load_map_from_json!, show +export KeplerGLMap, make_static_config, render, export_image, + load_map_from_json!, load_config_from_json!, load_map_from_json, + add_grid_layer!, add_arc_layer!, add_cluster_layer!, add_h3_layer!, add_heatmap_layer!, + add_hexagon_layer!, add_icon_layer!, add_line_layer!, add_polygon_layer!, add_trip_layer! ############################################################################## ## @@ -31,9 +34,6 @@ export KeplerGLMap, make_static_config #, load_map_from_json!, show ############################################################################## include("KeplerGLData.jl") -# include("layer.jl") -# include("layers/PointLayer.jl") - include("config.jl") include("map.jl") include("data.jl") diff --git a/src/config.jl b/src/config.jl index 7a58db7..7b54c3a 100644 --- a/src/config.jl +++ b/src/config.jl @@ -1,13 +1,13 @@ -function create_config() +# function create_config() -end +# end -# two presets: +# # two presets: -# interactive window -function interactive() +# # interactive window +# function interactive() -end +# end # this returns a minimal config for a static map function make_static_config() diff --git a/src/layers/polygon.jl b/src/layers/polygon.jl index d2790db..a8de415 100644 --- a/src/layers/polygon.jl +++ b/src/layers/polygon.jl @@ -83,8 +83,7 @@ function add_polygon_layer!( height_scale = "linear", elevation_scale = 1.0, enable_elevation_zoom_factor = true, - enable_3d = false - + enable_3d = false, ) if !Tables.istable(table) @@ -107,8 +106,11 @@ function add_polygon_layer!( df_to_use[!,:Height] = Tables.getcolumn(cols, height_field) end + # i'm choosing a buffer size based on the size of the :geojson column, plus a bit + # if this is still too low, it will error... + bufsize_exp = Int(maximum(floor.(log2.(sizeof.(df_to_use[!,:geojson]))))) + 6 buf = IOBuffer() - CSV.write(buf, df_to_use) + CSV.write(buf, df_to_use, bufsize=2^bufsize_exp) data_csv = String(take!(buf)) # data code diff --git a/src/layers/trip.jl b/src/layers/trip.jl index 56b6a55..a8b08b5 100644 --- a/src/layers/trip.jl +++ b/src/layers/trip.jl @@ -79,8 +79,11 @@ function add_trip_layer!( df_to_use[!,:OutlineWidth] = Tables.getcolumn(cols, outline_width_field) end + # i'm choosing a buffer size based on the size of the :geojson column, plus a bit + # if this is still too low, it will error... + bufsize_exp = Int(maximum(floor.(log2.(sizeof.(df_to_use[!,:geojson]))))) + 6 buf = IOBuffer() - CSV.write(buf, df_to_use) + CSV.write(buf, df_to_use, bufsize=2^bufsize_exp) data_csv = String(take!(buf)) # data code From 275f92d580d457f3ddd2b65d0882dff27f6b330b Mon Sep 17 00:00:00 2001 From: Johannes Boehm Date: Mon, 1 Jan 2024 13:51:31 +0100 Subject: [PATCH 2/2] bump version, fix install info, stable docs --- Project.toml | 2 +- README.md | 7 +++---- docs/src/index.md | 6 ++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index b9a57c7..7025945 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "KeplerGL" uuid = "389c4311-7670-4ca7-a1b4-f34bb8a2527a" authors = ["Johannes Boehm "] -version = "0.0.1" +version = "0.0.2" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/README.md b/README.md index 0664e4b..e9be7fb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # KeplerGL.jl +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://jmboehm.github.io/KeplerGL.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://jmboehm.github.io/KeplerGL.jl/dev/) [![Build Status](https://github.com/jmboehm/KeplerGL.jl/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jmboehm/KeplerGL.jl/actions/workflows/ci.yml?query=branch%3Amain) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/jmboehm/KeplerGL.jl/blob/main/LICENSE) @@ -66,7 +67,5 @@ At this point the following layers are implemented: To install the package, type in the Julia command prompt ``` -] add https://github.com/jmboehm/KeplerGL.jl -``` - -The package will soon be registered in Julia's `General` registry. \ No newline at end of file +] add KeplerGL +``` \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index b6e188b..8a52fd6 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -13,14 +13,12 @@ Depth = 3 ## Installation -To install the package, type in the Julia command prompt +To install the package, type in the Julia REPL ``` -] add https://github.com/jmboehm/KeplerGL.jl +] add KeplerGL ``` -The package will be registered in Julia's `General` registry once it's a bit more mature. - ## Support policy The development of the package is done in the author's spare time. I try to fix bugs as I have time and as they are reported on the [Github issue tracker](https://github.com/jmboehm/KeplerGL.jl/issues). The package isn't particularly complicated, and I'm happy to review and merge pull requests for both bug fixes and new features. Please don't email me about the package.