-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support replacing resources #655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for this post. However, I think the point is how to make such a minimum javascript. |
If you're talking about specifically how to make a smaller plotly.js bundle, first take a look at the ones already provided: https://github.com/plotly/plotly.js/tree/master/dist#partial-bundles If there isn't already one that meets your needs, there are ways to make your own - see eg https://community.plot.ly/t/modularizing-plotly/6029 The subject of this issue is, once you have the new bundle, how to cleanly plumb it into dash. But if you're looking for a quick-and-dirty way to do it, you can just put the new bundle somewhere convenient, and after importing |
Greate, thanks for your reply! And looking forward to the dynamic loading of dcc in future. |
For We're planning to do the same for markdown code highlighting plotly/dash-core-components#643. Something like I will leave this issue open though even after we do this for |
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
Background
As raised in plotly/dash-core-components#462, some of the default included JS libraries are not the latest/much larger than needed by some users. For example, there is no need to include the full plotly.js library for an application only using a scatter plot.
Potential implementation
@alexcjohnson laid out a potential function that would allow a user to swap out a resource on a per-namespace basis,
dash.replace_resource
: plotly/dash-core-components#462 (comment)This issue would need to cover implementing this function, which might look something like below:
In order to support this generically, future Dash component packages would need to include a
resource_name
field when specifying, e.g.,_js_dist
. Alternatively, it could also be set up using a lambda that returnsTrue
/False
(i.e., a function passed to afilter
) given a generic resource specification.There's likely a better way to handle this using the
Resources
objects for both css and for jsThe text was updated successfully, but these errors were encountered: