plotly / plotly/plotly.R

Special bindings for stars data structures

Open
#1,200 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

A good start would be to replicate the plot.stars() method (from https://github.com/r-spatial/stars)

library(stars)
etm <- st_stars(system.file("tif/L7_ETMs.tif", package = "stars"))
plot(etm)

screen shot 2018-02-20 at 4 00 19 pm

So plot_ly(etm) would do something similar to this (automatically)

library(sf)
etm <- st_transform(etm, 3857)
band <- st_dimensions(etm)[["band"]]
n <- band$to - band$from + 1
ann <- list(x = 0.5, y = 1, yanchor = "bottom", xanchor = "middle", xref = "paper", yref = "paper", showarrow = FALSE)
plots <- lapply(seq_len(n), function(i) {
  z <- t(etm[[1]][,,i])
  ann$text <- paste(names(etm), i)
  plot_ly(z = z[seq.int(nrow(z), 1), ]) %>%
    layout(annotations = ann) %>%
    colorbar(title = i)
})
subplot(plots, nrows = 2, titleX = TRUE, shareX = TRUE, shareY = TRUE)

https://plot.ly/~cpsievert/23012.png

cc @jackparmer

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by studying the referenced stars::plot.stars() behavior and the shown plot_ly(etm) and subplot() examples. Identify the existing plot_ly and subplot entry points that handle structured data, then define completion as automatic plotting of stars objects with band panels and matching annotations, colorbars, and shared axes.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.