| 1273 | return f'<script id="_dash-renderer" type="application/javascript">{self.renderer}</script>' |
| 1274 | |
| 1275 | def _generate_meta(self): |
| 1276 | meta_tags = [] |
| 1277 | has_ie_compat = any( |
| 1278 | x.get("http-equiv", "") == "X-UA-Compatible" for x in self.config.meta_tags |
| 1279 | ) |
| 1280 | has_charset = any("charset" in x for x in self.config.meta_tags) |
| 1281 | has_viewport = any(x.get("name") == "viewport" for x in self.config.meta_tags) |
| 1282 | |
| 1283 | if not has_ie_compat: |
| 1284 | meta_tags.append({"http-equiv": "X-UA-Compatible", "content": "IE=edge"}) |
| 1285 | if not has_charset: |
| 1286 | meta_tags.append({"charset": "UTF-8"}) |
| 1287 | if not has_viewport: |
| 1288 | meta_tags.append( |
| 1289 | {"name": "viewport", "content": "width=device-width, initial-scale=1"} |
| 1290 | ) |
| 1291 | |
| 1292 | return meta_tags + self.config.meta_tags |
| 1293 | |
| 1294 | def index(self, *_args, **_kwargs): |
| 1295 | scripts = self._generate_scripts_html() |