Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Anderson, Danny H
gist-charts
Commits
a91c9880
Commit
a91c9880
authored
Aug 31, 2018
by
David Anderson
Browse files
merge conflict fix
parent
a87f7244
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
demo-angularIO/src/app/heatmapchart-demo/heatmapchart-demo.component.ts
View file @
a91c9880
...
...
@@ -34,11 +34,11 @@ export class HeatmapChartDemoComponent{
ret
.
fill
=
dp
.
data
.
fill
;
return
ret
;
};
// barChart.debugLoger.isEnabled = true;
barChart
.
debugLoger
.
logPrefix
=
'
HeatMapDemo barchart
'
;
// barChart.debugLog
g
er.isEnabled = true;
barChart
.
debugLog
g
er
.
logPrefix
=
'
HeatMapDemo barchart
'
;
// me.chart.debugLoger.isEnabled = true;
me
.
chart
.
debugLoger
.
logPrefix
=
'
HeatMapDemo gistChart
'
;
// me.chart.debugLog
g
er.isEnabled = true;
me
.
chart
.
debugLog
g
er
.
logPrefix
=
'
HeatMapDemo gistChart
'
;
let
leftAxis
:
CategoricalAxisConfig
<
string
>
=
new
CategoricalAxisConfig
<
string
>
(
'
left
'
);
let
rightAxis
:
CategoricalAxisConfig
<
string
>
=
new
CategoricalAxisConfig
<
string
>
(
'
right
'
);
...
...
demo-angularIO/src/app/linechart-demo/linechart-demo.component.ts
View file @
a91c9880
...
...
@@ -30,11 +30,11 @@ export class LineChartDemoComponent {
let
activeChart
=
new
LineChartConfig
();
// gistChart.debugLoger.isEnabled = true;
// gistChart.debugLoger.logPrefix = 'LineDemo gistChart';
// gistChart.debugLog
g
er.isEnabled = true;
// gistChart.debugLog
g
er.logPrefix = 'LineDemo gistChart';
// activeChart.debugLoger.isEnabled = true;
// activeChart.debugLoger.logPrefix = 'lineDemo activeChart';
// activeChart.debugLog
g
er.isEnabled = true;
// activeChart.debugLog
g
er.logPrefix = 'lineDemo activeChart';
activeChart
.
getLineStyle
=
(
line
:
LineChartData
<
LineData
>
)
=>
{
let
ret
=
new
CanvasStyle
();
...
...
gist-charts/source/classes/gistChart.class.ts
View file @
a91c9880
...
...
@@ -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
.
debugLog
g
er
.
log
(
'
chart copied with
'
+
progress
.
drawnCount
+
'
out of
'
+
progress
.
totoalCount
+
'
datapoints
'
);
}
);
}
...
...
gist-charts/source/configs/charts/baseChartConfig.class.ts
View file @
a91c9880
...
...
@@ -18,7 +18,7 @@ export abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*
* @memberof BaseChartConfig
*/
public
readonly
debugLoger
=
new
DebugLogger
();
public
readonly
debugLog
g
er
=
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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
log
(
'
chart background change
'
,
val
);
this
.
implementation
.
isDirty
=
true
;
}
this
.
_background
=
val
;
...
...
gist-charts/source/implementations/charts/baseChartImplementation.class.ts
View file @
a91c9880
...
...
@@ -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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
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
.
debugLog
g
er
.
log
(
'
polling datalist stopped
'
);
window
.
cancelAnimationFrame
(
me
.
animationFrame
);
me
.
animationFrame
=
0
;
}
...
...
gist-charts/source/implementations/charts/scatterChart.class.ts
View file @
a91c9880
...
...
@@ -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
()
{
...
...
package/configs/axis/categoricalAxisConfig.class.d.ts
View file @
a91c9880
...
...
@@ -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
);
}
package/configs/charts/baseChartConfig.class.d.ts
View file @
a91c9880
...
...
@@ -15,7 +15,7 @@ export declare abstract class BaseChartConfig<T extends DataPoint = DataPoint> {
*
* @memberof BaseChartConfig
*/
readonly
debugLoger
:
DebugLogger
;
readonly
debugLog
g
er
:
DebugLogger
;
/**
* Overwrite this method to know when this chart starts and finishes rendering
*/
...
...
package/gistCharts.js
View file @
a91c9880
This source diff could not be displayed because it is too large. You can
view the blob
instead.
package/gistCharts.js.map
View file @
a91c9880
This diff is collapsed.
Click to expand it.
package/implementations/charts/scatterChart.class.d.ts
View file @
a91c9880
...
...
@@ -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
;
...
...
package/index.js
View file @
a91c9880
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment