首页 > 解决方案 > 字体不是粗体

问题描述

在下面的代码中(效果很好),当我将鼠标悬停在世界地图上的国家上时,我希望所有字体都是粗体或非粗体。正在发生的事情是根据以下示例 - 假设我将鼠标悬停在 USA 上然后我得到。562,079 人死亡 美国美国 病例数:30,211,178 人:320,635,163 人死亡人数百分比:v0.0097%

“Deaths United States”并不大胆。代码

   output$World_Map <- renderPlotly({
        l <- list(color = toRGB("grey"), width = 0.5)
        g <- list(
            showframe = FALSE,
            showcoastlines = FALSE,
            projection = list(type = "kavrayskiy7")
        )
        
        fig <- plot_geo(worldmap)
        fig <- fig %>% add_trace(
            z = ~ worldmap$Deaths,
            color = ~ worldmap$Deaths,
            colors = 'Reds',
            locations = ~ worldmap$Country_Alpha_Code,
            marker = list(line = l),
            hoverinfo = "text",
            text = ~ glue::glue(
                "Deaths: {Country.x} <b>{Country_Alpha_Code}<b>\nCases: {comma(Cases,digits=0)}<b>\nPopulation: {comma(Population,digits=0)}<b>\nDeaths % by Population: {comma(Deaths_Perc_Pop,digits=4)}%</b>"
            ),
            hovertemplate = "%{z:,0f}<extra>%{text}</extra>"
        )
        fig <-
            fig %>% colorbar(title = 'Deaths - Positive Cases Gradient', tickformat = ",0f")
        fig <-
            fig %>% layout(title = 'Covid19 Global Pandemic .... <br>Data Source:<a href="https://coronavirus.jhu.edu/">Johns Hopkins University of Medicine</a>',
                           geo = g)
        fig
    })
    

问候

标签: rshiny

解决方案


推荐阅读