Simplify TensorBoard build

- Remove tensorboard_typescript_genrule
- Remove tensorboard_typescript_bundle
- Introduce ts_web_library Skylark rule which supports seamless
  TypeScript compilation.
- Use Closure Compiler in semi-advanced mode to compile JavaScript.
  This is done in a way that preserves <script> tag placement, which
  causes pages to load faster and avoid FOUC, thereby making it a
  better solution than the existing vulcanize.

PiperOrigin-RevId: 157794795
This commit is contained in:
Justine Tunney 2017-06-01 19:24:34 -07:00 committed by TensorFlower Gardener
parent 0503ce09c7
commit b659bc39f2
125 changed files with 1854 additions and 1871 deletions

View File

@ -2,11 +2,11 @@ workspace(name = "org_tensorflow")
http_archive(
name = "io_bazel_rules_closure",
sha256 = "4be8a887f6f38f883236e77bb25c2da10d506f2bf1a8e5d785c0f35574c74ca4",
strip_prefix = "rules_closure-aac19edc557aec9b603cd7ffe359401264ceff0d",
sha256 = "edc91f556b762fc5212d1050d00b12e40dd0b0b1c1d5d96886b59e9a30a6cae4",
strip_prefix = "rules_closure-3f07fb6a58870afbb36051bd5d54da4479561cc6",
urls = [
"http://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/aac19edc557aec9b603cd7ffe359401264ceff0d.tar.gz", # 2017-05-10
"https://github.com/bazelbuild/rules_closure/archive/aac19edc557aec9b603cd7ffe359401264ceff0d.tar.gz",
"http://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/3f07fb6a58870afbb36051bd5d54da4479561cc6.tar.gz", # 2017-05-31
"https://github.com/bazelbuild/rules_closure/archive/3f07fb6a58870afbb36051bd5d54da4479561cc6.tar.gz",
],
)

View File

@ -1,21 +1,18 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
load("//tensorflow/tensorboard:vulcanize.bzl", "tensorboard_html_binary")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tensorboard",
srcs = [
"analytics.html",
"tensorboard.html",
],
path = "/",
deps = [
"//tensorflow/tensorboard/components/tf_tensorboard",
"@org_polymer_webcomponentsjs",
],
deps = ["//tensorflow/tensorboard/components/tf_tensorboard"],
)
tensorboard_html_binary(

View File

@ -19,7 +19,6 @@ limitations under the License.
<meta charset="utf-8">
<title>TensorBoard</title>
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAMAAAD3eH5ZAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD/UExURfFlKfaELvFmKfNyK/67NvWALf68Nv69NvNxK/20NfyyNP22NfN0K/JrKvqhMv2zNf25Nf24Nf23NfeOL/yzNPyvNPJoKviWMPmeMfN1K/WBLfePL/FnKfeML/qlMvR7LPmcMfeLL/aJLvR5LPFoKfJuKvR3LP66NvywNPeNL/V/LfaILv21Nf26NfNzK/NvK/R6LPmaMfyxNPqfMvV+LfurM/iSMPmbMfJvKvmdMfumM/qiMvmZMfytNPJqKvysNPN2K/iYMPNwK/upM/JtKvJsKviVMPaHLvaGLvJpKvR8LPaKLvqkMvuqM/aFLvR4LPuoM/iTMPWDLfiRMPmYMXS0ngkAAALoSURBVHja7drnctpAFIbhFUISSKJ3MKYa0+y4xTW9937/15JkJhlTjhrSrHRmvuf/as6L0YLFCgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMBJ6njenqspzgnPrsrGX9Zpi2tCrmnc6+dYNthVY5WpMmxQLWPdMsOuYVwzNj3ei2t3mQwaV43BJPDCS2NbJ5aEeuX/+9qcjQOtfFIkIkrvY2g4MVcmOBsFWbowKO/kNyj62gRpJcDaPBlxLr1B0zdG0C/8LzbJiJrshuvy1gzlA9+rD8mIkuyIJjFE3/dqnYwoSm7IUEPoD/wut8iIguSIDjlFxe/yfXL5vuSI21BTZLLhXoOILMO8Hxwa/L8bI0LfmUdhGowb2ZvT0e57pFNDgB06IlVyjmmIBl2T/nl9Rw6SD9GgSG/Q0uQkaW3XhmovKQ3eFQ4N2Uo9OQ1eFZsNerf7vP+rO4rhmY1Lg3vFVoP8+8BXg1sFnwbnCk4NThW8GuiKBDdkVVtTNFvNelVsNqTbyWnIOM2oeTRoyWvwmpJHg/ucXBrcJuXT4DwrpwZi2vy0VCx8YtXg/D2bU4OfiuQ3eFfE2KD4bfCqiLNB993gXsGlwa2CT4NzBacGIVQ6YsipQdh0xEdODUKjIxrSp88onZ8zbbFLg1DoiFO5BXvDGv2My9/JhUT8JUZTI0yDaNHLBzIbvqTDNYhUiVw/kdjQ1kM2CHFDPjKW+KzyRTF0g/ga9w9y+fANQpxvX8CU+Ny7FUWDeF3Y+g3lROIf4k0UDX9eCyvO531PyYhHga9zvPZJU5b73Y/eXj8Hv9D48n6HaF5LbcjRt8TZTtda5M1DfXnbkX1C0SHCFKzQB5Fe8op4GNGNHavvZESbVwT5r6W1xyuCPBY3Y9YgDqzknH/e3YfNzzuL30l0IebrZ5kKtuDIXt1n868ET6kf3/49tLvrCcZyF8Pu215dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcPIbNrBhOaBXucoAAAAASUVORK5CYII=">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="tf-tensorboard/style.html">
<link rel="import" href="tf-tensorboard/tf-tensorboard.html">
<link rel="import" href="analytics.html">

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_audio_dashboard",
srcs = [
"tf-audio-dashboard.html",
@ -17,7 +17,7 @@ web_library(
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_paper_icon_button",
"@org_polymer_paper_slider",
"@org_polymer_paper_spinner",
@ -25,7 +25,7 @@ web_library(
],
)
web_library(
ts_web_library(
name = "index",
srcs = [
"demo/index.html",
@ -35,11 +35,11 @@ web_library(
deps = [
":tf_audio_dashboard",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"//tensorflow/tensorboard/demo:demo_data",
"@org_polymer_iron_component_page",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -42,14 +42,16 @@ limitations under the License.
<tf-audio-dashboard id="demo" backend="[[backend]]"></tf-audio-dashboard>
</template>
<script>
import {Backend} from '../tf-backend/backend';
import {router} from '../tf-backend/router';
Polymer({
is: "audio-dash-demo",
properties: {
backend: {
type: Object,
value: function() {
var router = new TF.Backend.router("/data", true);
return new TF.Backend.Backend(router);
return new Backend(new router("/data", true));
},
},
},

View File

@ -3,15 +3,14 @@ package(
default_visibility = ["//tensorflow:internal"],
)
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "test",
srcs = [
"audioDashboardTests.js",
"audioDashboardTests.ts",
"tests.html",
],
path = "/tf-audio-dashboard/test",
@ -19,24 +18,10 @@ web_library(
"//tensorflow/tensorboard/components/tf_audio_dashboard",
"//tensorflow/tensorboard/components/tf_backend",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:web_component_tester",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"//tensorflow/tensorboard/demo:demo_data",
"@org_npmjs_registry_web_component_tester",
"@org_polymer",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["audioDashboardTests.ts"],
typings = [
"@org_definitelytyped//:chai.d.ts",
"@org_definitelytyped//:mocha.d.ts",
"@org_definitelytyped//:sinon.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_backend:bundle.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
],
)

View File

@ -13,6 +13,9 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as backend_backend from '../../tf-backend/backend';
import * as backend_router from '../../tf-backend/router';
// TODO(dandelion): Fix me.
declare function fixture(id: string): any;
declare function stub(x, y: any): void;
@ -22,8 +25,8 @@ describe('audio dashboard tests', () => {
let reloadCount = 0;
beforeEach(() => {
audioDash = fixture('testElementFixture');
const router = TF.Backend.router('/data', true);
const backend = new TF.Backend.Backend(router);
const router = backend_router.router('/data', true);
const backend = new backend_backend.Backend(router);
audioDash.backend = backend;
stub('tf-audio-loader', {
reload: () => { reloadCount++; },

View File

@ -59,18 +59,25 @@ tf-audio-dashboard displays a dashboard that loads audio from a TensorFlow run.
</style>
</template>
<script>
TF.Dashboard.TfAudioDashboard = Polymer({
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
Polymer({
is: "tf-audio-dashboard",
factoryImpl: function(backend) {
this.backend = backend;
},
properties: {
dataType: {value: "audio"},
dataType: {
type: Object,
value: "audio",
},
},
behaviors: [
TF.Dashboard.DashboardBehavior("audio"),
TF.Dashboard.ReloadBehavior("tf-audio-loader"),
TF.Backend.BackendBehavior
DashboardBehavior("audio"),
ReloadBehavior("tf-audio-loader"),
BackendBehavior,
],
attached: function() {
this.async(function() {

View File

@ -1,16 +1,19 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_backend",
srcs = [
"bundle.js",
"backend.ts",
"behavior.ts",
"requestManager.ts",
"router.ts",
"tf-backend.html",
"urlPathHelpers.ts",
],
path = "/tf-backend",
visibility = ["//visibility:public"],
@ -18,39 +21,22 @@ web_library(
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:plottable",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/vz_sorting",
"@org_polymer",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
"//tensorflow/tensorboard/components/tf_imports:plottable.d.ts",
"//tensorflow/tensorboard/components/vz_sorting:bundle.d.ts",
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_backend"],
destdir = "tf-backend",
deps = [
"//tensorflow/tensorboard/components/tf_imports_google:lib",
"//tensorflow/tensorboard/components/vz_sorting:legacy",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF.Backend": [
"requestManager.ts",
"backend.ts",
"behavior.ts",
"urlPathHelpers.ts",
"router.ts",
]},
namespace_symbol_aliases = {"TF.Backend": {
"compareTagNames": "VZ.Sorting.compareTagNames",
}},
)
filegroup(
name = "all_files",
srcs = glob(["**"]),

View File

@ -13,10 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as d3 from 'd3'; // from //third_party/javascript/typings/d3_v4
import {compareTagNames} from '../vz_sorting/sorting';
import {compareTagNames} from '../vz-sorting/sorting';
import {RequestManager} from './requestManager';
import {Router} from './router';
import {demoify} from './urlPathHelpers';

View File

@ -14,6 +14,7 @@ limitations under the License.
==============================================================================*/
import {getRuns, getTags, TYPES} from './backend';
/** @polymerBehavior */
export const BackendBehavior = {
properties: {
/** *** Required properties *** */

View File

@ -3,51 +3,27 @@ package(
default_visibility = ["//tensorflow:internal"],
)
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "test",
srcs = [
"bundle.js",
"tests.html",
"backendTests.ts",
"behaviorTests.ts",
"requestManagerTests.ts",
] + glob(["data/**"]),
path = "/tf-backend/test",
deps = [
"//tensorflow/tensorboard/components/tf_backend",
"@org_npmjs_registry_web_component_tester",
"@org_polymer",
"@org_polymer_webcomponentsjs",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:web_component_tester",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:chai.d.ts",
"@org_definitelytyped//:mocha.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_backend:bundle.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
"//tensorflow/tensorboard/components/tf_imports:plottable.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF.Backend": [
"backendTests.ts",
"behaviorTests.ts",
"requestManagerTests.ts",
]},
)
filegroup(
name = "all_files",
testonly = 0,

View File

@ -30,6 +30,8 @@ limitations under the License.
<test-element id="test"></test-element>
</template>
</test-fixture>
<script src="bundle.js"></script>
<script src="backendTests.js"></script>
<script src="behaviorTests.js"></script>
<script src="requestManagerTests.js"></script>
</body>
</html>

View File

@ -20,4 +20,8 @@ limitations under the License.
<link rel="import" href="../tf-imports/d3.html">
<link rel="import" href="../vz-sorting/vz-sorting.html">
<script src="bundle.js"></script>
<script src="requestManager.js"></script>
<script src="urlPathHelpers.js"></script>
<script src="backend.js"></script>
<script src="behavior.js"></script>
<script src="router.js"></script>

View File

@ -1,57 +1,37 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_color_scale",
srcs = [
"bundle.js",
"colorScale.ts",
"palettes.ts",
"tf-color-scale.html",
],
path = "/tf-color-scale",
deps = [
"//tensorflow/tensorboard/components/tf_imports:d3",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"],
path = "/tf-color-scale",
deps = [
":tf_color_scale",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_button",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF": [
"palettes.ts",
"colorScale.ts",
]},
)
filegroup(
name = "all_files",
srcs = glob(["**"]),

View File

@ -19,9 +19,8 @@ limitations under the License.
// ccs.domain(runs);
// ccs.getColor("train");
// ccs.getColor("test1");
import * as d3 from 'd3'; // from //third_party/javascript/typings/d3_v4
import {palettes} from './palettes'
import {palettes} from './palettes'
export class ColorScale {
private palette: string[];
@ -29,8 +28,8 @@ export class ColorScale {
/**
* Creates a color scale with optional custom palette.
* @param {string[]} [palette=palettes.googleColorBlind] - The color
* palette you want as an Array of hex strings.
* @param {Array<string>} [palette=palettes.googleColorBlind] - The color
* palette you want as an Array of hex strings.
*/
constructor(palette: string[] = palettes.googleColorBlindAssist) {
this.palette = palette;
@ -38,8 +37,8 @@ export class ColorScale {
/**
* Set the domain of strings.
* @param {string[]} strings - An array of possible strings to use as the
* domain for your scale.
* @param {Array<string>} strings - An array of possible strings to use as the
* domain for your scale.
*/
public domain(strings: string[]): this {
this.identifiers = d3.map();

View File

@ -3,43 +3,25 @@ package(
default_visibility = ["//tensorflow:internal"],
)
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "test",
srcs = [
"bundle.js",
"colorScaleTests.ts",
"tests.html",
],
path = "/tf-color-scale/test",
deps = [
"//tensorflow/tensorboard/components/tf_color_scale",
"@org_npmjs_registry_web_component_tester",
"@org_polymer",
"@org_polymer_webcomponentsjs",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:web_component_tester",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:chai.d.ts",
"@org_definitelytyped//:mocha.d.ts",
"//tensorflow/tensorboard/components/tf_color_scale:bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF": ["colorScaleTests.ts"]},
)
filegroup(
name = "all_files",
testonly = 0,

View File

@ -21,4 +21,4 @@ limitations under the License.
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="../tf-color-scale.html">
<body>
<script src="bundle.js"></script>
<script src="colorScaleTests.js"></script>

View File

@ -26,5 +26,6 @@ a set of colors.
@element tf-color-scale
-->
<dom-module id="tf-color-scale">
<script src="bundle.js"></script>
<script src="palettes.js"></script>
<script src="colorScale.js"></script>
</dom-module>

View File

@ -1,33 +1,33 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_dashboard_common",
srcs = [
"dashboard-behavior.ts",
"dashboard-style.html",
"reload-behavior.ts",
"run-color-style.html",
"scrollbar-style.html",
"tensorboard-color.html",
"tf-categorizer.html",
"tf-categorizer-bundle.js",
"tf-categorizer.ts",
"tf-chart-scaffold.html",
"tf-collapsable-pane.html",
"tf-dashboard.html",
"tf-dashboard.js",
"tf-dashboard-layout.html",
"tf-downloader.html",
"tf-multi-checkbox.html",
"tf-multi-checkbox-bundle.js",
"tf-multi-checkbox.ts",
"tf-no-data-warning.html",
"tf-option-selector.html",
"tf-panes-helper.html",
"tf-regex-group.html",
"tf-regex-group-bundle.js",
"tf-regex-group.ts",
"tf-run-selector.html",
"tf-sidebar-helper.html",
],
@ -35,9 +35,9 @@ web_library(
deps = [
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_storage",
"//tensorflow/tensorboard/components/vz_sorting",
"@org_polymer",
"@org_polymer_iron_ajax",
"@org_polymer_iron_collapse",
"@org_polymer_iron_icons",
@ -56,7 +56,7 @@ web_library(
],
)
web_library(
ts_web_library(
name = "demo",
srcs = [
"tf-categorizer-demo.html",
@ -73,91 +73,9 @@ web_library(
],
)
tensorboard_typescript_bundle(
name = "tf_categorizer_bundle",
out = "tf-categorizer-bundle.ts",
namespace_srcs = {"TF.Dashboard.Categorizer": ["tf-categorizer.ts"]},
namespace_symbol_aliases = {"TF.Dashboard.Categorizer": {"compareTagNames": "VZ.Sorting.compareTagNames"}},
)
tensorboard_typescript_genrule(
name = "tf_categorizer_ts",
srcs = ["tf-categorizer-bundle.ts"],
typings = [
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
"//tensorflow/tensorboard/components/vz_sorting:bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "tf_regex_group_bundle",
out = "tf-regex-group-bundle.ts",
namespace_srcs = {"TF.Dashboard.RegexGroup": ["tf-regex-group.ts"]},
namespace_symbol_aliases = {"TF.Dashboard.RegexGroup": {"storage": "TF.URIStorage"}},
)
tensorboard_typescript_genrule(
name = "tf_regex_group_ts",
srcs = ["tf-regex-group-bundle.ts"],
typings = [
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_storage:bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "tf_multi_checkbox_bundle",
out = "tf-multi-checkbox-bundle.ts",
namespace_srcs = {"TF.Dashboard.MultiCheckbox": ["tf-multi-checkbox.ts"]},
namespace_symbol_aliases = {"TF.Dashboard.MultiCheckbox": {"storage": "TF.URIStorage"}},
)
tensorboard_typescript_genrule(
name = "tf_multi_checkbox_ts",
srcs = ["tf-multi-checkbox-bundle.ts"],
typings = [
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_storage:bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "tf_dashboard_bundle",
out = "tf-dashboard.ts",
namespace_srcs = {
"TF.Dashboard": [
"dashboard-behavior.ts",
"reload-behavior.ts",
],
},
)
tensorboard_typescript_genrule(
name = "tf_dashboard_ts",
srcs = ["tf-dashboard.ts"],
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = glob(["*.html"]) + [":legacy_ts"],
srcs = [":tf_dashboard_common"],
destdir = "tf-dashboard-common",
deps = [
"//tensorflow/tensorboard/components/tf_imports_google:lib",
@ -182,19 +100,8 @@ tensorboard_webcomponent_library(
],
)
tensorboard_ts_library(
name = "legacy_ts",
srcs = [
"dashboard-behavior.ts",
"reload-behavior.ts",
"tf-categorizer.ts",
],
deps_mgmt = "off",
runtime = "nodejs",
deps = [
"//tensorflow/tensorboard/components/vz_sorting:legacy_ts",
"//third_party/javascript/typings/d3_v4:bundle",
"//third_party/javascript/typings/lodash",
"//third_party/javascript/typings/polymer:polymer_without_externs",
],
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)

View File

@ -16,6 +16,8 @@ limitations under the License.
/**
* A behavior that TensorBoard dashboards must implement. This behavior serves
* the purpose of an interface.
*
* @polymerBehavior
*/
export function DashboardBehavior(dashboardName) {
return {

View File

@ -20,6 +20,8 @@ limitations under the License.
* and call a `reload` method on that child.
* May later extend it so it has more sophisticated logic, e.g. reloading
* only tags that are in view.
*
* @polymerBehavior
*/
export function ReloadBehavior(tagName) {
return {

View File

@ -3,44 +3,25 @@ package(
default_visibility = ["//tensorflow:internal"],
)
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "test",
srcs = [
"bundle.js",
"tests.html",
"tf-categorizer-tests.ts",
],
path = "/tf-dashboard-common/test",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common",
"@org_npmjs_registry_web_component_tester",
"@org_polymer",
"@org_polymer_webcomponentsjs",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:web_component_tester",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:chai.d.ts",
"@org_definitelytyped//:mocha.d.ts",
"//tensorflow/tensorboard/components/tf_dashboard_common:tf-categorizer-bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF.Dashboard": ["tf-categorizer-tests.ts"]},
namespace_symbol_aliases = {"TF.Dashboard": {"cat": "TF.Dashboard.Categorizer"}},
)
filegroup(
name = "all_files",
testonly = 0,

View File

@ -21,4 +21,4 @@ limitations under the License.
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../tf-categorizer.html">
<body>
<script src="bundle.js"></script>
<script src="tf-categorizer-tests.js"></script>

View File

@ -59,5 +59,5 @@ categories are exclusive.
}
</style>
</template>
<script src="tf-categorizer-bundle.js"></script>
<script src="tf-categorizer.js"></script>
</dom-module>

View File

@ -13,10 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as d3 from 'd3'; // from //third_party/javascript/typings/d3_v4
import * as _ from 'lodash';
import {compareTagNames} from '../vz_sorting/sorting';
import {compareTagNames} from '../vz-sorting/sorting';
/**
* This module contains methods that allow sorting tags into 'categories'.

View File

@ -22,4 +22,5 @@ limitations under the License.
<link rel="import" href="tf-downloader.html">
<link rel="import" href="tf-no-data-warning.html">
<script src="tf-dashboard.js"></script>
<script src="dashboard-behavior.js"></script>
<script src="reload-behavior.js"></script>

View File

@ -156,5 +156,5 @@ handle these situations gracefully.
}
</style>
</template>
<script src="tf-multi-checkbox-bundle.js"></script>
<script src="tf-multi-checkbox.js"></script>
</dom-module>

View File

@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as _ from 'lodash';
import * as storage from '../tf-storage/storage';
Polymer({

View File

@ -95,5 +95,5 @@ more regexes).
</template>
</div>
</template>
<script src="tf-regex-group-bundle.js"></script>
<script src="tf-regex-group.js"></script>
</dom-module>

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_distribution_dashboard",
srcs = ["tf-distribution-dashboard.html"],
path = "/tf-distribution-dashboard",
@ -13,24 +13,24 @@ web_library(
"//tensorflow/tensorboard/components/tf_color_scale",
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/vz_distribution_chart",
"@org_polymer",
"@org_polymer_iron_collapse",
"@org_polymer_paper_icon_button",
"@org_polymer_paper_styles",
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-distribution-dashboard",
deps = [
":tf_distribution_dashboard",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -43,14 +43,17 @@ limitations under the License.
<tf-distribution-dashboard id="demo" backend="[[backend]]"></tf-distribution-dashboard>
</template>
<script>
import {Backend} from "../../tf-backend/backend";
import {router} from "../../tf-backend/router";
Polymer({
is: "distribution-dash-demo",
properties: {
backend: {
type: Object,
value: function() {
var router = new TF.Backend.router("data", true);
return new TF.Backend.Backend(router);
var router = new router("data", true);
return new Backend(router);
},
},
},

View File

@ -101,15 +101,19 @@ contains vz-distribution-charts embedded inside tf-panes-helper's.
</template>
<script>
TF.Dashboard.TfDistributionDashboard = Polymer({
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
Polymer({
is: "tf-distribution-dashboard",
factoryImpl: function(backend) {
this.backend = backend;
},
behaviors: [
TF.Dashboard.DashboardBehavior("distributions"),
TF.Dashboard.ReloadBehavior("tf-chart-scaffold"),
TF.Backend.BackendBehavior,
DashboardBehavior("distributions"),
ReloadBehavior("tf-chart-scaffold"),
BackendBehavior,
],
properties: {
backend: Object,
@ -117,7 +121,10 @@ contains vz-distribution-charts embedded inside tf-panes-helper's.
type: String,
value: "step"
},
dataType: {value: "compressedHistogram"},
dataType: {
type: Object,
value: "compressedHistogram",
},
},
});
</script>

View File

@ -1,29 +1,23 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_globals",
srcs = [
"bundle.js",
"globals.ts",
"tf-globals.html",
],
path = "/tf-globals",
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF.Globals": ["globals.ts"]},
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_globals"],
destdir = "tf-globals",
)
filegroup(
@ -31,25 +25,3 @@ filegroup(
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-globals.html",
":legacy_ts",
],
destdir = "tf-globals",
)
tensorboard_ts_library(
name = "legacy_ts",
srcs = ["globals.ts"],
deps_mgmt = "off",
runtime = "nodejs",
)

View File

@ -13,8 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
// The names of TensorBoard tabs.
export const TABS = [
'scalars', 'images', 'audio', 'graphs', 'distributions', 'histograms',

View File

@ -15,5 +15,5 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<script src="bundle.js"></script>
<script src="globals.js"></script>

View File

@ -1,10 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph",
srcs = [
"tf-graph.html",
@ -15,7 +16,7 @@ web_library(
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_graph_common",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_iron_flex_layout",
"@org_polymer_iron_icons",
"@org_polymer_paper_button",
@ -28,26 +29,28 @@ web_library(
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph"],
destdir = "tf-graph",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
"//third_party/javascript/polymer/v1/iron-flex-layout:lib",
"//third_party/javascript/polymer/v1/iron-icons:lib",
"//third_party/javascript/polymer/v1/paper-button:lib",
"//third_party/javascript/polymer/v1/paper-dropdown-menu:lib",
"//third_party/javascript/polymer/v1/paper-input:lib",
"//third_party/javascript/polymer/v1/paper-menu:lib",
"//third_party/javascript/polymer/v1/paper-radio-group:lib",
"//third_party/javascript/polymer/v1/paper-toggle-button:lib",
"//third_party/javascript/polymer/v1/paper-tooltip:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph.html",
"tf-graph-minimap.html",
"tf-graph-scene.html",
],
destdir = "tf-graph",
deps = [
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
],
)

View File

@ -1,11 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-graph/demo",
@ -13,9 +13,9 @@ web_library(
"//tensorflow/tensorboard/components/tf_graph",
"//tensorflow/tensorboard/components/tf_graph_common",
"//tensorflow/tensorboard/components/tf_graph_loader",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -941,7 +941,7 @@ Polymer({
delete this._nodeGroupIndex[n];
},
addEdgeGroup: function(n, selection) {
this._edgeGroupIndex[e] = selection;
this._edgeGroupIndex[n] = selection;
},
getEdgeGroup: function(e) {
return this._edgeGroupIndex[e];

View File

@ -1,11 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_app",
srcs = [
"index.html",
@ -16,9 +16,23 @@ web_library(
"//tensorflow/tensorboard/components/tf_graph_board",
"//tensorflow/tensorboard/components/tf_graph_controls",
"//tensorflow/tensorboard/components/tf_graph_loader",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_component_page",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_app"],
destdir = "tf-graph-app",
deps = [
"//tensorflow/tensorboard/components/tf_graph_board:legacy",
"//tensorflow/tensorboard/components/tf_graph_controls:legacy",
"//tensorflow/tensorboard/components/tf_graph_loader:legacy",
"//third_party/javascript/polymer/v1/iron-component-page:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
"//third_party/javascript/polymer/v1/webcomponentsjs:lib",
],
)
@ -27,23 +41,3 @@ filegroup(
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"index.html",
"tf-graph-app.html",
],
destdir = "tf-graph-app",
deps = [
"//tensorflow/tensorboard/components/tf_graph_board:legacy",
"//tensorflow/tensorboard/components/tf_graph_controls:legacy",
"//tensorflow/tensorboard/components/tf_graph_loader:legacy",
"//third_party/javascript/polymer/v1/iron-list:lib",
"//third_party/javascript/polymer/v1/paper-radio-group:lib",
"//third_party/javascript/polymer/v1/paper-tooltip:lib",
],
)

View File

@ -1,11 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph_app/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-graph-app/demo",

View File

@ -1,44 +1,38 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_board",
srcs = [
"tf-graph-board.html",
],
srcs = ["tf-graph-board.html"],
path = "/tf-graph-board",
deps = [
"//tensorflow/tensorboard/components/tf_graph",
"//tensorflow/tensorboard/components/tf_graph_common",
"//tensorflow/tensorboard/components/tf_graph_info",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_paper_progress",
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_board"],
destdir = "tf-graph-board",
deps = [
"//tensorflow/tensorboard/components/tf_graph:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_info:legacy",
"//third_party/javascript/polymer/v1/paper-progress:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph-board.html",
],
destdir = "tf-graph-board",
deps = [
"//tensorflow/tensorboard/components/tf_graph:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_info:legacy",
],
)

View File

@ -1,11 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph_board/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-graph-board/demo",
@ -13,9 +13,9 @@ web_library(
"//tensorflow/tensorboard/components/tf_graph_board",
"//tensorflow/tensorboard/components/tf_graph_common",
"//tensorflow/tensorboard/components/tf_graph_loader",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -180,10 +180,9 @@ Polymer({
graph: Object,
stats: Object,
/**
* @type {value: number, msg: string}
*
* A number between 0 and 100 denoting the % of progress
* for the progress bar and the displayed message.
* @type {{value: number, msg: string}}
*/
progress: Object,
colorBy: String,

View File

@ -1,15 +1,31 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_common",
srcs = [
"annotation.ts",
"colors.ts",
"common.ts",
"contextmenu.ts",
"edge.ts",
"externs.ts",
"graph.ts",
"hierarchy.ts",
"layout.ts",
"minimap.ts",
"node.ts",
"parser.ts",
"proto.ts",
"render.ts",
"scene.ts",
"template.ts",
"tf-graph-common.html",
":ts",
"util.ts",
],
path = "/tf-graph-common",
deps = [
@ -17,18 +33,17 @@ web_library(
"//tensorflow/tensorboard/components/tf_imports:dagre",
"//tensorflow/tensorboard/components/tf_imports:graphlib",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = glob(["*.ts"]),
typings = [
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_common"],
destdir = "tf-graph-common",
deps = [
"//tensorflow/tensorboard/components/tf_imports_google:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
@ -37,36 +52,3 @@ filegroup(
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph-common.html",
":legacy_ts",
],
destdir = "tf-graph-common",
deps = [
"//tensorflow/tensorboard/components/tf_imports_google:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
tensorboard_ts_library(
name = "legacy_ts",
srcs = glob(["*.ts"]),
deps_mgmt = "off",
runtime = "nodejs",
deps = [
"//third_party/javascript/node_modules/typescript:es2015.promise",
"//third_party/javascript/typings/d3_v4:bundle",
"//third_party/javascript/typings/lodash",
"//third_party/javascript/typings/polymer:polymer_without_externs",
"//third_party/javascript/typings/webcomponents_js",
],
)

View File

@ -1,19 +1,18 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_controls",
srcs = [
"tf-graph-controls.html",
],
srcs = ["tf-graph-controls.html"],
path = "/tf-graph-controls",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_graph_common",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_paper_button",
"@org_polymer_paper_dropdown_menu",
"@org_polymer_paper_menu",
@ -23,25 +22,25 @@ web_library(
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_controls"],
destdir = "tf-graph-controls",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
"//third_party/javascript/polymer/v1/paper-button:lib",
"//third_party/javascript/polymer/v1/paper-dropdown-menu:lib",
"//third_party/javascript/polymer/v1/paper-menu:lib",
"//third_party/javascript/polymer/v1/paper-radio-group:lib",
"//third_party/javascript/polymer/v1/paper-toggle-button:lib",
"//third_party/javascript/polymer/v1/paper-tooltip:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph-controls.html",
],
destdir = "tf-graph-controls",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
],
)

View File

@ -1,19 +1,19 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph_controls/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"],
path = "/tf-graph-controls/demo",
deps = [
"//tensorflow/tensorboard/components/tf_graph_controls",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -1,14 +1,13 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_dashboard",
srcs = [
"tf-graph-dashboard.html",
],
srcs = ["tf-graph-dashboard.html"],
path = "/tf-graph-dashboard",
deps = [
"//tensorflow/tensorboard/components/tf_backend",
@ -17,7 +16,24 @@ web_library(
"//tensorflow/tensorboard/components/tf_graph_board",
"//tensorflow/tensorboard/components/tf_graph_controls",
"//tensorflow/tensorboard/components/tf_graph_loader",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/vz_sorting",
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_dashboard"],
destdir = "tf-graph-dashboard",
deps = [
"//tensorflow/tensorboard/components/tf_backend:legacy",
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph:legacy",
"//tensorflow/tensorboard/components/tf_graph_board:legacy",
"//tensorflow/tensorboard/components/tf_graph_controls:legacy",
"//tensorflow/tensorboard/components/tf_graph_loader:legacy",
"//tensorflow/tensorboard/components/vz_sorting:legacy",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
@ -26,23 +42,3 @@ filegroup(
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph-dashboard.html",
],
destdir = "tf-graph-dashboard",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph:legacy",
"//tensorflow/tensorboard/components/tf_graph_board:legacy",
"//tensorflow/tensorboard/components/tf_graph_controls:legacy",
"//tensorflow/tensorboard/components/tf_graph_loader:legacy",
],
)

View File

@ -1,19 +1,19 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph_dashboard/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-graph-dashboard/demo",
deps = [
"//tensorflow/tensorboard/components/tf_graph_dashboard",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -37,14 +37,17 @@ limitations under the License.
<tf-graph-dashboard backend="[[backend]]"></tf-graph-dashboard>
</template>
<script>
import {Backend} from "../../tf-backend/backend";
import {router} from "../../tf-backend/router";
Polymer({
is: "graph-dashboard-demo",
properties: {
backend: {
type: Object,
value: function() {
var router = new TF.Backend.router("data", true);
return new TF.Backend.Backend(router);
var router = new router("data", true);
return new Backend(router);
},
},
},

View File

@ -21,6 +21,7 @@ limitations under the License.
<link rel="import" href="../tf-graph-controls/tf-graph-controls.html">
<link rel="import" href="../tf-dashboard-common/tf-dashboard.html">
<link rel="import" href="../tf-backend/tf-backend.html">
<link rel="import" href="../vz-sorting/vz-sorting.html">
<!--
tf-graph-dashboard displays a graph from a TensorFlow run.
@ -103,19 +104,21 @@ out-hierarchy-params="{{_hierarchyParams}}"
</dom-module>
<script>
"use strict";
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
import {compareTagNames} from "../vz-sorting/sorting";
(function() {
TF.Dashboard.TfGraphDashboard = Polymer({
Polymer({
is: 'tf-graph-dashboard',
factoryImpl: function(backend, debuggerDataEnabled) {
this.backend = backend;
this.debuggerDataEnabled = debuggerDataEnabled;
},
behaviors: [
TF.Dashboard.DashboardBehavior("graphs"),
TF.Dashboard.ReloadBehavior("tf-graph-dashboard"),
TF.Backend.Behavior,
DashboardBehavior("graphs"),
ReloadBehavior("tf-graph-dashboard"),
BackendBehavior,
],
properties: {
_datasets: Object,
@ -188,7 +191,7 @@ TF.Dashboard.TfGraphDashboard = Polymer({
this._initialized = true;
Promise.all([backend.graphRuns(), backend.runMetadataRuns()])
.then(function(result) {
var runsWithGraph = result[0].sort(VZ.Sorting.compareTagNames);
var runsWithGraph = result[0].sort(compareTagNames);
var runToMetadata = result[1];
var datasets = _.map(runsWithGraph, function(runName) {
return {
@ -196,7 +199,7 @@ TF.Dashboard.TfGraphDashboard = Polymer({
path: backend.router.graph(
runName, tf.graph.LIMIT_ATTR_SIZE, tf.graph.LARGE_ATTRS_KEY),
runMetadata: runToMetadata[runName] ? _.map(
runToMetadata[runName].sort(VZ.Sorting.compareTagNames), function(tag) {
runToMetadata[runName].sort(compareTagNames), function(tag) {
return {
tag: tag,
path: backend.router.runMetadata(tag, runName)
@ -296,5 +299,4 @@ TF.Dashboard.TfGraphDashboard = Polymer({
this._requestHealthPills();
},
});
})();
</script>

View File

@ -1,10 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_info",
srcs = [
"tf-graph-icon.html",
@ -16,7 +17,7 @@ web_library(
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_graph_common",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_iron_collapse",
"@org_polymer_iron_list",
"@org_polymer_paper_icon_button",
@ -26,28 +27,25 @@ web_library(
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_info"],
destdir = "tf-graph-info",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
"//third_party/javascript/polymer/v1/iron-collapse:lib",
"//third_party/javascript/polymer/v1/iron-list:lib",
"//third_party/javascript/polymer/v1/paper-icon-button:lib",
"//third_party/javascript/polymer/v1/paper-item:lib",
"//third_party/javascript/polymer/v1/paper-slider:lib",
"//third_party/javascript/polymer/v1/paper-spinner:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph-icon.html",
"tf-graph-info.html",
"tf-node-info.html",
"tf-node-list-item.html",
],
destdir = "tf-graph-info",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common:legacy",
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
],
)

View File

@ -1,11 +1,11 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph_info/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-graph-info/demo",
@ -13,9 +13,9 @@ web_library(
"//tensorflow/tensorboard/components/tf_graph_common",
"//tensorflow/tensorboard/components/tf_graph_info",
"//tensorflow/tensorboard/components/tf_graph_loader",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -548,7 +548,7 @@ limitations under the License.
*/
var unpackMetaedge = function(metaedge) {
return _.map(metaedge.baseEdgeList, function(baseEdge) {
name = isPredecessor ? baseEdge.v : baseEdge.w;
var name = isPredecessor ? baseEdge.v : baseEdge.w;
return {
name: name,
node: this._getNode(name, this.graphHierarchy),

View File

@ -1,18 +1,27 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_graph_loader",
srcs = [
"tf-graph-loader.html",
],
srcs = ["tf-graph-loader.html"],
path = "/tf-graph-loader",
deps = [
"//tensorflow/tensorboard/components/tf_graph_common",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":tf_graph_loader"],
destdir = "tf-graph-loader",
deps = [
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
@ -21,19 +30,3 @@ filegroup(
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-graph-loader.html",
],
destdir = "tf-graph-loader",
deps = [
"//tensorflow/tensorboard/components/tf_graph_common:legacy",
],
)

View File

@ -1,19 +1,19 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
# bazel run //third_party/tensorflow/tensorboard/components/tf_graph_loader/demo
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-graph-loader/demo",
deps = [
"//tensorflow/tensorboard/components/tf_graph_loader",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_histogram_dashboard",
srcs = ["tf-histogram-dashboard.html"],
path = "/tf-histogram-dashboard",
@ -13,24 +13,24 @@ web_library(
"//tensorflow/tensorboard/components/tf_color_scale",
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/vz_histogram_timeseries",
"@org_polymer",
"@org_polymer_iron_collapse",
"@org_polymer_paper_icon_button",
"@org_polymer_paper_styles",
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-histogram-dashboard",
deps = [
":tf_histogram_dashboard",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -42,14 +42,17 @@ limitations under the License.
<tf-histogram-dashboard id="demo" backend="[[backend]]"></tf-histogram-dashboard>
</template>
<script>
import {Backend} from "../../tf-backend/backend";
import {router} from "../../tf-backend/router";
Polymer({
is: "histogram-dash-demo",
properties: {
backend: {
type: Object,
value: function() {
var router = new TF.Backend.router("data", true);
return new TF.Backend.Backend(router);
var router = new router("data", true);
return new Backend(router);
},
},
},

View File

@ -121,15 +121,19 @@ contains vz-histogram-timeseries embedded inside tf-panes-helper's.
</template>
<script>
TF.Dashboard.TfHistogramDashboard = Polymer({
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
Polymer({
is: "tf-histogram-dashboard",
factoryImpl: function(backend) {
this.backend = backend;
},
behaviors: [
TF.Dashboard.DashboardBehavior("histograms"),
TF.Dashboard.ReloadBehavior("tf-chart-scaffold"),
TF.Backend.BackendBehavior,
DashboardBehavior("histograms"),
ReloadBehavior("tf-chart-scaffold"),
BackendBehavior,
],
properties: {
backend: Object,

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_image_dashboard",
srcs = [
"tf-image-dashboard.html",
@ -17,7 +17,7 @@ web_library(
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_paper_dialog",
"@org_polymer_paper_icon_button",
"@org_polymer_paper_slider",
@ -25,15 +25,15 @@ web_library(
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-image-dashboard",
deps = [
"//tensorflow/tensorboard/components/tf_image_dashboard",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -42,6 +42,9 @@ limitations under the License.
</tf-image-dashboard>
</template>
<script>
import {Backend} from "../../tf-backend/backend";
import {router} from "../../tf-backend/router";
Polymer({
is: "image-dash-demo",
properties: {
@ -49,8 +52,8 @@ limitations under the License.
type: Object,
value: function() {
var path = "data";
var router = new TF.Backend.router(path, true);
return new TF.Backend.Backend(router);
var router = new router(path, true);
return new Backend(router);
},
},
},

View File

@ -106,7 +106,11 @@ tf-image-dashboard displays a dashboard that loads images from a TensorFlow run.
</style>
</template>
<script>
TF.Dashboard.TfImageDashboard = Polymer({
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
Polymer({
is: "tf-image-dashboard",
factoryImpl: function(backend) {
this.backend = backend;
@ -119,9 +123,9 @@ tf-image-dashboard displays a dashboard that loads images from a TensorFlow run.
},
},
behaviors: [
TF.Dashboard.DashboardBehavior("images"),
TF.Dashboard.ReloadBehavior("tf-chart-scaffold"),
TF.Backend.BackendBehavior,
DashboardBehavior("images"),
ReloadBehavior("tf-chart-scaffold"),
BackendBehavior,
],
attached: function() {
this.async(function() {

View File

@ -1,28 +1,47 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "webcomponentsjs",
srcs = ["@org_definitelytyped//:webcomponents.js.d.ts"],
path = "/webcomponentsjs",
exports = ["@org_polymer_webcomponentsjs"],
)
ts_web_library(
name = "polymer",
srcs = ["@org_definitelytyped//:polymer.d.ts"],
path = "/polymer",
exports = ["@org_polymer"],
deps = [":webcomponentsjs"],
)
ts_web_library(
name = "lodash",
srcs = ["lodash.html"],
srcs = [
"lodash.html",
"@org_definitelytyped//:lodash.d.ts",
],
path = "/tf-imports",
deps = ["@com_lodash"],
)
web_library(
ts_web_library(
name = "threejs",
srcs = [
"threejs.html",
"@org_definitelytyped//:three.d.ts",
"@org_threejs//:OrbitControls.js",
"@org_threejs//:three.js",
],
path = "/tf-imports",
)
web_library(
ts_web_library(
name = "numericjs",
srcs = [
"numericjs.html",
@ -31,7 +50,7 @@ web_library(
path = "/tf-imports",
)
web_library(
ts_web_library(
name = "weblas",
srcs = [
"weblas.html",
@ -40,21 +59,21 @@ web_library(
path = "/tf-imports",
)
web_library(
ts_web_library(
name = "graphlib",
srcs = [
"graphlib.html",
"@io_github_cpettitt_graphlib//:graphlib.core.js",
"@io_github_cpettitt_graphlib//:graphlib.core.min.js",
],
path = "/tf-imports",
deps = [":lodash"],
)
web_library(
ts_web_library(
name = "dagre",
srcs = [
"dagre.html",
"@io_github_cpettitt_dagre//:dagre.core.js",
"@io_github_cpettitt_dagre//:dagre.core.min.js",
],
path = "/tf-imports",
deps = [
@ -63,33 +82,60 @@ web_library(
],
)
web_library(
ts_web_library(
name = "d3",
srcs = [
"d3.d.ts",
"d3.html",
"@org_d3js//:d3.js",
"@org_d3js//:d3.min.js",
],
path = "/tf-imports",
)
web_library(
ts_web_library(
name = "plottable",
srcs = ["plottable.html"],
srcs = [
"plottable.d.ts",
"plottable.html",
"@com_palantir_plottable//:plottable.css",
"@com_palantir_plottable//:plottable.js",
],
path = "/tf-imports",
deps = [
":d3",
":plottable_js_css",
deps = [":d3"],
)
ts_web_library(
name = "web_component_tester",
testonly = 1,
exports = [
":chai_typings",
":mocha_typings",
":sinon_typings",
"@org_npmjs_registry_web_component_tester",
],
)
web_library(
name = "plottable_js_css",
srcs = [
"@com_palantir_plottable//:package/plottable.css",
"@com_palantir_plottable//:package/plottable.js",
],
path = "/tf-imports",
strip_prefix = "package",
ts_web_library(
name = "chai_typings",
testonly = 1,
srcs = ["@org_definitelytyped//:chai.d.ts"],
path = "/chai",
visibility = ["//visibility:private"],
)
ts_web_library(
name = "mocha_typings",
testonly = 1,
srcs = ["@org_definitelytyped//:mocha.d.ts"],
path = "/mocha",
visibility = ["//visibility:private"],
)
ts_web_library(
name = "sinon_typings",
testonly = 1,
srcs = ["@org_definitelytyped//:sinon.d.ts"],
path = "/sinonjs",
visibility = ["//visibility:private"],
)
@ -141,139 +187,139 @@ tensorboard_typescript_bundle(
out = "plottable.d.ts",
namespace_srcs = {
"Plottable": [
"@com_palantir_plottable//:package/build/src/core/dataset.d.ts",
"@com_palantir_plottable//:package/build/src/core/interfaces.d.ts",
"@com_palantir_plottable//:package/build/src/core/version.d.ts",
"@com_palantir_plottable//:build/src/core/dataset.d.ts",
"@com_palantir_plottable//:build/src/core/interfaces.d.ts",
"@com_palantir_plottable//:build/src/core/version.d.ts",
],
"Plottable.Animators": [
"@com_palantir_plottable//:package/build/src/animators/animator.d.ts",
"@com_palantir_plottable//:package/build/src/animators/easingAnimator.d.ts",
"@com_palantir_plottable//:package/build/src/animators/nullAnimator.d.ts",
"@com_palantir_plottable//:build/src/animators/animator.d.ts",
"@com_palantir_plottable//:build/src/animators/easingAnimator.d.ts",
"@com_palantir_plottable//:build/src/animators/nullAnimator.d.ts",
],
"Plottable.Axes": [
"@com_palantir_plottable//:package/build/src/axes/axis.d.ts",
"@com_palantir_plottable//:package/build/src/axes/categoryAxis.d.ts",
"@com_palantir_plottable//:package/build/src/axes/numericAxis.d.ts",
"@com_palantir_plottable//:package/build/src/axes/timeAxis.d.ts",
"@com_palantir_plottable//:build/src/axes/axis.d.ts",
"@com_palantir_plottable//:build/src/axes/categoryAxis.d.ts",
"@com_palantir_plottable//:build/src/axes/numericAxis.d.ts",
"@com_palantir_plottable//:build/src/axes/timeAxis.d.ts",
],
"Plottable.Components": [
"@com_palantir_plottable//:package/build/src/components/component.d.ts",
"@com_palantir_plottable//:package/build/src/components/componentContainer.d.ts",
"@com_palantir_plottable//:package/build/src/components/dragBoxLayer.d.ts",
"@com_palantir_plottable//:package/build/src/components/dragLineLayer.d.ts",
"@com_palantir_plottable//:package/build/src/components/gridlines.d.ts",
"@com_palantir_plottable//:package/build/src/components/group.d.ts",
"@com_palantir_plottable//:package/build/src/components/guideLineLayer.d.ts",
"@com_palantir_plottable//:package/build/src/components/interpolatedColorLegend.d.ts",
"@com_palantir_plottable//:package/build/src/components/label.d.ts",
"@com_palantir_plottable//:package/build/src/components/legend.d.ts",
"@com_palantir_plottable//:package/build/src/components/plotGroup.d.ts",
"@com_palantir_plottable//:package/build/src/components/selectionBoxLayer.d.ts",
"@com_palantir_plottable//:package/build/src/components/table.d.ts",
"@com_palantir_plottable//:package/build/src/components/xDragBoxLayer.d.ts",
"@com_palantir_plottable//:package/build/src/components/yDragBoxLayer.d.ts",
"@com_palantir_plottable//:build/src/components/component.d.ts",
"@com_palantir_plottable//:build/src/components/componentContainer.d.ts",
"@com_palantir_plottable//:build/src/components/dragBoxLayer.d.ts",
"@com_palantir_plottable//:build/src/components/dragLineLayer.d.ts",
"@com_palantir_plottable//:build/src/components/gridlines.d.ts",
"@com_palantir_plottable//:build/src/components/group.d.ts",
"@com_palantir_plottable//:build/src/components/guideLineLayer.d.ts",
"@com_palantir_plottable//:build/src/components/interpolatedColorLegend.d.ts",
"@com_palantir_plottable//:build/src/components/label.d.ts",
"@com_palantir_plottable//:build/src/components/legend.d.ts",
"@com_palantir_plottable//:build/src/components/plotGroup.d.ts",
"@com_palantir_plottable//:build/src/components/selectionBoxLayer.d.ts",
"@com_palantir_plottable//:build/src/components/table.d.ts",
"@com_palantir_plottable//:build/src/components/xDragBoxLayer.d.ts",
"@com_palantir_plottable//:build/src/components/yDragBoxLayer.d.ts",
],
"Plottable.Configs": [
"@com_palantir_plottable//:package/build/src/core/config.d.ts",
"@com_palantir_plottable//:build/src/core/config.d.ts",
],
"Plottable.Formatters": [
"@com_palantir_plottable//:package/build/src/core/formatters.d.ts",
"@com_palantir_plottable//:build/src/core/formatters.d.ts",
],
"Plottable.RenderController": [
"@com_palantir_plottable//:package/build/src/core/renderController.d.ts",
"@com_palantir_plottable//:build/src/core/renderController.d.ts",
],
"Plottable.RenderPolicies": [
"@com_palantir_plottable//:package/build/src/core/renderPolicy.d.ts",
"@com_palantir_plottable//:build/src/core/renderPolicy.d.ts",
],
"Plottable.SymbolFactories": [
"@com_palantir_plottable//:package/build/src/core/symbolFactories.d.ts",
"@com_palantir_plottable//:build/src/core/symbolFactories.d.ts",
],
"Plottable.Dispatchers": [
"@com_palantir_plottable//:package/build/src/dispatchers/dispatcher.d.ts",
"@com_palantir_plottable//:package/build/src/dispatchers/keyDispatcher.d.ts",
"@com_palantir_plottable//:package/build/src/dispatchers/mouseDispatcher.d.ts",
"@com_palantir_plottable//:package/build/src/dispatchers/touchDispatcher.d.ts",
"@com_palantir_plottable//:build/src/dispatchers/dispatcher.d.ts",
"@com_palantir_plottable//:build/src/dispatchers/keyDispatcher.d.ts",
"@com_palantir_plottable//:build/src/dispatchers/mouseDispatcher.d.ts",
"@com_palantir_plottable//:build/src/dispatchers/touchDispatcher.d.ts",
],
"Plottable.Drawers": [
"@com_palantir_plottable//:package/build/src/drawers/arcDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/arcOutlineDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/areaDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/canvasBuffer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/canvasDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/drawStep.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/drawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/lineDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/rectangleDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/segmentDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/svgDrawer.d.ts",
"@com_palantir_plottable//:package/build/src/drawers/symbolDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/arcDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/arcOutlineDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/areaDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/canvasBuffer.d.ts",
"@com_palantir_plottable//:build/src/drawers/canvasDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/drawStep.d.ts",
"@com_palantir_plottable//:build/src/drawers/drawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/lineDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/rectangleDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/segmentDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/svgDrawer.d.ts",
"@com_palantir_plottable//:build/src/drawers/symbolDrawer.d.ts",
],
"Plottable.Interactions": [
"@com_palantir_plottable//:package/build/src/interactions/clickInteraction.d.ts",
"@com_palantir_plottable//:package/build/src/interactions/dragInteraction.d.ts",
"@com_palantir_plottable//:package/build/src/interactions/interaction.d.ts",
"@com_palantir_plottable//:package/build/src/interactions/keyInteraction.d.ts",
"@com_palantir_plottable//:package/build/src/interactions/panZoomInteraction.d.ts",
"@com_palantir_plottable//:package/build/src/interactions/pointerInteraction.d.ts",
"@com_palantir_plottable//:build/src/interactions/clickInteraction.d.ts",
"@com_palantir_plottable//:build/src/interactions/dragInteraction.d.ts",
"@com_palantir_plottable//:build/src/interactions/interaction.d.ts",
"@com_palantir_plottable//:build/src/interactions/keyInteraction.d.ts",
"@com_palantir_plottable//:build/src/interactions/panZoomInteraction.d.ts",
"@com_palantir_plottable//:build/src/interactions/pointerInteraction.d.ts",
],
"Plottable.Plots": [
"@com_palantir_plottable//:package/build/src/plots/areaPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/barPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/clusteredBarPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/commons.d.ts",
"@com_palantir_plottable//:package/build/src/plots/linePlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/piePlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/plot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/rectanglePlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/scatterPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/segmentPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/stackedAreaPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/stackedBarPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/waterfallPlot.d.ts",
"@com_palantir_plottable//:package/build/src/plots/xyPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/areaPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/barPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/clusteredBarPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/commons.d.ts",
"@com_palantir_plottable//:build/src/plots/linePlot.d.ts",
"@com_palantir_plottable//:build/src/plots/piePlot.d.ts",
"@com_palantir_plottable//:build/src/plots/plot.d.ts",
"@com_palantir_plottable//:build/src/plots/rectanglePlot.d.ts",
"@com_palantir_plottable//:build/src/plots/scatterPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/segmentPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/stackedAreaPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/stackedBarPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/waterfallPlot.d.ts",
"@com_palantir_plottable//:build/src/plots/xyPlot.d.ts",
],
"Plottable.Scales": [
"@com_palantir_plottable//:package/build/src/scales/index.d.ts",
"@com_palantir_plottable//:package/build/src/scales/categoryScale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/colorScale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/interpolatedColorScale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/linearScale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/modifiedLogScale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/quantitativeScale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/scale.d.ts",
"@com_palantir_plottable//:package/build/src/scales/timeScale.d.ts",
"@com_palantir_plottable//:build/src/scales/index.d.ts",
"@com_palantir_plottable//:build/src/scales/categoryScale.d.ts",
"@com_palantir_plottable//:build/src/scales/colorScale.d.ts",
"@com_palantir_plottable//:build/src/scales/interpolatedColorScale.d.ts",
"@com_palantir_plottable//:build/src/scales/linearScale.d.ts",
"@com_palantir_plottable//:build/src/scales/modifiedLogScale.d.ts",
"@com_palantir_plottable//:build/src/scales/quantitativeScale.d.ts",
"@com_palantir_plottable//:build/src/scales/scale.d.ts",
"@com_palantir_plottable//:build/src/scales/timeScale.d.ts",
],
"Plottable.Scales.TickGenerators": [
"@com_palantir_plottable//:package/build/src/scales/tickGenerators.d.ts",
"@com_palantir_plottable//:build/src/scales/tickGenerators.d.ts",
],
"Plottable.Utils": [
"@com_palantir_plottable//:package/build/src/utils/addD3SelectionMulti.d.ts",
"@com_palantir_plottable//:package/build/src/utils/bucket.d.ts",
"@com_palantir_plottable//:package/build/src/utils/callbackSet.d.ts",
"@com_palantir_plottable//:package/build/src/utils/coerceD3.d.ts",
"@com_palantir_plottable//:package/build/src/utils/entityStore.d.ts",
"@com_palantir_plottable//:package/build/src/utils/makeEnum.d.ts",
"@com_palantir_plottable//:package/build/src/utils/map.d.ts",
"@com_palantir_plottable//:package/build/src/utils/set.d.ts",
"@com_palantir_plottable//:package/build/src/utils/transformAwareTranslator.d.ts",
"@com_palantir_plottable//:build/src/utils/addD3SelectionMulti.d.ts",
"@com_palantir_plottable//:build/src/utils/bucket.d.ts",
"@com_palantir_plottable//:build/src/utils/callbackSet.d.ts",
"@com_palantir_plottable//:build/src/utils/coerceD3.d.ts",
"@com_palantir_plottable//:build/src/utils/entityStore.d.ts",
"@com_palantir_plottable//:build/src/utils/makeEnum.d.ts",
"@com_palantir_plottable//:build/src/utils/map.d.ts",
"@com_palantir_plottable//:build/src/utils/set.d.ts",
"@com_palantir_plottable//:build/src/utils/transformAwareTranslator.d.ts",
],
"Plottable.Utils.Array": [
"@com_palantir_plottable//:package/build/src/utils/arrayUtils.d.ts",
"@com_palantir_plottable//:build/src/utils/arrayUtils.d.ts",
],
"Plottable.Utils.Color": [
"@com_palantir_plottable//:package/build/src/utils/colorUtils.d.ts",
"@com_palantir_plottable//:build/src/utils/colorUtils.d.ts",
],
"Plottable.Utils.DOM": [
"@com_palantir_plottable//:package/build/src/utils/domUtils.d.ts",
"@com_palantir_plottable//:build/src/utils/domUtils.d.ts",
],
"Plottable.Utils.Math": [
"@com_palantir_plottable//:package/build/src/utils/mathUtils.d.ts",
"@com_palantir_plottable//:build/src/utils/mathUtils.d.ts",
],
"Plottable.Utils.Stacking": [
"@com_palantir_plottable//:package/build/src/utils/stackingUtils.d.ts",
"@com_palantir_plottable//:build/src/utils/stackingUtils.d.ts",
],
"Plottable.Utils.Window": [
"@com_palantir_plottable//:package/build/src/utils/windowUtils.d.ts",
"@com_palantir_plottable//:build/src/utils/windowUtils.d.ts",
],
},
namespace_symbol_aliases = {

View File

@ -47,4 +47,4 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<script src="d3.js"></script>
<script jscomp-nocompile src="d3.min.js"></script>

View File

@ -42,4 +42,4 @@ THE SOFTWARE.
<link rel="import" href="lodash.html">
<link rel="import" href="graphlib.html">
<script src="dagre.core.js"></script>
<script jscomp-nocompile src="dagre.core.min.js"></script>

View File

@ -17,4 +17,4 @@ limitations under the License.
<link rel="import" href="lodash.html">
<script src="graphlib.core.js"></script>
<script jscomp-nocompile src="graphlib.core.min.js"></script>

View File

@ -15,4 +15,4 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<script src="../lodash/lodash.js"></script>
<script jscomp-nocompile src="../lodash/lodash.js"></script>

View File

@ -40,4 +40,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<script src="numeric.js"></script>
<script jscomp-suppress src="numeric.js"></script>

View File

@ -40,5 +40,5 @@ THE SOFTWARE.
-->
<link rel="import" href="d3.html">
<script src="plottable.js"></script>
<script jscomp-suppress src="plottable.js"></script>
<link rel="stylesheet" href="plottable.css">

View File

@ -39,5 +39,5 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<script src="three.js"></script>
<script src="OrbitControls.js"></script>
<script jscomp-suppress src="three.js"></script>
<script jscomp-suppress src="OrbitControls.js"></script>

View File

@ -39,4 +39,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<script src="weblas.js"></script>
<script jscomp-nocompile src="weblas.js"></script>

View File

@ -1,16 +1,16 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_option_selector",
srcs = ["tf-option-selector.html"],
path = "/tf-option-selector",
deps = [
"//tensorflow/tensorboard/components/tf_dashboard_common",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
],
)

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_scalar_dashboard",
srcs = [
"tf-scalar-dashboard.html",
@ -16,8 +16,8 @@ web_library(
"//tensorflow/tensorboard/components/tf_color_scale",
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/vz_line_chart",
"@org_polymer",
"@org_polymer_iron_collapse",
"@org_polymer_paper_checkbox",
"@org_polymer_paper_dropdown_menu",

View File

@ -1,22 +1,22 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"],
path = "/tf-scalar-dashboard/demo",
deps = [
"//tensorflow/tensorboard/components/tf_backend",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"//tensorflow/tensorboard/components/tf_scalar_dashboard",
"//tensorflow/tensorboard/demo:demo_data",
"@org_polymer",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -45,14 +45,17 @@ limitations under the License.
<tf-scalar-dashboard id="demo" backend="[[backend]]"></tf-scalar-dashboard>
</template>
<script>
import {Backend} from "../tf-backend/backend";
import {router} from "../tf-backend/router";
Polymer({
is: "scalar-dash-demo",
properties: {
backend: {
type: Object,
value: function() {
var router = new TF.Backend.router("/data", true);
return new TF.Backend.Backend(router);
var router = new router("/data", true);
return new Backend(router);
},
},
},

View File

@ -190,16 +190,21 @@ contains vz-line-charts embedded inside tf-panes-helper's.
</template>
<script>
TF.Dashboard.TfScalarDashboard = Polymer({
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
import * as storage from "../tf-storage/storage";
Polymer({
is: "tf-scalar-dashboard",
factoryImpl: function(backend, router) {
this.backend = backend;
this.router = router;
},
behaviors: [
TF.Dashboard.DashboardBehavior("scalars"),
TF.Dashboard.ReloadBehavior("tf-chart-scaffold"),
TF.Backend.BackendBehavior,
DashboardBehavior("scalars"),
ReloadBehavior("tf-chart-scaffold"),
BackendBehavior,
],
properties: {
backend: Object,
@ -215,14 +220,13 @@ contains vz-line-charts embedded inside tf-panes-helper's.
_showDownloadLinks: {
type: Boolean,
notify: true,
value: TF.URIStorage.getBooleanInitializer('_showDownloadLinks',
false, true),
value: storage.getBooleanInitializer('_showDownloadLinks', false, true),
observer: '_showDownloadLinksObserver'
},
_smoothingWeight: {
type: Number,
notify: true,
value: TF.URIStorage.getNumberInitializer('_smoothingWeight', 0.6),
value: storage.getNumberInitializer('_smoothingWeight', 0.6),
observer: '_smoothingWeightObserver'
},
_smoothingEnabled: {
@ -231,7 +235,7 @@ contains vz-line-charts embedded inside tf-panes-helper's.
},
_ignoreYOutliers: {
type: Boolean,
value: TF.URIStorage.getBooleanInitializer('_ignoreYOutliers', true, true),
value: storage.getBooleanInitializer('_ignoreYOutliers', true, true),
observer: '_ignoreYOutliersObserver',
},
_xType: {
@ -247,11 +251,11 @@ contains vz-line-charts embedded inside tf-panes-helper's.
_getScalarUrl: function() {
return this.router.pluginRunTagRoute('scalars', '/scalars');
},
_showDownloadLinksObserver: TF.URIStorage.getBooleanObserver(
_showDownloadLinksObserver: storage.getBooleanObserver(
'_showDownloadLinks', /*default=*/ false, /*useLocalStorage=*/ true),
_smoothingWeightObserver: TF.URIStorage.getNumberObserver(
_smoothingWeightObserver: storage.getNumberObserver(
'_smoothingWeight', 0.6),
_ignoreYOutliersObserver: TF.URIStorage.getBooleanObserver(
_ignoreYOutliersObserver: storage.getBooleanObserver(
'_ignoreYOutliers', /*default=*/ true, /*useLocalStorage=*/true),
_computeSmoothingEnabled: function(_smoothingWeight) {
return _smoothingWeight > 0;

View File

@ -1,15 +1,14 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_storage",
srcs = [
"bundle.js",
"storage.ts",
"tf-storage.html",
],
path = "/tf-storage",
@ -19,50 +18,9 @@ web_library(
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_globals:bundle.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF.URIStorage": [
"storage.ts",
]},
namespace_symbol_aliases = {"TF.URIStorage": {
"TABS": "TF.Globals.TABS",
"getFakeHash": "TF.Globals.getFakeHash",
"setFakeHash": "TF.Globals.setFakeHash",
"setUseHash": "TF.Globals.setUseHash",
"useHash": "TF.Globals.useHash",
}},
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"tf-storage.html",
":legacy_ts",
],
srcs = [":tf_storage"],
destdir = "tf-storage",
deps = [
"//tensorflow/tensorboard/components/tf_globals:legacy",
@ -71,13 +29,8 @@ tensorboard_webcomponent_library(
],
)
tensorboard_ts_library(
name = "legacy_ts",
srcs = ["storage.ts"],
deps_mgmt = "off",
runtime = "nodejs",
deps = [
"//tensorflow/tensorboard/components/tf_globals:legacy_ts",
"//third_party/javascript/typings/lodash",
],
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)

View File

@ -12,8 +12,8 @@ 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.
==============================================================================*/
import * as _ from 'lodash';
import {getFakeHash, setFakeHash, TABS, useHash} from '../tf_globals/globals';
import {getFakeHash, setFakeHash, TABS, useHash} from '../tf-globals/globals';
/* tslint:disable:no-namespace variable-name */

View File

@ -3,45 +3,25 @@ package(
default_visibility = ["//tensorflow:internal"],
)
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "test",
srcs = [
"bundle.js",
"storageTests.ts",
"tests.html",
],
path = "/tf-storage/test",
deps = [
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_imports:web_component_tester",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"//tensorflow/tensorboard/components/tf_storage",
"@org_npmjs_registry_web_component_tester",
"@org_polymer",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:chai.d.ts",
"@org_definitelytyped//:mocha.d.ts",
"//tensorflow/tensorboard/components/tf_globals:bundle.d.ts",
"//tensorflow/tensorboard/components/tf_storage:bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"TF.URIStorage": ["storageTests.ts"]},
namespace_symbol_aliases = {"TF.URIStorage": {"TABS": "TF.Globals.TABS"}},
)
filegroup(
name = "all_files",
testonly = 0,

View File

@ -22,4 +22,4 @@ limitations under the License.
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../tf-storage.html">
<body>
<script src="bundle.js"></script>
<script src="storageTests.js"></script>

View File

@ -18,4 +18,4 @@ limitations under the License.
<link rel="import" href="../tf-globals/tf-globals.html">
<link rel="import" href="../tf-imports/lodash.html">
<script src="bundle.js"></script>
<script src="storage.js"></script>

View File

@ -1,16 +1,16 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
load("//tensorflow/tensorboard:vulcanize.bzl", "tensorboard_html_binary")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_tensorboard",
srcs = [
"autoReloadBehavior.ts",
"style.html",
"tf-tensorboard.html",
":ts",
],
path = "/tf-tensorboard",
visibility = ["//visibility:public"],
@ -23,11 +23,11 @@ web_library(
"//tensorflow/tensorboard/components/tf_graph_dashboard",
"//tensorflow/tensorboard/components/tf_histogram_dashboard",
"//tensorflow/tensorboard/components/tf_image_dashboard",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/tf_scalar_dashboard",
"//tensorflow/tensorboard/components/tf_storage",
"//tensorflow/tensorboard/components/tf_text_dashboard",
"//tensorflow/tensorboard/components/vz_projector",
"@org_polymer",
"@org_polymer_font_roboto",
"@org_polymer_iron_icons",
"@org_polymer_paper_button",
@ -40,20 +40,22 @@ web_library(
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["demo.html"],
path = "/tf-tensorboard",
deps = [
":tf_tensorboard",
"//tensorflow/tensorboard/demo:demo_data",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["autoReloadBehavior.ts"],
tensorboard_html_binary(
name = "devserver",
testonly = 1,
input_path = "/tf-tensorboard/demo.html",
output_path = "/index.html",
deps = [":demo"],
)
filegroup(

View File

@ -12,49 +12,51 @@ 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.
==============================================================================*/
module TF.TensorBoard {
export var AUTORELOAD_LOCALSTORAGE_KEY = 'TF.TensorBoard.autoReloadEnabled';
var getAutoReloadFromLocalStorage: () => boolean = () => {
var val = window.localStorage.getItem(AUTORELOAD_LOCALSTORAGE_KEY);
return val === 'true' || val == null; // defaults to true
};
export var AUTORELOAD_LOCALSTORAGE_KEY = 'TF.TensorBoard.autoReloadEnabled';
export var AutoReloadBehavior = {
properties: {
autoReloadEnabled: {
type: Boolean,
observer: '_autoReloadObserver',
value: getAutoReloadFromLocalStorage,
},
_autoReloadId: {
type: Number,
},
autoReloadIntervalSecs: {
type: Number,
value: 30,
},
var getAutoReloadFromLocalStorage: () => boolean = () => {
var val = window.localStorage.getItem(AUTORELOAD_LOCALSTORAGE_KEY);
return val === 'true' || val == null; // defaults to true
};
/**
* @polymerBehavior
*/
export var AutoReloadBehavior = {
properties: {
autoReloadEnabled: {
type: Boolean,
observer: '_autoReloadObserver',
value: getAutoReloadFromLocalStorage,
},
detached: function() {
window.clearTimeout(this._autoReloadId);
_autoReloadId: {
type: Number,
},
_autoReloadObserver: function(autoReload) {
window.localStorage.setItem(AUTORELOAD_LOCALSTORAGE_KEY, autoReload);
if (autoReload) {
var _this = this;
this._autoReloadId = window.setTimeout(
this._doAutoReload.bind(this), this.autoReloadIntervalSecs * 1000);
} else {
window.clearTimeout(this._autoReloadId);
}
autoReloadIntervalSecs: {
type: Number,
value: 30,
},
_doAutoReload: function() {
if (this.reload == null) {
throw new Error('AutoReloadBehavior requires a reload method');
}
this.reload();
},
detached: function() {
window.clearTimeout(this._autoReloadId);
},
_autoReloadObserver: function(autoReload) {
window.localStorage.setItem(AUTORELOAD_LOCALSTORAGE_KEY, autoReload);
if (autoReload) {
var _this = this;
this._autoReloadId = window.setTimeout(
this._doAutoReload.bind(this), this.autoReloadIntervalSecs * 1000);
} else {
window.clearTimeout(this._autoReloadId);
}
};
}
},
_doAutoReload: function() {
if (this.reload == null) {
throw new Error('AutoReloadBehavior requires a reload method');
}
this.reload();
this._autoReloadId = window.setTimeout(
this._doAutoReload.bind(this), this.autoReloadIntervalSecs * 1000);
}
};

View File

@ -18,7 +18,6 @@ limitations under the License.
<meta charset="utf-8">
<title>TensorBoard Demo</title>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="style.html">
<link rel="import" href="tf-tensorboard.html">
<body>

View File

@ -12,19 +12,23 @@ 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.
==============================================================================*/
import {AUTORELOAD_LOCALSTORAGE_KEY, AutoReloadBehavior} from '../autoReloadBehavior';
declare function fixture(id: string): void;
window.HTMLImports.whenReady(() => {
Polymer({
is: 'autoreload-test-element',
behaviors: [TF.TensorBoard.AutoReloadBehavior],
behaviors: [AutoReloadBehavior],
});
describe('autoReload-behavior', function() {
var testElement;
var ls = window.localStorage;
var key = TF.TensorBoard.AUTORELOAD_LOCALSTORAGE_KEY;
var clock;
var callCount: number;
let testElement;
const ls = window.localStorage;
const key = AUTORELOAD_LOCALSTORAGE_KEY;
let clock;
let callCount: number;
beforeEach(function() {
ls.setItem(key, 'false'); // start it turned off so we can mutate fns

View File

@ -13,13 +13,15 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import {TABS} from '../../tf-globals/globals';
describe('end-to-end test', () => {
window.HTMLImports.whenReady(() => {
let tb = d3.select('tf-tensorboard');
var tabs = (<any>tb.node()).$.tabs;
function testTab(tabIndex: number) {
it(`selecting ${TF.Globals.TABS[tabIndex]} tab`, done => {
it(`selecting ${TABS[tabIndex]} tab`, done => {
// Every dashboard emits a rendered event when it is done rendering.
tb.on('rendered', () => done());
tabs.set('selected', tabIndex);
@ -32,7 +34,7 @@ describe('end-to-end test', () => {
// have failed. Re-selecting the default tab and listening for
// "rendered" event won't work since the content is not re-stamped.
let selected = +tabs.get('selected');
for (let i = 0; i < TF.Globals.TABS.length; i++) {
for (let i = 0; i < TABS.length; i++) {
if (i !== selected) {
testTab(i);
}

View File

@ -13,9 +13,12 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import {TABS} from '../../tf-globals/globals';
describe('fast tab switch', () => {
window.HTMLImports.whenReady(() => {
let tb = d3.select('tf-tensorboard');
// tslint:disable-next-line:no-any be quiet tsc
var tabs = (<any>tb.node()).$.tabs;
// This test will select the events tab. Once the events tab
@ -23,9 +26,9 @@ describe('fast tab switch', () => {
// the images tab wihout waiting for the graph tab to finish
// rendering. Finally, it finishes when the images tab
// has rendered and no errors were thrown.
let eventsTabIndex = TF.Globals.TABS.indexOf('events');
let imagesTabIndex = TF.Globals.TABS.indexOf('images');
let graphTabIndex = TF.Globals.TABS.indexOf('graphs');
const eventsTabIndex = TABS.indexOf('events');
const imagesTabIndex = TABS.indexOf('images');
const graphTabIndex = TABS.indexOf('graphs');
// Listen for when the events tab rendered.
tb.on('rendered', () => {

View File

@ -12,6 +12,10 @@ 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.
==============================================================================*/
import * as backend_router from '../../tf-backend/router';
import {TABS} from '../../tf-globals/globals';
describe('tf-tensorboard tests', () => {
window.HTMLImports.whenReady(() => {
let tensorboard: any;
@ -25,16 +29,16 @@ describe('tf-tensorboard tests', () => {
setTimeout(function() {
let tabs = tensorboard.$.tabs.getElementsByTagName('paper-tab');
let tabMode = Array.prototype.map.call(tabs, (x) => x.dataMode);
chai.assert.deepEqual(tabMode, TF.Globals.TABS, 'mode is correct');
chai.assert.deepEqual(tabMode, TABS, 'mode is correct');
let tabText =
Array.prototype.map.call(tabs, (x) => x.innerText.toLowerCase());
chai.assert.deepEqual(tabText, TF.Globals.TABS, 'text is correct');
chai.assert.deepEqual(tabText, TABS, 'text is correct');
done();
});
});
it('respects router manually provided', function() {
let router = TF.Backend.router('data', true);
const router = backend_router.router('data', true);
tensorboard.router = router;
tensorboard.demoDir = null;
chai.assert.equal(tensorboard._backend.router, router);
@ -46,7 +50,7 @@ describe('tf-tensorboard tests', () => {
});
describe('reloading the selected dashboard', function() {
TF.Globals.TABS.forEach((name, tabIndex) => {
TABS.forEach((name, tabIndex) => {
// These tabs do not support reload mode.
if (name === 'graphs' || name === 'projections') {
return;
@ -70,7 +74,7 @@ describe('tf-tensorboard tests', () => {
});
it('reload is disabled for graph dashboard', function(done) {
let idx = TF.Globals.TABS.indexOf('graphs');
const idx = TABS.indexOf('graphs');
chai.assert.notEqual(idx, -1, 'graphs was found');
tensorboard.$.tabs.set('selected', idx);
setTimeout(

View File

@ -44,7 +44,6 @@ tf-tensorboard is the frontend entry point for TensorBoard.
It implements a toolbar (via paper-header-panel and paper-toolbar) that
allows the user to toggle between various dashboards.
-->
<script src="autoReloadBehavior.js"></script>
<dom-module id="tf-tensorboard">
<template>
<paper-dialog with-backdrop id="settings">
@ -210,17 +209,22 @@ allows the user to toggle between various dashboards.
</style>
</template>
<script src="autoReloadBehavior.js"></script>
<script>
"use strict";
import {AutoReloadBehavior} from "./autoReloadBehavior";
import {Backend} from "../tf-backend/backend";
import {TABS, setUseHash} from "../tf-globals/globals";
import {getString, setString, TAB} from "../tf-storage/storage";
import * as backend_router from "../tf-backend/router";
Polymer({
is: "tf-tensorboard",
behaviors: [TF.TensorBoard.AutoReloadBehavior],
behaviors: [AutoReloadBehavior],
properties: {
router: {
type: Object,
value: function() {
return TF.Backend.router();
return backend_router.router();
},
},
_backend: {
@ -245,7 +249,7 @@ allows the user to toggle between various dashboards.
tabs: {
type: Array,
readOnly: true,
value: TF.Globals.TABS,
value: TABS,
},
// If this is set to a string, TensorBoard will switch to "demo mode"
// and attempt to load serialized json data from that directory. You can
@ -271,15 +275,15 @@ allows the user to toggle between various dashboards.
},
_getModeFromIndex: function(modeIndex) {
var mode = this.tabs[modeIndex];
TF.URIStorage.setString(TF.URIStorage.TAB, mode);
setString(TAB, mode);
return mode;
},
_makeBackend: function(router, demoDir) {
// use the demoDir if it is set, otherwise use the provided router
if (demoDir != null) {
router = TF.Backend.router(demoDir, true);
router = backend_router.router(demoDir, true);
}
return new TF.Backend.Backend(router);
return new Backend(router);
},
_isReloadDisabled: function(mode) {
return !this._debuggerDataEnabled && this._modeIsGraphs(mode);
@ -316,7 +320,7 @@ allows the user to toggle between various dashboards.
return dashboard;
},
ready: function() {
TF.Globals.setUseHash(this.useHash);
setUseHash(this.useHash);
this._getModeFromHash();
window.addEventListener('hashchange', function() {
@ -324,7 +328,7 @@ allows the user to toggle between various dashboards.
}.bind(this));
},
_getModeFromHash: function() {
var tabName = TF.URIStorage.getString(TF.URIStorage.TAB);
var tabName = getString(TAB);
var modeIndex = this.tabs.indexOf(tabName);
if (modeIndex == -1 && this.modeIndex == null) {
// Select the first tab as default.
@ -348,5 +352,4 @@ allows the user to toggle between various dashboards.
},
});
</script>
<script src="autoReloadBehavior.js"></script>
</dom-module>

View File

@ -1,10 +1,10 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "tf_text_dashboard",
srcs = [
"tf-text-dashboard.html",
@ -17,7 +17,7 @@ web_library(
"//tensorflow/tensorboard/components/tf_dashboard_common",
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"@org_polymer_paper_dialog",
"@org_polymer_paper_icon_button",
"@org_polymer_paper_material",
@ -26,15 +26,15 @@ web_library(
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"] + glob(["data/**"]),
path = "/tf-text-dashboard",
deps = [
":tf_text_dashboard",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)

View File

@ -44,6 +44,9 @@ limitations under the License.
</tf-text-dashboard>
</template>
<script>
import * as backend_backend from '../tf-backend/backend';
import * as backend_router from '../tf-backend/router';
Polymer({
is: "text-dash-demo",
properties: {
@ -51,8 +54,8 @@ limitations under the License.
type: Object,
value: function() {
var path = "data";
var router = new TF.Backend.router(path, true);
return new TF.Backend.Backend(router);
var router = new backend_backend.router(path, true);
return new backend_backend.Backend(router);
},
},
},

View File

@ -82,7 +82,11 @@ tf-text-dashboard displays a dashboard that loads texts from a TensorFlow run.
</style>
</template>
<script>
TF.Dashboard.TfTextDashboard = Polymer({
import {DashboardBehavior} from "../tf-dashboard-common/dashboard-behavior";
import {ReloadBehavior} from "../tf-dashboard-common/reload-behavior";
import {BackendBehavior} from "../tf-backend/behavior";
Polymer({
is: "tf-text-dashboard",
factoryImpl: function(backend) {
this.backend = backend;
@ -95,9 +99,9 @@ tf-text-dashboard displays a dashboard that loads texts from a TensorFlow run.
},
},
behaviors: [
TF.Dashboard.DashboardBehavior("text"),
TF.Dashboard.ReloadBehavior("tf-chart-scaffold"),
TF.Backend.BackendBehavior,
DashboardBehavior("text"),
ReloadBehavior("tf-chart-scaffold"),
BackendBehavior,
],
attached: function() {
this.async(function() {

View File

@ -1,64 +1,37 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "vz_distribution_chart",
srcs = [
"bundle.js",
"vz-distribution-chart.html",
"vz-distribution-chart.ts",
],
path = "/vz-distribution-chart",
visibility = ["//visibility:public"],
deps = [
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:plottable",
"//tensorflow/tensorboard/components/tf_imports:polymer",
"//tensorflow/tensorboard/components/vz_line_chart",
"@org_polymer",
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"],
path = "/vz-distribution-chart",
deps = [
":vz_distribution_chart",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
"//tensorflow/tensorboard/components/tf_imports:plottable.d.ts",
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/vz_line_chart:bundle.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {"VZ": [
"vz-distribution-chart.ts",
]},
namespace_symbol_aliases = {"VZ": {
"Dataset": "Plottable.Dataset",
"ChartHelpers": "VZ.ChartHelpers",
}},
)
filegroup(
name = "all_files",
srcs = glob(["**"]),

View File

@ -41,5 +41,5 @@ limitations under the License.
</style>
</template>
<script src="bundle.js"></script>
<script src="vz-distribution-chart.js"></script>
</dom-module>

View File

@ -12,13 +12,8 @@ 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.
==============================================================================*/
/* tslint:disable:no-namespace variable-name */
import * as d3 from 'd3'; // from //third_party/javascript/typings/d3_v4
import * as _ from 'lodash'
import * as Plottable from 'Plottable/plottable'; // from //third_party/javascript/plottable
import {Dataset} from 'Plottable/plottable';
import * as ChartHelpers from '../vz_line_chart/vz-chart-helpers';
import * as ChartHelpers from '../vz-line-chart/vz-chart-helpers';
export class DistributionChart {
private run2datasets: {[run: string]: Plottable.Dataset};

View File

@ -1,29 +1,41 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "vz_histogram_timeseries",
srcs = ["vz-histogram-timeseries.html"],
path = "/vz-histogram-timeseries",
deps = [
"//tensorflow/tensorboard/components/tf_imports:d3",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"],
path = "/vz-histogram-timeseries",
deps = [
":vz_histogram_timeseries",
"//tensorflow/tensorboard/components/tf_imports:webcomponentsjs",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_button",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_webcomponent_library(
name = "legacy",
srcs = [":vz_histogram_timeseries"],
visibility = ["//learning/vis/vz_elements/catalog:__pkg__"],
destdir = "vz-histogram-timeseries",
deps = [
"//tensorflow/tensorboard/components/tf_imports_google:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)
@ -32,22 +44,3 @@ filegroup(
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"index.html",
"vz-histogram-timeseries.html",
],
visibility = ["//learning/vis/vz_elements/catalog:__pkg__"],
destdir = "vz-histogram-timeseries",
deps = [
"//tensorflow/tensorboard/components/tf_imports_google:lib",
"//third_party/javascript/polymer/v1/polymer:lib",
],
)

View File

@ -1,16 +1,17 @@
package(default_visibility = ["//tensorflow:internal"])
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library")
load("//tensorflow/tensorboard:hacks.bzl", "tensorboard_typescript_bundle")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
load("//tensorflow/tensorboard:web.bzl", "ts_web_library")
licenses(["notice"]) # Apache 2.0
web_library(
ts_web_library(
name = "vz_line_chart",
srcs = [
"bundle.js",
"dragZoomInteraction.ts",
"vz-chart-helpers.ts",
"vz-line-chart.html",
"vz-line-chart.ts",
],
path = "/vz-line-chart",
visibility = ["//visibility:public"],
@ -18,11 +19,11 @@ web_library(
"//tensorflow/tensorboard/components/tf_imports:d3",
"//tensorflow/tensorboard/components/tf_imports:lodash",
"//tensorflow/tensorboard/components/tf_imports:plottable",
"@org_polymer",
"//tensorflow/tensorboard/components/tf_imports:polymer",
],
)
web_library(
ts_web_library(
name = "demo",
srcs = ["index.html"],
path = "/vz-line-chart",
@ -30,60 +31,12 @@ web_library(
":vz_line_chart",
"@org_polymer_iron_demo_helpers",
"@org_polymer_paper_styles",
"@org_polymer_webcomponentsjs",
],
)
tensorboard_typescript_genrule(
name = "ts",
srcs = ["bundle.ts"],
typings = [
"@org_definitelytyped//:lodash.d.ts",
"@org_definitelytyped//:polymer.d.ts",
"@org_definitelytyped//:webcomponents.js.d.ts",
"//tensorflow/tensorboard/components/tf_imports:d3.d.ts",
"//tensorflow/tensorboard/components/tf_imports:plottable.d.ts",
],
)
tensorboard_typescript_bundle(
name = "bundle",
out = "bundle.ts",
namespace_srcs = {
"VZ.ChartHelpers": [
"vz-chart-helpers.ts",
],
"VZ": [
"vz-line-chart.ts",
"dragZoomInteraction.ts",
],
},
namespace_symbol_aliases = {
"VZ.ChartHelpers": {
"Dataset": "Plottable.Dataset",
},
},
)
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)
################################################################################
# MARKED FOR DELETION
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
tensorboard_webcomponent_library(
name = "legacy",
srcs = [
"index.html",
"vz-line-chart.html",
":legacy_ts",
],
srcs = [":vz_line_chart"],
visibility = ["//learning/vis/vz_elements/catalog:__pkg__"],
destdir = "vz-line-chart",
deps = [
@ -93,24 +46,8 @@ tensorboard_webcomponent_library(
],
)
tensorboard_ts_library(
name = "legacy_ts",
srcs = [
"dragZoomInteraction.ts",
"vz-chart-helpers.ts",
"vz-line-chart.ts",
],
deps_mgmt = "off",
runtime = "nodejs",
deps = [
"//third_party/javascript/node_modules/typescript:es2015.promise",
"//third_party/javascript/plottable:bundle",
"//third_party/javascript/typings/chai",
"//third_party/javascript/typings/d3_v4:bundle",
"//third_party/javascript/typings/lodash",
"//third_party/javascript/typings/mocha",
"//third_party/javascript/typings/polymer:polymer_without_externs",
"//third_party/javascript/typings/sinon",
"//third_party/javascript/typings/webcomponents_js",
],
filegroup(
name = "all_files",
srcs = glob(["**"]),
tags = ["notsan"],
)

View File

@ -13,11 +13,6 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
import * as d3 from 'd3'; // from //third_party/javascript/typings/d3_v4
import * as Plottable from 'Plottable/plottable'; // from //third_party/javascript/plottable
export class DragZoomLayer extends Plottable.Components.SelectionBoxLayer {
private _dragInteraction: Plottable.Interactions.Drag;
private _doubleClickInteraction: Plottable.Interactions.Click;

View File

@ -21,7 +21,6 @@ limitations under the License.
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vz-line-chart demo</title>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="vz-line-chart.html">
<link rel="import" href="../iron-demo-helpers/demo-snippet.html">
<link rel="import" href="../paper-styles/typography.html">

View File

@ -12,12 +12,6 @@ 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.
==============================================================================*/
/* tslint:disable:no-namespace variable-name */
import * as d3 from 'd3'; // from //third_party/javascript/typings/d3_v4
import * as Plottable from 'Plottable/plottable'; // from //third_party/javascript/plottable
import {Dataset} from 'Plottable/plottable';
export interface Datum {
wall_time: Date;
@ -123,6 +117,7 @@ export function computeDomain(values: number[], ignoreOutliers: boolean) {
}
export function accessorize(key: string): Plottable.IAccessor<number> {
// tslint:disable-next-line:no-any be quiet tsc
return (d: any, index: number, dataset: Plottable.Dataset) => d[key];
}
@ -157,19 +152,21 @@ export function wallX(): XComponents {
accessor: (d: Datum) => d.wall_time,
};
}
export let relativeAccessor = (d: any, index: number, dataset: Dataset) => {
// We may be rendering the final-point datum for scatterplot.
// If so, we will have already provided the 'relative' property
if (d.relative != null) {
return d.relative;
}
let data = dataset.data();
// I can't imagine how this function would be called when the data is
// empty (after all, it iterates over the data), but lets guard just
// to be safe.
let first = data.length > 0 ? +data[0].wall_time : 0;
return (+d.wall_time - first) / (60 * 60 * 1000); // ms to hours
};
export let relativeAccessor =
// tslint:disable-next-line:no-any be quiet tsc
(d: any, index: number, dataset: Plottable.Dataset) => {
// We may be rendering the final-point datum for scatterplot.
// If so, we will have already provided the 'relative' property
if (d.relative != null) {
return d.relative;
}
let data = dataset.data();
// I can't imagine how this function would be called when the data is
// empty (after all, it iterates over the data), but lets guard just
// to be safe.
let first = data.length > 0 ? +data[0].wall_time : 0;
return (+d.wall_time - first) / (60 * 60 * 1000); // ms to hours
};
export let relativeFormatter = (n: number) => {
// we will always show 2 units of precision, e.g days and hours, or

Some files were not shown because too many files have changed in this diff Show More