You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by de...@apache.org on 2019/02/19 06:10:04 UTC

[incubator-echarts] branch fix/release-license updated: fix(sankey): fix third-party license

This is an automated email from the ASF dual-hosted git repository.

deqingli pushed a commit to branch fix/release-license
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/fix/release-license by this push:
     new ba33803  fix(sankey): fix third-party license
ba33803 is described below

commit ba33803024204e24c5a5bf47928b501d614f01b4
Author: deqingli <an...@gmail.com>
AuthorDate: Tue Feb 19 14:05:41 2019 +0800

    fix(sankey): fix third-party license
---
 src/chart/tree/layoutHelper.js | 66 +++++++++++++++++++++++++++++++++++-------
 1 file changed, 56 insertions(+), 10 deletions(-)

diff --git a/src/chart/tree/layoutHelper.js b/src/chart/tree/layoutHelper.js
index f7f94d8..405e623 100644
--- a/src/chart/tree/layoutHelper.js
+++ b/src/chart/tree/layoutHelper.js
@@ -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
+* <echarts/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/master/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/master/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/master/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/master/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/master/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/master/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;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org