Skip to content

Commit

Permalink
Move the frontend of the embedding projector to TensorBoard.
Browse files Browse the repository at this point in the history
This is just code move and build integration. There are no UI/logic changes to TensorBoard.
Change: 131862643
  • Loading branch information
Dan Smilkov authored and tensorflower-gardener committed Aug 31, 2016
1 parent b9e6287 commit 38a4afc
Show file tree
Hide file tree
Showing 29 changed files with 6,327 additions and 16 deletions.
31 changes: 29 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ new_http_archive(
new_http_archive(
name = "iron_fit_behavior",
build_file = "bower.BUILD",
url = "https://github.com/polymerelements/iron-fit-behavior/archive/v1.2.1.tar.gz",
strip_prefix = "iron-fit-behavior-1.2.1",
url = "https://github.com/polymerelements/iron-fit-behavior/archive/v1.2.5.tar.gz",
strip_prefix = "iron-fit-behavior-1.2.5",
)

new_http_archive(
Expand Down Expand Up @@ -234,6 +234,13 @@ new_http_archive(
strip_prefix = "neon-animation-1.2.2",
)

new_http_archive(
name = "numericjs",
build_file = "bower.BUILD",
url = "https://github.com/sloisel/numeric/archive/v1.2.6.tar.gz",
strip_prefix = "numeric-1.2.6",
)

new_http_archive(
name = "paper_behaviors",
build_file = "bower.BUILD",
Expand Down Expand Up @@ -304,6 +311,13 @@ new_http_archive(
strip_prefix = "paper-item-1.1.4",
)

new_http_archive(
name = "paper_listbox",
build_file = "bower.BUILD",
url = "https://github.com/polymerelements/paper-listbox/archive/v1.1.2.tar.gz",
strip_prefix = "paper-listbox-1.1.2",
)

new_http_archive(
name = "paper_material",
build_file = "bower.BUILD",
Expand Down Expand Up @@ -416,6 +430,12 @@ new_http_archive(
strip_prefix = "promise-polyfill-1.0.0",
)

new_http_archive(
name = "three_js",
build_file = "bower.BUILD",
url = "https://github.com/mrdoob/three.js/archive/r77.tar.gz",
)

new_http_archive(
name = "web_animations_js",
build_file = "bower.BUILD",
Expand All @@ -429,3 +449,10 @@ new_http_archive(
url = "https://github.com/webcomponents/webcomponentsjs/archive/v0.7.22.tar.gz",
strip_prefix = "webcomponentsjs-0.7.22",
)

new_http_archive(
name = "weblas",
build_file = "bower.BUILD",
url = "https://github.com/waylonflinn/weblas/archive/v0.9.0.tar.gz",
strip_prefix = "weblas-0.9.0",
)
334 changes: 334 additions & 0 deletions bower.BUILD

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tensorflow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ filegroup(
"//tensorflow/tensorboard/backend:all_files",
"//tensorflow/tensorboard/components:all_files",
"//tensorflow/tensorboard/components/vz-data-summary:all_files",
"//tensorflow/tensorboard/components/vz-projector:all_files",
"//tensorflow/tensorboard/lib:all_files",
"//tensorflow/tensorboard/lib/python:all_files",
"//tensorflow/tensorboard/scripts:all_files",
Expand Down
16 changes: 12 additions & 4 deletions tensorflow/tensorboard/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#1.0.4",
"iron-collapse": "PolymerElements/iron-collapse#1.0.8",
"iron-dropdown": "PolymerElements/iron-dropdown#1.4.0",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#1.2.1",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#1.2.5",
"iron-flex-layout": "PolymerElements/iron-flex-layout#1.3.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#1.0.6",
"iron-icon": "PolymerElements/iron-icon#1.0.8",
Expand All @@ -61,6 +61,7 @@
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#1.1.1",
"lodash": "3.8.0",
"neon-animation": "PolymerElements/neon-animation#1.2.2",
"numericjs": "1.2.6",
"paper-behaviors": "PolymerElements/paper-behaviors#1.0.11",
"paper-button": "PolymerElements/paper-button#1.0.11",
"paper-checkbox": "PolymerElements/paper-checkbox#1.1.3",
Expand All @@ -71,6 +72,7 @@
"paper-icon-button": "PolymerElements/paper-icon-button#1.1.1",
"paper-input": "PolymerElements/paper-input#1.1.14",
"paper-item": "PolymerElements/paper-item#1.1.4",
"paper-listbox": "PolymerElements/paper-listbox#1.1.2",
"paper-material": "PolymerElements/paper-material#1.0.6",
"paper-menu": "PolymerElements/paper-menu#1.2.2",
"paper-menu-button": "PolymerElements/paper-menu-button#1.5.0",
Expand All @@ -87,8 +89,10 @@
"plottable": "1.16.1",
"polymer": "1.6.1",
"promise-polyfill": "polymerlabs/promise-polyfill#1.0.0",
"three.js": "threejs#r77",
"web-animations-js": "web-animations/web-animations-js#2.2.1",
"webcomponentsjs": "webcomponents/webcomponentsjs#0.7.22"
"webcomponentsjs": "webcomponents/webcomponentsjs#0.7.22",
"weblas": "0.9.0"
},
"description": "TensorBoard: Visualizations for TensorFlow",
"devDependencies": {
Expand Down Expand Up @@ -120,7 +124,7 @@
"iron-checked-element-behavior": "1.0.4",
"iron-collapse": "1.0.8",
"iron-dropdown": "1.4.0",
"iron-fit-behavior": "1.2.1",
"iron-fit-behavior": "1.2.5",
"iron-flex-layout": "1.3.0",
"iron-form-element-behavior": "1.0.6",
"iron-icon": "1.0.8",
Expand All @@ -137,6 +141,7 @@
"iron-validatable-behavior": "1.1.1",
"lodash": "3.8.0",
"neon-animation": "1.2.2",
"numericjs": "1.2.6",
"paper-behaviors": "1.0.11",
"paper-button": "1.0.11",
"paper-checkbox": "1.1.3",
Expand All @@ -147,6 +152,7 @@
"paper-icon-button": "1.1.1",
"paper-input": "1.1.14",
"paper-item": "1.1.4",
"paper-listbox": "1.1.2",
"paper-material": "1.0.6",
"paper-menu": "1.2.2",
"paper-menu-button": "1.5.0",
Expand All @@ -163,8 +169,10 @@
"plottable": "1.16.1",
"polymer": "1.6.1",
"promise-polyfill": "1.0.0",
"three.js": "threejs#r77",
"web-animations-js": "2.2.1",
"webcomponentsjs": "0.7.22"
"webcomponentsjs": "0.7.22",
"weblas": "0.9.0"
},
"version": "0.0.0"
}
4 changes: 4 additions & 0 deletions tensorflow/tensorboard/bower/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ filegroup(
"@iron_validatable_behavior//:iron_validatable_behavior",
"@lodash//:lodash",
"@neon_animation//:neon_animation",
"@numericjs//:numericjs",
"@paper_behaviors//:paper_behaviors",
"@paper_button//:paper_button",
"@paper_checkbox//:paper_checkbox",
Expand All @@ -45,6 +46,7 @@ filegroup(
"@paper_icon_button//:paper_icon_button",
"@paper_input//:paper_input",
"@paper_item//:paper_item",
"@paper_listbox//:paper_listbox",
"@paper_material//:paper_material",
"@paper_menu//:paper_menu",
"@paper_menu_button//:paper_menu_button",
Expand All @@ -61,7 +63,9 @@ filegroup(
"@plottable//:plottable",
"@polymer//:polymer",
"@promise_polyfill//:promise_polyfill",
"@three_js//:three_js",
"@web_animations_js//:web_animations_js",
"@webcomponentsjs//:webcomponentsjs",
"@weblas//:weblas",
],
)
19 changes: 19 additions & 0 deletions tensorflow/tensorboard/components/vz-projector/BUILD
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__"],
)
51 changes: 51 additions & 0 deletions tensorflow/tensorboard/components/vz-projector/async.ts
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);
}
}
Loading

0 comments on commit 38a4afc

Please sign in to comment.