Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65013208
quant_data_handler.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 31, 02:29
Size
1 KB
Mime Type
text/x-java
Expires
Sun, Jun 2, 02:29 (2 d)
Engine
blob
Format
Raw Data
Handle
17989988
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
quant_data_handler.ts
View Options
import { OnInit, EventEmitter} from '@angular/core';
import { first, takeUntil } from 'rxjs/operators';
import { BasicResultBindingElement, AskResult} from './datatypes/basic_datatype';
import { DataHandler, Handler } from './data_handler';
/**
* This class retrieves quantitative data from a query service and instantiates it using
* corresponding handlers.
**/
export class QuantitativeDataHandler extends DataHandler {
/**
* @param component the component that uses this data handler
**/
constructor(protected component: OnInit){
super(component)
}
/**
* Retrieve and instantiate data
* @param key data handler key
* @param query iri that should be passed to query
**/
public getData(key: string, query: string, raw_data_key?: string) {
this.start_processing.emit(true);
let handler = this[key]['handler'];
this.queryService.getData(query).pipe(takeUntil(this.stop_processing) || first()).subscribe(results => {
this.component[key] = handler.convertData(results);
if (raw_data_key != undefined && raw_data_key != null){
this.component[raw_data_key] = results;
}
this.processing_finished.emit(true);
if (this[key]['process_data'] != undefined && this[key]['process_data'] != null){
this[key]['process_data'].processData();
}
});
}
}
Event Timeline
Log In to Comment