Commit a91c9880 authored by David Anderson's avatar David Anderson
Browse files

merge conflict fix

parent a87f7244
......@@ -34,11 +34,11 @@ export class HeatmapChartDemoComponent{
ret.fill = dp.data.fill;
return ret;
};
// barChart.debugLoger.isEnabled = true;
barChart.debugLoger.logPrefix = 'HeatMapDemo barchart';
// barChart.debugLogger.isEnabled = true;
barChart.debugLogger.logPrefix = 'HeatMapDemo barchart';
// me.chart.debugLoger.isEnabled = true;
me.chart.debugLoger.logPrefix = 'HeatMapDemo gistChart';
// me.chart.debugLogger.isEnabled = true;
me.chart.debugLogger.logPrefix = 'HeatMapDemo gistChart';
let leftAxis: CategoricalAxisConfig<string> = new CategoricalAxisConfig<string>( 'left' );
let rightAxis: CategoricalAxisConfig<string> = new CategoricalAxisConfig<string>( 'right' );
......
......@@ -30,11 +30,11 @@ export class LineChartDemoComponent {
let activeChart = new LineChartConfig();
// gistChart.debugLoger.isEnabled = true;
// gistChart.debugLoger.logPrefix = 'LineDemo gistChart';
// gistChart.debugLogger.isEnabled = true;
// gistChart.debugLogger.logPrefix = 'LineDemo gistChart';
// activeChart.debugLoger.isEnabled = true;
// activeChart.debugLoger.logPrefix = 'lineDemo activeChart';
// activeChart.debugLogger.isEnabled = true;
// activeChart.debugLogger.logPrefix = 'lineDemo activeChart';
activeChart.getLineStyle = ( line: LineChartData<LineData> ) => {
let ret = new CanvasStyle();
......
......@@ -471,7 +471,7 @@ export class GistChart {
let progress = imp.getDrawProgress();
config.debugLoger.log( 'chart copied with ' + progress.drawnCount +' out of ' + progress.totoalCount + ' datapoints' );
config.debugLogger.log( 'chart copied with ' + progress.drawnCount +' out of ' + progress.totoalCount + ' datapoints' );
} );
}
......
......@@ -18,7 +18,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*
* @memberof BaseChartConfig
*/
public readonly debugLoger = new DebugLogger();
public readonly debugLogger = new DebugLogger();
/**
* Overwrite this method to know when this chart starts and finishes rendering
......@@ -66,7 +66,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*/
public datalist( val?: Array<T> | T ) {
if ( arguments.length && val !== undefined) {
this.debugLoger.log( 'Setting datalist', val );
this.debugLogger.log( 'Setting datalist', val );
this._datalist = makeList( val );
this.implementation.isDirty = true;
}
......@@ -97,7 +97,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
* @memberof BaseChartConfig
*/
public set isActive( val: boolean ) {
this.debugLoger.log( 'chart isActive change', val );
this.debugLogger.log( 'chart isActive change', val );
if ( val && !this._isActive ) {
this.implementation.isDirty = true;
}
......@@ -120,7 +120,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*/
public set background( val: string | undefined ) {
if ( val !== this._background ) {
this.debugLoger.log( 'chart background change', val );
this.debugLogger.log( 'chart background change', val );
this.implementation.isDirty = true;
}
this._background = val;
......
......@@ -80,7 +80,7 @@ export abstract class BaseChartImplementation {
}
public set isRenderInProgress( b: boolean ) {
if ( b !== this._isRenderInProgress ) {
this.config.debugLoger.log( 'render stat change', b );
this.config.debugLogger.log( 'render stat change', b );
if ( this.config.onRenderStateChange ) {
this.config.onRenderStateChange( b );
}
......@@ -91,7 +91,7 @@ export abstract class BaseChartImplementation {
private _isDirty: boolean = false;
public set isDirty( b: boolean ) {
if ( b != this._isDirty ) {
this.config.debugLoger.log( 'isDirty change', b );
this.config.debugLogger.log( 'isDirty change', b );
}
if ( b ) {
this.canvas.clearCanvas( this.config.background );
......@@ -117,7 +117,7 @@ export abstract class BaseChartImplementation {
this.canvas.clearCanvas( background );
this.isDirty = true;
this.canvas.context.globalAlpha = this.config.alpha;
this.config.debugLoger.log( 'Canvas has been initialized: width=' + width + ', height=' + height + ', background=' + background );
this.config.debugLogger.log( 'Canvas has been initialized: width=' + width + ', height=' + height + ', background=' + background );
}
/**
......@@ -199,7 +199,7 @@ export abstract class BaseChartImplementation {
me.animationFrame = window.requestAnimationFrame( () => {
if ( this.config.datalist().length !== this.drawnData.length ) {
this._isDirty = true;
me.config.debugLoger.log( 'rendering new points, isDirty will be true without clearing' );
me.config.debugLogger.log( 'rendering new points, isDirty will be true without clearing' );
me.render();
this.isRenderInProgress = this.config.datalist().length !== this.drawnData.length;
}
......@@ -207,7 +207,7 @@ export abstract class BaseChartImplementation {
me.startDrawing();
} );
} else {
me.config.debugLoger.log( 'no longer rendering. datalist length: ' + this.config.datalist() + ', drawn data length: ' + this.drawnData.length );
me.config.debugLogger.log( 'no longer rendering. datalist length: ' + this.config.datalist() + ', drawn data length: ' + this.drawnData.length );
}
}
......@@ -217,7 +217,7 @@ export abstract class BaseChartImplementation {
public stopDrawing(): void {
const me = this;
if ( me.animationFrame ) {
me.config.debugLoger.log( 'polling datalist stopped' );
me.config.debugLogger.log( 'polling datalist stopped' );
window.cancelAnimationFrame( me.animationFrame );
me.animationFrame = 0;
}
......
......@@ -12,20 +12,7 @@ export class CanvasScatterChart extends BaseChartImplementation {
private quadTree: Quadtree<Point>;
constructor( scc: ScatterChartConfig ) {
super();
this.config = scc;
this.quadTree = quadtree<Point>()
.x(( point: Point ) => {
return point.x;
} )
.y(( point: Point ) => {
return point.y;
} );
}
public onDataWipe() {
// replaced the old function because deletion was much faster
private resetQuadTree() {
this.quadTree = quadtree<Point>()
.x(( point: Point ) => {
return point.x;
......@@ -33,6 +20,16 @@ export class CanvasScatterChart extends BaseChartImplementation {
.y(( point: Point ) => {
return point.y;
} );
}
constructor( scc: ScatterChartConfig ) {
super();
this.config = scc;
this.resetQuadTree();
}
public onDataWipe() {
// replaced the old function because deletion was much faster
this.resetQuadTree();
}
public render() {
......
......@@ -89,6 +89,6 @@ export declare class CategoricalAxisConfig<T extends string | number = string> e
* @param a
* @param b
*/
sortValues(a: T, b: T): 0 | 1 | -1;
sortValues(a: T, b: T): 1 | 0 | -1;
constructor(orientation: Orientation);
}
......@@ -15,7 +15,7 @@ export declare abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*
* @memberof BaseChartConfig
*/
readonly debugLoger: DebugLogger;
readonly debugLogger: DebugLogger;
/**
* Overwrite this method to know when this chart starts and finishes rendering
*/
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -6,6 +6,7 @@ export declare class CanvasScatterChart extends BaseChartImplementation {
protected config: ScatterChartConfig;
drawnData: Array<Point>;
private quadTree;
private resetQuadTree();
constructor(scc: ScatterChartConfig);
onDataWipe(): void;
render(): void;
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment