Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit ccf8a2f

Browse files
authored
Merge pull request #185 from PAIR-code/p2_merge
Update Facets to Polymer 2
2 parents 5a42fe3 + a11c63b commit ccf8a2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+17210
-3009
lines changed

WORKSPACE

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ versions.check(minimum_bazel_version = "0.22.0")
1919

2020
http_archive(
2121
name = "io_bazel_rules_closure",
22-
sha256 = "0e6de40666f2ebb2b30dc0339745a274d9999334a249b05a3b1f46462e489adf",
23-
# The changes that we need for Bazel 0.23 compatibility are not in
24-
# any release, so we pin to HEAD as of 2019-02-22.
25-
strip_prefix = "rules_closure-87d24b1df8b62405de8dd059cb604fd9d4b1e395",
22+
sha256 = "b6936ecc0b5a1ef616b9d7e76694d414aa5605265c11322257a610fb256b1bf7",
23+
# The changes that we need for Bazel 0.26 compatibility are not in
24+
# any release, so we pin to HEAD as of 2019-06-04.
25+
strip_prefix = "rules_closure-7434c41542ca9e1b05166d897b90073d1b8b2cf8",
2626
urls = [
27-
"https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/87d24b1df8b62405de8dd059cb604fd9d4b1e395.tar.gz",
28-
"https://github.com/bazelbuild/rules_closure/archive/87d24b1df8b62405de8dd059cb604fd9d4b1e395.tar.gz", # 2019-02-22
27+
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/7434c41542ca9e1b05166d897b90073d1b8b2cf8.tar.gz",
28+
"https://github.com/bazelbuild/rules_closure/archive/7434c41542ca9e1b05166d897b90073d1b8b2cf8.tar.gz", # 2019-06-04
2929
],
3030
)
3131

@@ -47,14 +47,12 @@ closure_repositories(
4747
# omit_com_google_protobuf = True,
4848
omit_com_google_protobuf_js = True,
4949
)
50-
5150
http_archive(
5251
name = "org_tensorflow_tensorboard",
53-
sha256 = "5d04f587e4597b555f144dc128ddd5a0d8d1b26065d24dddc2b36ac82d9a85dd",
54-
strip_prefix = "tensorboard-8de790143b2cb787a8b0f1168cb0dd8d64eb8dcf",
52+
sha256 = "09ced8f421fb9d4e73b3b0f8f44c91ee653251e7c2e2b953a4774a507c348a86",
53+
strip_prefix = "tensorboard-b7dd0e369dfe51f6f08dbaf3e85fe0942dbaf64f",
5554
urls = [
56-
"https://mirror.bazel.build/github.com/tensorflow/tensorboard/archive/8de790143b2cb787a8b0f1168cb0dd8d64eb8dcf.tar.gz",
57-
"https://github.com/tensorflow/tensorboard/archive/8de790143b2cb787a8b0f1168cb0dd8d64eb8dcf.tar.gz", # 2019-01-13
55+
"https://github.com/stephanwlee/tensorboard/archive/b7dd0e369dfe51f6f08dbaf3e85fe0942dbaf64f.tar.gz", # 2019-06-28
5856
],
5957
)
6058

colab_facets.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"\n",
7171
"jsonstr = train_data.to_json(orient='records')\n",
7272
"HTML_TEMPLATE = \"\"\"\n",
73-
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.js\"></script>\n",
73+
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js\"></script>\n",
7474
" <link rel=\"import\" href=\"https://raw.githubusercontent.com/PAIR-code/facets/master/facets-dist/facets-jupyter.html\">\n",
7575
" <facets-dive id=\"elem\" height=\"600\"></facets-dive>\n",
7676
" <script>\n",
@@ -176,7 +176,7 @@
176176
"from IPython.core.display import display, HTML\n",
177177
"\n",
178178
"HTML_TEMPLATE = \"\"\"\n",
179-
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.js\"></script>\n",
179+
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js\"></script>\n",
180180
" <link rel=\"import\" href=\"https://raw.githubusercontent.com/PAIR-code/facets/master/facets-dist/facets-jupyter.html\" >\n",
181181
" <facets-overview id=\"elem\"></facets-overview>\n",
182182
" <script>\n",

facets-dist/facets-jupyter.html

Lines changed: 16910 additions & 2927 deletions
Large diffs are not rendered by default.

facets/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ tf_web_library(
1414
deps = [
1515
"//facets_dive/components/facets_dive",
1616
"//facets_overview/components/facets_overview",
17+
"@org_tensorflow_tensorboard//tensorboard/components:polymer",
1718
],
1819
)
1920

facets/visualizations.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
<link rel="import" href="../../polymer.html">
12
<link rel="import" href="../facets-overview/components/facets-overview/facets-overview.html">
23
<link rel="import" href="../facets-dive/components/facets-dive/facets-dive.html">

facets_dive/Dive_demo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"\n",
5959
"# Create Facets template \n",
6060
"HTML_TEMPLATE = \"\"\"\n",
61-
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.js\"></script>\n",
61+
" <script src=\"https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js\"></script>\n",
6262
" <link rel=\"import\" href=\"/nbextensions/facets-dist/facets-jupyter.html\">\n",
6363
" <facets-dive sprite-image-width=\"{sprite_size}\" sprite-image-height=\"{sprite_size}\" id=\"elem\" height=\"600\"></facets-dive>\n",
6464
" <script>\n",

facets_dive/components/facets_dive/facets-dive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* This CSS rule forces the containing element to have the correct height
3333
* in either case.
3434
*/
35-
::content paper-input-container > .floated-label-placeholder {
35+
:host paper-input-container > .floated-label-placeholder {
3636
min-height: 20px;
3737
}
3838

facets_dive/components/facets_dive/facets-dive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ Polymer({
412412
this._updateHeight();
413413
},
414414

415-
_updateHeight(this: any, height: number) {
415+
_updateHeight: function(this: any, height: number) {
416416
if (this.height !== null) {
417417
this.style.height =
418418
typeof this.height === 'number' ? this.height + 'px' : this.height;

facets_dive/components/facets_dive_controls/facets-dive-controls.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -231,24 +231,21 @@ Polymer({
231231
return positionMode === 'scatter';
232232
},
233233

234-
_isKeyNumeric(this: any, key: string): boolean {
234+
_isKeyNumeric: function(this: any, key: string): boolean {
235235
return this.stats && (key in this.stats) && this.stats[key].isNumeric();
236236
},
237237

238-
_isKeyCategorical(this: any, key: string): boolean {
238+
_isKeyCategorical: function(this: any, key: string): boolean {
239239
return this.stats && (key in this.stats) && !this.stats[key].isNumeric();
240240
},
241241

242242
_updateCSSVars(this: any) {
243-
this.customStyle['--grid-faceting-vertical-label-color'] =
244-
this.gridFacetingVerticalLabelColor;
245-
this.customStyle['--grid-faceting-horizontal-label-color'] =
246-
this.gridFacetingHorizontalLabelColor;
247-
this.customStyle['--item-positioning-vertical-label-color'] =
248-
this.itemPositioningVerticalLabelColor;
249-
this.customStyle['--item-positioning-horizontal-label-color'] =
250-
this.itemPositioningHorizontalLabelColor;
251-
this.updateStyles();
243+
this.updateStyles({
244+
'--grid-faceting-vertical-label-color': this.gridFacetingVerticalLabelColor,
245+
'--grid-faceting-horizontal-label-color': this.gridFacetingHorizontalLabelColor,
246+
'--item-positioning-vertical-label-color': this.itemPositioningVerticalLabelColor,
247+
'--item-positioning-horizontal-label-color': this.itemPositioningHorizontalLabelColor
248+
});
252249
},
253250

254251
/**
@@ -263,7 +260,7 @@ Polymer({
263260
*/
264261
_maxBuckets(this: any, fieldName: string, bagOfWords: boolean): number {
265262
const defaultMax = 100;
266-
const fieldStats: FieldStats = this.stats[fieldName];
263+
const fieldStats: FieldStats = this.stats ? this.stats[fieldName] : null;
267264
if (!fieldStats) {
268265
return defaultMax;
269266
}
@@ -276,8 +273,8 @@ Polymer({
276273
/**
277274
* Return whether the chosen field has a usable word tree.
278275
*/
279-
_hasWordTree(this: any, fieldName: string): boolean {
280-
const fieldStats: FieldStats = this.stats[fieldName];
276+
_hasWordTree: function(this: any, fieldName: string): boolean {
277+
const fieldStats: FieldStats = this.stats ? this.stats[fieldName] : null;
281278
return !!fieldStats && !!fieldStats.wordTree &&
282279
fieldStats.wordTree.highestLevel > 1;
283280
},

facets_dive/components/facets_dive_info_card/facets-dive-info-card.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@
3030
overflow: auto;
3131
padding: 8px;
3232
}
33-
::content dt {
33+
dt {
3434
color: #9e7c65;
3535
font-size: 14px;
3636
}
37-
::content dd {
37+
dd {
3838
@apply --paper-font-common-code;
3939
color: #513726;
4040
margin: 0 0 16px 0;
4141
}
4242
</style>
43+
<div id="holder"></div>
4344
<!-- Additional content filled in dynamically. -->
4445
</template>
4546
</dom-module>

0 commit comments

Comments
 (0)