跳到主要内容
NEUSNCP / 知识空间

博客

发现有价值的观点,记录自己的思考。

写博客
alpha

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. 警告解决方案

有时候,浏览器加载网站,在控制台会出现 jquery.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end users experience. For more help, check https://xhr.spec.whatwg.org/. 的警告,原因是在某个js 脚本中,又额外动态引用了其他 js ...

hxy

平台数据导出数据处理方法

目前,实验室平台提供用户关注关系API,导出数据格式为Json,为了方便大家在算法中使用,特此提供数据处理参考(页面停止维护,新版本请移驾: www.neusncp.com/api/ )。 格式: Json数据格式 在Python语言处理下提供一种数据处理方式,以NetworkX为例,代码如下: def load_json_data(path,attrs): ''' : Load data from Json file. :param path: :return: ''' G = nx.Graph() f...

hxy

D3 (Data-Driven Documents) Examples

D3.js 可以画出非常漂亮的图。如饼状图,树状图,网络图谱结构图,甚至地图等等。主要的原理就相当于 SVG (Scalable Vector Graphics, 可缩放矢量图形)里的JQuery,支持数据与DOM元素的绑定,目前最新版本问V4,官网地址为 http://d3js.org 看一个网络示例图: 具体实现过程如下: 首先在服务器端生成Json格式的数据,示例如下: # 定义加载数据方法 def load_data(): links = [] nodes = [] friends = db_se...