您使用express v4.x构建node.js应用程序,然后通过npm start启动您的应用程序.我的问题是如何停止应用程序?有没有停止?
编辑以在实现npm stop时包含错误
/home/nodetest2# npm stop
> nodetest2@0.0.1 stop /home/nodetest2
> pkill -s SIGINT nodetest2
pkill: invalid argument for option 's' -- SIGINT
npm ERR! nodetest2@0.0.1 stop: `pkill -s SIGINT nodetest2`
npm ERR! Exit status 2
Run Code Online (Sandbox Code Playgroud) 这对我很有意思.看下面的D3代码:
var scale = d3.scale.linear()
.domain([100, 500])
.range([10, 350]);
scale(100); //Returns 10
scale(300); //Returns 180
scale(500); //Returns 350
Run Code Online (Sandbox Code Playgroud)
是否存在比例倒数的函数?例如,
inverseScale(10); //Returns 100
inverseScale(180); //Returns 300
inverseScale(350); //Returns 500
Run Code Online (Sandbox Code Playgroud) 我正在学习D3.我知道简单的事情,比如散点图和所有.我的下一步是尝试一些简单的互动动作.例如,在我添加了一个svg后,生成了轴和网格,现在我希望通过单击svg画布中的一个点来创建一个圆.我想我必须记录点击点的坐标,然后用它的cx nad cy附加一个圆圈,但是怎么样?如何记录坐标?
我感谢你向我展示一个教程,给出一个提示或最好的例子.
如何通过更改文件d3访问来按需更新数据?例如,通过单击,它将从新数据文件中读取数据,并将更多节点添加到图形中,如AJAX.
我使用d3.tsv读取data.tsv,它是同一格式的许多文件之一.
我做了一个简单的图表来说明我的问题.提前致谢.
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var width = 400,
height = 200;
var x = d3.scale.linear().range([0, width]),
y = d3.scale.linear().range([height, 0]);
var svg = d3.select("body")
.append("svg")
.attr("width", width)
.attr("height", height);
d3.tsv("data.tsv", function(error, data) {
if (error) console.warn(error);
x.domain(d3.extent(data, function(q) {return q.xCoord;}));
y.domain(d3.extent(data, function(q) {return q.yCoord;}));
svg.selectAll(".dot")
.data(data)
.enter().append("circle")
.attr("r", 10)
.attr("cx", function(d) { return x(d.xCoord); })
.attr("cy", function(d) { return y(d.yCoord); })
});
</script>
<a href="#">update the graph</a>
Run Code Online (Sandbox Code Playgroud) 我有限的理解是分位数和四分位数是某种相似但完全不同的测量方式。我用谷歌搜索但找不到易于理解的解释。这里有一个与 D3 相关的问题,但还没有答案。
我的具体问题是我们什么时候应该使用分位数而不是四分位数,反之亦然?我感谢任何非专业术语的解释或琐碎的例子。谢谢!
我有一个需要内联 CKEditor 但没有工具栏的应用程序。对于内联 CKEditor 部分,我有:
CKEDITOR.disableAutoInline = true;
var editor = CKEDITOR.inline('editable', {on: {
instanceReady: function() {periodic();}
}});
var periodic = (function() {
var data, oldData;
return function() {
if ((data = editor.getData()) !== oldData) {
oldData = data;
$.post("update.php", {txt:data});
}
setTimeout(periodic, 1000);
};
})();
Run Code Online (Sandbox Code Playgroud)
然后对于工具栏隐藏部分我发现了这个:CKEditor 4 Inline: How to hidetoolbar ondemand?
//Whenever CKEditor loses focus, We will hide the corresponding toolbar DIV.
function hideToolBarDiv(event) {
// Select the correct toolbar DIV and hide it.
//'event.editor.name' returns the …Run Code Online (Sandbox Code Playgroud) 我已经整天尝试过了,还没有。我想以某种延迟的方式显示文本字符串。例如,首先显示“ a”,然后等待一秒钟,然后显示“ ab”,然后等待一秒,然后显示“ abc”,到目前为止,等等。
我使用D3进行显示,使用功能片从字母表生成部分文本字符串。我使用setTimeout或setInterval。没有办法。感谢您的帮助。这是我的代码:
<!DOCTYPE html>
<html>
<head>
<style>
text {
font: bold 48px monospace;
}
.enter {
fill: green;
}
.update {
fill: #333;
}
</style>
</head>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var alphabet = "abcdefghijklmnopqrstuvwxyz".split("");
var width = 1000,
height = 200;
var svg = d3.select("body")
.append("svg")
.attr("width", width)
.attr("height", height);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(32," + (height / 2) + ")");
function update(data) {
var text = svg.selectAll("text").data(data);
text.attr("class", "update");
text.enter().append("text") …Run Code Online (Sandbox Code Playgroud) d3.js ×5
ajax ×1
ckeditor ×1
graph ×1
interactive ×1
javascript ×1
node.js ×1
npm ×1
quantile ×1
setinterval ×1
settimeout ×1
statistics ×1