Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

add more examples #5

Closed
timelyportfolio opened this issue Feb 11, 2015 · 17 comments
Closed

add more examples #5

timelyportfolio opened this issue Feb 11, 2015 · 17 comments

Comments

@timelyportfolio
Copy link
Contributor

I started working through some of the ggplot2 examples and doing the equivalent in rbokeh if it helps fill in the document examples.

https://gist.github.com/timelyportfolio/8300c43ac43d772600df

@timelyportfolio
Copy link
Contributor Author

Also added some lattice examples (from this book ) and modelled after these examples in rCharts+polycharts http://timelyportfolio.github.io/rCharts_lattice_book/polycharts_versions/gallery/figure1_02.html

@hafen
Copy link
Collaborator

hafen commented Feb 12, 2015

This is great! I'm traveling and in meetings - will get on and make more comments on this and others in a bit.

@hafen
Copy link
Collaborator

hafen commented Feb 13, 2015

These are great examples. I'm wondering if we should set up a gallery type of thing. I think something like bl.ocks.org would be cool - a collection of gists that generate a gallery. What do you think? Or going through the lattice and ggplot book examples might make for a good set of blog posts.

This exercise can also serve the purpose of helping us make note of shortcomings and can be the source of new issues. For example, making a GridPlot is a little too cumbersome right now.

@abresler
Copy link

Yes!! You can absolutely use this:

http://asbcllc.com/blog/2015/february/happy_valentines_day/

Have more coming too

Alex Bresler

ASBC LLLC
asbcllc.com
917-455-0239

abresler@asbcllc.com
@abresler
On Feb 13, 2015 12:26 PM, "hafen" notifications@github.com wrote:

These are great examples. I'm wondering if we should set up a gallery type
of thing. I think something like bl.ocks.org would be cool - a collection
of gists that generate a gallery. What do you think? Or going through the
lattice and ggplot book examples might make for a good set of blog posts.

This exercise can also serve the purpose of helping us make note of
shortcomings and can be the source of new issues. For example, making a
GridPlot is a little too cumbersome right now.


Reply to this email directly or view it on GitHub
#5 (comment).

@hafen
Copy link
Collaborator

hafen commented Feb 14, 2015

@abresler, that's beautiful :)

@timelyportfolio
Copy link
Contributor Author

Ok, here are a couple more examples.

https://gist.github.com/timelyportfolio/60c9676395f541d1d743

@hafen
Copy link
Collaborator

hafen commented Feb 17, 2015

Cool! Here's an example of how to use some of the fine axis control in your last example:

p %>%
  ly_points(
    as.character(source), as.character(target), MisLinks, size = 3, color = value
  ) %>%
  x_axis(major_label_text_font_size = "6pt", major_label_orientation = 90) %>%
  y_axis(major_label_text_font_size = "6pt")

@hafen
Copy link
Collaborator

hafen commented Feb 17, 2015

Need latest for that to work.

@timelyportfolio
Copy link
Contributor Author

works great. Love it.

@kaneplusplus
Copy link

When I click on p1 a new tab opens with the original graph. The old tab has p1 with the point I clicked on highlighted. Is this the expected behavior? Shouldn't I stay on the same tab and see only the point I clicked on highlighted?

@timelyportfolio
Copy link
Contributor Author

Try to reinstall to get newest version that disables tap tool

@hafen
Copy link
Collaborator

hafen commented Feb 17, 2015

@kaneplusplus, none of these examples should have the tap/click tool. I accidentally made every plot have taptool by default in a version from earlier today. If you install the latest, you should not see tap behavior anymore.

I need to add an example for using click to open url - will do this soon.

@hafen
Copy link
Collaborator

hafen commented Feb 17, 2015

What @timelyportfolio said :)

@kaneplusplus
Copy link

OK, thanks.

@hafen
Copy link
Collaborator

hafen commented Feb 17, 2015

@kaneplusplus, since I know tap is an important use case for you, here's an example. The basic idea is to have a variable with the url you want and then set url="@variable_name". Technically you should be able to do something like url="http://something/@variable_name" but I don't quite understand all the details yet.

## if not installed:
# devtools::install_github("hafen/housingData")
library(housingData)
library(dplyr)

a <- housing %>%
  filter(time == max(housing$time) & state == "MA") %>%
  filter(!is.na(medListPriceSqft)) %>%
  mutate(rank = rank(medListPriceSqft)) %>%
  mutate(url = sprintf("http://www.zillow.com/homes/%s_rb/", 
    gsub(" ", "-", paste(county, state))))

figure(title = "Real Estate Prices for Counties in MA, 2014-03-01",
  title_text_font_size = "11pt") %>%
  ly_points(rank, medListPriceSqft, data = a,
    hover = c(state, county, medListPriceSqft), url = "@url")

@kaneplusplus
Copy link

@hafen Nice! Thanks for the example.

@MySchizoBuddy
Copy link

For now you can add these examples in an examples folder of this repo. The examples can then be called from R.

@hafen hafen closed this as completed Jan 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants