plotly / plotly/plotly.R

Korean(UTF-8) encoding breaks when texts provided by `str_glue`

未關閉
#2,101 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
R
星號
2.7k
分支
641
PR 合併指標
30 天內沒有已合併 PR

描述


Korean(UTF-8) encoding breaks when texts provided by str_glue

Brief description of the problem
  • Korean(UTF-8) encoding breaks (it returns a unicode like string '<U...><U...>') in shiny application operated on docker
  • works properly with docker based on mac; does not with docker based on linux server
  • breaks only and if only when a plot including Korean texts that is provided with function str_glue is ported to plotly
  • Korean texts that is not related to the function str_glue does not break
docker envirionments
FROM rocker/shiny-verse:latest

# system libraries of general use
RUN apt-get update && apt-get install -y \
    sudo \
    pandoc \
    pandoc-citeproc \
    libcurl4-gnutls-dev \
    libcairo2-dev \
    libxt-dev \
    libssl-dev \
    libssh2-1-dev

### install R packages required
RUN R -e "install.packages(c('hms','devtools'))"
RUN R -e "devtools::install_version('shiny', version='1.6.0', dependencies=T)"
RUN R -e "devtools::install_version('shinydashboard', version='0.7.1', dependencies=T)"
RUN R -e "devtools::install_version('plotly', version='4.9.4.1', dependencies=T)"
RUN R -e "devtools::install_version('DT', version='0.19', dependencies=T)"
RUN R -e "devtools::install_version('tidyverse', version='1.3.1', dependencies=T)"
RUN R -e "devtools::install_version('data.table', version='1.14.2', dependencies=T)"
RUN R -e "devtools::install_version('scales', version='1.1.1', dependencies=T)"
RUN R -e "devtools::install_version('bdscale', version='2.0.0', dependencies=T)"
RUN R -e "devtools::install_version('hrbrthemes', version='0.8.0', dependencies=T)"
RUN R -e "devtools::install_version('showtext', version='0.9-4', dependencies=T)"
RUN R -e "devtools::install_version('stringi', version='1.7.3', dependencies=T)"
insert reprex here
font_add_google("Nanum Gothic")
showtext_auto()

df
# A tibble: 13 × 4
   col           TRT  CTRL total
   <chr>      <int> <int> <int>
 1 72365    25   152   177
 2 72368    25   143   168
 3 72369    25    54    79
 4 74927    25   151   176
 5 70647    25    93   118
 6 76992    25   111   136
 7 79735    25   106   131
 8 74516    25   161   186
 9 70920    25   125   150
10 78630    25   164   189
11 79495    21   125   146
12 79496    24   145   169
13 70105     0    66    66

p <- df %>%
    ggplot(aes(x = '', y = total, text = str_glue("ID: {col}\n처리군 건수: {TRT}\n전체 건수: {total}"))) +
    geom_boxplot(color = "gray") +
    geom_point(aes(x = '', y = total, color = TRT==0), size = 2.5, position = position_jitterdodge()) +
    scale_color_manual(values = c("#DA135F", "gray")) +
    xlab("") + ylab("") + guides(color = 'none') +
    theme(axis.ticks.x=element_blank(), axis.text.x=element_blank()) +
    theme_ipsum(base_family = "Nanum Gothic")
ggplotly(p, tooltip = c("text")) %>%
    layout(xaxis = list(title = "", visible = TRUE), showlegend = FALSE)

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 issue 中的 R reprex 開始,比較它在以 macOS 為基礎和以 Linux 為基礎的 Docker 環境中的行為。追蹤韓文工具提示文字從 str_glue 經過 ggplotly 和 plotly 的過程;完成的標準是韓文文字能正確顯示,而不是在 plotly 輸出中顯示為類似 Unicode 的字串。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
plotly, r
領域
data-visualization
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。