d3.js - 将用户评论存储到 d3js 图表中的数据点

标签 d3.js user-feedback collective-intelligence

我们需要找到或从头开始构建一个工具,用于收集用户对他们查看的图表的反馈。科学家评论一些获得的分布就是一个典型的例子。一般来说,这应该是某种针对d3js

的集体讨论层

我想,这个想法并不新鲜,几年前我什至看到过原型(prototype)。谁能指出可能有用的现有解决方案或框架?

最简单的用例 - Bob 看到 d3js 散点图并观察到左上角的奇怪异常值 A。他点击它并写下评论——“这次观察的所有条件都正常吗?”。当 John 进入系统并单击 A 时,他可以阅读评论并回复 smth,例如“这只是我的猫跑过键盘”。

这个逻辑可以有很多扩展,所以最好使用现有的工具。

最佳答案

如果评论必须在一个点上完成,你可以考虑在 json 中组织数据,例如

{
  "x":10, 
  "y":20, 
  "comments":[
               {
               "name":"Bob", 
               "content":"Was all conditions normal for this observation?",
               "replies":[
                           {
                            "name":"John",
                            "content":"That's just my cat who ran over keyboard",
                            "replies":null
                            }
                         ]
               },
               {
               "name":"indy", 
               "content":"ok for me",
               "replies":null
               }
             ]
}

这样“评论”部分可以通过点击点(假设是一个圆圈)来填充,就像

d3.selectAll("circle") // data are already bind here providing the d.x and d.y values
  .on("click",funtion(d){
      d3.select("#node_where_I_want_the_comment_form")
        .append("form") //... the user sets name and content
})

然后用名称和内容设置d.comment=。这并不简单,但我建议使用 https://www.mongodb.org/存储这种无模式数据。看:

http://docs.mongodb.org/ecosystem/use-cases/storing-comments/

关于d3.js - 将用户评论存储到 d3js 图表中的数据点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23417264/

相关文章:

d3.js - 如何在 nvd3 分组多条形图中的分组条形图中的条形之间添加空间?

javascript - d3.js 的堆积条形图 .offset() 值

javascript - JS下载图片并添加文字

android - 谷歌开发者控制台 : How to see all ratings in review list?

c++ - 返回一个整数以确定显示哪个 switch 语句

java - 在 Lucene 中编写 Tokenizer 的正确方法

Python 和集体智慧

collective-intelligence - 集体智慧如何超越专家的观点?

d3.js - 使用 d3.js 缩放和平移以太平洋为中心的墨卡托 map