Skip to content

Commit

Permalink
- Adds ability for scripts/notice.js to check files with the .tsx fil…
Browse files Browse the repository at this point in the history
…e extension

- Adds attribution for `applyCubicBezierStyles`
  • Loading branch information
ogupte committed Sep 2, 2020
1 parent cba22a8 commit 20daa20
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---
This product includes code in the function applyCubicBezierStyles that was
inspired by a public Codepen, which was available under a "MIT" license.

Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
MIT License http://www.opensource.org/licenses/mit-license.php

---
This product includes code that is adapted from mapbox-gl-js, which is
available under a "BSD-3-Clause" license.
Expand Down
2 changes: 1 addition & 1 deletion src/dev/notice/generate_notice_from_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface Options {
* into the repository.
*/
export async function generateNoticeFromSource({ productName, directory, log }: Options) {
const globs = ['**/*.{js,less,css,ts}'];
const globs = ['**/*.{js,less,css,ts,tsx}'];

const options = {
cwd: directory,
Expand Down
10 changes: 10 additions & 0 deletions x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ function getLayoutOptions(nodeHeight: number): cytoscape.LayoutOptions {
};
}

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

0 comments on commit 20daa20

Please sign in to comment.