[metrics-bugs] #25264 [Metrics/Website]: Decide what graph to display when there's no data to graph

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Mar 12 14:22:09 UTC 2018


#25264: Decide what graph to display when there's no data to graph
-----------------------------+------------------------------
 Reporter:  karsten          |          Owner:  metrics-team
     Type:  enhancement      |         Status:  new
 Priority:  Low              |      Milestone:
Component:  Metrics/Website  |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:                   |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:                   |        Sponsor:
-----------------------------+------------------------------

Comment (by karsten):

 Replying to [comment:3 karsten]:
 > Replying to [comment:2 iwakeh]:
 > > For avoiding the 500 server error when trying to access the png (as
 reported in detail in #25468) an empty graph/png stating 'no data
 available for this parameter choice' should be generated.
 >
 > Sounds good. We'll also need such a static file in the PDF format. I'll
 create placeholders using R/ggplot2 in a bit. We just need to write the
 code to put them in.

 Attached. I generated these two files with the following code:

 {{{
 library(ggplot2)
 library(dplyr)
 library(tidyr)

 data.frame(x = c(0, NA), y = c(0, NA)) %>%
   filter(x != 0) %>%
   ggplot(aes(x = x, y = y)) +
   scale_x_continuous("") +
   scale_y_continuous("") +
   labs(caption = "The Tor Project - https://metrics.torproject.org/") +
   theme(plot.margin = margin(5.5, 11, 5.5, 5.5),
     plot.title = element_text(hjust = 0.5, margin = margin(b = 11), size =
 36),
     panel.background = element_rect(fill = NA)) +
   ggtitle("\n\n\n\nNo Data Available")
 ggsave(filename = "no-data-available.png", width = 8, height = 5, dpi =
 150)
 ggsave(filename = "no-data-available.pdf", width = 8, height = 5, dpi =
 150)
 }}}

 I can also write the code that returns these files, unless you'd like to
 do that.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25264#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the metrics-bugs mailing list