Web 应用程序的热图工具
I have a client that want to have a web app I'm building for them display heat maps of the data.
I haven't worked with heat maps at all and I was wondering if anyone knew of some good tools for generating them.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
热图通常用来代替更传统的术语:内核密度估计器。 如果您需要动态计算这些,请考虑 GRASS GIS - 具体来说,v.kernel 或 v.neighbors 模块。 这些将在某些目标分辨率(由当前的 区域设置)。 GRASS GIS 可以通过 Python 代码进行控制,因此围绕底层模块编写一个 Python 包装器将是一件简单的事情,它可以将结果导出到您的 Web 应用程序。
对于小型数据集,R 项目具有多个用于读取/写入空间数据和计算核密度估计的函数。
Heat maps are often used in place of a more conventional term: kernel density estimators. If you need to compute these on the fly, consider GRASS GIS- specifically, the v.kernel or v.neighbors modules. These will generate a continuous estimate (i.e. raster surface) of density, at some target resolution (defined by the current region settings). GRASS GIS can be controlled via Python code, so it would be a simple matter to write a Python wrapper around the underlying modules, that could export the results to your web application.
For small datasets, the R project has several functions for reading/writing spatial data, and computing kernel density estimates.
我意识到这是一篇非常非常老的帖子 - 但下一个偶然发现此页面的人可能会尝试 gheat 用于网络应用程序中的热图。 如果您碰巧使用 Django 和 Google App Engine,则有这些后端的端口。
I realize this is an old, old post -- but the next guy to stumble across this page might try gheat for heatmaps in webapps. There are ports for Django and Google App Engine, if you happen to be using those backends.
我假设这是每个数据点具有三个值的数据 - 我们将它们称为 x、y 和 z。
如果 x 和 y 是空间坐标,那确实会有帮助,因为这会让事情变得更容易。
无论如何,生成 x x y 的位图(适当缩放)。
对于数据中的每个 x 和 y 对,将 z 缩放到 0 到 1 之间(或 0 以及地图中的任意颜色),并将 z 绘制为由该值表示的颜色。
例如,一个简单的贴图可以只使用 RGB 的 R 部分,在这种情况下,红色就有 256 个刻度。
最有可能的是,您想要一些更奇特的东西,但您应该能够理解这个想法。
如果您的数据点分散,您可以将它们绘制为占据空间的矩形,或者在它们之间平滑插值。
注意:这里有一个基于网络的工具。 我发现它来自关于热图的维基百科文章。 还有一个 java 也从那里链接。
I'll assume this is data with three values per data-point - we'll call them x, y and z.
It would really help if x and y were spatial coordinates as that makes things easier.
Anyway, generate a bitmap of x by y (scaled appropriately).
For each x and y pair in the data, scale z to between 0 and 1 (or 0 and however many colours you have in your map), and plot z as a colour represented by that value.
E.g. a simple map could just use the R portion of RGB, in which case you'd have 256 graduations for your red.
Most likely, you'd want something more fancy, but you should be able to get the idea.
If your datapoints are spread apart, you can either plot them as rectangles that take up the space, or smoothly interpolate between them.
NOTE: THere is a web-based tool that does it here. I found it linked from the Wikipedia article on heatmaps. There's a java one too linked from there too.
如果您想在客户端生成热图(使用 JavaScript),我可以推荐 heatmap.js 给你。 它使用 HTML5 Canvas 元素生成动态网页热图,您可以随时新添加数据并刷新热图。
If you want to generate heatmaps on the clientside (with JavaScript) I can recommend heatmap.js to you. It uses the HTML5 Canvas element to generate dynamic web heatmaps, you can new add data at any time and the heatmaps refresh.
Pyheat 是 python 中另一个用于构建热图的好库。
JJ 的回复中已经提到了 Gheat
Pyheat is another good library in python for building heatmaps.
Gheat is already mentioned in a reply by J.J.
我有一个引人注目的 PC 和移动网页热图工具值得推荐:http://miapex.com
I have a compelling heatmaps tool for both PC and mobile web pages to recommend: http://miapex.com
我可以推荐我自己的 jQuery 插件吗?
jQuery Hottie 可以轻松地采用正常标记并添加背景颜色,如下所示:
Might I suggest my own jQuery plugin?
jQuery Hottie makes it easy to take normal markup and add a background color like so: