Commit 51f0618a authored by David Anderson's avatar David Anderson
Browse files

chart margin space will now redraw without axis blink

parent 2d86797d
......@@ -119,7 +119,7 @@ export class ChartCanvas {
let ele = chart._implementation.canvas.canvasEle;
ele.style.position = 'absolute';
ele.style.zIndex = '-1';
ele.style.display = 'none';
// ele.style.display = 'none';
me.contextEle.appendChild( ele );
} );
}
......@@ -157,6 +157,10 @@ export class ChartCanvas {
let configList: Array<BaseAxis> = makeList( configs );
configList.forEach( ( axis: BaseAxis ) => {
me.axisList.push( axis );
let ele = axis._implementation.canvas.canvasEle;
ele.style.position = 'absolute';
ele.style.zIndex = '-2';
me.contextEle.appendChild( ele );
} );
}
......@@ -174,6 +178,8 @@ export class ChartCanvas {
me.axisList.forEach( axis => {
if ( idList.indexOf( axis.id ) === -1 ) {
newList.push( axis );
} else {
axis._implementation.canvas.canvasEle.remove();
}
} );
......@@ -216,7 +222,7 @@ export class ChartCanvas {
/**
*
* The Chart freezes as it stands
*
* @memberof ChartCanvas
*/
......@@ -423,9 +429,10 @@ export class ChartCanvas {
areAllAxisValid = isValid && areAllAxisValid;
if ( isValid ) {
axis._implementation.render();
axis._implementation.canvas.renderTo( me.canvas.canvasEle, x, y );
var ele = axis._implementation.canvas.canvasEle;
ele.style.left = x + 'px';
ele.style.top = y + 'px';
if ( axis.shouldExtendTicksAcrossChart && axis._implementation.gridLineCanvas ) {
axis._implementation.gridLineCanvas.renderTo( me.canvas.canvasEle, rs.chartBounds.left, rs.chartBounds.top );
}
} else {
......@@ -461,7 +468,6 @@ export class ChartCanvas {
let ele = implementation.canvas.canvasEle;
ele.style.left = ( cb.left - margin ) + 'px';
ele.style.top = ( cb.top - margin ) + 'px';
ele.style.display = 'block';
implementation.startDrawing();
} else {
chart.debugLogger._log( 'INVALID CHART SIZE: CHART WILL NOT RENDER: chartWidth = ' + width + ', chartHeight = ' + height );
......@@ -512,8 +518,10 @@ export class ChartCanvas {
this.debugLogger._log( 'making config charts visible' );
me.canvas.clearCanvas( me.background );
me.drawGridLines();
me.axisList.forEach( axis => {
axis._implementation.canvas.canvasEle.style.visibility = 'visible';
} );
me.chartList.forEach( chart => {
// me.canvas.context.globalAlpha = chart.alpha;
let imp = chart._implementation;
let canvas = imp.canvas;
canvas.canvasEle.style.zIndex = chart.getStyledZIndex();
......@@ -547,6 +555,15 @@ export class ChartCanvas {
let bVal = ( isNaN( b.zIndex as number ) ? b.zIndex as number : Number.MAX_SAFE_INTEGER );
return aVal - bVal;
} );
me.axisList.forEach( axis => {
let style = axis._implementation.canvas.canvasEle.style;
style.visibility = 'hidden';
let x: number = Number.parseFloat( ( style.left || '0' ) );
let y: number = Number.parseFloat( ( style.top || '0' ) );
axis._implementation.canvas.renderTo( me.canvas.canvasEle, x, y );
} );
me.chartList.forEach( chart => {
chart._implementation.hasActiveChanged = false;
if ( chart.isActive ) {
......
......@@ -27,9 +27,11 @@
"gist-charts:install": "cd gist-charts && npm install",
"testAngular": "cd demo-angularIO && npm run start -- -o",
"testScript": "open demo-script/index.html",
"demo": "cd gist-charts && npm run build",
"demo": "npm run build",
"postdemo": "npm run testScript; npm run testAngular",
"predemo": "npm run angular-io:install || exit 0; npm run gist-charts:install || exit 0; npm install",
"start": "concurrently \"cd gist-charts && npm run start\" \"npm run testAngular\""
"start": "concurrently \"cd gist-charts && npm run start\" \"npm run testAngular\"",
"build": "cd gist-charts && npm run build"
}
}
......@@ -104,7 +104,7 @@ export declare class ChartCanvas {
*/
beginRender(): void;
/**
*
* The Chart freezes as it stands
*
* @memberof ChartCanvas
*/
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
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