Skip to content

Commit 20daa20

Browse files
committed
- Adds ability for scripts/notice.js to check files with the .tsx file extension
- Adds attribution for `applyCubicBezierStyles`
1 parent cba22a8 commit 20daa20

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

NOTICE.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
281281
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
282282
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
283283

284+
---
285+
This product includes code in the function applyCubicBezierStyles that was
286+
inspired by a public Codepen, which was available under a "MIT" license.
287+
288+
Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
289+
MIT License http://www.opensource.org/licenses/mit-license.php
290+
284291
---
285292
This product includes code that is adapted from mapbox-gl-js, which is
286293
available under a "BSD-3-Clause" license.

src/dev/notice/generate_notice_from_source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface Options {
4141
* into the repository.
4242
*/
4343
export async function generateNoticeFromSource({ productName, directory, log }: Options) {
44-
const globs = ['**/*.{js,less,css,ts}'];
44+
const globs = ['**/*.{js,less,css,ts,tsx}'];
4545

4646
const options = {
4747
cwd: directory,

x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ function getLayoutOptions(nodeHeight: number): cytoscape.LayoutOptions {
7474
};
7575
}
7676

77+
/*
78+
* @notice
79+
* This product includes code in the function applyCubicBezierStyles that was
80+
* inspired by a public Codepen, which was available under a "MIT" license.
81+
*
82+
* Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
83+
* MIT License http://www.opensource.org/licenses/mit-license.php
84+
*/
7785
function applyCubicBezierStyles(edges: cytoscape.EdgeCollection) {
7886
edges.forEach((edge) => {
7987
const { x: x0, y: y0 } = edge.source().position();
@@ -83,6 +91,8 @@ function applyCubicBezierStyles(edges: cytoscape.EdgeCollection) {
8391
const z = Math.sqrt(x * x + y * y);
8492
const costheta = z === 0 ? 0 : x / z;
8593
const alpha = 0.25;
94+
// Two values for control-point-distances represent a pair symmetric quadratic
95+
// bezier curves joined to appear as a single cubic bezier curve:
8696
edge.style('control-point-distances', [
8797
-alpha * y * costheta,
8898
alpha * y * costheta,

0 commit comments

Comments
 (0)