psrc / psrcplot

Package for Creating PSRC consistent data visualizations with R
https://psrc.github.io/psrcplot/
GNU General Public License v3.0
2 stars 0 forks source link

Interactive source text #80

Open MrichardsPSRC opened 1 year ago

MrichardsPSRC commented 1 year ago

I am generating an interactive bar chart:

own_race_income_chart <-interactive_bar_chart(t=dt_2021_simprace,
                                               x="share", y="income_cat",
                                               fill="HRACE",
                                               pos="dodge", est="percent", moe=NULL,
                                               # href="ref_val", hrefnm="Region", hrefcl='#00716c',
                                               title="Regional Homeownership by Income and Race/Ethnicity",
                                               subtitle=NULL,
                                               source="U.S. Census Bureau, American Community Survey (ACS) 2021 1-Year Public Use Microdata Sample (PUMS)",
                                               dec = 2, color="psrc_light")

And the source information is overlapping the legend information: image

MrichardsPSRC commented 1 year ago
prison_pop_chart <-interactive_column_chart(t=prison_pop_imprisonment, 
                                            x="race-ethnicity", y="estimate", 
                                            fill="percent",
                                            pos="dodge", est="percent", moe=NULL,
                                            href=NULL, hrefnm=NULL, hrefcl=NULL,
                                            title="Washington State Population and Prison Percentages by Race/Ethnicity (2019)",
                                            # subtitle=2019,
                                            # source="The Color of Justice: Racial and Equity Disparity in State Prisons (The Sentencing Project), Bureau of Justice Statistics, U.S. Census Bureau",
                                            source=paste0("The Color of Justice: Racial and Equity Disparity in State Prisons (The Sentencing Project)","\n", "Bureau of Justice Statistics","\n", "U.S. Census Bureau"),
                                            dec = 0, color="psrc_dark")

image In this chart, I separated the three different sources into different lines and the indentations change, as well as overlapping the legend.