plotly / plotly/plotly.R

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

オープン
#2,101 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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. リポジトリをフォークし、ブランチを切って変更します。
  4. 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 を短くまとめたダイジェスト。