gpt4 book ai didi

javascript - concec.js 中 Conrec.contour 的参数是什么?

转载 作者:行者123 更新时间:2023-11-30 17:23:22 25 4
gpt4 key购买 nike

我正在尝试使用 d3.js 和 conrec.js 构建等高线图

在 Jason 的示例代码中 conrec.js , 我无法插入 Conrec 对象的 contour() 属性的每个参数应该是什么。这是他来自 github README 的例子:

var data = [[0, 1, 0], [1, 2, 1], [0, 1, 0]];
var c = new Conrec;
c.contour(data, 0, 2, 0, 2, [1, 2, 3], [1, 2, 3], 3, [0, 1, 2]);
// c.contours will now contain vectors in the form of doubly-linked lists.
// c.contourList() will return an array of vectors in the form of arrays.

在一般情况下,c.contour 的参数应该是什么还不清楚,因为零和二的语义在这里重载了。

我可以得到每个论点的一般描述吗?

最佳答案

这是源代码中的文档在这里 https://github.com/jasondavies/conrec.js/blob/master/conrec.js :

/**
* contour is a contouring subroutine for rectangularily spaced data
*
* It emits calls to a line drawing subroutine supplied by the user which
* draws a contour map corresponding to real*4data on a randomly spaced
* rectangular grid. The coordinates emitted are in the same units given in
* the x() and y() arrays.
*
* Any number of contour levels may be specified but they must be in order of
* increasing value.
*
*
* @param {number[][]} d - matrix of data to contour
* @param {number} ilb,iub,jlb,jub - index bounds of data matrix
*
* The following two, one dimensional arrays (x and y) contain
* the horizontal and vertical coordinates of each sample points.
* @param {number[]} x - data matrix column coordinates
* @param {number[]} y - data matrix row coordinates
* @param {number} nc - number of contour levels
* @param {number[]} z - contour levels in increasing order.
*/
Conrec.prototype.contour = function(d, ilb, iub, jlb, jub, x, y, nc, z) {

关于javascript - concec.js 中 Conrec.contour 的参数是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24719495/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com