Plotly.Blazor icon indicating copy to clipboard operation
Plotly.Blazor copied to clipboard

Add "plotly-basic.min.js" to the project.

Open IvanJosipovic opened this issue 3 years ago • 5 comments

Currently, this NuGet package bundles the "plotly-latest.min.js", I would like to use the "plotly-basic.min.js" script as its much smaller in size.

IvanJosipovic avatar Sep 15 '22 16:09 IvanJosipovic

Is it feasible to simply add plotly-latest.min.js (version matched to Plotly.Blazor's built-in version) to wwwroot and replace the javascript import to point to the minimal version?

tibkiss avatar Oct 03 '23 13:10 tibkiss

Is it feasible to simply add plotly-latest.min.js (version matched to Plotly.Blazor's built-in version) to wwwroot and replace the javascript import to point to the minimal version?

Should be possible I guess

sean-mcl avatar Oct 03 '23 13:10 sean-mcl

@sean-mcl : Thanks for the prompt reply.

The reason I asked, because I tried it out and seemed to work. Not sure about the internals of Plotly.Blazor which would make this transition unsafe.

Would you consider this hack safe? :)

tibkiss avatar Oct 03 '23 13:10 tibkiss

@sean-mcl : Thanks for the prompt reply.

The reason I asked, because I tried it out and seemed to work. Not sure about the internals of Plotly.Blazor which would make this transition unsafe.

Would you consider this hack safe? :)

Well, it is safe, as long as of course only what is available in the slimmed down version is used. That's why I don't have any concerns, as long as you know what you're doing. 😄

sean-mcl avatar Oct 03 '23 13:10 sean-mcl

@sean-mcl : Thanks for the prompt reply. The reason I asked, because I tried it out and seemed to work. Not sure about the internals of Plotly.Blazor which would make this transition unsafe. Would you consider this hack safe? :)

Well, it is safe, as long as of course only what is available in the slimmed down version is used. That's why I don't have any concerns, as long as you know what you're doing. 😄

Thanks!

tibkiss avatar Oct 03 '23 13:10 tibkiss

https://github.com/LayTec-AG/Plotly.Blazor/pull/432 introduces a new property UseBasicVersion to the PlotlyChart-Component.

It will automatically lazy load the basic minified instead of the full version.

sean-mcl avatar Jun 17 '24 12:06 sean-mcl