From 180e24fb859ccc36e23908b9afd60bbc5ac43923 Mon Sep 17 00:00:00 2001 From: Emily Reif Date: Wed, 6 Nov 2019 13:36:41 -0500 Subject: [PATCH 1/4] updating umap version --- third_party/js.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/js.bzl b/third_party/js.bzl index c63b6bb94e7..a736b44c188 100644 --- a/third_party/js.bzl +++ b/third_party/js.bzl @@ -212,8 +212,8 @@ def tensorboard_js_workspace(): licenses = ["notice"], # Apache License 2.0 sha256_urls = { "85a2ff924f1bf4757976aca22fd0efb045d9b3854f5a4ae838c64e4d11e75005": [ - "http://mirror.tensorflow.org/unpkg.com/umap-js@1.0.5/lib/umap-js.min.js", - "https://unpkg.com/umap-js@1.0.5/lib/umap-js.min.js", + "http://mirror.tensorflow.org/unpkg.com/umap-js@1.2.2/lib/umap-js.min.js", + "https://unpkg.com/umap-js@1.2.2/lib/umap-js.min.js", ], }, ) From 266ef02b6137be6859b54c8345f737ac5e424ede Mon Sep 17 00:00:00 2001 From: Emily Reif Date: Fri, 8 Nov 2019 08:52:01 -0500 Subject: [PATCH 2/4] updating hash --- third_party/js.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/js.bzl b/third_party/js.bzl index a736b44c188..d19b50348b5 100644 --- a/third_party/js.bzl +++ b/third_party/js.bzl @@ -211,7 +211,7 @@ def tensorboard_js_workspace(): # no @license header licenses = ["notice"], # Apache License 2.0 sha256_urls = { - "85a2ff924f1bf4757976aca22fd0efb045d9b3854f5a4ae838c64e4d11e75005": [ + "035fede477f10b909dd64a2ea01c031149ee523f54fb9bbe48a170eb04d53825": [ "http://mirror.tensorflow.org/unpkg.com/umap-js@1.2.2/lib/umap-js.min.js", "https://unpkg.com/umap-js@1.2.2/lib/umap-js.min.js", ], From 4177a406f368160b8fb2c9fc5c33c5dbb3557c8c Mon Sep 17 00:00:00 2001 From: Emily Reif Date: Tue, 3 Dec 2019 16:37:14 -0500 Subject: [PATCH 3/4] updating comment in umap.d.ts --- .../plugins/projector/vz_projector/umap.d.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tensorboard/plugins/projector/vz_projector/umap.d.ts b/tensorboard/plugins/projector/vz_projector/umap.d.ts index 5232848ad21..95776aa0bf1 100644 --- a/tensorboard/plugins/projector/vz_projector/umap.d.ts +++ b/tensorboard/plugins/projector/vz_projector/umap.d.ts @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -// TODO(@andycoenen): Figure out a way to properly import the .d.ts file -// generated in the umap-js build into the tensorboard build system -// https://raw.githubusercontent.com/PAIR-code/umap-js/1.0.3/lib/umap-js.d.ts +// TODO(@andycoenen): Figure out a way to properly import the .d.ts file. +// This version is currently a hand-picked subset of the API that is sufficient +// for what we use. type DistanceFn = (x: Vector, y: Vector) => number; -type EpochCallback = (epoch: number) => boolean | void; +type EpochCallback = (epoch: number) => boolean|void; type Vector = number[]; type Vectors = Vector[]; interface UMAPParameters { @@ -28,12 +28,10 @@ interface UMAPParameters { random?: () => number; } interface UMAP { - new (params?: UMAPParameters): UMAP; + new(params?: UMAPParameters): UMAP; fit(X: Vectors): number[][]; - fitAsync( - X: Vectors, - callback?: (epochNumber: number) => void | boolean - ): Promise; + fitAsync(X: Vectors, callback?: (epochNumber: number) => void|boolean): + Promise; initializeFit(X: Vectors): number; setPrecomputedKNN(knnIndices: number[][], knnDistances: number[][]): void; step(): number; From 7e60a11d5aab7763b23ba7739d9524ef76a97540 Mon Sep 17 00:00:00 2001 From: Emily Reif Date: Tue, 3 Dec 2019 16:41:08 -0500 Subject: [PATCH 4/4] fixing formatting --- tensorboard/plugins/projector/vz_projector/umap.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tensorboard/plugins/projector/vz_projector/umap.d.ts b/tensorboard/plugins/projector/vz_projector/umap.d.ts index 95776aa0bf1..f965b6f2d65 100644 --- a/tensorboard/plugins/projector/vz_projector/umap.d.ts +++ b/tensorboard/plugins/projector/vz_projector/umap.d.ts @@ -18,7 +18,7 @@ limitations under the License. // for what we use. type DistanceFn = (x: Vector, y: Vector) => number; -type EpochCallback = (epoch: number) => boolean|void; +type EpochCallback = (epoch: number) => boolean | void; type Vector = number[]; type Vectors = Vector[]; interface UMAPParameters { @@ -28,10 +28,12 @@ interface UMAPParameters { random?: () => number; } interface UMAP { - new(params?: UMAPParameters): UMAP; + new (params?: UMAPParameters): UMAP; fit(X: Vectors): number[][]; - fitAsync(X: Vectors, callback?: (epochNumber: number) => void|boolean): - Promise; + fitAsync( + X: Vectors, + callback?: (epochNumber: number) => void | boolean + ): Promise; initializeFit(X: Vectors): number; setPrecomputedKNN(knnIndices: number[][], knnDistances: number[][]): void; step(): number;