Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7507bc

Browse files
committed
Removing the PlotlyViaCdnModule
1 parent 859d43a commit e7507bc

File tree

4 files changed

+0
-226
lines changed

4 files changed

+0
-226
lines changed

README.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ Supports Angular 9.x and up. If you want to use with Angular 8.x, please use ver
2727
* [API](#api-reference)
2828
* [Basic props](#basic-props)
2929
* [Event handler props](#event-handler-props)
30-
* [Customizing the `plotly.js` bundle](#customizing-the-plotlyjs-bundle)
31-
* [Plotly Via CDN Module](#plotly-via-cdn-module)
3230
* [Development](#development)
3331

3432
## Installation
@@ -91,7 +89,6 @@ For a full description of Plotly chart types and attributes see the following re
9189
* [Plotly JavaScript API documentation](https://plot.ly/javascript/)
9290
* [Full plotly.js attribute listing](https://plot.ly/javascript/reference/)
9391

94-
The `plotly.js` is bundled within the angular code. To avoid this, please read [how to customize the plotlyjs bundle](#customizing-the-plotlyjs-bundle) below.
9592

9693
## API Reference
9794

@@ -185,53 +182,6 @@ will put the user template into the root *\<div\>* of the resulting *plotly.js*
185182
in front of any plotly-generated elements. This could be useful for implementing plot overlays.
186183

187184

188-
## Customizing the `plotly.js` bundle
189-
190-
By default, this library bundles `plotly.js` from the peer dependency together within the output. This results on huge outputs, for `plotly.js` itself is ~3MB when bundled. It also makes the build (with `ng serve --prod`) really slow, for it minifies everything together.
191-
192-
If you wish to optimize loading `plotly.js` in a different way, please check the [`PlotlyViaCDNModule`](#plotly-via-cdn-module) module below.
193-
194-
195-
### Plotly Via CDN Module
196-
197-
If you want to load `plotly.js` [from a CDN](https://github.com/plotly/plotly.js#use-the-plotlyjs-cdn-hosted-by-fastly), use the `PlotlyViaCDNModule` and set on the `PlotlyViaCDNModule.plotlyVersion` property the plotly.js's version you want to use and, optionally, you can also set on the `PlotlyViaCDNModule.plotlyBundle` property the plotly.js's build you want to use:
198-
199-
```typescript
200-
import { NgModule } from '@angular/core';
201-
import { CommonModule } from '@angular/common';
202-
203-
import { PlotlyViaCDNModule } from 'angular-plotly.js';
204-
205-
206-
PlotlyViaCDNModule.setPlotlyVersion('1.55.2'); // can be `latest` or any version number (i.e.: '1.40.0')
207-
PlotlyViaCDNModule.setPlotlyBundle('basic'); // optional: can be null (for full) or 'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox' or 'finance'
208-
209-
@NgModule({
210-
imports: [
211-
CommonModule,
212-
PlotlyViaCDNModule,
213-
],
214-
...
215-
})
216-
export class AppModule { }
217-
```
218-
219-
By default, plotly's CDN is used to fetch the requested bundle.js. However, you can either choose `plotly`, `cloudflare` or `custom`.
220-
221-
```typescript
222-
...
223-
224-
// For cloudflare
225-
PlotlyViaCDNModule.setPlotlyVersion('1.55.2', 'cloudflare'); // cloudflare doesn't support `latest`. It is mandatory to supply version.
226-
PlotlyViaCDNModule.setPlotlyBundle('basic'); // optional: can be null (for full) or 'basic', 'cartesian', 'geo', 'gl3d', 'gl2d', 'mapbox' or 'finance'
227-
228-
// For custom CDN URL
229-
PlotlyViaCDNModule.loadViaCDN('custom', 'https://custom.cdn/url'); // can be used directly for any self hosted plotly bundle
230-
231-
...
232-
```
233-
234-
235185
## Development
236186

237187
To get started:

projects/plotly/src/lib/plotly-via-cdn.module.spec.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

projects/plotly/src/lib/plotly-via-cdn.module.ts

Lines changed: 0 additions & 100 deletions
This file was deleted.

projects/plotly/src/public-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44

55
export * from './lib/plotly.module';
6-
export * from './lib/plotly-via-cdn.module';
76
export * from './lib/plotly-shared.module';
87

98
export * from './lib/plotly.service';

0 commit comments

Comments
 (0)