Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ export const DataLoaderBehavior = {

_loadDataImpl() {
this.cancelAsync(this._loadDataAsync);

if (!this.isAttached) return;
this._loadDataAsync = this.async(() => {
if (!this.isAttached) return;
this.dataLoading = true;

// Before updating, cancel any network-pending updates, to
Expand All @@ -140,7 +141,7 @@ export const DataLoaderBehavior = {

return Promise.all(promises).then(this._canceller.cancellable(result => {
this.dataLoading = false;
if (result.cancelled || !promises.length) return;
if (result.cancelled) return;
this.onLoadFinish();
}));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
},

setSeriesData(name, data) {
this._resetDomainOnNextLoad = true;
this.$.chart.setSeriesData(name, data);
},

Expand Down
15 changes: 14 additions & 1 deletion tensorboard/components/tf_tensorboard/tf-tensorboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ <h3>There’s no dashboard by the name of “<tt>[[_selectedDashboard]]</tt>.”
throw new Error('HTML import plugin dashboards *before* tf-tensorboard');
}

const DATA_SELECTION_CHANGE_DEBOUNCE_MS = 200;

Polymer({
is: "tf-tensorboard",
behaviors: [tf_tensorboard.AutoReloadBehavior],
Expand Down Expand Up @@ -728,6 +730,7 @@ <h3>There’s no dashboard by the name of “<tt>[[_selectedDashboard]]</tt>.”
const component = document.createElement(dashboard.elementName);
component.id = 'dashboard'; // used in `_selectedDashboardComponent`
if (dashboard.useDataSelector) {
this.cancelDebouncer('updateDataSelection');
component.dataSelection = this._dataSelection;
}
container.appendChild(component);
Expand Down Expand Up @@ -760,10 +763,20 @@ <h3>There’s no dashboard by the name of “<tt>[[_selectedDashboard]]</tt>.”
_updateDataSelection() {
// The dashboard is not ready yet until it stamped the containers.
if (!this._dashboardContainersStamped) return;

this.cancelDebouncer('updateDataSelection');

const component = this._selectedDashboardComponent();
// The dashboard may not exist.
if (!component) return;
component.dataSelection = this._dataSelection;

const selectedDashboard = this._selectedDashboard;
const dashboard = tf_tensorboard.dashboardRegistry[selectedDashboard];
if (dashboard.useDataSelector) {
this.debounce('updateDataSelection', () => {
component.dataSelection = this._dataSelection;
}, DATA_SELECTION_CHANGE_DEBOUNCE_MS);
}
},

ready() {
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/components/vz_line_chart2/vz-line-chart2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Polymer({
},

observers: [
'_makeChart(xComponentsCreationMethod, xType, yValueAccessor, yScaleType, tooltipColumns, colorScale)',
'_makeChart(xComponentsCreationMethod, xType, yValueAccessor, yScaleType, tooltipColumns, colorScale, isAttached)',
'_reloadFromCache(_chart)',
'_smoothingChanged(smoothingEnabled, smoothingWeight, _chart)',
'_tooltipSortingMethodChanged(tooltipSortingMethod, _chart)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
_getDataLoadName: {
type: Function,
value: function() {
return this._getSeriesNameFromDatum;
return (datum) => this._getSeriesNameFromDatum(datum);
},
},

Expand Down