forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the frontend of the embedding projector to TensorBoard.
This is just code move and build integration. There are no UI/logic changes to TensorBoard. Change: 131862643
- Loading branch information
1 parent
b9e6287
commit 38a4afc
Showing
29 changed files
with
6,327 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Description: | ||
# Package for the Embedding Projector component. | ||
package(default_visibility = ["//tensorflow:internal"]) | ||
|
||
licenses(["notice"]) # Apache 2.0 | ||
|
||
exports_files(["LICENSE"]) | ||
|
||
filegroup( | ||
name = "all_files", | ||
srcs = glob( | ||
["**/*"], | ||
exclude = [ | ||
"**/METADATA", | ||
"**/OWNERS", | ||
], | ||
), | ||
visibility = ["//tensorflow:__subpackages__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
/** Delay for running async tasks, in milliseconds. */ | ||
const ASYNC_DELAY = 15; | ||
|
||
/** | ||
* Runs an expensive task asynchronously with some delay | ||
* so that it doesn't block the UI thread immediately. | ||
*/ | ||
export function runAsyncTask<T>(message: string, task: () => T): Promise<T> { | ||
updateMessage(message); | ||
return new Promise<T>((resolve, reject) => { | ||
d3.timer(() => { | ||
try { | ||
let result = task(); | ||
// Clearing the old message. | ||
updateMessage(); | ||
resolve(result); | ||
} catch (ex) { | ||
updateMessage('Error: ' + ex.message); | ||
reject(ex); | ||
} | ||
return true; | ||
}, ASYNC_DELAY); | ||
}); | ||
} | ||
|
||
/** | ||
* Updates the user message at the top of the page. If the provided msg is | ||
* null, the message box is hidden from the user. | ||
*/ | ||
export function updateMessage(msg?: string): void { | ||
if (msg == null) { | ||
d3.select('#notify-msg').style('display', 'none'); | ||
} else { | ||
d3.select('#notify-msg').style('display', 'block').text(msg); | ||
} | ||
} |
Oops, something went wrong.