aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2017-02-03 17:13:49 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-02-03 17:28:36 -0800
commit02f276c63130e031e56711bff1bbac9d34a663f1 (patch)
tree10b1c12f7a34fa4248422a0672cd2497011dec8b /tensorflow/tensorboard
parentd08b6eb365f38f54408f4caee489c796dff71a56 (diff)
TensorBoard: Migrate vz_{sorting,line_chart} to webfiles
Change: 146535501
Diffstat (limited to 'tensorflow/tensorboard')
-rw-r--r--tensorflow/tensorboard/bower/BUILD2
-rw-r--r--tensorflow/tensorboard/components/tf_imports/BUILD57
-rw-r--r--tensorflow/tensorboard/components/tf_imports/d3.html2
-rw-r--r--tensorflow/tensorboard/components/tf_imports/dagre.html6
-rw-r--r--tensorflow/tensorboard/components/tf_imports/graphlib.html4
-rw-r--r--tensorflow/tensorboard/components/tf_imports/lodash.html2
-rw-r--r--tensorflow/tensorboard/components/tf_imports/plottable.html4
-rw-r--r--tensorflow/tensorboard/components/tf_imports_google/README.md3
-rw-r--r--tensorflow/tensorboard/components/tf_imports_google/d3.html18
-rw-r--r--tensorflow/tensorboard/components/tf_imports_google/dagre.html18
-rw-r--r--tensorflow/tensorboard/components/tf_imports_google/graphlib.html18
-rw-r--r--tensorflow/tensorboard/components/tf_imports_google/lodash.html18
-rw-r--r--tensorflow/tensorboard/components/tf_imports_google/plottable.html19
-rw-r--r--tensorflow/tensorboard/components/vz_line_chart/BUILD71
-rw-r--r--tensorflow/tensorboard/components/vz_line_chart/demo/BUILD24
-rw-r--r--tensorflow/tensorboard/components/vz_sorting/BUILD48
-rw-r--r--tensorflow/tensorboard/components/vz_sorting/test/BUILD35
-rw-r--r--tensorflow/tensorboard/defs.bzl55
18 files changed, 394 insertions, 10 deletions
diff --git a/tensorflow/tensorboard/bower/BUILD b/tensorflow/tensorboard/bower/BUILD
index 2c2921d988..22a9d8187b 100644
--- a/tensorflow/tensorboard/bower/BUILD
+++ b/tensorflow/tensorboard/bower/BUILD
@@ -65,7 +65,7 @@ filegroup(
"@paper_toolbar//:paper_toolbar",
"@paper_tooltip//:paper_tooltip",
"@plottable//:plottable",
- "@polymer//:polymer",
+ "@polymer_archive//:polymer",
"@promise_polyfill//:promise_polyfill",
"@three_js_orbitcontrols_js//file",
"@three_js_three_min_js//file",
diff --git a/tensorflow/tensorboard/components/tf_imports/BUILD b/tensorflow/tensorboard/components/tf_imports/BUILD
new file mode 100644
index 0000000000..5655407b30
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports/BUILD
@@ -0,0 +1,57 @@
+package(default_visibility = ["//tensorflow:internal"])
+
+load("@io_bazel_rules_closure//closure:defs.bzl", "webfiles")
+
+licenses(["notice"]) # Apache 2.0
+
+webfiles(
+ name = "d3",
+ srcs = [
+ "d3.html",
+ "@org_d3js",
+ ],
+ path = "/tf-imports",
+)
+
+webfiles(
+ name = "lodash",
+ srcs = [
+ "lodash.html",
+ "@com_lodash",
+ ],
+ path = "/tf-imports",
+)
+
+webfiles(
+ name = "graphlib",
+ srcs = [
+ "graphlib.html",
+ "@io_github_cpettitt_graphlib",
+ ],
+ path = "/tf-imports",
+ deps = [":lodash"],
+)
+
+webfiles(
+ name = "dagre",
+ srcs = [
+ "dagre.html",
+ "@io_github_cpettitt_dagre",
+ ],
+ path = "/tf-imports",
+ deps = [
+ ":graphlib",
+ ":lodash",
+ ],
+)
+
+webfiles(
+ name = "plottable",
+ srcs = [
+ "plottable.html",
+ "@com_palantir_plottable//:plottable.css",
+ "@com_palantir_plottable//:plottable.js",
+ ],
+ path = "/tf-imports",
+ deps = [":d3"],
+)
diff --git a/tensorflow/tensorboard/components/tf_imports/d3.html b/tensorflow/tensorboard/components/tf_imports/d3.html
index 8e7295f3a0..d2c6cd8b5f 100644
--- a/tensorflow/tensorboard/components/tf_imports/d3.html
+++ b/tensorflow/tensorboard/components/tf_imports/d3.html
@@ -15,4 +15,4 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<script src="../d3/d3.js"></script>
+<script src="d3.js"></script>
diff --git a/tensorflow/tensorboard/components/tf_imports/dagre.html b/tensorflow/tensorboard/components/tf_imports/dagre.html
index 71d69ac93a..48fe39da79 100644
--- a/tensorflow/tensorboard/components/tf_imports/dagre.html
+++ b/tensorflow/tensorboard/components/tf_imports/dagre.html
@@ -19,6 +19,6 @@ limitations under the License.
HTML imports are non-blocking thus getting the dependency 'graphlib'
and 'lodash' via script imports instead.
-->
-<script src="../lodash/lodash.min.js"></script>
-<script src="../graphlib/dist/graphlib.core.js"></script>
-<script src="../dagre/dist/dagre.core.js"></script>
+<script src="lodash.js"></script>
+<script src="graphlib.core.js"></script>
+<script src="dagre.core.js"></script>
diff --git a/tensorflow/tensorboard/components/tf_imports/graphlib.html b/tensorflow/tensorboard/components/tf_imports/graphlib.html
index d093b528c2..4e19f7b008 100644
--- a/tensorflow/tensorboard/components/tf_imports/graphlib.html
+++ b/tensorflow/tensorboard/components/tf_imports/graphlib.html
@@ -15,5 +15,5 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<script src="../lodash/lodash.min.js"></script>
-<script src="../graphlib/dist/graphlib.core.js"></script>
+<script src="lodash.js"></script>
+<script src="graphlib.core.js"></script>
diff --git a/tensorflow/tensorboard/components/tf_imports/lodash.html b/tensorflow/tensorboard/components/tf_imports/lodash.html
index 9d8c43728c..f92aa80879 100644
--- a/tensorflow/tensorboard/components/tf_imports/lodash.html
+++ b/tensorflow/tensorboard/components/tf_imports/lodash.html
@@ -15,4 +15,4 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<script src="../lodash/lodash.min.js"></script>
+<script src="lodash.js"></script>
diff --git a/tensorflow/tensorboard/components/tf_imports/plottable.html b/tensorflow/tensorboard/components/tf_imports/plottable.html
index 6d619e0d72..57f9c1d6d3 100644
--- a/tensorflow/tensorboard/components/tf_imports/plottable.html
+++ b/tensorflow/tensorboard/components/tf_imports/plottable.html
@@ -16,5 +16,5 @@ limitations under the License.
-->
<link rel="import" href="d3.html">
-<script src="../plottable/plottable.js"></script>
-<link rel="stylesheet" type="text/css" href="../plottable/plottable.css">
+<script src="plottable.js"></script>
+<link rel="stylesheet" type="text/css" href="plottable.css">
diff --git a/tensorflow/tensorboard/components/tf_imports_google/README.md b/tensorflow/tensorboard/components/tf_imports_google/README.md
new file mode 100644
index 0000000000..60d9cce777
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports_google/README.md
@@ -0,0 +1,3 @@
+This file acts as import routers for third party javascript libraries,
+e.g. Plottable and D3 from `g3/third_party`; it exists to facilitate development
+inside google.
diff --git a/tensorflow/tensorboard/components/tf_imports_google/d3.html b/tensorflow/tensorboard/components/tf_imports_google/d3.html
new file mode 100644
index 0000000000..dbfd11aa87
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports_google/d3.html
@@ -0,0 +1,18 @@
+<!--
+@license
+Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<script src="../d3-library/d3.js"></script>
diff --git a/tensorflow/tensorboard/components/tf_imports_google/dagre.html b/tensorflow/tensorboard/components/tf_imports_google/dagre.html
new file mode 100644
index 0000000000..5b8b981741
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports_google/dagre.html
@@ -0,0 +1,18 @@
+<!--
+@license
+Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<link rel="import" href="../dagre-library/dagre.html">
diff --git a/tensorflow/tensorboard/components/tf_imports_google/graphlib.html b/tensorflow/tensorboard/components/tf_imports_google/graphlib.html
new file mode 100644
index 0000000000..56b37ebe4b
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports_google/graphlib.html
@@ -0,0 +1,18 @@
+<!--
+@license
+Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<link rel="import" href="../graphlib-library/graphlib.html">
diff --git a/tensorflow/tensorboard/components/tf_imports_google/lodash.html b/tensorflow/tensorboard/components/tf_imports_google/lodash.html
new file mode 100644
index 0000000000..eb8fef2883
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports_google/lodash.html
@@ -0,0 +1,18 @@
+<!--
+@license
+Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<link rel="import" href="../lodash-library/lodash-library.html">
diff --git a/tensorflow/tensorboard/components/tf_imports_google/plottable.html b/tensorflow/tensorboard/components/tf_imports_google/plottable.html
new file mode 100644
index 0000000000..6f9678f9cb
--- /dev/null
+++ b/tensorflow/tensorboard/components/tf_imports_google/plottable.html
@@ -0,0 +1,19 @@
+<!--
+@license
+Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<link rel="import" href="d3.html">
+<link rel="import" href="../plottable-library/plottable.html">
diff --git a/tensorflow/tensorboard/components/vz_line_chart/BUILD b/tensorflow/tensorboard/components/vz_line_chart/BUILD
new file mode 100644
index 0000000000..967d86596f
--- /dev/null
+++ b/tensorflow/tensorboard/components/vz_line_chart/BUILD
@@ -0,0 +1,71 @@
+package(default_visibility = ["//tensorflow:internal"])
+
+load("@io_bazel_rules_closure//closure:defs.bzl", "webfiles")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
+
+licenses(["notice"]) # Apache 2.0
+
+webfiles(
+ name = "vz_line_chart",
+ srcs = [
+ "vz-line-chart.html",
+ ":ts",
+ ],
+ path = "/vz-line-chart",
+ deps = [
+ "//tensorflow/tensorboard/components/tf_imports:lodash",
+ "//tensorflow/tensorboard/components/tf_imports:plottable",
+ "@org_polymer",
+ ],
+)
+
+tensorboard_typescript_genrule(
+ name = "ts",
+ srcs = [
+ "dragZoomInteraction.ts",
+ "vz-chart-helpers.ts",
+ "vz-line-chart.ts",
+ ],
+ typings = [
+ "@org_definitelytyped//:d3.d.ts",
+ "@com_palantir_plottable//:plottable.d.ts",
+ "@org_definitelytyped//:lodash.d.ts",
+ ],
+)
+
+filegroup(
+ name = "all_files",
+ srcs = glob(["**"]),
+ tags = ["notsan"],
+)
+
+################################################################################
+# MARKED FOR DELETION
+
+tensorboard_webcomponent_library(
+ name = "legacy",
+ srcs = [
+ "index.html",
+ "vz-line-chart.html",
+ ":legacy_ts",
+ ],
+ visibility = ["//visibility:public"],
+ destdir = "vz-line-chart",
+ deps = [
+ "//tensorflow/tensorboard/components:tf_imports",
+ "//tensorflow/tensorboard/components/vz_sorting:legacy",
+ "//third_party/javascript/polymer/v1/polymer:lib",
+ ],
+)
+
+tensorboard_ts_library(
+ name = "legacy_ts",
+ srcs = [
+ "dragZoomInteraction.ts",
+ "vz-chart-helpers.ts",
+ "vz-line-chart.ts",
+ ],
+ deps = ["//tensorflow/tensorboard/components:common_deps"],
+)
diff --git a/tensorflow/tensorboard/components/vz_line_chart/demo/BUILD b/tensorflow/tensorboard/components/vz_line_chart/demo/BUILD
new file mode 100644
index 0000000000..84699b67b6
--- /dev/null
+++ b/tensorflow/tensorboard/components/vz_line_chart/demo/BUILD
@@ -0,0 +1,24 @@
+package(default_visibility = ["//tensorflow:internal"])
+
+load("@io_bazel_rules_closure//closure:defs.bzl", "webfiles")
+
+licenses(["notice"]) # Apache 2.0
+
+# bazel run //third_party/tensorflow/tensorboard/components/vz_line_chart/demo
+webfiles(
+ name = "demo",
+ srcs = ["index.html"],
+ path = "/vz-line-chart/demo",
+ deps = [
+ "//tensorflow/tensorboard/components/vz_line_chart",
+ "@org_polymer_iron_demo_helpers",
+ "@org_polymer_paper_styles",
+ "@org_polymer_webcomponentsjs",
+ ],
+)
+
+filegroup(
+ name = "all_files",
+ srcs = glob(["**"]),
+ tags = ["notsan"],
+)
diff --git a/tensorflow/tensorboard/components/vz_sorting/BUILD b/tensorflow/tensorboard/components/vz_sorting/BUILD
new file mode 100644
index 0000000000..ae3f6e2777
--- /dev/null
+++ b/tensorflow/tensorboard/components/vz_sorting/BUILD
@@ -0,0 +1,48 @@
+package(default_visibility = ["//tensorflow:internal"])
+
+load("@io_bazel_rules_closure//closure:defs.bzl", "webfiles")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_typescript_genrule")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_webcomponent_library")
+
+licenses(["notice"]) # Apache 2.0
+
+webfiles(
+ name = "vz_sorting",
+ srcs = [
+ "vz-sorting.html",
+ ":ts",
+ ],
+ path = "/vz-sorting",
+ visibility = ["//visibility:public"],
+)
+
+tensorboard_typescript_genrule(
+ name = "ts",
+ srcs = ["sorting.ts"],
+)
+
+filegroup(
+ name = "all_files",
+ srcs = glob(["**"]),
+ tags = ["notsan"],
+)
+
+################################################################################
+# MARKED FOR DELETION
+
+tensorboard_webcomponent_library(
+ name = "legacy",
+ srcs = [
+ "vz-sorting.html",
+ ":legacy_ts",
+ ],
+ visibility = ["//visibility:public"],
+ destdir = "vz-sorting",
+)
+
+tensorboard_ts_library(
+ name = "legacy_ts",
+ srcs = ["sorting.ts"],
+ deps = ["//tensorflow/tensorboard/components:common_deps"],
+)
diff --git a/tensorflow/tensorboard/components/vz_sorting/test/BUILD b/tensorflow/tensorboard/components/vz_sorting/test/BUILD
new file mode 100644
index 0000000000..f8b01b61f2
--- /dev/null
+++ b/tensorflow/tensorboard/components/vz_sorting/test/BUILD
@@ -0,0 +1,35 @@
+package(default_visibility = ["//tensorflow:internal"])
+
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_ts_library")
+load("//tensorflow/tensorboard:defs.bzl", "tensorboard_wct_test_suite")
+
+licenses(["notice"]) # Apache 2.0
+
+filegroup(
+ name = "all_files",
+ srcs = glob(["**"]),
+ tags = ["notsan"],
+)
+
+################################################################################
+# MARKED FOR DELETION
+
+tensorboard_wct_test_suite(
+ name = "legacy_test",
+ size = "medium",
+ srcs = ["index.html"],
+ deps = [
+ "//tensorflow/tensorboard/components/vz_sorting:legacy",
+ "//third_party/javascript/polymer/v1/webcomponentsjs:lib",
+ ],
+)
+
+tensorboard_ts_library(
+ name = "legacy_ts",
+ testonly = 1,
+ srcs = ["sortingTests.ts"],
+ deps = [
+ "//tensorflow/tensorboard/components:common_deps",
+ "//tensorflow/tensorboard/components/vz_sorting:legacy_ts",
+ ],
+)
diff --git a/tensorflow/tensorboard/defs.bzl b/tensorflow/tensorboard/defs.bzl
new file mode 100644
index 0000000000..3488978ab2
--- /dev/null
+++ b/tensorflow/tensorboard/defs.bzl
@@ -0,0 +1,55 @@
+# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+_DEFAULT_TYPINGS = [
+ "@com_microsoft_typescript//:lib.es6.d.ts",
+]
+
+def tensorboard_typescript_genrule(name, srcs, typings=[], **kwargs):
+ """Filegroup of compiled TypeScript sources.
+
+ This is a very unsophisticated TypeScript rule where the user is responsible
+ for passing all typings and sources via srcs. It's meant as a stopgap because
+ TypeScript rules currently don't exist for Bazel. The definition of this rule
+ will need to evolve as more ts_library rules are migrated.
+ """
+ for src in srcs:
+ if (src.startswith("/") or
+ src.endswith(".d.ts") or
+ not src.endswith(".ts")):
+ fail("srcs must be typescript sources in same package")
+ native.genrule(
+ name = name,
+ srcs = _DEFAULT_TYPINGS + typings + srcs,
+ outs = [src[:-3] + ".js" for src in srcs],
+ cmd = "$(location @com_microsoft_typescript//:tsc)" +
+ " --inlineSourceMap" +
+ " --inlineSources" +
+ " --outDir $(@D)" +
+ " $(SRCS)",
+ tools = ["@com_microsoft_typescript//:tsc"],
+ **kwargs
+ )
+
+def tensorboard_ts_library(**kwargs):
+ """Rules referencing this will be deleted from the codebase soon."""
+ pass
+
+def tensorboard_webcomponent_library(**kwargs):
+ """Rules referencing this will be deleted from the codebase soon."""
+ pass
+
+def tensorboard_wct_test_suite(**kwargs):
+ """Rules referencing this will be deleted from the codebase soon."""
+ pass