Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
Use ExportServices from climate-change-components
Browse files Browse the repository at this point in the history
  • Loading branch information
ddohler committed Mar 29, 2019
1 parent 033c161 commit e378681
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 79 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"ngx-clipboard": "^8.1.4",
"nouislider": "^10.1.0",
"rxjs": "^5.5.11",
"save-svg-as-png": "^1.4.9",
"save-svg-as-png": "^1.4.12",
"zone.js": "0.8.29"
},
"devDependencies": {
Expand Down
4 changes: 0 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ import { apiHttpProvider } from './auth/api-http.provider';
import { AuthService } from './auth/auth.service';
import { AuthGuard } from './auth/auth.guard';

import { DataExportService } from './services/data-export.service';
import { ImageExportService } from './services/image-export.service';
import { MapCellService } from './services/map-cell.service';
import { ProjectService } from './services/project.service';

Expand Down Expand Up @@ -104,8 +102,6 @@ const AGM_CONFIG = {
apiHttpProvider,
AuthService,
AuthGuard,
DataExportService,
ImageExportService,
MapCellService,
ProjectService
]
Expand Down
2 changes: 2 additions & 0 deletions src/app/auth/api-http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Injectable } from '@angular/core';
import { ConnectionBackend, Http, Headers, Request, RequestOptions, RequestOptionsArgs,
Response, URLSearchParams } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';

import { ApiHttp } from 'climate-change-components';

Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Headers, Http, RequestOptions } from '@angular/http';
import { Router } from '@angular/router';
import { Observable } from 'rxjs/Observable';

import 'rxjs/add/operator/catch';
import { apiHost } from '../constants';

@Injectable()
Expand Down
14 changes: 9 additions & 5 deletions src/app/charts/chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import * as cloneDeep from 'lodash.clonedeep';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/forkJoin';
import { Subscription } from 'rxjs/Subscription';

import {
Expand All @@ -31,11 +32,11 @@ import {
isHistoricIndicator,
isPercentileIndicator,
isThresholdIndicator,
DataExportService,
ImageExportService
} from 'climate-change-components';

import { AuthService } from '../auth/auth.service';
import { DataExportService } from '../services/data-export.service';
import { ImageExportService } from '../services/image-export.service';

import { environment } from '../../environments/environment';

Expand All @@ -45,7 +46,11 @@ import { environment } from '../../environments/environment';
*/
@Component({
selector: 'ccl-chart', // if this selector is renamed, image export service must also be updated
templateUrl: './chart.component.html'
templateUrl: './chart.component.html',
providers: [
DataExportService,
ImageExportService
]
})
export class ChartComponent implements OnChanges, OnDestroy, AfterViewInit {

Expand Down Expand Up @@ -203,8 +208,7 @@ export class ChartComponent implements OnChanges, OnDestroy, AfterViewInit {
this.dataset.name,
this.scenario.name
].join('_');

this.imageExportService.downloadAsPNG(this.chart.indicator.name, fileName);
this.imageExportService.downloadAsPNG(this.chart.indicator.name, fileName, 'ccl-chart');
}

public onExtraParamsSelected(params: IndicatorDistanceQueryParams) {
Expand Down
1 change: 1 addition & 0 deletions src/app/lab/components/city-dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { MapsAPILoader } from '@agm/core';
import { City } from 'climate-change-components';
import { Point } from 'geojson';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';

import { MapCell } from '../../models/map-cell.model';
import { MapCellService } from '../../services/map-cell.service';
Expand Down
15 changes: 0 additions & 15 deletions src/app/services/data-export.service.spec.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/services/data-export.service.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/app/services/image-export.service.ts

This file was deleted.

6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4920,9 +4920,9 @@ saucelabs@^1.5.0:
dependencies:
https-proxy-agent "^2.2.1"

save-svg-as-png@^1.4.9:
version "1.4.9"
resolved "https://registry.yarnpkg.com/save-svg-as-png/-/save-svg-as-png-1.4.9.tgz#0ac8e037de150e202dd80cc63061a2fe3e15199e"
save-svg-as-png@^1.4.12:
version "1.4.12"
resolved "https://registry.yarnpkg.com/save-svg-as-png/-/save-svg-as-png-1.4.12.tgz#6acaa3b542d0236d6e96ff38c1da40a6b18bc15e"

[email protected]:
version "0.5.8"
Expand Down

0 comments on commit e378681

Please sign in to comment.