Skip to content

Commit

Permalink
avoid dom only function for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Mar 13, 2019
1 parent 89a6f07 commit ed03fa1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
36 changes: 19 additions & 17 deletions src/internal/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1126,20 +1126,22 @@ function sortWorkerMain() {
* to avoid webpack imports all the code functions need to be in this file
* @internal
*/
export const WORKER_BLOB = createWorkerCodeBlob([
pushAll.toString(),
quantile.toString(),
normalizedStatsBuilder.toString(),
boxplotBuilder.toString(),
computeGranularity.toString(),
pushDateHist.toString(),
dateStatsBuilder.toString(),
categoricalStatsBuilder.toString(),
createIndexArray.toString(),
asc.toString(),
desc.toString(),
sortComplex.toString(),
dateValueCache2Value.toString(),
categoricalValueCache2Value.toString(),
toFunctionBody(sortWorkerMain)
]);
export function createWorkerBlob() {
return createWorkerCodeBlob([
pushAll.toString(),
quantile.toString(),
normalizedStatsBuilder.toString(),
boxplotBuilder.toString(),
computeGranularity.toString(),
pushDateHist.toString(),
dateStatsBuilder.toString(),
categoricalStatsBuilder.toString(),
createIndexArray.toString(),
asc.toString(),
desc.toString(),
sortComplex.toString(),
dateValueCache2Value.toString(),
categoricalValueCache2Value.toString(),
toFunctionBody(sortWorkerMain)
]);
}
4 changes: 2 additions & 2 deletions src/provider/ScheduledTasks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {abortAble} from 'lineupengine';
import {getNumberOfBins, IAdvancedBoxPlotData, ICategoricalStatistics, IDateStatistics, ISequence, ISortMessageResponse, IStatistics, lazySeq, toIndexArray, WorkerTaskScheduler, WORKER_BLOB} from '../internal';
import {getNumberOfBins, IAdvancedBoxPlotData, ICategoricalStatistics, IDateStatistics, ISequence, ISortMessageResponse, IStatistics, lazySeq, toIndexArray, WorkerTaskScheduler, createWorkerBlob} from '../internal';
import TaskScheduler, {ABORTED, oneShotIterator} from '../internal/scheduler';
import Column, {ICategoricalLikeColumn, ICompareValue, IDataRow, IDateColumn, IGroup, IndicesArray, INumberColumn, IOrderedGroup, isCategoricalLikeColumn, isDateColumn, isNumberColumn, Ranking, UIntTypedArray} from '../model';
import {IRenderTask} from '../renderer';
Expand All @@ -11,7 +11,7 @@ export class ScheduleRenderTasks extends ARenderTasks implements IRenderTaskExec

private readonly cache = new Map<string, IRenderTask<any>>();
private readonly tasks = new TaskScheduler();
private readonly workers = new WorkerTaskScheduler(WORKER_BLOB);
private readonly workers = new WorkerTaskScheduler(createWorkerBlob());

setData(data: IDataRow[]) {
this.data = data;
Expand Down

0 comments on commit ed03fa1

Please sign in to comment.