Skip to content

Commit

Permalink
brushing extension POC for #164
Browse files Browse the repository at this point in the history
  • Loading branch information
SymbolixAU committed Sep 18, 2019
2 parents 2f281b8 + 8f1eb4a commit 7329001
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# mapdeck 0.3

* `add_bitmap()` to add a bitmap / image to the map
* input$map_view_change now observed [issue211](https://github.com/SymbolixAU/mapdeck/issues/211) - thanks @zacdav
* `update_stype()` function
* `add_path()` accepts dashed lines
Expand Down
4 changes: 3 additions & 1 deletion R/map_layer_bitmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ mapdeckBitmapDependency <- function() {

#' Add bitmap
#'
#' Adds an image to a map
#'
#' @inheritParams add_arc
#' @param image url to an image to use on the map
#' @param bounds coordinates of the bounding box of the image [left, bottom, right, top]
Expand Down Expand Up @@ -75,7 +77,7 @@ add_bitmap <- function(
focus_layer <- force( focus_layer )

transparent_colour <- force( transparent_colour )
tin_colour <- force( tint_colour )
tint_colour <- force( tint_colour )

transparent_colour <- colourvalues::convert_colour( transparent_colour )
tint_colour <- colourvalues::convert_colour( tint_colour )
Expand Down
2 changes: 1 addition & 1 deletion R/mapdeck_tokens.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ get_access_token <- function(api = "mapbox") {

api <- unique( as.character( e ) )
if( length( api ) > 1 ) {
warning("Multiple MAPBOX API tokens found in Sys.getenv(), using the firt one")
warning("Multiple MAPBOX API tokens found in Sys.getenv(), using the first one")
}
}
if(length(api) == 0) api <- NULL
Expand Down
6 changes: 3 additions & 3 deletions inst/htmlwidgets/lib/deckgl.min.js

Large diffs are not rendered by default.

23 changes: 7 additions & 16 deletions inst/htmlwidgets/lib/scatterplot/scatterplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ function add_scatterplot_geo( map_id, map_type, scatter_data, layer_id, auto_hig
//console.log( radius_min_pixels );

var extensions = [];

const d = new deck.DirectionalLight({
color: [255, 255, 255],
intensity: 1.0,
direction: [-3, -9, -1]
});
console.log( d );
const b = new deck.BrushingExtension();
console.log( b );
extensions.push( b );

// if ( brush_radius > 0 ) {
// // add brushing extension
Expand Down Expand Up @@ -46,17 +39,15 @@ function add_scatterplot_geo( map_id, map_type, scatter_data, layer_id, auto_hig
onClick: info => md_layer_click( map_id, "scatterplot", info ),
onHover: md_update_tooltip,
transitions: js_transition || {},
<<<<<<< HEAD
brushingEnabled: true,
brushingRadius: brush_radius,
mousePosition: [0, 0],
extensions: [ ]
=======

// brushingEnabled: true,
// brushingRadius: brush_radius,
// mousePosition: [0, 0],
// extensions: [ ]
//brushingEnabled: true,
//brushingRadius: brush_radius,
brushingRadius: 100000,
//mousePosition: [0, 0],
extensions: extensions
>>>>>>> 2864a15abb152b17b6a74b884d281b8b84f3b344
});

if( map_type == "google_map") {
Expand Down
2 changes: 1 addition & 1 deletion man/add_bitmap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7329001

Please sign in to comment.