Skip to content

Commit e31b05d

Browse files
committed
Downgrading to version 8.x
1 parent 1dd2553 commit e31b05d

File tree

6 files changed

+41
-9
lines changed

6 files changed

+41
-9
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
## [1.8.0] - 2020-02-28
4+
### Changed
5+
- Downgraded to angular 8.0 (See https://github.com/plotly/angular-plotly.js/issues/101)
6+
7+
## [1.7.0] - 2020-02-27
8+
### Added
9+
- Adding `treemapclick` and `sunburstclick` events (See https://github.com/plotly/angular-plotly.js/issues/105)
10+
11+
## [1.6.1] - 2020-02-25
12+
### Changed
13+
- Adding `@angular/core^9.0.0` as a peer dependency
14+
15+
## [1.6.0] - 2020-02-22
16+
### Changed
17+
- Upgraded to angular 9.0 (See https://github.com/plotly/angular-plotly.js/issues/101)

README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
---
1313

14-
Supports Angular 8.x and up. If you want to use with Angular 7.x, [please read the FAQ](https://github.com/plotly/angular-plotly.js/blob/master/FAQ.md#how-to-support-angular-7x-).
14+
Supports Angular 8.x. To use with angular 9.x, please check the 2.x version. If you want to use with Angular 7.x, [please read the FAQ](https://github.com/plotly/angular-plotly.js/blob/master/FAQ.md#how-to-support-angular-7x-).
1515

1616

1717
## Content
@@ -123,14 +123,14 @@ The `plotly.js` is bundled within the angular code. To avoid this, please read [
123123
@Component({
124124
selector: 'plotly-example',
125125
template: `
126-
<plotly-plot [data]="graph.data" [layout]="graph.layout"
126+
<plotly-plot [data]="graph.data" [layout]="graph.layout"
127127
[useResizeHandler]="true" [style]="{position: 'relative', width: '100%', height: '100%'}">
128128
</plotly-plot>`,
129129
})
130130
export class PlotlyExampleComponent {
131131
public graph = {
132132
data: [{ x: [1, 2, 3], y: [2, 5, 3], type: 'bar' }],
133-
layout: {autosize: true, title: 'A Fancy Plot'},
133+
layout: {autosize: true, title: 'A Fancy Plot'},
134134
};
135135
}
136136
```
@@ -169,11 +169,13 @@ Event handlers for specific [`plotly.js` events](https://plot.ly/javascript/plot
169169
| `(transitionInterrupted)` | `Function` | `plotly_transitioninterrupted` |
170170
| `(unhover)` | `Function` | `plotly_unhover` |
171171
| `(relayouting)` | `Function` | `plotly_relayouting` |
172+
| `(treemapclick)` | `Function` | `plotly_treemapclick` |
173+
| `(sunburstclick)` | `Function` | `plotly_sunburstclick` |
172174

173175

174176
## Customizing the `plotly.js` bundle
175177

176-
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.
178+
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.
177179

178180
If you wish to optimize loading `plotly.js` in a different way, please check both [`PlotlyViaCDNModule`](#plotly-via-cdn-module) and [`PlotlyViaWindowModule`](#plotly-via-window-module) modules below.
179181

@@ -195,7 +197,7 @@ PlotlyViaCDNModule.plotlyBundle = 'basic'; // optional: can be null (for full) o
195197
@NgModule({
196198
imports: [
197199
CommonModule,
198-
PlotlyViaCDNModule,
200+
PlotlyViaCDNModule,
199201
],
200202
...
201203
})
@@ -204,7 +206,7 @@ export class AppModule { }
204206

205207
### Plotly Via Window Module
206208

207-
`plotly.js` can be added as a [global script on angular.json](https://github.com/angular/angular-cli/wiki/stories-global-scripts#global-scripts) to avoid it being bundled into the final project's code. To make this happen, you must first add `plotly.js` path into `angular.json` file as shown below:
209+
`plotly.js` can be added as a [global script on angular.json](https://github.com/angular/angular-cli/wiki/stories-global-scripts#global-scripts) to avoid it being bundled into the final project's code. To make this happen, you must first add `plotly.js` path into `angular.json` file as shown below:
208210

209211
```javascript
210212
// angular.json

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-plotly.js",
3-
"version": "1.5.0",
3+
"version": "1.7.0",
44
"license": "MIT",
55
"main": "index.ts",
66
"scripts": {

src/app/plotly-via-cdn/plotly-via-cdn.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PlotlyViaCDNModule {
4242
PlotlyViaCDNModule._plotlyBundle = bundle;
4343
}
4444

45-
static loadViaCDN() {
45+
static loadViaCDN(): void {
4646
PlotlyService.setPlotly('waiting');
4747

4848
const init = () => {

src/app/shared/plot/plot.component.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ export class PlotComponent implements OnInit, OnChanges, OnDestroy, DoCheck {
8686
@Output() transitionInterrupted = new EventEmitter();
8787
@Output() unhover = new EventEmitter();
8888
@Output() relayouting = new EventEmitter();
89+
@Output() treemapclick = new EventEmitter();
90+
@Output() sunburstclick = new EventEmitter();
8991

9092
public eventNames = ['afterExport', 'afterPlot', 'animated', 'animatingFrame', 'animationInterrupted', 'autoSize',
9193
'beforeExport', 'buttonClicked', 'clickAnnotation', 'deselect', 'doubleClick', 'framework', 'hover',
9294
'legendClick', 'legendDoubleClick', 'relayout', 'restyle', 'redraw', 'selected', 'selecting', 'sliderChange',
93-
'sliderEnd', 'sliderStart', 'transitioning', 'transitionInterrupted', 'unhover', 'relayouting'];
95+
'sliderEnd', 'sliderStart', 'transitioning', 'transitionInterrupted', 'unhover', 'relayouting', 'treemapclick',
96+
'sunburstclick'];
9497

9598
constructor(
9699
public plotly: PlotlyService,

src/app/shared/plotly.service.spec.ts

+10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ describe('PlotlyService', () => {
3636
expect(service.getPlotly()).toBe(PlotlyJS);
3737
}));
3838

39+
it('should set the module name', () => {
40+
expect((PlotlyService as any)._moduleName).toBeUndefined();
41+
PlotlyService.setModuleName('ViaCDN');
42+
expect((PlotlyService as any)._moduleName).toBe('ViaCDN');
43+
PlotlyService.setModuleName('ViaCDN');
44+
45+
// cleaning up
46+
(PlotlyService as any)._moduleName = undefined;
47+
});
48+
3949
it('should call plotly.newPlot method', inject([PlotlyService], async (service: PlotlyService) => {
4050
return new Promise(async (resolve) => {
4151
const plotly = service.getPlotly();

0 commit comments

Comments
 (0)