(coord_names, index)
| 149 | |
| 150 | |
| 151 | def summarize_index(coord_names, index) -> str: |
| 152 | name = "<br>".join([escape(str(n)) for n in coord_names]) |
| 153 | |
| 154 | index_id = f"index-{uuid.uuid4()}" |
| 155 | preview = escape(inline_index_repr(index, max_width=70)) |
| 156 | details = short_index_repr_html(index) |
| 157 | |
| 158 | data_icon = _icon("icon-database") |
| 159 | |
| 160 | return ( |
| 161 | f"<div class='xr-index-name'><div>{name}</div></div>" |
| 162 | f"<div class='xr-index-preview'>{preview}</div>" |
| 163 | # need empty input + label here to conform to the fixed CSS grid layout |
| 164 | f"<input type='checkbox' disabled/>" |
| 165 | f"<label></label>" |
| 166 | f"<input id='{index_id}' class='xr-index-data-in' type='checkbox'/>" |
| 167 | f"<label for='{index_id}' title='Show/Hide index repr'>{data_icon}</label>" |
| 168 | f"<div class='xr-index-data'>{details}</div>" |
| 169 | ) |
| 170 | |
| 171 | |
| 172 | def summarize_indexes(indexes) -> str: |
no test coverage detected
searching dependent graphs…