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
1ade9064
Commit
1ade9064
authored
Aug 06, 2019
by
David Anderson
Browse files
commiting before changing projects
parent
8085b97b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
demo-angularIO/src/app/zoom-pan-demo/zoom-pan-demo.component.ts
View file @
1ade9064
...
...
@@ -78,7 +78,7 @@ export class ZoomPanDemoComponent implements AfterViewInit, OnDestroy {
let
zoom
=
new
ZoomBehavior
();
zoom
.
limitZoom
(
axis
,
0.5
,
1.5
);
let
pan
=
new
PanBehavior
(
'
wheel
'
);
// use wheel because we want to click on the data
let
pan
=
new
PanBehavior
(
);
pan
.
limitPan
(
bottomAxis
,
pointCount
*
-
0.25
,
pointCount
*
1.25
);
me
.
chart
.
addBehavior
(
...
...
gist-charts/source/configs/axis/baseAxis.class.ts
View file @
1ade9064
import
{
DataPoint
}
from
'
../../classes/datapoint.class
'
;
import
{
DebugLogger
}
from
'
../../classes/debugLogger.class
'
;
import
{
BaseAxisImplementation
}
from
'
../../implementations/axis/baseAxisImplementation.class
'
;
import
{
clamp
}
from
'
../../utility/clamp.method
'
;
import
{
makeList
}
from
'
../../utility/makeList.method
'
;
import
{
uID
}
from
'
../../utility/uID.method
'
;
import
{
BaseChart
}
from
'
../charts/baseChart.class
'
;
...
...
@@ -223,7 +224,8 @@ export abstract class BaseAxis<T = any> {
if
(
zoom
!==
this
.
_implementation
.
currentZoomLevel
)
{
multiplier
=
zoom
/
this
.
_implementation
.
currentZoomLevel
;
}
this
.
_implementation
.
currentZoomLevel
=
Math
.
max
(
Math
.
min
(
zoom
,
this
.
_implementation
.
scaleExtent
[
1
]
),
this
.
_implementation
.
scaleExtent
[
0
]
);
this
.
_implementation
.
currentZoomLevel
=
clamp
(
zoom
,
this
.
_implementation
.
scaleExtent
[
0
],
this
.
_implementation
.
scaleExtent
[
1
]
);
this
.
_implementation
.
offset
*=
multiplier
;
this
.
_implementation
.
offset
+=
offset
;
Object
.
keys
(
this
.
_implementation
.
charts
).
forEach
(
key
=>
{
...
...
gist-charts/source/implementations/axis/baseAxisImplementation.class.ts
View file @
1ade9064
...
...
@@ -545,15 +545,15 @@ export abstract class BaseAxisImplementation<T> {
}
let
preferredAligns
=
{
top
:
'
center
'
,
bottom
:
'
center
'
,
left
:
'
right
'
,
right
:
'
left
'
top
:
'
center
'
as
any
,
bottom
:
'
center
'
as
any
,
left
:
'
right
'
as
any
,
right
:
'
left
'
as
any
};
let
baseLines
=
{
top
:
'
bottom
'
,
bottom
:
'
top
'
,
left
:
'
middle
'
,
right
:
'
middle
'
top
:
'
bottom
'
as
any
,
bottom
:
'
top
'
as
any
,
left
:
'
middle
'
as
any
,
right
:
'
middle
'
as
any
};
package/gistCharts.js
View file @
1ade9064
This source diff could not be displayed because it is too large. You can
view the blob
instead.
package/gistCharts.js.map
View file @
1ade9064
This diff is collapsed.
Click to expand it.
package/implementations/axis/baseAxisImplementation.class.d.ts
View file @
1ade9064
...
...
@@ -81,7 +81,7 @@ export declare abstract class BaseAxisImplementation<T> {
max
:
number
;
diff
:
number
;
};
readonly
textAlign
:
string
;
readonly
textAlign
:
any
;
/**
* Buffer this axis is drawn to. This should be never be added to the dom
*
...
...
package/index.js
View file @
1ade9064
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