提交 36ce2a17 编写于 作者: S sushuang

Fix/release license (#9938)

* Tweak the descriptions of the thrid-party license.
上级 4d1a2262
......@@ -210,15 +210,14 @@ Apache ECharts Subcomponents:
The Apache ECharts project contains subcomponents with separate copyright
notices and license terms. Your use of the source code for these
subcomponents is subject to the terms and conditions of the following
subcomponents is also subject to the terms and conditions of the following
licenses.
BSD 3-Clause (d3.js):
The following files embed [d3.js](https://github.com/d3/d3) BSD 3-Clause:
`src/chart/treemap/treemapLayout.js`,
`src/chart/tree/layoutHelper.js`,
`src/chart/graph/forceHelper.js`,
`src/util/array/nest.js`,
`src/util/number.js`,
`src/scale/Time.js`,
See `licenses/LICENSE-d3` for details of the license.
`/src/chart/treemap/treemapLayout.js`,
`/src/chart/tree/layoutHelper.js`,
`/src/chart/graph/forceHelper.js`,
`/src/util/number.js`,
`/src/scale/Time.js`,
See `/licenses/LICENSE-d3` for details of the license.
......@@ -18,10 +18,13 @@
*/
/*
* The layout implementation references to d3.js. The use of
* the source code of this file is also subject to the terms
* and consitions of its license (BSD-3Clause, see
* <echarts/src/licenses/LICENSE-d3>).
* A third-party license is embeded for some of the code in this file:
* Some formulas were originally copied from "d3.js" with some
* modifications made for this project.
* (See more details in the comment of the method "step" below.)
* The use of the source code of this file is also subject to the terms
* and consitions of the license of "d3.js" (BSD-3Clause, see
* </licenses/LICENSE-d3>).
*/
import * as vec2 from 'zrender/src/core/vector';
......@@ -53,26 +56,10 @@ export function forceLayout(nodes, edges, opts) {
for (var i = 0; i < nodes.length; i++) {
var n = nodes[i];
if (!n.p) {
// Use the position from first adjecent node with defined position
// Or use a random position
// From d3
// if (n.edges) {
// var j = -1;
// while (++j < n.edges.length) {
// var e = n.edges[j];
// var other = adjacentNode(n, e);
// if (other.p) {
// n.p = vec2.clone(other.p);
// break;
// }
// }
// }
// if (!n.p) {
n.p = vec2.create(
width * (Math.random() - 0.5) + center[0],
height * (Math.random() - 0.5) + center[1]
);
// }
n.p = vec2.create(
width * (Math.random() - 0.5) + center[0],
height * (Math.random() - 0.5) + center[1]
);
}
n.pp = vec2.clone(n.p);
n.edges = null;
......@@ -97,6 +84,12 @@ export function forceLayout(nodes, edges, opts) {
nodes[idx].fixed = false;
},
/**
* Some formulas were originally copied from "d3.js"
* https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js
* with some modifications made for this project.
* See the license statement at the head of this file.
*/
step: function (cb) {
var v12 = [];
var nLen = nodes.length;
......
......@@ -18,23 +18,27 @@
*/
/*
* The tree layout implementation references to d3.js
* (https://github.com/d3/d3-hierarchy). The use of the source
* code of this file is also subject to the terms and consitions
* of its license (BSD-3Clause, see <echarts/src/licenses/LICENSE-d3>).
* A third-party license is embeded for some of the code in this file:
* The tree layoutHelper implementation was originally copied from
* "d3.js"(https://github.com/d3/d3-hierarchy) with
* some modifications made for this project.
* (see more details in the comment of the specific method below.)
* The use of the source code of this file is also subject to the terms
* and consitions of the licence of "d3.js" (BSD-3Clause, see
* </licenses/LICENSE-d3>).
*/
/**
* @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing
* the tree.
* @see https://github.com/d3/d3-hierarchy
*/
import * as layout from '../../util/layout';
/**
* Initialize all computational message for following algorithm
* @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree
* Initialize all computational message for following algorithm.
*
* @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree.
*/
export function init(root) {
root.hierNode = {
......@@ -75,10 +79,16 @@ export function init(root) {
}
/**
* The implementation of this function was originally copied from "d3.js"
* <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*
* Computes a preliminary x coordinate for node. Before that, this function is
* applied recursively to the children of node, as well as the function
* apportion(). After spacing out the children by calling executeShifts(), the
* node is placed to the midpoint of its outermost children.
*
* @param {module:echarts/data/Tree~TreeNode} node
* @param {Function} separation
*/
......@@ -110,7 +120,13 @@ export function firstWalk(node, separation) {
/**
* The implementation of this function was originally copied from "d3.js"
* <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*
* Computes all real x-coordinates by summing up the modifiers recursively.
*
* @param {module:echarts/data/Tree~TreeNode} node
*/
export function secondWalk(node) {
......@@ -125,7 +141,8 @@ export function separation(cb) {
}
/**
* Transform the common coordinate to radial coordinate
* Transform the common coordinate to radial coordinate.
*
* @param {number} x
* @param {number} y
* @return {Object}
......@@ -139,7 +156,8 @@ export function radialCoordinate(x, y) {
}
/**
* Get the layout position of the whole view
* Get the layout position of the whole view.
*
* @param {module:echarts/model/Series} seriesModel the model object of sankey series
* @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call
* @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view
......@@ -156,6 +174,12 @@ export function getViewRect(seriesModel, api) {
/**
* All other shifts, applied to the smaller subtrees between w- and w+, are
* performed by this function.
*
* The implementation of this function was originally copied from "d3.js"
* <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*
* @param {module:echarts/data/Tree~TreeNode} node
*/
function executeShifts(node) {
......@@ -173,6 +197,11 @@ function executeShifts(node) {
}
/**
* The implementation of this function was originally copied from "d3.js"
* <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*
* The core of the algorithm. Here, a new subtree is combined with the
* previous subtrees. Threads are used to traverse the inside and outside
* contours of the left and right subtree up to the highest common level.
......@@ -180,6 +209,7 @@ function executeShifts(node) {
* one of the greatest uncommon ancestors using the function nextAncestor()
* and call moveSubtree() to shift the subtree and prepare the shifts of
* smaller subtrees. Finally, we add a new thread (if necessary).
*
* @param {module:echarts/data/Tree~TreeNode} subtreeV
* @param {module:echarts/data/Tree~TreeNode} subtreeW
* @param {module:echarts/data/Tree~TreeNode} ancestor
......@@ -233,6 +263,7 @@ function apportion(subtreeV, subtreeW, ancestor, separation) {
* This function is used to traverse the right contour of a subtree.
* It returns the rightmost child of node or the thread of node. The function
* returns null if and only if node is on the highest depth of its subtree.
*
* @param {module:echarts/data/Tree~TreeNode} node
* @return {module:echarts/data/Tree~TreeNode}
*/
......@@ -245,6 +276,7 @@ function nextRight(node) {
* This function is used to traverse the left contour of a subtree (or a subforest).
* It returns the leftmost child of node or the thread of node. The function
* returns null if and only if node is on the highest depth of its subtree.
*
* @param {module:echarts/data/Tree~TreeNode} node
* @return {module:echarts/data/Tree~TreeNode}
*/
......@@ -256,6 +288,7 @@ function nextLeft(node) {
/**
* If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.
* Otherwise, returns the specified ancestor.
*
* @param {module:echarts/data/Tree~TreeNode} nodeInLeft
* @param {module:echarts/data/Tree~TreeNode} node
* @param {module:echarts/data/Tree~TreeNode} ancestor
......@@ -267,7 +300,14 @@ function nextAncestor(nodeInLeft, node, ancestor) {
}
/**
* Shifts the current subtree rooted at wr. This is done by increasing prelim(w+) and modifier(w+) by shift.
* The implementation of this function was originally copied from "d3.js"
* <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*
* Shifts the current subtree rooted at wr.
* This is done by increasing prelim(w+) and modifier(w+) by shift.
*
* @param {module:echarts/data/Tree~TreeNode} wl
* @param {module:echarts/data/Tree~TreeNode} wr
* @param {number} shift [description]
......@@ -281,6 +321,12 @@ function moveSubtree(wl, wr, shift) {
wl.hierNode.change += change;
}
/**
* The implementation of this function was originally copied from "d3.js"
* <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*/
function defaultSeparation(node1, node2) {
return node1.parentNode === node2.parentNode ? 1 : 2;
}
......@@ -18,11 +18,13 @@
*/
/*
* The treemap layout implementation references to the treemap
* layout of d3.js (d3/src/layout/treemap.js in v3). The use of
* the source code of this file is also subject to the terms
* and consitions of its license (BSD-3Clause, see
* <echarts/src/licenses/LICENSE-d3>).
* A third-party license is embeded for some of the code in this file:
* The treemap layout implementation was originally copied from
* "d3.js" with some modifications made for this project.
* (See more details in the comment of the method "squarify" below.)
* The use of the source code of this file is also subject to the terms
* and consitions of the license of "d3.js" (BSD-3Clause, see
* </licenses/LICENSE-d3>).
*/
import * as zrUtil from 'zrender/src/core/util';
......@@ -151,8 +153,12 @@ export default {
/**
* Layout treemap with squarify algorithm.
* @see https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf
* The implementation references to the treemap layout of d3.js.
* The original presentation of this algorithm
* was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk
* <https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf>.
* The implementation of this algorithm was originally copied from "d3.js"
* <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/layout/treemap.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*
* @protected
......
......@@ -18,11 +18,16 @@
*/
/*
* The `scaleLevels` references to d3.js. The use of the source
* code of this file is also subject to the terms and consitions
* of its license (BSD-3Clause, see <echarts/src/licenses/LICENSE-d3>).
* A third-party license is embeded for some of the code in this file:
* The "scaleLevels" was originally copied from "d3.js" with some
* modifications made for this project.
* (See more details in the comment on the definition of "scaleLevels" below.)
* The use of the source code of this file is also subject to the terms
* and consitions of the license of "d3.js" (BSD-3Clause, see
* </licenses/LICENSE-d3>).
*/
// [About UTC and local time zone]:
// In most cases, `number.parseDate` will treat input data string as local time
// (except time zone is specified in time string). And `format.formateTime` returns
......@@ -171,7 +176,12 @@ zrUtil.each(['contain', 'normalize'], function (methodName) {
};
});
// Steps from d3, see the license statement at the top of this file.
/**
* This implementation was originally copied from "d3.js"
* <https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/time/scale.js>
* with some modifications made for this program.
* See the license statement at the head of this file.
*/
var scaleLevels = [
// Format interval
['hh:mm:ss', ONE_SECOND], // 1s
......
......@@ -17,6 +17,15 @@
* under the License.
*/
/*
* A third-party license is embeded for some of the code in this file:
* The method "quantile" was copied from "d3.js".
* (See more details in the comment of the method below.)
* The use of the source code of this file is also subject to the terms
* and consitions of the license of "d3.js" (BSD-3Clause, see
* </licenses/LICENSE-d3>).
*/
import * as zrUtil from 'zrender/src/core/util';
var RADIAN_EPSILON = 1e-4;
......@@ -439,39 +448,9 @@ export function nice(val, round) {
}
/**
* BSD 3-Clause
*
* Copyright (c) 2010-2015, Michael Bostock
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * The name Michael Bostock may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @see <https://github.com/mbostock/d3/blob/master/src/arrays/quantile.js>
* @see <http://en.wikipedia.org/wiki/Quantile>
* This code was copied from "d3.js"
* <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
* See the license statement at the head of this file.
* @param {Array.<number>} ascArr
*/
export function quantile(ascArr, p) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册