aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf-event-dashboard/tf-tooltip-coordinator.html
blob: 23b0cba87a01295d17eccdf72a884f9746a207ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<link rel="import" href="../../bower_components/polymer/polymer.html">

<!-- tf-tooltip-coordinator is a plumbing component that provides a TooltipUpdater,
which is a function that allows modification of the values within the tooltip-coordinator
from javascript logic elsewhere. It then propagates the values to other Polymer components.

Thus, the tooltip-coordinator allows many JS pieces of the application to modify a single
piece of shared state.
 -->
<dom-module id="tf-tooltip-coordinator">
  <script>
    Polymer({
      is: "tf-tooltip-coordinator",
      properties: {
        outTooltipUpdater: {
          type: Function,
          value: function() {
            return (function(tooltipMap, xValue, closestRun) {
              this._setOutTooltipMap(tooltipMap);
              this._setOutXValue(xValue);
              this._setOutClosestRun(closestRun);
            }).bind(this);
          },
          notify: true,
          readOnly: true,
        },
        outTooltipMap: {
          // a {runName: tooltipValue} map, where runName and tooltipValue are strings.
          type: Object,
          notify: true,
          readOnly: true,
        },
        outXValue: {
          // a string representation of the closest x value for the tooltips
          type: Number,
          notify: true,
          readOnly: true,
        },
        outClosestRun: {
          // the name of the run that is closest to the user cursor (if any)
          type: String,
          notify: true,
          readOnly: true,
        },
      },
    });
  </script>
</dom-module>