-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
投稿: 一个访问量高达 1300 万的 shiny 应用的诞生故事 苏玮 #907
Conversation
感谢投稿,不知轩哥 @yixuan 有时间看下吗? |
湘云有空看下这篇吗?@XiangyunHuang |
@yufree 好的👌,这周末我会审一下 |
- 可视化 | ||
- shiny | ||
- dashboard | ||
forum_id: InfinityLoop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
论坛 ID forum_id 就用帖子 https://d.cosx.org/d/421731-covid-19dashboard 对应的 ID 怎么样?@Perfectizer
论坛 ID 和帖子链接的对应关系就是前面这一串数字,比如这里的 421731
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 68ca7df
forum_id: InfinityLoop | ||
--- | ||
|
||
本文主要分享一下我从1月底开始的一个用`shiny`制作的用来关注日本疫情动态的项目。项目本身为日文版`(https://covid-2019.live/)`,然后5月份左右开始逐步翻译成中`(/cn)`英文`(/en)`版本。项目所有代码和数据集全部开源[swsoyee/2019-ncov-japan](https://github.com/swsoyee/2019-ncov-japan)。只要Clone到本地,安装完所有需要的软件包即可本地启动。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shiny 之类的 R 包名称可以统一加粗 shiny,链接可以用一对尖括号包住 https://covid-2019.live/
英文类的字词,比如 Clone 可以汉化为克隆, commit 可以汉化为提交, dashboard 可以汉化为仪表盘,除了专有名词(比如 Github)外,建议尽量少中文英文混杂,下同
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
本文主要分享一下我从1月底开始的一个用`shiny`制作的用来关注日本疫情动态的项目。项目本身为日文版`(https://covid-2019.live/)`,然后5月份左右开始逐步翻译成中`(/cn)`英文`(/en)`版本。项目所有代码和数据集全部开源[swsoyee/2019-ncov-japan](https://github.com/swsoyee/2019-ncov-japan)。只要Clone到本地,安装完所有需要的软件包即可本地启动。 | ||
|
||
需要注意的是由于项目开发是本人利用工作之余时间赶制而成,我本人也不是R语言老手和shiny应用开发老手,代码质量和项目结构可能极其恐怖(能用就行),各位吐槽时希望能嘴下留情。如果大家能帮忙提出改进的PR当然是最好的了! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
作者大可不必这么谦虚,这么谦虚的话,我都要无地自容了。我相信大部分人第一眼看到的时候还是很惊艳的,会很想知道作者是怎么做到的,将想法变成一款数据产品。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 3a27054
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
总体上,作为一款 shiny 打造的数据产品,给人眼前一亮的视觉冲击是本文最显著的特色!其次,对于想要掌握背后技术的人,相信会毫不犹豫地去看作者的源码仓库。
另外文笔不好请大家多多包涵。文章对废话进行了标注,各位跳着看即可。 | ||
|
||
这个dashboard经过了数次迭代(GitHub的commit数量高达7000多次,去掉数据更新的类的commit外大概有数千次都是功能改善的结果),到现在它长成了下面这个样子: | ||
![Figure1](https://raw.githubusercontent.com/swsoyee/2019-ncov-japan/doc/www/doc/img/Figure1.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文字和图之间需要空行,这样更加美观,作者不妨看看预览效果 https://deploy-preview-907--cosx.netlify.app/2020/09/covid19-bulletin-board/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 68ca7df
2. 在尽可能多维度展示数据上下功夫; | ||
3. 注重动态互动,处理好疫情时间轴。 | ||
|
||
**下面主要是一些详细的个人思考流程,废话比较多不感兴趣的各位可以直接跳过。** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本段和下面那段都不是废话,很体现数据思维,甚至可以说是商业思维。数据收集、组织、管理是打造数据产品的基石,数据源头的可靠性、收集的规范性、组织的科学性、管理的合理性直接决定数据产品的开发效率以及应用价值
|
||
## 应用逻辑 | ||
|
||
可能对于一些老手来说下面的这些可能是初级问题,但由于非应用开发专业的前生信专业的渣渣的我来说也走过这个坑,作为经验还是想分享给大家,应用开发老手可以直接跳过。简单来说: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不管读者是高级用户还是初级用户,建议全把他们当作小白来介绍。
|
||
##### 1.2.4 确诊矩形树图 | ||
|
||
在很多疫情dashboard中,通常采用地图的形式展示每个地区的确诊人数情况(可用`leaflet`实现),但每个国家的所发表的确诊患者的详细程度不同,比如国内包括香港的dashboard可以实现精确到小区和楼栋,而日本通常最细只能获取到区级范围的信息,如果使用地图来展现的化,坐标定位就会是一个很大的问题,因此在这里我使用了矩形树图来进行可视化。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
处处体现了作者数据驱动的思维,选择合适的图形来展示数据并不是人人都具备的能力
|
||
![Figure17](https://raw.githubusercontent.com/swsoyee/2019-ncov-japan/doc/www/doc/img/Figure17.png) | ||
|
||
接下来是PCR检测人数、康复和新冠咨询热线的接线情况等。在`echarts4r`下支持图例点击(显示/隐藏)效果,而在切换的过程中会有**默认过渡动画**效果,个人认为这一点比`plotly`更为出色。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议单独开辟一节的篇幅介绍在整个项目的技术实现过程中积累起来的宝贵经验。建议正文主要以图文并茂的方式陈述功能、内容、想法和创意,借助数据思维给大家讲一个故事。
另外,有一个问题就是 shinydashboardPlus 包的函数 |
|
||
![Figure21](https://raw.githubusercontent.com/swsoyee/2019-ncov-japan/doc/www/doc/img/Figure21.png) | ||
|
||
右侧为一个关于确诊患者去向的Sankey图。用于显示每日确诊患者的流向(症状的有无轻重、是否在住院、出院和死亡等信息)。但由于厚生劳动省所发表的数据格式有过多次变更,而上述信息已经不再进行详细公布,因此这个Sankey图可以说已经可有可无了。待以后有时间再进行修正。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sankey图可以改为桑基图
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 8459a69
|
||
##### 1.2.5 详细数值栏 | ||
|
||
在全国数据总览的`box`中的底部,使用`shinydashboardPlus`的`DescriptionBlock`制作了一排用于展示主要数据的底栏。一开始出于全面展示日本境内的疫情状况(包括医疗资源应对等)的目的,同时将公主号游轮的数据纳入了统计范围当中了(根据WHO的标准,公主号游轮单独进行了统计而不并作日本的数据)。因此在这里为了说明这一情况,把日本国内的计数和游轮进行分开统计以免造成误解。此外使用`shinyBS`中的`bsTooltip`进行一些额外信息的加注。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 建议全文 R 包都加粗表示,比如 shinydashboardPlus
- 建议 R 函数都用一对反引号包裹,且加一对英文小括号 (),比如
DescriptionBlock()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e0f103b
@XiangyunHuang 感谢黄编辑,我已润色完毕,shinydashboardPlus的版本升级不兼容问题也已经解决。 |
@swsoyee 太好了!我去安排人编辑一下微信端 |
@swsoyee 可以直接提交PR修改成员数据文件 https://github.com/cosname/cosx.org/blob/master/data/members.yaml, 它是个 YAML 格式,插入的位置根据你的姓名的拼音字母顺序来 |
@XiangyunHuang 感谢!我也追加添加了自己的个人信息 |
@swsoyee 👍,那我们晚上8点半,正式推送啦! @Perfectizer 麻烦微博也同步推广一下 |
@yufree 那我先合并到主库了,生成正式主站链接,微博可以下午或晚上都可以发 |
@XiangyunHuang 居然有这种事……这个版本明明更新的😭正文也修改了这么多,不好意思给大家添麻烦了…… |
@swsoyee 微信后台检测相似度很高,不能以原创文章发出来 |
印象中微信转载时可以做一定修改吧?是不是要开白名单之类,以后已经微信原创的文章再投主站应加上白名单放行的要求。 |
文章若在其它媒体上发过,应该提前告知我们,这样也可以提前和相关媒体联系获取权限 @swsoyee 你是否可以联系之前发过的公众号,让他们给我们开通微信公众号的白名单,把修订版本发出去。你方便加我的微信号吗?我的是 Sophorae |
@XiangyunHuang @yufree 非常抱歉给大家添麻烦了。我已经邮件联系之前的公众账号开放白名单看能不能把修订版发出去了。
另:或许是否考虑把这个添加到PR模版中去更方便一下。 |
非常感谢您的PR, 如果您是在为主站投稿, 请将PR的标题改为"投稿:标题+作者的形式",如:
"投稿: 数据通灵术 杜亚磊"
并保留下面的内容.
forum_id
加入文章投稿指南在这里,有任何问题,可以直接在PR留言,其他问题请联系: editor@cos.name。