benyamindsmith / starBliss

Create beautiful, print quality maps of the night sky in R
44 stars 2 forks source link

Set default linen_text parameters to have a nice format #2

Closed laresbernardo closed 1 year ago

laresbernardo commented 1 year ago

Really nice package. I have an enhancement suggestion: why don't you set the default values for line1_text, line2_text, and line3_text parameters like so:

  line1_text = location,
  line2_text = format(date, "%B %d, %Y"),
  line3_text= [not sure how to get this one but use default]"
benyamindsmith commented 1 year ago

Done.

Let me know if there are any other problems with this, otherwise I will close this issue.

laresbernardo commented 1 year ago
benyamindsmith commented 1 year ago

@laresbernardo could you show me the code you wrote which gave you the error?

laresbernardo commented 1 year ago

I simply passed a character value (date = "1991-03-27") instead of as.Date("1991-03-27")

benyamindsmith commented 1 year ago

@laresbernardo I see.

This is the fix that I have. This essentially runs as.Date(date) in the function to deal with varying formats.

Initially I wrote the code to only handle YMD formats.

Let me know how it works out on your end.

laresbernardo commented 1 year ago

Yes, "1991-03-27" is YMD format, but if it's simply set as a character value then it crashed. It seems to be fixed! Thanks

laresbernardo commented 1 year ago

Woops, closed but the coordinates default is not set yet (if you agree on setting it up of course)

benyamindsmith commented 1 year ago

@laresbernardo my bad! I wonder how its possible to do this. I'll look into it. If you find anything let me know!

benyamindsmith commented 1 year ago

@laresbernardo check out this fix.

The geocoder is set by default to ArcGIS so the default geocoordinates are slightly different from what you'll find if you look it up on Google.

 plot_starmap(location= "Caracas, Venezuala")

image

Let me know what you think!

laresbernardo commented 1 year ago

Good one, thanks! Really improved the UX here :)