Title: Plotly.js is incompatible with Chrome's native shadow DOM implementation · Issue #1433 · plotly/plotly.js · GitHub
Open Graph Title: Plotly.js is incompatible with Chrome's native shadow DOM implementation · Issue #1433 · plotly/plotly.js
X Title: Plotly.js is incompatible with Chrome's native shadow DOM implementation · Issue #1433 · plotly/plotly.js
Description: Context I develop and maintain ginkgobioworks/plotly-plot, a Polymer element that encapsulates plotly.js. Polymer is a web-component framework written by Google, which uses browser functionality known as the "shadow DOM" to isolate the i...
Open Graph Description: Context I develop and maintain ginkgobioworks/plotly-plot, a Polymer element that encapsulates plotly.js. Polymer is a web-component framework written by Google, which uses browser functionality kn...
X Description: Context I develop and maintain ginkgobioworks/plotly-plot, a Polymer element that encapsulates plotly.js. Polymer is a web-component framework written by Google, which uses browser functionality kn...
Opengraph URL: https://github.com/plotly/plotly.js/issues/1433
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Plotly.js is incompatible with Chrome's native shadow DOM implementation","articleBody":"### Context\r\nI develop and maintain [ginkgobioworks/plotly-plot](https://github.com/ginkgobioworks/plotly-plot), a Polymer element that encapsulates plotly.js. Polymer is a web-component framework written by Google, which uses browser functionality known as the \"shadow DOM\" to isolate the internals of web components from the rest of the page.\r\n\r\nPolymer 1.x has two kinds of shadow DOM implementations: native shadow DOM (v0), and a\r\nshim called \"shady DOM.\" Native shadow DOM is newer and yields improved\r\nperformance, but it has poor support in browsers outside of Chrome\r\nand can cause problems with existing code. For this reason, shady DOM is\r\nstill the default implementation in Polymer 1.x.\r\n\r\n### Issue\r\nUnfortunately, native shadow DOM is currently incompatible with plotly.js. The\r\nicon toolbar layout code in the plotly.js library fails for all plotly plots\r\nrendered inside a shadow DOM.\r\n\r\n### Example\r\nSince it's a pain to create your own elements without the tools in a code pen, the easiest example to observe is on the [plotly-plot demo page](http://ginkgobioworks.github.io/plotly-plot/components/plotly-plot/demo/).\r\n\r\nYou can render the page either with shady DOM (the default) or with shadow DOM by [passing in the `?dom=shadow` GET parameter](http://ginkgobioworks.github.io/plotly-plot/components/plotly-plot/demo/?dom=shadow), which forces Polymer to use native shadow DOM v0 in [browsers that support it](http://caniuse.com/#feat=shadowdom).\r\n\r\n#### Expected/Observed\r\nUnder shady DOM (no GET parameter), the elements behave as expected. Under shadow DOM (with the GET parameter), however, the toolbars fail to render entirely.\r\n\r\n### Impact\r\nI don't know why this is the case. It might have to do with SVG support for the buttons, or CSS effects.\r\n\r\nThe work-around on my side is that anyone who consumes my element must not turn on native shadow DOM rendering on any page that renders a `plotly-plot` widget. This is fine for small, simple pages, but can be a real drag when front-end performance is at stake.\r\n\r\nI'm wondering if there might be a relatively easy fix that would prevent this from happening—if there is, it'd be nice to do it. If not, it's probably not worth doing any serious rewriting for this use case.\r\n\r\nIn any case, thought you'd be interested to know.\r\n\r\n","author":{"url":"https://github.com/myw","@type":"Person","name":"myw"},"datePublished":"2017-03-02T07:28:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/1433/plotly.js/issues/1433"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40859b08-f766-f4cb-09c0-f1208d74877e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF48:321E68:3477FE1:4B2C961:6A568926 |
| html-safe-nonce | 624f5642d55a003c108ec222af1a3ffbb6ce07a594de89f738b48f138d147e13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjQ4OjMyMUU2ODozNDc3RkUxOjRCMkM5NjE6NkE1Njg5MjYiLCJ2aXNpdG9yX2lkIjoiOTA5MDk3NzA2MDM5OTUxNTk0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4d0dbf1c53b3b6f2f5f95e52512efc04ef0b8354642e55c313d9c7b110a8570a |
| hovercard-subject-tag | issue:211310915 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/1433/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9860372d31e98080ea1b7ba450730d85730a9e5097607b85f31addcb9eb27ca9/plotly/plotly.js/issues/1433 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9860372d31e98080ea1b7ba450730d85730a9e5097607b85f31addcb9eb27ca9/plotly/plotly.js/issues/1433 |
| og:image:alt | Context I develop and maintain ginkgobioworks/plotly-plot, a Polymer element that encapsulates plotly.js. Polymer is a web-component framework written by Google, which uses browser functionality kn... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | myw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38 |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 78af172a48a2056810bb627ffa684003e4f9a5ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width