Skip to content

Commit 19ff375

Browse files
committed
Remove plotly.js-dist, tests (WIP)
1 parent 9a3fec2 commit 19ff375

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

package-lock.json

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@angular/platform-browser": "^20.0.2",
2020
"@angular/platform-browser-dynamic": "^20.0.2",
2121
"@angular/router": "^20.0.2",
22-
"plotly.js-dist": "^2.20.0",
2322
"plotly.js-dist-min": "^3.1.1",
2423
"rxjs": "~7.8.0",
2524
"tslib": "^2.8.1",

projects/demo_app/src/app/app.module.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3-
import * as PlotlyJS from 'plotly.js-dist';
3+
import * as PlotlyJS from "plotly.js-dist-min";
4+
45
import { PlotlyModule } from '../../../plotly/src/lib/plotly.module';
56
import { PlotlyViaCDNModule } from 'projects/plotly/src/lib/plotly-via-cdn.module';
67

7-
8-
98
import { AppComponent } from './app.component';
109
import { PlotlyViaWindowModule } from 'projects/plotly/src/lib/plotly-via-window.module';
1110

projects/plotly/src/lib/plotly.component.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('PlotlyComponent', () => {
8383
component.ngDoCheck();
8484
expect(component.updatePlot).toHaveBeenCalledTimes(1);
8585

86-
component.data()[0].y[0] = 12;
86+
component.data()[0]['y'][0] = 12;
8787
component.ngDoCheck();
8888
expect(component.updatePlot).toHaveBeenCalledTimes(2);
8989
done();
@@ -97,14 +97,14 @@ describe('PlotlyComponent', () => {
9797
component.ngDoCheck();
9898
expect(component.updatePlot).not.toHaveBeenCalled();
9999

100-
componentRef.setInput('layout', { title: 'title two' });
100+
componentRef.setInput('layout', { title: { text: 'title two' }});
101101
component.ngDoCheck();
102102
expect(component.updatePlot).toHaveBeenCalled();
103103

104104
component.ngDoCheck();
105105
expect(component.updatePlot).toHaveBeenCalledTimes(1);
106106

107-
component.layout()['title'] = 'title three ';
107+
component.layout().title = { text: 'title three '};
108108
component.ngDoCheck();
109109
expect(component.updatePlot).toHaveBeenCalledTimes(2);
110110
done();
@@ -197,21 +197,21 @@ describe('PlotlyComponent', () => {
197197
await component.createPlot();
198198
await fixture.whenStable();
199199

200-
spyOn(Plots, 'resize').and.callThrough();
200+
const spy = spyOn(Plots, 'resize').and.callThrough();
201201

202202
window.dispatchEvent(new Event('resize'));
203203
await fixture.whenStable();
204204

205-
expect(Plots.resize).toHaveBeenCalled();
206-
Plots.resize.calls.reset();
205+
expect(spy).toHaveBeenCalled();
206+
spy.calls.reset();
207207

208208
fixture.destroy();
209209
await fixture.whenStable();
210210

211211
window.dispatchEvent(new Event('resize'));
212212
await fixture.whenStable();
213213

214-
expect(Plots.resize).not.toHaveBeenCalled();
214+
expect(spy).not.toHaveBeenCalled();
215215
});
216216

217217

projects/plotly/src/lib/plotly.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TestBed, inject } from '@angular/core/testing';
2-
import PlotlyJS from 'plotly.js-dist';
32

43
import { PlotlyService } from './plotly.service';
4+
import * as PlotlyJS from "plotly.js-dist-min";
55
import {PlotlyHTMLElement} from "plotly.js-dist-min";
66

77
describe('PlotlyService', () => {

0 commit comments

Comments
 (0)