国内机场航线网络分析示例
3D效果示例
环路分析示例
通用3D网络分析示例
Shiny APP通过IFRAME嵌入网页的方案非常灵活,可以嵌入任何现存的传统WEB界面应用系统,从而扩充系统的功能,集成深度数据分析与展示的能力,盘活存量的软硬件与数据资产。
但Shiny APP与嵌入的网页窗口之间要能够通过javascript在程序的层面互相操作(流程与数据),实现真正的集成连通,嵌入才有意义。
浏览器有同源规则的安全限制,不同源的网页之间不能互相操作。Shiny APP与宿主网页一般是不同源的,即协议+域名+端口三项一般不完全一致,这里通过HTML5引入的跨文档通信 API(Cross-document messaging)来解决,这个API为window对象新增了一个window.postMessage方法,允许跨窗口通信,不论这两个窗口是否同源。
传入的参数可以用于为Shiny APP设定初始的运行状态,传出的参数可以向调用者报告APP运行的状态或结果,从而实现与嵌入环境的集成。
本示例先按《传入》按钮传入数据给嵌入的Shiny APP,记录调用的父窗口,然后才可以按《传出》按钮传出数据给父窗口。
通过Shiny.setInputValue(id, data)通知Shiny服务器端input变量的更新事件,Shiny的reactive与observe机制会被触发更新所有相关的变量与状态,但浏览器端的可视化控件,比如本例的selectInput等,是JS 的C3控件,不会自动更新,要由服务器端通知浏览器去更新,通过在observeEvent()中调用updateSelectInput(session, id, value = data)来完成。父窗口的页面源码包含了发消息给IFRAME中Shiny APP的javascript,可以在浏览器中查看页面的源码。
本例中要打开“记录点击的节点”开关选择节点,然后点击《传出》按钮传给父窗口。因为可视化分析网络要缩放、拖动,这时点击节点就不是选中。
国内机场列表
机场
Saertu Airport
Foshan Shadi Airport
Nanning Wuxu Airport
Xuzhou Guanyin Airport
Hefei Luogang International Airport
Nanjing Lukou Airport
Shenzhen Bao'an International Airport
Mangshi Airport
Nanchang Changbei International Airport
Chifeng Airport
Kunming Wujiaba International Airport
Guilin Liangjiang International Airport
Zhanjiang Airport
Bijie Feixiong Airport
Zhongwei Shapotou Airport
Taoxian Airport
Yinchuan Airport
Ganzhou Airport
Bao'anying Airport
Wuhan Tianhe International Airport
Sanya Phoenix International Airport
Ordos Ejin Horo Airport
Erenhot Saiwusu International Airport
Jinggangshan Airport
Lanzhou Zhongchuan Airport
Luoyang Airport
Xiangfan Airport
Zhangye Southeast Air Base
Changzhou Airport
Wuhai Airport
Zhoushan Airport
Chengdu Shuangliu International Airport
Fuzhou Changle International Airport
Meixian Airport
Chongqing Jiangbei International Airport
Jiagedaqi Airport
Bailian Airport
Yan'an Airport
Datong Airport
Dachuan Airport
Xilinhot Airport
Tangshan Sannühe Airport
Changbaishan Airport
Taiping Airport
Xiamen Gaoqi International Airport
Jiuhuashan Airport
Longjia Airport
Qianjiang Wulingshan Airport
Shanghai Hongqiao International Airport
Baise Youjiang Airport
Jiujiang Lushan Airport
Taiyuan Wusu Airport
Tunxi International Airport
Mudanjiang Hailang International Airport
Guangyuan Airport
Tongliao Airport
Qiqihar Sanjiazi Airport
Jixi Xingkaihu Airport
Guangzhou Baiyun International Airport
Yantai Laishan Airport
Nanping Wuyishan Airport
Jingdezhen Airport
Haikou Meilan International Airport
Baotou Airport
Yiwu Airport
Yanji Chaoyangchuan Airport
Yulin Airport
Zhuhai Airport
Lianshui Airport
Dongying Shengli Airport
Lintsang Airfield
Sunan Shuofang International Airport
Yancheng Airport
Quanzhou Airport
Ulanhot Airport
Jining Qufu Airport
Yaoqiang Airport
Changzhi Airport
Tianjin Binhai International Airport
Yichang Airport
Luzhou Airport
Huangyan Luqiao Airport
Dayong Airport
Hangzhou Xiaoshan International Airport
Beijing Nanyuan Airport
Heihe Airport
Changde Airport
Baita International Airport
Baoshan Yunduan Airport
Beihai Airport
Ningbo Lishe International Airport
Lijiang Airport
Lianyungang Airport
Beijing Capital International Airport
Wenzhou Yongqiang Airport
Nantong Airport
Liuting Airport
Dandong Airport
Zhoushuizi Airport
Lindu Airport
Changsha Huanghua International Airport
Anqing Airport
Xi'an Xianyang International Airport
Xining Caojiabu Airport
Shanghai - Pudong International Airport
Jinchuan Airport
Dongshan Airport
Longdongbao Airport
Lhasa Gonggar Airport
Yuncheng Guangong Airport
Fuyang Xiguan Airport
Jiamusi Airport
Shubuling Airport
Gu-Lian Airport
Shantou Waisha Airport
Weifang Airport
Zhengzhou Xinzheng International Airport
传出选中的节点: