crazycapivara / deckgl Goto Github PK
View Code? Open in Web Editor NEWAn R Interface to deck.gl
Home Page: https://crazycapivara.github.io/deckgl/
License: Other
An R Interface to deck.gl
Home Page: https://crazycapivara.github.io/deckgl/
License: Other
Add file LICENCE.note
with licence information for deck.gl
and mapbox-gl
add_layer(data = data, getTooltip = ~name)
# equals
add_layer(data = data, getTooltip = get_property("name"))
Add new layers supported in version 7 (see #83)
Add argument to deckgl
widget to enable js debug mode (logs)
Add proxy object to update layers in shiny mode
Looks like we have similar packages, your deckgl and my mapdeck. Maybe there's a way we can combine efforts?
Add R helper function to parse hex colors from a property of a js object to an RGB array.
Use the already implemented js function deckglWidget.colorToRGBArray
.
Move properties like lat
, lng
to something like x$properties
or x$deck$properties
@crazycapivara hi,
Something's bothering me
when I run the code:
url0 <- paste0(
"https://raw.githubusercontent.com/",
"uber-common/deck.gl-data/",
"master/website/bart-stations.json"
)
sample_data<-fromJSON(url0)
and I get a dataframe like this:
head(sample_data)
name code address
1 Lafayette (LAFY) LF 3601 Deer Hill Road, Lafayette CA 94549
2 12th St. Oakland City Center (12TH) 12 1245 Broadway, Oakland CA 94612
3 16th St. Mission (16TH) 16 2000 Mission Street, San Francisco CA 94110
4 19th St. Oakland (19TH) 19 1900 Broadway, Oakland CA 94612
5 24th St. Mission (24TH) 24 2800 Mission Street, San Francisco CA 94110
6 Ashby (ASHB) AS 3100 Adeline Street, Berkeley CA 94703
entries exits coordinates
1 3481 3616 -122.123801, 37.893394
2 13418 13547 -122.271604, 37.803664
3 12409 12351 -122.419694, 37.765062
4 13108 13090 -122.269029, 37.807870
5 12817 12529 -122.418466, 37.752254
6 5452 5341 -122.269780, 37.853024
the coordinates include lng and lat
How am I going to generate new coordinates like that ?
ps: raw data as below
head(dt[,.(vin,lng,lat)])
vin lng lat
1: L6T792423JN451621 121.2295550 30.33141889
2: L6T792423JN451621 121.2368408 30.34006500
3: L6T792423JN451621 121.6590389 29.73693583
4: L6T792423JN451621 121.6553528 29.73500694
5: L6T792423JN451621 121.2299058 30.33186083
6: L6T792423JN451621 121.2268678 30.32662194
or https://crazycapivara.github.io/deckgl/articles/icon-layer.html
when I creatte icon-layer, is data must be JSON?
Thanks a million
Thanks a million
Looks like we have similar packages, your deckgl and my mapdeck. Maybe there's a way we can combine efforts?
Pass object data (from getTooltip
?) back to R on hover
via wellknown
Add controls / overlays like legend
Rename shiny bindings from camel case to deckgl_output
and render_deckgl
Add examples for different data types:
Use htmlDependency
to add large data as external js
file
To be used in example of h3-layer.
I really like the wind demo, but it looks like the particles layer is unofficial. Any chance you should include it? - https://github.com/uber/deck.gl/blob/413e394cabf7778265159e9851eabe42147a554e/showcases/wind/src/wind-demo.js
Fixes hexagon bug
Detect sf column, if data is supplied as sf object: attr(x, "sf_column")
Add startup message with deckgl-js
version number and link to documentation.
somethin like:
get_js_property <- function(name) {
sprintf("data => data.%s", name) %>% JS()
}
Use new data accessor style ~lat + lng
in examples
Add default icon properties (iconAtlas
, iconMapping
and getColor
) when the property iconAtlas
is not set in add_icon_layer
.
Automatically set pickable = TRUE
when getTooltip
property is set.
Use webpack for js development.
Use initialViewState
instead of deprecated latitude
, longitude
etc properties when creating new DeckGL
object.
Add parameter data
to deckgl
func, so that same data objects can be used by multiple layers
deckgl seems overlay with mapdeck?
I was trying to use add_layer function to display ColumnLayer, but nothing shows in the Shiny app.
properties <- list(
extruded = TRUE,
radius = 100,
elevationScale = 4,
getElevation = JS("d => d.total_lots"),
getPosition = JS("d => d.geometry"),
getTooltip = JS("object => `${object.centroid.join(', ')}<br/>Count: ${object.points.length}`"),
fixedTooltip = TRUE
)
output$distPlot <- renderDeckgl({
deckgl(latitude = 1.3521, longitude = 103.8198, pitch = 45) %>%
add_layer(class_name = "ColumnLayer", id="column-layer", data = sf, properties = properties) %>%
add_mapbox_basemap(style = "mapbox://styles/mapbox/dark-v10")
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.