mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
201
web/js/amcharts/plugins/animate/LICENSE
Normal file
201
web/js/amcharts/plugins/animate/LICENSE
Normal file
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
108
web/js/amcharts/plugins/animate/README.md
Normal file
108
web/js/amcharts/plugins/animate/README.md
Normal file
|
@ -0,0 +1,108 @@
|
|||
# amCharts Animate
|
||||
|
||||
Version: 1.1.2
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
Smoothly animates the `dataProvider`
|
||||
|
||||
It works with serial, pie, XY, funnel, and radar.
|
||||
|
||||
Here are some examples:
|
||||
|
||||
[Serial chart (line)](http://codepen.io/team/amcharts/pen/64673d1369cc47c0e6a970b071bafd03)
|
||||
|
||||
[Serial chart (column)](http://codepen.io/team/amcharts/pen/a5322d071a194d5975a4c68309724324)
|
||||
|
||||
[Pie chart](http://codepen.io/team/amcharts/pen/3ff9b206ce37111fa508156df38504bc)
|
||||
|
||||
[XY chart](http://codepen.io/team/amcharts/pen/9c9289a7b5f8b1d6d11441836e09cc81)
|
||||
|
||||
[Funnel chart](http://codepen.io/team/amcharts/pen/8fd8d025730b01939a2eb56b908488df)
|
||||
|
||||
[Radar chart](http://codepen.io/team/amcharts/pen/6ffb5e356b6015a6dcb6019d7b14d3f6)
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Include `animate.min.js` on your web page:
|
||||
|
||||
```
|
||||
<script src="//www.amcharts.com/lib/3/plugins/animate/animate.min.js"></script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Rather than using `chart.validateData`, instead use `chart.animateData`:
|
||||
|
||||
```
|
||||
chart.animateData(newData, { duration: 1000 });
|
||||
```
|
||||
|
||||
It will now smoothly animate from the old data to the new data.
|
||||
|
||||
----
|
||||
|
||||
The first argument is the new `dataProvider` for the chart.
|
||||
|
||||
The second argument is an object that can contain the following options:
|
||||
|
||||
* `duration` is required: it is the number of milliseconds that the animation should play for.
|
||||
|
||||
* `complete` is optional: it is a function that is called when the animation completes.
|
||||
|
||||
----
|
||||
|
||||
The new `dataProvider` must be different from the old `dataProvider`
|
||||
|
||||
If you want to modify the existing `dataProvider`, you must create a deep copy:
|
||||
|
||||
```
|
||||
// Creates a deep copy of the old dataProvider
|
||||
var newDataProvider = JSON.parse(JSON.stringify(chart.dataProvider));
|
||||
|
||||
// Adds new data to the new dataProvider
|
||||
newDataProvider.push({ category: "foo", value: 10 });
|
||||
|
||||
// Mutates the data in the new dataProvider
|
||||
newDataProvider[0].value = 50;
|
||||
|
||||
// Animates with the new dataProvider
|
||||
chart.animateData(newDataProvider, { duration: 1000 });
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
All software included in this collection is licensed under Apache License 2.0.
|
||||
|
||||
This basically means you're free to use or modify it, even make your own
|
||||
versions or completely different products out of them.
|
||||
|
||||
Please see attached file "license.txt" for the complete license or online here:
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
|
||||
## Contact us
|
||||
|
||||
* Email: contact@amcharts.com
|
||||
* Web: http://www.amcharts.com/
|
||||
* Facebook: https://www.facebook.com/amcharts
|
||||
* Twitter: https://twitter.com/amcharts
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
### 1.1.2
|
||||
* Fixing a bug with the minimum/maximum
|
||||
|
||||
### 1.1.1
|
||||
* It now automatically sets the minimum/maximum on the value axes while animating
|
||||
|
||||
### 1.1.0
|
||||
* Adding in support for XY charts
|
||||
|
||||
### 1.0.0
|
||||
* Initial release
|
583
web/js/amcharts/plugins/animate/animate.js
Normal file
583
web/js/amcharts/plugins/animate/animate.js
Normal file
|
@ -0,0 +1,583 @@
|
|||
/*
|
||||
Plugin Name: amCharts Animate
|
||||
Description: Smoothly animates the `dataProvider`
|
||||
Author: Paul Chapman, amCharts
|
||||
Version: 1.1.2
|
||||
Author URI: http://www.amcharts.com/
|
||||
|
||||
Copyright 2015 amCharts
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Please note that the above license covers only this plugin. It by all means does
|
||||
not apply to any other amCharts products that are covered by different licenses.
|
||||
*/
|
||||
|
||||
/* globals AmCharts */
|
||||
/* jshint -W061 */
|
||||
|
||||
( function() {
|
||||
"use strict";
|
||||
|
||||
|
||||
// For older browsers, e.g. IE9 and lower
|
||||
if ( typeof requestAnimationFrame === "undefined" ) {
|
||||
var fps = 1000 / 60;
|
||||
|
||||
var raf = function( f ) {
|
||||
setTimeout( function() {
|
||||
f( new Date().getTime() );
|
||||
}, fps );
|
||||
};
|
||||
|
||||
} else {
|
||||
var raf = requestAnimationFrame;
|
||||
}
|
||||
|
||||
|
||||
function tween( time, from, to ) {
|
||||
return ( time * ( to - from ) ) + from;
|
||||
}
|
||||
|
||||
|
||||
function easeInOut3( t ) {
|
||||
var r = ( t < 0.5 ? t * 2 : ( 1 - t ) * 2 );
|
||||
r *= r * r * r;
|
||||
return ( t < 0.5 ? r / 2 : 1 - ( r / 2 ) );
|
||||
}
|
||||
|
||||
function easeIn3( t ) {
|
||||
t *= t * t * t;
|
||||
return t;
|
||||
}
|
||||
|
||||
function easeOut3( t ) {
|
||||
var r = ( 1 - t );
|
||||
r *= r * r * r;
|
||||
return ( 1 - r );
|
||||
}
|
||||
|
||||
|
||||
function Tween( object, key, from, to ) {
|
||||
this._object = object;
|
||||
this._key = key;
|
||||
this._from = from;
|
||||
this._to = to;
|
||||
}
|
||||
|
||||
Tween.prototype.interpolate = function( time ) {
|
||||
this._object[ this._key ] = tween( time, this._from, this._to );
|
||||
};
|
||||
|
||||
|
||||
function Animation( duration, easing, onComplete, tweens, chart ) {
|
||||
this._finished = false;
|
||||
this._startTime = null;
|
||||
|
||||
this._duration = duration;
|
||||
this._easing = ( easing == null ? easeOut3 : easing );
|
||||
this._onComplete = onComplete;
|
||||
this._tweens = tweens;
|
||||
|
||||
this._chart = chart;
|
||||
}
|
||||
|
||||
Animation.prototype.cancel = function() {
|
||||
this._finished = true;
|
||||
this._startTime = null;
|
||||
|
||||
this._duration = null;
|
||||
this._easing = null;
|
||||
this._onComplete = null;
|
||||
this._tweens = null;
|
||||
|
||||
this._chart = null;
|
||||
};
|
||||
|
||||
Animation.prototype._onFrame = function( now ) {
|
||||
// This will only happen when the animation was cancelled
|
||||
if ( this._finished ) {
|
||||
return true;
|
||||
|
||||
} else if ( this._startTime === null ) {
|
||||
this._startTime = now;
|
||||
return false;
|
||||
|
||||
} else {
|
||||
var diff = now - this._startTime;
|
||||
|
||||
if ( diff < this._duration ) {
|
||||
this._tick( diff / this._duration );
|
||||
return false;
|
||||
|
||||
} else {
|
||||
this._end( 1 );
|
||||
// Cleanup all the properties
|
||||
this.cancel();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Animation.prototype._tick = function( time ) {
|
||||
// Apply the easing to the time ratio
|
||||
time = this._easing( time );
|
||||
|
||||
var tweens = this._tweens;
|
||||
|
||||
for ( var i = 0; i < tweens.length; ++i ) {
|
||||
tweens[ i ].interpolate( time );
|
||||
}
|
||||
|
||||
// TODO check the performance of this
|
||||
pushNew( needsValidation, this._chart );
|
||||
};
|
||||
|
||||
Animation.prototype._end = function( time ) {
|
||||
this._tick( time );
|
||||
|
||||
this._onComplete();
|
||||
};
|
||||
|
||||
|
||||
function Animator() {
|
||||
this._animating = false;
|
||||
this._animations = [];
|
||||
this._onBeforeFrames = [];
|
||||
this._onAfterFrames = [];
|
||||
|
||||
var self = this;
|
||||
|
||||
this._raf = function( now ) {
|
||||
self._onFrame( now );
|
||||
};
|
||||
}
|
||||
|
||||
Animator.prototype.animate = function( animation ) {
|
||||
this._animations.push( animation );
|
||||
|
||||
if ( !this._animating ) {
|
||||
this._animating = true;
|
||||
|
||||
raf( this._raf );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Animator.prototype.onBeforeFrame = function( f ) {
|
||||
this._onBeforeFrames.push( f );
|
||||
};
|
||||
|
||||
Animator.prototype.onAfterFrame = function( f ) {
|
||||
this._onAfterFrames.push( f );
|
||||
};
|
||||
|
||||
|
||||
Animator.prototype._onFrame = function( now ) {
|
||||
var onBeforeFrames = this._onBeforeFrames;
|
||||
|
||||
for ( var i = 0; i < onBeforeFrames.length; ++i ) {
|
||||
onBeforeFrames[ i ]( now );
|
||||
}
|
||||
|
||||
|
||||
var animations = this._animations;
|
||||
|
||||
for ( var i = 0; i < animations.length; ++i ) {
|
||||
var animation = animations[ i ];
|
||||
|
||||
// If the animation is finished...
|
||||
if ( animation._onFrame( now ) ) {
|
||||
// TODO this is a bit slow, but I don't know of a faster alternative
|
||||
animations.splice( i, 1 );
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var onAfterFrames = this._onAfterFrames;
|
||||
|
||||
for ( var i = 0; i < onAfterFrames.length; ++i ) {
|
||||
onAfterFrames[ i ]( now );
|
||||
}
|
||||
|
||||
|
||||
// All animations are finished
|
||||
if ( animations.length === 0 ) {
|
||||
this._animating = false;
|
||||
|
||||
} else {
|
||||
raf( this._raf );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var _animator = new Animator();
|
||||
|
||||
|
||||
var needsValidation = [];
|
||||
|
||||
// This is more robust than the built-in `isNaN` function
|
||||
function isNaN( x ) {
|
||||
return x !== x;
|
||||
}
|
||||
|
||||
function each( array, fn ) {
|
||||
for ( var i = 0; i < array.length; ++i ) {
|
||||
fn( array[ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
function pushNew( array, x ) {
|
||||
for ( var i = 0; i < array.length; ++i ) {
|
||||
if ( array[ i ] === x ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
array.push( x );
|
||||
}
|
||||
|
||||
// TODO check the performance of this
|
||||
_animator.onAfterFrame( function() {
|
||||
for ( var i = 0; i < needsValidation.length; ++i ) {
|
||||
needsValidation[ i ].validateData();
|
||||
}
|
||||
|
||||
needsValidation.length = 0;
|
||||
} );
|
||||
|
||||
|
||||
// This ensures that a key is only added once
|
||||
function addKey( keys, seen, key ) {
|
||||
if ( !seen[ key ] ) {
|
||||
seen[ key ] = true;
|
||||
keys.push( key );
|
||||
}
|
||||
}
|
||||
|
||||
function addKeys( keys, seen, object, a ) {
|
||||
each( a, function( key ) {
|
||||
var value = object[ key ];
|
||||
|
||||
if ( value != null ) {
|
||||
addKey( keys, seen, value );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
function getKeysSliced( chart, keys, seen ) {
|
||||
addKeys( keys, seen, chart, [
|
||||
"alphaField",
|
||||
"valueField"
|
||||
] );
|
||||
}
|
||||
|
||||
function getKeysFunnel( chart, keys, seen ) {
|
||||
getKeysSliced( chart, keys, seen );
|
||||
}
|
||||
|
||||
function getKeysPie( chart, keys, seen ) {
|
||||
getKeysSliced( chart, keys, seen );
|
||||
|
||||
addKeys( keys, seen, chart, [
|
||||
"labelRadiusField"
|
||||
] );
|
||||
}
|
||||
|
||||
function getKeysGraph( graph, keys, seen ) {
|
||||
addKeys( keys, seen, graph, [
|
||||
"alphaField",
|
||||
"bulletSizeField",
|
||||
"closeField",
|
||||
"dashLengthField",
|
||||
"errorField",
|
||||
"highField",
|
||||
"lowField",
|
||||
"openField",
|
||||
"valueField"
|
||||
] );
|
||||
}
|
||||
|
||||
function getKeysXY( graph, keys, seen ) {
|
||||
getKeysGraph( graph, keys, seen );
|
||||
|
||||
addKeys( keys, seen, graph, [
|
||||
"xField",
|
||||
"yField"
|
||||
] );
|
||||
}
|
||||
|
||||
function getKeysGraphs( graphs, keys, seen, f ) {
|
||||
each( graphs, function( graph ) {
|
||||
f( graph, keys, seen );
|
||||
} );
|
||||
}
|
||||
|
||||
function getKeysCategoryAxis( categoryAxis, keys, seen ) {
|
||||
addKeys( keys, seen, categoryAxis, [
|
||||
"widthField"
|
||||
] );
|
||||
}
|
||||
|
||||
|
||||
// Returns an array of all of the animatable keys
|
||||
function getKeys( chart ) {
|
||||
var keys = [];
|
||||
|
||||
var seen = {};
|
||||
|
||||
if ( chart.type === "funnel" ) {
|
||||
getKeysFunnel( chart, keys, seen );
|
||||
|
||||
} else if ( chart.type === "pie" ) {
|
||||
getKeysPie( chart, keys, seen );
|
||||
|
||||
} else if ( chart.type === "serial" ) {
|
||||
getKeysCategoryAxis( chart.categoryAxis, keys, seen );
|
||||
getKeysGraphs( chart.graphs, keys, seen, getKeysGraph );
|
||||
|
||||
} else if ( chart.type === "radar" ) {
|
||||
getKeysGraphs( chart.graphs, keys, seen, getKeysGraph );
|
||||
|
||||
} else if ( chart.type === "xy" ) {
|
||||
getKeysGraphs( chart.graphs, keys, seen, getKeysXY );
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
|
||||
// Sets the minimum/maximum of the value axes while the animation is playing
|
||||
function setAxesMinMax( chart ) {
|
||||
var axes = {};
|
||||
|
||||
if ( chart.type === "serial" || chart.type === "radar" || chart.type === "xy" ) {
|
||||
each( chart.valueAxes, function( axis ) {
|
||||
// TODO is it guaranteed that every value axis has an id ?
|
||||
if ( axes[ axis.id ] == null ) {
|
||||
// This saves the old minimum / maximum so that we can restore it after the animation is complete
|
||||
axes[ axis.id ] = {
|
||||
minimum: axis.minimum,
|
||||
maximum: axis.maximum
|
||||
};
|
||||
|
||||
var min = axis.minRR;
|
||||
var max = axis.maxRR;
|
||||
|
||||
var dif = max - min;
|
||||
var difE;
|
||||
|
||||
if ( dif === 0 ) {
|
||||
difE = Math.pow( 10, Math.floor( Math.log( Math.abs( max ) ) * Math.LOG10E ) ) / 10;
|
||||
|
||||
} else {
|
||||
difE = Math.pow( 10, Math.floor( Math.log( Math.abs( dif ) ) * Math.LOG10E ) ) / 10;
|
||||
}
|
||||
|
||||
if ( axis.minimum == null ) {
|
||||
axis.minimum = Math.floor( min / difE ) * difE - difE;
|
||||
}
|
||||
|
||||
if ( axis.maximum == null ) {
|
||||
axis.maximum = Math.ceil( max / difE ) * difE + difE;
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
return axes;
|
||||
}
|
||||
|
||||
// Resets the minimum/maximum of the value axes after the animation is finished
|
||||
function resetAxesMinMax( chart, axes ) {
|
||||
if ( chart.type === "serial" || chart.type === "radar" || chart.type === "xy" ) {
|
||||
each( chart.valueAxes, function( axis ) {
|
||||
var info = axes[ axis.id ];
|
||||
|
||||
if ( info != null ) {
|
||||
if ( info.minimum == null ) {
|
||||
delete axis.minimum;
|
||||
}
|
||||
|
||||
if ( info.maximum == null ) {
|
||||
delete axis.maximum;
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getCategoryField( chart ) {
|
||||
if ( chart.type === "funnel" || chart.type === "pie" ) {
|
||||
return chart.titleField;
|
||||
|
||||
} else if ( chart.type === "serial" || chart.type === "radar" ) {
|
||||
return chart.categoryField;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getValue( object, key ) {
|
||||
var value = object[ key ];
|
||||
|
||||
if ( value == null ) {
|
||||
return null;
|
||||
|
||||
} else {
|
||||
value = +value;
|
||||
|
||||
// TODO test this
|
||||
// TODO what about Infinity, etc. ?
|
||||
if ( isNaN( value ) ) {
|
||||
return null;
|
||||
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCategory( object, key ) {
|
||||
var value = object[ key ];
|
||||
|
||||
if ( value == null ) {
|
||||
return null;
|
||||
|
||||
} else {
|
||||
// TODO better algorithm for this ?
|
||||
return "" + value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getCategories( dataProvider, categoryField ) {
|
||||
var categories = {};
|
||||
|
||||
each( dataProvider, function( data ) {
|
||||
var category = getCategory( data, categoryField );
|
||||
|
||||
if ( category != null ) {
|
||||
categories[ category ] = data;
|
||||
}
|
||||
} );
|
||||
|
||||
return categories;
|
||||
}
|
||||
|
||||
|
||||
function getNormalTweens( dataProvider, categoryField, categories, keys ) {
|
||||
var tweens = [];
|
||||
|
||||
each( dataProvider, function( newData ) {
|
||||
var category = getCategory( newData, categoryField );
|
||||
|
||||
// If the new data has the same category as the old data...
|
||||
if ( category != null && category in categories ) {
|
||||
var oldData = categories[ category ];
|
||||
|
||||
each( keys, function( key ) {
|
||||
var oldValue = getValue( oldData, key );
|
||||
var newValue = getValue( newData, key );
|
||||
|
||||
// If the old field and new field both exist...
|
||||
if ( oldValue != null && newValue != null ) {
|
||||
tweens.push( new Tween( newData, key, oldValue, newValue ) );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
return tweens;
|
||||
}
|
||||
|
||||
|
||||
function getXYTweens( oldDataProvider, newDataProvider, keys ) {
|
||||
var tweens = [];
|
||||
|
||||
var length = Math.min( oldDataProvider.length, newDataProvider.length );
|
||||
|
||||
for ( var i = 0; i < length; ++i ) {
|
||||
var oldData = oldDataProvider[ i ];
|
||||
var newData = newDataProvider[ i ];
|
||||
|
||||
each( keys, function( key ) {
|
||||
var oldValue = getValue( oldData, key );
|
||||
var newValue = getValue( newData, key );
|
||||
|
||||
// If the old field and new field both exist...
|
||||
if ( oldValue != null && newValue != null ) {
|
||||
tweens.push( new Tween( newData, key, oldValue, newValue ) );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
return tweens;
|
||||
}
|
||||
|
||||
|
||||
function getTweens( chart, dataProvider ) {
|
||||
if ( chart.type === "xy" ) {
|
||||
var keys = getKeys( chart );
|
||||
|
||||
return getXYTweens( chart.dataProvider, dataProvider, keys );
|
||||
|
||||
} else {
|
||||
var categoryField = getCategoryField( chart );
|
||||
var keys = getKeys( chart );
|
||||
|
||||
var categories = getCategories( chart.dataProvider, categoryField );
|
||||
|
||||
return getNormalTweens( dataProvider, categoryField, categories, keys );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function animateData( dataProvider, options ) {
|
||||
var chart = this;
|
||||
|
||||
var tweens = getTweens( chart, dataProvider );
|
||||
|
||||
var axes = setAxesMinMax( chart );
|
||||
|
||||
chart.dataProvider = dataProvider;
|
||||
|
||||
function onComplete() {
|
||||
resetAxesMinMax( chart, axes );
|
||||
|
||||
if ( options.complete != null ) {
|
||||
options.complete();
|
||||
}
|
||||
}
|
||||
|
||||
var animation = new Animation(
|
||||
options.duration,
|
||||
options.easing,
|
||||
onComplete,
|
||||
tweens,
|
||||
chart
|
||||
);
|
||||
|
||||
_animator.animate( animation );
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
|
||||
AmCharts.addInitHandler( function( chart ) {
|
||||
chart.animateData = animateData;
|
||||
}, [ "funnel", "pie", "serial", "radar", "xy" ] );
|
||||
|
||||
} )();
|
40
web/js/amcharts/plugins/animate/animate.min.js
vendored
Normal file
40
web/js/amcharts/plugins/animate/animate.min.js
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
!function(){"use strict"
|
||||
function t(t,n,i){return t*(i-n)+n}function n(t){var n=1-t
|
||||
return n*=n*n*n,1-n}function i(t,n,i,e){this._object=t,this._key=n,this._from=i,this._to=e}function e(t,i,e,r,a){this._finished=!1,this._startTime=null,this._duration=t,this._easing=null==i?n:i,this._onComplete=e,this._tweens=r,this._chart=a}function r(){this._animating=!1,this._animations=[],this._onBeforeFrames=[],this._onAfterFrames=[]
|
||||
var t=this
|
||||
this._raf=function(n){t._onFrame(n)}}function a(t){return t!==t}function o(t,n){for(var i=0;i<t.length;++i)n(t[i])}function u(t,n){for(var i=0;i<t.length;++i)if(t[i]===n)return
|
||||
t.push(n)}function l(t,n,i){n[i]||(n[i]=!0,t.push(i))}function s(t,n,i,e){o(e,function(e){var r=i[e]
|
||||
null!=r&&l(t,n,r)})}function h(t,n,i){s(n,i,t,["alphaField","valueField"])}function f(t,n,i){h(t,n,i)}function m(t,n,i){h(t,n,i),s(n,i,t,["labelRadiusField"])}function c(t,n,i){s(n,i,t,["alphaField","bulletSizeField","closeField","dashLengthField","errorField","highField","lowField","openField","valueField"])}function p(t,n,i){c(t,n,i),s(n,i,t,["xField","yField"])}function _(t,n,i,e){o(t,function(t){e(t,n,i)})}function d(t,n,i){s(n,i,t,["widthField"])}function v(t){var n=[],i={}
|
||||
return"funnel"===t.type?f(t,n,i):"pie"===t.type?m(t,n,i):"serial"===t.type?(d(t.categoryAxis,n,i),_(t.graphs,n,i,c)):"radar"===t.type?_(t.graphs,n,i,c):"xy"===t.type&&_(t.graphs,n,i,p),n}function y(t){var n={}
|
||||
return("serial"===t.type||"radar"===t.type||"xy"===t.type)&&o(t.valueAxes,function(t){if(null==n[t.id]){n[t.id]={minimum:t.minimum,maximum:t.maximum}
|
||||
var i,e=t.minRR,r=t.maxRR,a=r-e
|
||||
i=0===a?Math.pow(10,Math.floor(Math.log(Math.abs(r))*Math.LOG10E))/10:Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E))/10,null==t.minimum&&(t.minimum=Math.floor(e/i)*i-i),null==t.maximum&&(t.maximum=Math.ceil(r/i)*i+i)}}),n}function F(t,n){("serial"===t.type||"radar"===t.type||"xy"===t.type)&&o(t.valueAxes,function(t){var i=n[t.id]
|
||||
null!=i&&(null==i.minimum&&delete t.minimum,null==i.maximum&&delete t.maximum)})}function g(t){return"funnel"===t.type||"pie"===t.type?t.titleField:"serial"===t.type||"radar"===t.type?t.categoryField:void 0}function x(t,n){var i=t[n]
|
||||
return null==i?null:(i=+i,a(i)?null:i)}function M(t,n){var i=t[n]
|
||||
return null==i?null:""+i}function w(t,n){var i={}
|
||||
return o(t,function(t){var e=M(t,n)
|
||||
null!=e&&(i[e]=t)}),i}function A(t,n,e,r){var a=[]
|
||||
return o(t,function(t){var u=M(t,n)
|
||||
if(null!=u&&u in e){var l=e[u]
|
||||
o(r,function(n){var e=x(l,n),r=x(t,n)
|
||||
null!=e&&null!=r&&a.push(new i(t,n,e,r))})}}),a}function T(t,n,e){for(var r=[],a=Math.min(t.length,n.length),u=0;a>u;++u){var l=t[u],s=n[u]
|
||||
o(e,function(t){var n=x(l,t),e=x(s,t)
|
||||
null!=n&&null!=e&&r.push(new i(s,t,n,e))})}return r}function b(t,n){if("xy"===t.type){var i=v(t)
|
||||
return T(t.dataProvider,n,i)}var e=g(t),i=v(t),r=w(t.dataProvider,e)
|
||||
return A(n,e,r,i)}function k(t,n){function i(){F(r,o),null!=n.complete&&n.complete()}var r=this,a=b(r,t),o=y(r)
|
||||
r.dataProvider=t
|
||||
var u=new e(n.duration,n.easing,i,a,r)
|
||||
return C.animate(u),u}if("undefined"==typeof requestAnimationFrame)var R=1e3/60,B=function(t){setTimeout(function(){t((new Date).getTime())},R)}
|
||||
else var B=requestAnimationFrame
|
||||
i.prototype.interpolate=function(n){this._object[this._key]=t(n,this._from,this._to)},e.prototype.cancel=function(){this._finished=!0,this._startTime=null,this._duration=null,this._easing=null,this._onComplete=null,this._tweens=null,this._chart=null},e.prototype._onFrame=function(t){if(this._finished)return!0
|
||||
if(null===this._startTime)return this._startTime=t,!1
|
||||
var n=t-this._startTime
|
||||
return n<this._duration?(this._tick(n/this._duration),!1):(this._end(1),this.cancel(),!0)},e.prototype._tick=function(t){t=this._easing(t)
|
||||
for(var n=this._tweens,i=0;i<n.length;++i)n[i].interpolate(t)
|
||||
u(D,this._chart)},e.prototype._end=function(t){this._tick(t),this._onComplete()},r.prototype.animate=function(t){this._animations.push(t),this._animating||(this._animating=!0,B(this._raf))},r.prototype.onBeforeFrame=function(t){this._onBeforeFrames.push(t)},r.prototype.onAfterFrame=function(t){this._onAfterFrames.push(t)},r.prototype._onFrame=function(t){for(var n=this._onBeforeFrames,i=0;i<n.length;++i)n[i](t)
|
||||
for(var e=this._animations,i=0;i<e.length;++i){var r=e[i]
|
||||
r._onFrame(t)&&(e.splice(i,1),--i)}for(var a=this._onAfterFrames,i=0;i<a.length;++i)a[i](t)
|
||||
0===e.length?this._animating=!1:B(this._raf)}
|
||||
var C=new r,D=[]
|
||||
C.onAfterFrame(function(){for(var t=0;t<D.length;++t)D[t].validateData()
|
||||
D.length=0}),AmCharts.addInitHandler(function(t){t.animateData=k},["funnel","pie","serial","radar","xy"])}()
|
28
web/js/amcharts/plugins/animate/bower.json
Normal file
28
web/js/amcharts/plugins/animate/bower.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "amcharts3-animate",
|
||||
"authors": [
|
||||
"amCharts <contact@amcharts.com>"
|
||||
],
|
||||
"description": "amCharts V3 Animate plugin",
|
||||
"main": [
|
||||
"animate.js"
|
||||
],
|
||||
"keywords": [
|
||||
"amcharts",
|
||||
"charts",
|
||||
"javascript",
|
||||
"plugin"
|
||||
],
|
||||
"moduleType": [
|
||||
"globals"
|
||||
],
|
||||
"dependencies": {
|
||||
"amcharts3": ">= 3.11.1"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"homepage": "https://www.amcharts.com/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/amcharts/animate.git"
|
||||
}
|
||||
}
|
78
web/js/amcharts/plugins/animate/examples/funnel.html
Normal file
78
web/js/amcharts/plugins/animate/examples/funnel.html
Normal file
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/funnel.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="../animate.min.js"></script>
|
||||
|
||||
<div id="chartdiv"></div>
|
||||
|
||||
<script>
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "funnel",
|
||||
"theme": "light",
|
||||
"dataProvider": generateChartData(),
|
||||
"valueField": "value",
|
||||
"titleField": "category",
|
||||
"alphaField": "alpha",
|
||||
"startDuration": 0,
|
||||
"precision": 2,
|
||||
"neckHeight": 150,
|
||||
"neckWidth": 200
|
||||
});
|
||||
|
||||
|
||||
function generateChartData() {
|
||||
var chartData = [];
|
||||
|
||||
for ( var i = 0; i < 10; i++ ) {
|
||||
var value = Math.floor(Math.random() * 100);
|
||||
var labelRadius = Math.floor(Math.random() * 100);
|
||||
var alpha = Math.random();
|
||||
|
||||
chartData.push( {
|
||||
category: "" + i,
|
||||
value: value,
|
||||
labelRadius: labelRadius,
|
||||
alpha: alpha
|
||||
} );
|
||||
}
|
||||
|
||||
return chartData;
|
||||
}
|
||||
|
||||
|
||||
function loop() {
|
||||
var data = generateChartData();
|
||||
|
||||
chart.animateData(data, {
|
||||
duration: 1000,
|
||||
complete: function () {
|
||||
setTimeout(loop, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chart.addListener("init", function () {
|
||||
setTimeout(loop, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
76
web/js/amcharts/plugins/animate/examples/pie.html
Normal file
76
web/js/amcharts/plugins/animate/examples/pie.html
Normal file
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="../animate.min.js"></script>
|
||||
|
||||
<div id="chartdiv"></div>
|
||||
|
||||
<script>
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "pie",
|
||||
"theme": "light",
|
||||
"dataProvider": generateChartData(),
|
||||
"valueField": "value",
|
||||
"titleField": "category",
|
||||
"labelRadiusField": "labelRadius",
|
||||
"alphaField": "alpha",
|
||||
"startDuration": 0
|
||||
});
|
||||
|
||||
|
||||
function generateChartData() {
|
||||
var chartData = [];
|
||||
|
||||
for ( var i = 0; i < 10; i++ ) {
|
||||
var value = Math.floor(Math.random() * 100);
|
||||
var labelRadius = Math.floor(Math.random() * 100);
|
||||
var alpha = Math.random();
|
||||
|
||||
chartData.push( {
|
||||
category: "" + i,
|
||||
value: value,
|
||||
labelRadius: labelRadius,
|
||||
alpha: alpha
|
||||
} );
|
||||
}
|
||||
|
||||
return chartData;
|
||||
}
|
||||
|
||||
|
||||
function loop() {
|
||||
var data = generateChartData();
|
||||
|
||||
chart.animateData(data, {
|
||||
duration: 1000,
|
||||
complete: function () {
|
||||
setTimeout(loop, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chart.addListener("init", function () {
|
||||
setTimeout(loop, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
97
web/js/amcharts/plugins/animate/examples/radar.html
Normal file
97
web/js/amcharts/plugins/animate/examples/radar.html
Normal file
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/radar.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="../animate.min.js"></script>
|
||||
|
||||
<div id="chartdiv"></div>
|
||||
|
||||
<script>
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "radar",
|
||||
"theme": "light",
|
||||
"dataProvider": generateChartData(),
|
||||
"graphs": [{
|
||||
"bullet": "round",
|
||||
"bulletSizeField": "bullet1",
|
||||
"lineThickness": 2,
|
||||
"valueField": "value",
|
||||
"type": "line",
|
||||
"alphaField": "alpha1",
|
||||
"dashLengthField": "dash1"
|
||||
}, {
|
||||
"bullet": "round",
|
||||
"bulletSizeField": "bullet2",
|
||||
"lineThickness": 2,
|
||||
"valueField": "value2",
|
||||
"type": "line",
|
||||
"alphaField": "alpha2",
|
||||
"dashLengthField": "dash2"
|
||||
}],
|
||||
"valueAxes": [{
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
}],
|
||||
"categoryField": "category"
|
||||
});
|
||||
|
||||
|
||||
function generateChartData() {
|
||||
var chartData = [];
|
||||
|
||||
for ( var i = 0; i < 25; i++ ) {
|
||||
var a = Math.floor( Math.random() * 100 );
|
||||
var b = Math.floor( Math.random() * 100 );
|
||||
|
||||
chartData.push( {
|
||||
category: "" + i,
|
||||
value: a,
|
||||
value2: b,
|
||||
bullet1: Math.floor(Math.random() * 10),
|
||||
bullet2: Math.floor(Math.random() * 10),
|
||||
alpha1: (Math.random() < 0.5 ? 0 : 1),
|
||||
alpha2: (Math.random() < 0.5 ? 0 : 1),
|
||||
dash1: Math.floor(Math.random() * 20),
|
||||
dash2: Math.floor(Math.random() * 20)
|
||||
} );
|
||||
}
|
||||
|
||||
return chartData;
|
||||
}
|
||||
|
||||
|
||||
function loop() {
|
||||
var data = generateChartData();
|
||||
|
||||
chart.animateData(data, {
|
||||
duration: 1000,
|
||||
complete: function () {
|
||||
setTimeout(loop, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chart.addListener("init", function () {
|
||||
setTimeout(loop, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
99
web/js/amcharts/plugins/animate/examples/serial_column.html
Normal file
99
web/js/amcharts/plugins/animate/examples/serial_column.html
Normal file
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="../animate.min.js"></script>
|
||||
|
||||
<div id="chartdiv"></div>
|
||||
|
||||
<script>
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": generateChartData(),
|
||||
"graphs": [{
|
||||
"valueField": "value",
|
||||
"type": "column",
|
||||
"fillAlphas": 1,
|
||||
"alphaField": "alpha1"
|
||||
}, {
|
||||
"valueField": "value2",
|
||||
"fillAlphas": 1,
|
||||
"type": "column",
|
||||
"alphaField": "alpha2"
|
||||
}],
|
||||
"valueAxes": [{
|
||||
"minimum": 0,
|
||||
"maximum": 400
|
||||
}],
|
||||
"chartCursor": {},
|
||||
"categoryAxis": {
|
||||
"parseDates": true,
|
||||
"minPeriod": "mm"
|
||||
},
|
||||
"zoomOutOnDataUpdate": false,
|
||||
"categoryField": "date"
|
||||
});
|
||||
|
||||
|
||||
function generateChartData() {
|
||||
var chartData = [];
|
||||
var firstDate = new Date( 2012, 0, 1 );
|
||||
firstDate.setDate( firstDate.getDate() - 1000 );
|
||||
firstDate.setHours( 0, Math.floor(Math.random() * 10), 0, 0 );
|
||||
|
||||
for ( var i = 0; i < 10; i++ ) {
|
||||
var newDate = new Date( firstDate );
|
||||
newDate.setHours( 0, i, 0, 0 );
|
||||
|
||||
var a = Math.round( Math.random() * ( 200 + i ) ) + 100 + i;
|
||||
var b = Math.round( Math.random() * ( 200 + i ) ) + 100 + i;
|
||||
|
||||
chartData.push( {
|
||||
date: newDate,
|
||||
value: a,
|
||||
value2: b,
|
||||
alpha1: (Math.random() < 0.5 ? 0 : 1),
|
||||
alpha2: (Math.random() < 0.5 ? 0 : 1)
|
||||
} );
|
||||
}
|
||||
|
||||
return chartData;
|
||||
}
|
||||
|
||||
|
||||
function loop() {
|
||||
var data = generateChartData();
|
||||
|
||||
chart.animateData(data, {
|
||||
duration: 1000,
|
||||
complete: function () {
|
||||
setTimeout(loop, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chart.addListener("init", function () {
|
||||
setTimeout(loop, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
96
web/js/amcharts/plugins/animate/examples/serial_line.html
Normal file
96
web/js/amcharts/plugins/animate/examples/serial_line.html
Normal file
|
@ -0,0 +1,96 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="../animate.min.js"></script>
|
||||
|
||||
<div id="chartdiv"></div>
|
||||
|
||||
<script>
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": generateChartData(),
|
||||
"graphs": [{
|
||||
"lineThickness": 2,
|
||||
"valueField": "value",
|
||||
"type": "smoothedLine"
|
||||
}, {
|
||||
"lineThickness": 2,
|
||||
"valueField": "value2",
|
||||
"type": "smoothedLine"
|
||||
}],
|
||||
"valueAxes": [{
|
||||
"minimum": 0,
|
||||
"maximum": 400
|
||||
}],
|
||||
"chartScrollbar": {},
|
||||
"chartCursor": {},
|
||||
"categoryAxis": {
|
||||
"parseDates": true,
|
||||
"minPeriod": "mm"
|
||||
},
|
||||
"zoomOutOnDataUpdate": false,
|
||||
"categoryField": "date"
|
||||
});
|
||||
|
||||
|
||||
function generateChartData() {
|
||||
var chartData = [];
|
||||
var firstDate = new Date( 2012, 0, 1 );
|
||||
firstDate.setDate( firstDate.getDate() - 1000 );
|
||||
firstDate.setHours( 0, Math.floor(Math.random() * 10), 0, 0 );
|
||||
|
||||
for ( var i = 0; i < 100; i++ ) {
|
||||
var newDate = new Date( firstDate );
|
||||
newDate.setHours( 0, i, 0, 0 );
|
||||
|
||||
var a = Math.round( Math.random() * ( 40 + i ) ) + 100 + i;
|
||||
var b = Math.round( Math.random() * ( 40 + i ) ) + 100 + i;
|
||||
|
||||
chartData.push( {
|
||||
date: newDate,
|
||||
value: a,
|
||||
value2: b
|
||||
} );
|
||||
}
|
||||
|
||||
return chartData;
|
||||
}
|
||||
|
||||
|
||||
function loop() {
|
||||
var data = generateChartData();
|
||||
|
||||
chart.animateData(data, {
|
||||
duration: 1000,
|
||||
complete: function () {
|
||||
setTimeout(loop, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chart.addListener("init", function () {
|
||||
setTimeout(loop, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
83
web/js/amcharts/plugins/animate/examples/xy.html
Normal file
83
web/js/amcharts/plugins/animate/examples/xy.html
Normal file
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/xy.js"></script>
|
||||
<script src="http://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<script src="../animate.js"></script>
|
||||
|
||||
<div id="chartdiv"></div>
|
||||
|
||||
<script>
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "xy",
|
||||
"theme": "light",
|
||||
"dataProvider": generateChartData(),
|
||||
"valueAxes": [{
|
||||
"position": "left",
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
}, {
|
||||
"position": "bottom",
|
||||
"minimum": 0,
|
||||
"maximum": 100
|
||||
}],
|
||||
"graphs": [{
|
||||
"bullet": "round",
|
||||
"xField": "x",
|
||||
"yField": "y",
|
||||
"valueField": "value",
|
||||
"alphaField": "alpha"
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
function generateChartData() {
|
||||
var chartData = [];
|
||||
|
||||
for ( var i = 0; i < 50; i++ ) {
|
||||
chartData.push( {
|
||||
x: Math.floor(Math.random() * 100),
|
||||
y: Math.floor(Math.random() * 100),
|
||||
value: Math.floor(Math.random() * 100),
|
||||
alpha: Math.random()
|
||||
} );
|
||||
}
|
||||
|
||||
return chartData;
|
||||
}
|
||||
|
||||
|
||||
function loop() {
|
||||
var data = generateChartData();
|
||||
|
||||
chart.animateData(data, {
|
||||
duration: 1000,
|
||||
complete: function () {
|
||||
setTimeout(loop, 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chart.addListener("init", function () {
|
||||
setTimeout(loop, 1000);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
2
web/js/amcharts/plugins/animate/index.js
Normal file
2
web/js/amcharts/plugins/animate/index.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
require("amcharts3/amcharts/amcharts.js");
|
||||
require("./animate.min.js");
|
10
web/js/amcharts/plugins/animate/package.json
Normal file
10
web/js/amcharts/plugins/animate/package.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "amcharts3-animate",
|
||||
"version": "1.1.2",
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amcharts/animate.git"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue