首页 \ 问答 \ 为什么在骨干全局事件调度程序中使用名为“vent”的变量(Why use a variable named 'vent' in a backbone global event despatcher)

为什么在骨干全局事件调度程序中使用名为“vent”的变量(Why use a variable named 'vent' in a backbone global event despatcher)

当人们创建应用程序范围的事件调度程序时,我已经在很多地方看到过这种情况。

var vent = {};
_.extend(vent, Backbone.Events);

为什么每个人都使用'vent'这个名字。 在我看来,这是事件减去e。 他们是否使用它是因为事件是保留的工作?

事件调度员这样一个愚蠢名字的原因是什么? 这个名字有什么特别的意义吗?


I have seen this in numerous places now when people are creating an application wide event despatcher.

var vent = {};
_.extend(vent, Backbone.Events);

Why is everyone using the name 'vent'. It seems to me that it is event minus the e. Are they using it because event is a reserved work?

Any reasons for such a stupid name for an event despatcher? Is there some special meaning to this name?


原文:https://stackoverflow.com/questions/18718432
更新时间:2021-10-13 21:10

最满意答案

以下结果运作良好。

reshape库引入了melt命令,该命令将数据识别为ggplot可用的格式。

library(ggplot2)
library(reshape)
data=read.csv("out20",comment.char = "#",sep = "")
mdata=melt(data,id=c("Time"))
ggplot(mdata, aes(x=Time,y=value,group=variable,fill=variable)) + geom_area(position="fill")

The following ended up working well enough.

The reshape library pulls in the melt command which recognises the data into a format usable by ggplot.

library(ggplot2)
library(reshape)
data=read.csv("out20",comment.char = "#",sep = "")
mdata=melt(data,id=c("Time"))
ggplot(mdata, aes(x=Time,y=value,group=variable,fill=variable)) + geom_area(position="fill")

相关问答

更多
  • 您可以尝试将此添加到图表声明中,它将提取数据系列的名称(除了x)并将它们转换为一个大组: onrendered: function () { var seriesNames = this.data.targets.map (function (d) { return d.id; }).filter (function (sname) { return sname !== "x"; }); this.api.groups ([seriesNames] ...
  • 一个使用ggplot的例子: library(ggplot2) library(reshape2) dat <- data.frame( x = LETTERS[1:3], series1 = 1:3, series2 = 4:6) ggplot(melt(dat), aes(x=x, y=value, fill=variable, group=variable)) + geom_area() An example using ggplot: library(ggplot2) ...
  • 将b作为一个因素。 您还需要添加与fill美学相同的group美学。 (这告诉ggplot如何在不同的因子级别之间“连接点”。) ggplot(df, aes(x = b, y = a, fill = c, group = c)) + geom_area(position = 'stack') + theme(axis.text.x = element_text(angle = 90, hjust = 1)) 至于顺序,x轴将按因子水平的顺序排列。 要更改轴的顺序,只需更改因子级别的顺序 ...
  • 感谢您的评论, 代码veritas 。 通过进一步清理我的代码并处理我造成的数据过滤问题,我能够回答我自己的问题。 我已经更新了要点, 与上面相同的链接 ,以防它有任何类似问题的人。 萨拉 Thanks for your comment, in code veritas. I was able to answer my own question by further cleaning up my code and dealing with a data filtering issue that I had ...
  • 以下结果运作良好。 reshape库引入了melt命令,该命令将数据识别为ggplot可用的格式。 library(ggplot2) library(reshape) data=read.csv("out20",comment.char = "#",sep = "") mdata=melt(data,id=c("Time")) ggplot(mdata, aes(x=Time,y=value,group=variable,fill=variable)) + geom_area(position="fill" ...
  • 来自?stackpoly : col: Color to fill the polygons. If NULL, ‘rainbow’ will be called to generate the colors. If NA, the polygons will not be filled. 略微修改?stackpoly的示例: stackpoly(matrix(cumsum(testx),nrow=10),main="Test Stackpoly I", xaxlab=c( ...
  • 添加text和tooltip将为您提供所需内容: Plot <- ggplot(data=df2, aes(x=X, y=Value, fill=Label, text = paste("Value:", Value))) + geom_area(position='stack') ggplotly(Plot) ggplotly(tooltip = c("text", "x", "fill")) Adding text and tooltip will give you what you want: ...
  • 我没有在这里得到任何答案后在ggplot2邮件列表上问了这个问题,Winston Chang提出了一个解决方案: ggplot2 google group中的线程 I asked this question on the ggplot2 mailing list after not getting any answers here, and Winston Chang came up with a solution: Thread within ggplot2 google group
  • 我发现了很多: 绘制形状的人( http://www.dashingd3js.com/using-json-to-simplify-code ) 另一个绘制图形( http://bl.ocks.org/mbostock/4062045 ) 一篇有用的文章解释了与(out)AJAX的数据转换( http://empire5.com/development/d3-js-dynamic-bar-graphing-with-transitions-and-json/ ) 另外,看看这个问题, d3.js差异图表示例 ...
  • 问题是堆积面积图中数据中的每一行总和为100.然而,您的数据总和为每行中的不同值,并且每个日期的'Kermit'值>100 。 因此,当D3绘制数据集的所有路径时,它们不在图形的范围内。 要解决此问题,您需要初始化y轴的domain ,以便默认情况下不希望您的值在[1, 100]范围内。 初始化x轴域后,可以添加以下内容: // Find the value of the day with highest total value var maxDateVal = d3.max(data, function( ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)