- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚开始使用 cubism.js
剥离示例代码,我能够显示两个指标..一个计算的 (kpi1) - 随机函数,一个来自 Cube (kpi2)。只要我将其更改为 1e3,它就可以在 1e4 的上下文步骤中完美运行,计算出的一个 - 随机 - 在 1s 的分辨率下显示良好,而来自 Cube 的一个根本不显示。
这有效:
var context = cubism.context()
.serverDelay(0)
.clientDelay(0)
.step(1e4)
.size(960);
var context = cubism.context()
.serverDelay(0)
.clientDelay(0)
.step(1e3)
.size(960);
<!DOCTYPE html>
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8">
<title>Dashboard</title>
</head><body><div id="body">
<div id="kpi1"></div>
<div id="kpi2"></div>
<script src="../d3.v2.js"></script>
<script src="../cubism.v1.js"></script>
<script>function random(name) {
var value = 0,
values = [],
i = 0,
last;
return context.metric(function(start, stop, step, callback) {
start = +start, stop = +stop;
if (isNaN(last)) last = start;
while (last < stop) {
last += step;
value = Math.max(-10, Math.min(10, value + .8 * Math.random() - .4 + .2 * Math.cos(i += .2)));
values.push(value);
}
callback(null, values = values.slice((start - stop) / step));
}, name);
}</script>
<script>
var context = cubism.context()
.serverDelay(0)
.clientDelay(0)
.step(1e4)
.size(960);
var foo = random("foo");
var cube = context.cube();
d3.select("#kpi1").call(function(div) {
div.selectAll(".horizon")
.data([foo])
.enter().append("div")
.attr("class", "horizon")
.call(context.horizon());
});
d3.select("#kpi2").call(function(div) {
div.selectAll(".horizon")
.data([cube.metric("median(cube_compute(ms))")])
.enter().append("div")
.attr("class", "horizon")
.call(context.horizon());
});
</script>
</body></html>
最佳答案
Cubism.js 支持任何步骤,但 Cube 后端系统仅支持以下五个步骤之一的存储指标聚合:
1e4 or 10 seconds
6e4 or 1 minute
3e5 or 5 minutes
36e5 or 1 hour
864e5 or 1 day
关于cubism.js - 如何更改 Cube 指标的步骤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13052877/
我喜欢 cubism.js,我们每天都在使用它 我正在为每个设备定义自定义尺寸图表,以利用我非常讨厌的全屏尺寸(手机与台式机) 我从其他堆栈溢出问题中了解到,无论何时调整窗口大小,您都可以执行以下操作
所以我的目标是绘制一些存储在 Backbone 集合中的实时指标。我有一个存储指标的主干集合,当我轮询后端服务器时它每秒都会更新。我的集合有一系列历史指标和一个“最新数据”字段,它是来自后端的最新数据
我爱Cubism.js 但我想实现演示中缺少的功能。 这就是需要查看选定时间和行的值。当我将鼠标悬停在图表上时 - 我想显示鼠标光标所在行的值(参见垂直线旁边的图片) 这怎么可能呢? 我有机会使用 C
TLDR:为什么在页面更新之前有一个暂停,导致图表中出现一个小的白色间隙? http://jsbin.com/ABoLaya/1 我最近发现了立体主义并被震撼了。所以我决定我的树莓派可以使用一些监控。
我的问题是标尺没有像屏幕截图中那样完全落在光标上,我不确定从哪里开始寻找以修复它。 有什么建议吗? 最佳答案 尺子的定位是absolute到它所包含的 div。因此,您需要确保您的 div 没有任何其
我正在尝试重置或清除 D3.js 立体图,以便它重新开始。这是代码: $(function(){ // create new cubism.js context to render v
这几天我一直在玩立体主义。在成功可视化实时数据后,现在我正在尝试可视化历史数据。 这是我的场景:我想为每个用户制作一个历史页面,每个水平条显示一周中的每一天。因为我每 10 分钟就有一次数据,所以 .
我刚开始使用 cubism.js 剥离示例代码,我能够显示两个指标..一个计算的 (kpi1) - 随机函数,一个来自 Cube (kpi2)。只要我将其更改为 1e3,它就可以在 1e4 的上下文步
我喜欢立体主义的用户体验,并希望在我们拥有的后端之上使用它。 我已经阅读了 API 文档和一些代码,其中大部分似乎都被提取了。我怎样才能开始准确地使用其他数据源? 我有大约 6k 台机器的数据存储,在
有人可以指出我应该调整什么以获得确定性色带的方向吗?例如,如果它们的颜色数组包含 6 种颜色,我希望值 10-30 始终转到第 5 个色带,50-80 始终转到第 6 个色带,依此类推。 (如果有人想
我正在尝试为我的 Graphite 数据创建实时仪表板。我希望它只显示最后几个小时的数据。我可以配置 Cubism 从 Graphite 中提取数据,但我无法创建过去一小时的轴。 Graphite 数
我想获得使用 cubism.js 的经验 我找到了这个数据集nyc real-time traffic我想要绘制图表。 我需要一些关于如何完成此任务的提示。我知道我可以使用python每隔N分钟查询一
我看到了立体主义图表,它们简直太棒了。我有一个包含 1000 个条目的大 JSON 文件,这些条目具有时间戳和值(整数)。立体主义能不能把这些画出来?!我似乎无法找到有关此的文档... 最佳答案 Cu
可以 cubism.js用从 server-sent events 收到的数据填充图形?如果是这样,这是否容易实现? 谢谢, /大卫 最佳答案 据我所知,Cubism 想要轮询——而且似乎完全围绕轮询
上周我完成了一个使用 d3.js 和 cubism.js 的网站。在开发过程中,我偶然发现了一些问题,但总是能够解决它们。在项目的最后一次 session 上,我的同事提出了在 Microsoft 的
我正在使用 cubism.js 绘制来自 JSON 对象的一些静态数据。我们希望能够显示一年的数据,每天都有一个点。我的解决方案部分工作,但我希望能够设置独立于今天日期的比例,即我想绘制从昨天到去年相
在介绍性示例中 http://bost.ocks.org/mike/cubism/intro/demo-stocks.html ,创建上下文的行是: var context = cubism.cont
有没有人知道可以让我执行以下操作的教程或示例:我正在将实时数据插入 mongodb,并希望通过使用 cubism.js 将其实时可视化为地平线图。可视化应该在数据插入数据库时发生。 最终结果将是一
是否有专门关于连接 WebSockets(或其他非轮询数据源)和 cubism.js 的教程? 特别是,我希望能够创建服务器数据流的实时图表,在视觉上类似于 cubism page 上的示例. 引用资
有人可以提供一些有关 cubism.js 中尺度和范围如何协同工作的见解吗? .call(context.horizon() .extent([-100, 100])
我是一名优秀的程序员,十分优秀!