aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf_dashboard_common/tf-multi-checkbox.html
blob: 8a56616f820f19c15a0097051abfaad929332d65 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!--
@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="../polymer/polymer.html">
<link rel="import" href="../iron-icons/iron-icons.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../tf-storage/tf-storage.html">
<link rel="import" href="../tf-imports/lodash.html">
<link rel="import" href="scrollbar-style.html">
<link rel="import" href="run-color-style.html">

<!--
tf-multi-checkbox creates a list of checkboxes that can be used to toggle on or off
a large number of values. Each checkbox displays a name, and may also have an
associated tooltip value. Checkboxes can be highlighted, hidden, and re-ordered.

tf-multi-checkbox assumes that the names may be very long compared to the width
of the checkbox, and the number of names may also be very large, and works to
handle these situations gracefully.
-->
<dom-module id="tf-multi-checkbox">
  <style include="scrollbar-style"></style>
  <style include="run-color-style"></style>

  <template>
      <paper-input
        id="runs-regex"
        no-label-float
        label="Write a regex to filter runs"
        value="[[regexInput]]"
        on-bind-value-changed="_debouncedRegexChange"
      ></paper-input>
    <div id="outer-container" class="scrollbar">
      <template
        is="dom-repeat"
        items="[[namesMatchingRegex]]"
      >
        <div
          class="run-row"
        >
          <div class="icon-container checkbox-container vertical-align-container">
            <paper-checkbox
              class="checkbox vertical-align-center"
              name="[[item]]"
              checked$="[[_isChecked(item, runSelectionState.*)]]"
              on-change="_checkboxChange"
            ></paper-checkbox>

          </div>
          <div class="icon-container isolator-container vertical-align-container">
            <paper-icon-button
              icon="radio-button-unchecked"
              class="isolator vertical-align-center"
              on-tap="_isolateRun"
              name="[[item]]"
            ></paper-icon-button>
          </div>
          <div class="item-label-container">
            <span>[[item]]</span>
          </div>
        </div>
      </template>
    </div>
  <style>
    paper-input {
      --paper-input-container-focus-color: var(--tb-orange-strong);
      --paper-input-container-input: {
        font-size: 14px;
      };
      --paper-input-container-label: {
        font-size: 14px;
      };
    }
    :host {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
    #outer-container {
      overflow-y: auto;
      overflow-x: hidden;
      width: 100%;
      height: 0; /* Quirk to make firefox add scrolling instead of expand div */
      flex-grow: 1;
      flex-shrink: 1;
      word-wrap: break-word;
    }
    .run-row {
      padding-top: 5px;
      padding-bottom: 5px;
      display: flex;
      flex-direction: row;
      font-size: 13px;
    }
    .icon-container {
      flex-grow: 0;
      flex-shrink: 0;
      padding-left: 2px;
    }
    .checkbox {
      padding-left: 2px;
      width: 18px;
      height: 18px;
    }
    .isolator {
      width: 18px;
      height: 18px;
      padding: 0px;
    }
    .isolator-container {
      padding-left: 6px;
      padding-right: 3px;
    }
    .checkbox-container {
      padding-left: 2px;
    }
    .item-label-container {
      padding-left: 5px;
      flex-grow: 1;
      flex-shrink: 1;
      width: 0px; /* hack to get the flex-grow to work properly */
    }
    .tooltip-value-container {
      display: flex;
      justify-content: center;
      flex-grow: 0;
      flex-shrink: 0;
      text-align:right;
      padding-left: 2px;
    }
    .vertical-align-container {
      display: flex;
      justify-content: center;
    }
    .vertical-align-container .vertical-align-center {
      align-self: center;
    }
    .vertical-align-container .vertical-align-top {
      align-self: start;
    }
  </style>
  </template>
  <script src="tf-multi-checkbox-bundle.js"></script>
</dom-module>