Code Monkey home page Code Monkey logo

trakt-shiny's Introduction

tRakt-shiny

This is tRakt-shiny (dummy name) version 0.6.5.

Using the trakt.tv API to graph show data and whatevs.
To run it, use shiny::runGitHub(username = "jemus42", repo = "tRakt-shiny").
Note that this only works with trakt.tv API credentials set. See tRakt for further information. Maybe you'd rather look at trakt.jemu.name to see it live™.

Dependencies

When you clone this repository, sourceing global.R should automatically install any missing dependency it finds.

What this should be soon:

graphtv.kevinformatics.com, but with more R, more trakt.tv, and such and such.

trakt-shiny's People

Contributors

jemus42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

trakt-shiny's Issues

Properizzle the tooltip

Create function that takes the episode dataset as an argument, and returns the dataset with a new column including the html-tooltip for each episode.

It should contain the following columns' values at least:

  • epid
  • title
  • firstaired.string
  • rating

And probably also:

  • votes
  • id.tvdb

Which would need to be formatted appropriately and combined with <br />-tags because html 'n stuff.

Implement caching

First up: The way deployment to shinyapps.io works is that everything the application writes to disk does not survive consecutive deployments, i.e. the vm the app runs in gets destroyed and a new one is created. Therefore caching is even more temporary that one would assume.

However, I think we should create a cache dir, and every series dataset that gets pulled should be saved in the most efficient way (either via save or saveRDS, which would probably be more flexible) to said directory, and on startup the app should be able to compare the query (or download the search result and then compare id_tvdb or something) and if the dataset is present in cache, read the data from there.

We could also download some popular series' data and permanently commit it to the repository, as example data. This would probably be helpful for debugging purposes as well.

Enable URLs containing queries to directly trigger a datapull

I.e. for example /?show=True+Detective should insert True Detective in the textInput (as it does now) but also trigger a data update, which currently solely relies on the value of the actionButton being >= 0.
The goal would be to make it easier to share certain results.

Since the query would be evaluated when the actionButton is still at zero, it could be used as an additional argument to conditions that check if actionButton == 0.

Or something like that.

The application unexpectedly exited.

Searching for "once upon a time"

Checking if devtools is installed…
devtools is installed, skipping installation…
Loading devtools
Checking if tRakt is installed…
tRakt is installed, skipping installation…
Loading tRakt
Checking if shiny is installed…
shiny is installed, skipping installation…
Loading shiny
Checking if ggvis is installed…
ggvis is installed, skipping installation…
Loading ggvis
Checking if ggplot2 is installed…
ggplot2 is installed, skipping installation…
Loading ggplot2
Checking if rmarkdown is installed…
rmarkdown is installed, skipping installation…
Loading rmarkdown
Checking if plyr is installed…
plyr is installed, skipping installation…
Loading plyr
Checking if shinythemes is installed…
shinythemes is installed, skipping installation…
Loading shinythemes

Listening on http://127.0.0.1:51232
is.null(query_parsed$show):
TRUE
query_parsed$show is ''
Activate. url_show_query is ''
TRUE
Warnung: All formats failed to parse. No formats found.
Getting once-upon-a-time-1969
Warnung: All formats failed to parse. No formats found.
Warnung in max(show.episodes$season) :
  kein nicht-fehlendes Argument für max; gebe -Inf zurück
Warnung: Unhandled error in observer: Resultat wäre zu langer Vektor
observe({
    if (!(isActive())) {
        return(NULL)
    }
    if (input$btn_scale_y_range && input$btn_scale_y_variable != 
        "rating") {
        updateCheckboxInput(session, inputId = "btn_scale_y_range", 
            value = FALSE)
    }
    else if (input$btn_scale_y_zero && input$btn_scale_y_variable == 
        "rating") {
        updateCheckboxInput(session, inputId = "btn_scale_y_zero", 
            value = FALSE)
    }
    show <- isolate(show())
    if (is.null(show)) {
        return(NULL)
    }
    label_x <- names(btn.scale.x.choices[btn.scale.x.choices == 
        input$btn_scale_x_variable])
    label_y <- names(btn.scale.y.choices[btn.scale.y.choices == 
        input$btn_scale_y_variable])
    var_x <- input$btn_scale_x_variable
    var_y <- input$btn_scale_y_variable
    plot <- show$episodes %>% ggvis(x = as.name(var_x), y = as.name(var_y), 
        fill = ~season)
    plot <- plot %>% layer_points [... truncated]

Cache refresh?

When are the cached shows refreshed?
The walking dead seems to be two weeks behind in the plotted graphic for example.

Some elements don't render sometimes

Sometimes the show title / summary doesn't update,
sometimes the plot doesn't render until updated.

I don't know what's going on, but it's bad.

y-Axis scaling is dysfunctional

Should probably use checkboxInput, with some kind of

…ggvis stuff…
if (checkbox.value == TRUE){
scale_numeric… %>%
}
…

However, the %>%-piping doesn't work through if statements, so there will probably be the need for ggplot2-like statements in the form of

plot <- ggvis…
plot <- plot %>% morestuff
plot <- plot %>% evenmorestuff
return(plot)

¯_(ツ)_/¯

EDIT1: Come to think of it, the latter form of combining ggvis elements is probably a good idea anyway, since we'll probably have a few more plot options as user inputs. The more modular approach seems more appropriate in this case than the serial, straightforward piping mechanism.

clickable data-points in graphs

something like

ggvis() %>%
  ...
  handle_click(utils::browseURL("http://www.r-project.org")) %>%
  ...

should/could somehow provide clickable data-points.

Add selectizeInput with a list of cached shows

A selectizeInput() below the current textInput could have its choices consist of the titles of already cached shows, as to give suggestions on which show data too look at (and also giving an indicator of which shows have been searched for in a deployed instance).

However, since currently only the episode datasets are cached and their filenames consist of tvdb_ids, it would require to greatly expand or rewrite the current caching process, which, to be fair, is pretty basic as of now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.