Skip to content

Commit

Permalink
Merge pull request #3 from jmboehm/bufsize
Browse files Browse the repository at this point in the history
Fix bufsize issue, export functions
  • Loading branch information
jmboehm authored Jan 1, 2024
2 parents a89b039 + 275f92d commit 3da703f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KeplerGL"
uuid = "389c4311-7670-4ca7-a1b4-f34bb8a2527a"
authors = ["Johannes Boehm <[email protected]>"]
version = "0.0.1"
version = "0.0.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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.
] add KeplerGL
```
6 changes: 2 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/KeplerGL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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!

##############################################################################
##
Expand All @@ -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")
Expand Down
12 changes: 6 additions & 6 deletions src/config.jl
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
8 changes: 5 additions & 3 deletions src/layers/polygon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/layers/trip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3da703f

Please sign in to comment.