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
9a5eb02d
Commit
9a5eb02d
authored
Jul 31, 2019
by
David Anderson
Browse files
demo file created
parent
7972e44b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
demo-angularIO/src/app/app-routing.module.ts
View file @
9a5eb02d
import
{
ResizeableChartDemoComponent
}
from
'
./resizeable-demo/resizeable-demo.component
'
;
import
{
RadialChartDemoComponent
}
from
'
./radialchart-demo/radialchart-demo.component
'
;
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
RouterModule
}
from
'
@angular/router
'
;
import
{
AreaChartDemoComponent
}
from
'
./areachart-demo/areachart-demo.component
'
;
import
{
BarChartDemoComponent
}
from
'
./barchart-demo/barchart-demo.component
'
;
import
{
BoxplotDemoComponent
}
from
'
./boxplot-demo/boxplot-demo.component
'
;
import
{
DemoAppComponent
}
from
'
./demo-app/demo-app.component
'
;
import
{
HeatmapChartDemoComponent
}
from
'
./heatmapchart-demo/heatmapchart-demo.component
'
;
import
{
BarChartDemoComponent
}
from
'
./barchart-demo/barchart-demo.component
'
;
import
{
ScatterChartDemoComponent
}
from
'
./scatterchart-demo/scatterchart-demo.component
'
;
import
{
AreaChartDemoComponent
}
from
'
./areachart-demo/areachart-demo.component
'
;
import
{
LineChartDemoComponent
}
from
'
./linechart-demo/linechart-demo.component
'
;
import
{
DemoAppComponent
}
from
'
./demo-app/demo-app.component
'
;
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
RouterModule
,
Routes
}
from
'
@angular/router
'
;
import
{
RadialChartDemoComponent
}
from
'
./radialchart-demo/radialchart-demo.component
'
;
import
{
ResizeableChartDemoComponent
}
from
'
./resizeable-demo/resizeable-demo.component
'
;
import
{
ScatterChartDemoComponent
}
from
'
./scatterchart-demo/scatterchart-demo.component
'
;
import
{
ZoomPanDemmoComponent
}
from
'
./zoom-pan-demmo/zoom-pan-demmo.component
'
;
@
NgModule
(
{
imports
:
[
...
...
@@ -49,6 +51,10 @@ import { RouterModule, Routes } from '@angular/router';
path
:
'
resize
'
,
component
:
ResizeableChartDemoComponent
,
},
{
path
:
'
zoom
'
,
component
:
ZoomPanDemmoComponent
,
},
{
path
:
'
**
'
,
redirectTo
:
'
gistcharts
'
...
...
demo-angularIO/src/app/app.module.ts
View file @
9a5eb02d
...
...
@@ -19,6 +19,7 @@ const materialItems = [ MatToolbarModule, MatCardModule ];
import
{
FlexLayoutModule
}
from
'
@angular/flex-layout
'
;
import
{
FormsModule
}
from
'
@angular/forms
'
;
import
{
ZoomPanDemmoComponent
}
from
'
./zoom-pan-demmo/zoom-pan-demmo.component
'
;
@
NgModule
(
{
declarations
:
[
...
...
@@ -31,7 +32,8 @@ import { FormsModule } from '@angular/forms';
LineChartDemoComponent
,
RadialChartDemoComponent
,
ScatterChartDemoComponent
,
ResizeableChartDemoComponent
ResizeableChartDemoComponent
,
ZoomPanDemmoComponent
],
imports
:
[
BrowserModule
,
...
...
gist-charts/source/classes/chartCanvas.class.ts
View file @
9a5eb02d
...
...
@@ -354,7 +354,6 @@ export class ChartCanvas {
const
me
=
this
;
if
(
x
|
y
)
{
me
.
axisList
.
forEach
(
(
axis
:
BaseAxis
)
=>
{
axis
.
zoom
(
me
.
_currentZoomState
,
(
axis
.
_implementation
.
isVertical
)
?
y
:
x
);
}
);
me
.
beginRender
();
...
...
gist-charts/source/configs/axis/baseAxis.class.ts
View file @
9a5eb02d
...
...
@@ -220,7 +220,9 @@ export abstract class BaseAxis<T = any> {
*/
public
zoom
(
zoom
:
number
=
1.14
,
offset
:
number
=
0
)
{
let
multiplier
:
number
=
1
;
if
(
zoom
!==
this
.
_implementation
.
currentZoomLevel
)
{
multiplier
=
zoom
/
this
.
_implementation
.
currentZoomLevel
;
}
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
.
offset
*=
multiplier
;
this
.
_implementation
.
offset
+=
offset
;
...
...
package/index.js
View file @
9a5eb02d
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