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

merge conflict fix

parent a87f7244
...@@ -34,11 +34,11 @@ export class HeatmapChartDemoComponent{ ...@@ -34,11 +34,11 @@ export class HeatmapChartDemoComponent{
ret.fill = dp.data.fill; ret.fill = dp.data.fill;
return ret; return ret;
}; };
// barChart.debugLoger.isEnabled = true; // barChart.debugLogger.isEnabled = true;
barChart.debugLoger.logPrefix = 'HeatMapDemo barchart'; barChart.debugLogger.logPrefix = 'HeatMapDemo barchart';
// me.chart.debugLoger.isEnabled = true; // me.chart.debugLogger.isEnabled = true;
me.chart.debugLoger.logPrefix = 'HeatMapDemo gistChart'; me.chart.debugLogger.logPrefix = 'HeatMapDemo gistChart';
let leftAxis: CategoricalAxisConfig<string> = new CategoricalAxisConfig<string>( 'left' ); let leftAxis: CategoricalAxisConfig<string> = new CategoricalAxisConfig<string>( 'left' );
let rightAxis: CategoricalAxisConfig<string> = new CategoricalAxisConfig<string>( 'right' ); let rightAxis: CategoricalAxisConfig<string> = new CategoricalAxisConfig<string>( 'right' );
......
...@@ -30,11 +30,11 @@ export class LineChartDemoComponent { ...@@ -30,11 +30,11 @@ export class LineChartDemoComponent {
let activeChart = new LineChartConfig(); let activeChart = new LineChartConfig();
// gistChart.debugLoger.isEnabled = true; // gistChart.debugLogger.isEnabled = true;
// gistChart.debugLoger.logPrefix = 'LineDemo gistChart'; // gistChart.debugLogger.logPrefix = 'LineDemo gistChart';
// activeChart.debugLoger.isEnabled = true; // activeChart.debugLogger.isEnabled = true;
// activeChart.debugLoger.logPrefix = 'lineDemo activeChart'; // activeChart.debugLogger.logPrefix = 'lineDemo activeChart';
activeChart.getLineStyle = ( line: LineChartData<LineData> ) => { activeChart.getLineStyle = ( line: LineChartData<LineData> ) => {
let ret = new CanvasStyle(); let ret = new CanvasStyle();
......
...@@ -471,7 +471,7 @@ export class GistChart { ...@@ -471,7 +471,7 @@ export class GistChart {
let progress = imp.getDrawProgress(); 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> { ...@@ -18,7 +18,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
* *
* @memberof BaseChartConfig * @memberof BaseChartConfig
*/ */
public readonly debugLoger = new DebugLogger(); public readonly debugLogger = new DebugLogger();
/** /**
* Overwrite this method to know when this chart starts and finishes rendering * Overwrite this method to know when this chart starts and finishes rendering
...@@ -66,7 +66,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> { ...@@ -66,7 +66,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*/ */
public datalist( val?: Array<T> | T ) { public datalist( val?: Array<T> | T ) {
if ( arguments.length && val !== undefined) { if ( arguments.length && val !== undefined) {
this.debugLoger.log( 'Setting datalist', val ); this.debugLogger.log( 'Setting datalist', val );
this._datalist = makeList( val ); this._datalist = makeList( val );
this.implementation.isDirty = true; this.implementation.isDirty = true;
} }
...@@ -97,7 +97,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> { ...@@ -97,7 +97,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
* @memberof BaseChartConfig * @memberof BaseChartConfig
*/ */
public set isActive( val: boolean ) { public set isActive( val: boolean ) {
this.debugLoger.log( 'chart isActive change', val ); this.debugLogger.log( 'chart isActive change', val );
if ( val && !this._isActive ) { if ( val && !this._isActive ) {
this.implementation.isDirty = true; this.implementation.isDirty = true;
} }
...@@ -120,7 +120,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> { ...@@ -120,7 +120,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*/ */
public set background( val: string | undefined ) { public set background( val: string | undefined ) {
if ( val !== this._background ) { if ( val !== this._background ) {
this.debugLoger.log( 'chart background change', val ); this.debugLogger.log( 'chart background change', val );
this.implementation.isDirty = true; this.implementation.isDirty = true;
} }
this._background = val; this._background = val;
......
...@@ -80,7 +80,7 @@ export abstract class BaseChartImplementation { ...@@ -80,7 +80,7 @@ export abstract class BaseChartImplementation {
} }
public set isRenderInProgress( b: boolean ) { public set isRenderInProgress( b: boolean ) {
if ( b !== this._isRenderInProgress ) { if ( b !== this._isRenderInProgress ) {
this.config.debugLoger.log( 'render stat change', b ); this.config.debugLogger.log( 'render stat change', b );
if ( this.config.onRenderStateChange ) { if ( this.config.onRenderStateChange ) {
this.config.onRenderStateChange( b ); this.config.onRenderStateChange( b );
} }
...@@ -91,7 +91,7 @@ export abstract class BaseChartImplementation { ...@@ -91,7 +91,7 @@ export abstract class BaseChartImplementation {
private _isDirty: boolean = false; private _isDirty: boolean = false;
public set isDirty( b: boolean ) { public set isDirty( b: boolean ) {
if ( b != this._isDirty ) { if ( b != this._isDirty ) {
this.config.debugLoger.log( 'isDirty change', b ); this.config.debugLogger.log( 'isDirty change', b );
} }
if ( b ) { if ( b ) {
this.canvas.clearCanvas( this.config.background ); this.canvas.clearCanvas( this.config.background );
...@@ -117,7 +117,7 @@ export abstract class BaseChartImplementation { ...@@ -117,7 +117,7 @@ export abstract class BaseChartImplementation {
this.canvas.clearCanvas( background ); this.canvas.clearCanvas( background );
this.isDirty = true; this.isDirty = true;
this.canvas.context.globalAlpha = this.config.alpha; 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 { ...@@ -199,7 +199,7 @@ export abstract class BaseChartImplementation {
me.animationFrame = window.requestAnimationFrame( () => { me.animationFrame = window.requestAnimationFrame( () => {
if ( this.config.datalist().length !== this.drawnData.length ) { if ( this.config.datalist().length !== this.drawnData.length ) {
this._isDirty = true; 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(); me.render();
this.isRenderInProgress = this.config.datalist().length !== this.drawnData.length; this.isRenderInProgress = this.config.datalist().length !== this.drawnData.length;
} }
...@@ -207,7 +207,7 @@ export abstract class BaseChartImplementation { ...@@ -207,7 +207,7 @@ export abstract class BaseChartImplementation {
me.startDrawing(); me.startDrawing();
} ); } );
} else { } 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 { ...@@ -217,7 +217,7 @@ export abstract class BaseChartImplementation {
public stopDrawing(): void { public stopDrawing(): void {
const me = this; const me = this;
if ( me.animationFrame ) { if ( me.animationFrame ) {
me.config.debugLoger.log( 'polling datalist stopped' ); me.config.debugLogger.log( 'polling datalist stopped' );
window.cancelAnimationFrame( me.animationFrame ); window.cancelAnimationFrame( me.animationFrame );
me.animationFrame = 0; me.animationFrame = 0;
} }
......
...@@ -12,20 +12,7 @@ export class CanvasScatterChart extends BaseChartImplementation { ...@@ -12,20 +12,7 @@ export class CanvasScatterChart extends BaseChartImplementation {
private quadTree: Quadtree<Point>; private quadTree: Quadtree<Point>;
private resetQuadTree() {
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
this.quadTree = quadtree<Point>() this.quadTree = quadtree<Point>()
.x(( point: Point ) => { .x(( point: Point ) => {
return point.x; return point.x;
...@@ -33,6 +20,16 @@ export class CanvasScatterChart extends BaseChartImplementation { ...@@ -33,6 +20,16 @@ export class CanvasScatterChart extends BaseChartImplementation {
.y(( point: Point ) => { .y(( point: Point ) => {
return point.y; 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() { public render() {
......
...@@ -89,6 +89,6 @@ export declare class CategoricalAxisConfig<T extends string | number = string> e ...@@ -89,6 +89,6 @@ export declare class CategoricalAxisConfig<T extends string | number = string> e
* @param a * @param a
* @param b * @param b
*/ */
sortValues(a: T, b: T): 0 | 1 | -1; sortValues(a: T, b: T): 1 | 0 | -1;
constructor(orientation: Orientation); constructor(orientation: Orientation);
} }
...@@ -15,7 +15,7 @@ export declare abstract class BaseChartConfig<T extends DataPoint = DataPoint> { ...@@ -15,7 +15,7 @@ export declare abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
* *
* @memberof BaseChartConfig * @memberof BaseChartConfig
*/ */
readonly debugLoger: DebugLogger; readonly debugLogger: DebugLogger;
/** /**
* Overwrite this method to know when this chart starts and finishes rendering * 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 { ...@@ -6,6 +6,7 @@ export declare class CanvasScatterChart extends BaseChartImplementation {
protected config: ScatterChartConfig; protected config: ScatterChartConfig;
drawnData: Array<Point>; drawnData: Array<Point>;
private quadTree; private quadTree;
private resetQuadTree();
constructor(scc: ScatterChartConfig); constructor(scc: ScatterChartConfig);
onDataWipe(): void; onDataWipe(): void;
render(): 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