jmgraph 3.2.6 → 3.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/build/gulpfile.js +143 -0
  2. package/build/package-lock.json +19282 -0
  3. package/build/package.json +71 -0
  4. package/dist/jmgraph.core.min.js +1 -1
  5. package/dist/jmgraph.core.min.js.map +1 -1
  6. package/dist/jmgraph.js +29 -4
  7. package/dist/jmgraph.min.js +1 -1
  8. package/docs/_config.yml +1 -0
  9. package/docs/about.html +41 -0
  10. package/docs/api/jmGraph.md +2302 -0
  11. package/docs/css/index.css +131 -0
  12. package/docs/images/ball.gif +0 -0
  13. package/docs/images/bezier.gif +0 -0
  14. package/docs/images/cell.gif +0 -0
  15. package/docs/images/chart.gif +0 -0
  16. package/docs/images/editor.gif +0 -0
  17. package/docs/images/sort.gif +0 -0
  18. package/docs/index.html +80 -0
  19. package/docs/js/helper.js +89 -0
  20. package/docs/js/jquery.min.js +6 -0
  21. package/example/ball.html +223 -0
  22. package/example/base.html +112 -0
  23. package/example/canvas.html +54 -0
  24. package/example/cell.html +284 -0
  25. package/example/controls/arc.html +126 -0
  26. package/example/controls/arrowline.html +77 -0
  27. package/example/controls/bezier.html +223 -0
  28. package/example/controls/img.html +90 -0
  29. package/example/controls/label.html +85 -0
  30. package/example/controls/line.html +170 -0
  31. package/example/controls/prismatic.html +63 -0
  32. package/example/controls/rect.html +64 -0
  33. package/example/controls/resize.html +75 -0
  34. package/example/controls/test.html +136 -0
  35. package/example/es.html +70 -0
  36. package/example/es5module.html +64 -0
  37. package/example/heartarc.html +116 -0
  38. package/example/index.html +46 -0
  39. package/example/js/require.js +5 -0
  40. package/example/love/img/bling/bling.tps +265 -0
  41. package/example/love/img/bling.json +87 -0
  42. package/example/love/img/bling.tps +295 -0
  43. package/example/love/img/doc/bling.gif +0 -0
  44. package/example/love/img/love.json +95 -0
  45. package/example/love/img/love.tps +315 -0
  46. package/example/love/img/music/bg.mp3 +0 -0
  47. package/example/love/img/music/bg_2019130144035.mp3 +0 -0
  48. package/example/love/img/music/f.mp3 +0 -0
  49. package/example/love/img/music/fail.mp3 +0 -0
  50. package/example/love/img/music/s.mp3 +0 -0
  51. package/example/love/img/music/s_201913014415.mp3 +0 -0
  52. package/example/love/img/qq/qq.tps +399 -0
  53. package/example/love/img/qq.json +242 -0
  54. package/example/love/index.html +40 -0
  55. package/example/love/js/game.js +558 -0
  56. package/example/music.html +192 -0
  57. package/example/node/test.js +138 -0
  58. package/example/pdf.html +187 -0
  59. package/example/progress.html +173 -0
  60. package/example/pso.html +148 -0
  61. package/example/sort.html +816 -0
  62. package/example/tweenjs.html +84 -0
  63. package/example/webgl.html +255 -0
  64. package/example/xfj/img/dr_die.gif +0 -0
  65. package/example/xfj/index.html +332 -0
  66. package/example/xfj/shake.js +49 -0
  67. package/example/xfj/testori.html +76 -0
  68. package/package.json +1 -1
  69. package/src/core/jmControl.js +3 -2
  70. package/src/core/jmGradient.js +4 -0
  71. package/src/core/jmGraph.js +6 -4
@@ -0,0 +1,143 @@
1
+
2
+ console.log('start build');
3
+ const jshint = require('gulp-jshint');
4
+ const concat = require('gulp-concat');
5
+ const rename = require('gulp-rename');
6
+ const uglify = require('gulp-uglify');
7
+ const uglifyes = require('gulp-terser');
8
+ const babelify = require('babelify');
9
+ const standalonify = require('standalonify');
10
+ const browserify = require('browserify');
11
+ const buffer = require('vinyl-buffer');
12
+ const source = require('vinyl-source-stream');
13
+ const gulp = require('gulp');
14
+ const rollup = require('rollup');
15
+ const rollupugify = require('rollup-plugin-uglify');
16
+ const rollupbabel = require('rollup-plugin-babel');
17
+ const cleanimport = require('gulp-clean-import');
18
+ const gulpJsdoc2md = require('gulp-jsdoc-to-markdown')
19
+
20
+ const jsSources = [
21
+ "../src/core/jmList.js",
22
+ "../src/core/jmUtils.js",
23
+ "../src/core/jmObject.js",
24
+ "../src/core/jmProperty.js",
25
+ "../src/core/jmEvents.js",
26
+ "../src/core/jmGradient.js",
27
+ "../src/core/jmShadow.js",
28
+ "../src/core/jmControl.js",
29
+ "../src/core/jmPath.js",
30
+ "../src/shapes/*.js",
31
+ "../src/core/jmGraph.js"
32
+ ];
33
+
34
+ //语法检测
35
+ gulp.task('jshint', function () {
36
+
37
+ //console.log('jshint:');
38
+ return gulp.src(jsSources)
39
+ .pipe(jshint({
40
+ "esversion": 6
41
+ }))
42
+ .pipe(jshint.reporter('default'));
43
+ });
44
+
45
+ //生成文档
46
+ gulp.task('docs', function () {
47
+ return gulp.src(jsSources)
48
+ .pipe(concat('jmGraph.md'))
49
+ .pipe(gulpJsdoc2md({}))
50
+ .on('error', function (err) {
51
+ console.error('jsdoc2md failed', err.message);
52
+ })
53
+ .pipe(rename(function (path) {
54
+ path.extname = '.md'
55
+ }))
56
+ .pipe(gulp.dest('../docs/api'));
57
+ });
58
+
59
+ //编译成es6版本
60
+ gulp.task('build-js-es6', function () {
61
+ return gulp.src(jsSources)
62
+ .pipe(cleanimport())
63
+ .pipe(concat('jmgraph.es6.js'))
64
+ .pipe(gulp.dest('../dist'))
65
+ .pipe(uglifyes())
66
+ .pipe(rename('jmgraph.es6.min.js'))
67
+ .pipe(gulp.dest('../dist'));
68
+ });
69
+
70
+ //编译core成es5版本
71
+ gulp.task('build-js-core', function () {
72
+ /*return browserify({
73
+ entries: [
74
+ '../src/core/jmGraph.js'
75
+ ]
76
+ })//.plugin(standalonify, {
77
+ // name: 'jmGraph' //转为umd规范
78
+ //})
79
+ .transform("babelify", {
80
+ presets: ['@babel/preset-env'],
81
+ //plugins: ['transform-runtime']
82
+ }) //使用babel转换es6代码
83
+ .bundle() //合并打包
84
+ .on('error', function(err) {
85
+ console.log(err);
86
+ })
87
+ .pipe(source('jmgraph.core.js'))
88
+ .pipe(buffer())
89
+ .pipe(gulp.dest('../dist'))
90
+ .pipe(rename('jmgraph.core.min.js'))
91
+ .pipe(uglify())
92
+ .pipe(gulp.dest('../dist'));*/
93
+
94
+ return rollup.rollup({
95
+ input: '../src/core/jmGraph.js',
96
+ plugins: [
97
+ rollupbabel({
98
+ babelrc: false, //不设置.babelrc文件;
99
+ exclude: 'node_modules/**', //排除node_modules文件夹;
100
+ presets: [['@babel/env', { modules: false }]],
101
+ //plugins: ['transform-class-properties']//转换静态类属性以及属性声明的属性初始化语法
102
+ }),
103
+ rollupugify.uglify({
104
+ sourcemap: true
105
+ })
106
+ ]
107
+ }).then(bundle => {
108
+
109
+ return bundle.write({
110
+ file: '../dist/jmgraph.core.min.js',
111
+ format: 'umd',
112
+ name: 'jmGraph',
113
+ sourcemap: true
114
+ });
115
+ });
116
+ });
117
+
118
+ //编译成es5版本
119
+ gulp.task('build-js-cmd', function () {
120
+ return browserify({
121
+ entries: [
122
+ '../index.js'
123
+ ]
124
+ }).plugin(standalonify, {
125
+ name: 'jmGraph' //转为umd规范
126
+ })
127
+ .transform("babelify", {
128
+ presets: ['@babel/preset-env']
129
+ }) //使用babel转换es6代码
130
+ .bundle() //合并打包
131
+ .pipe(source('jmgraph.js'))
132
+ .pipe(buffer())
133
+ .pipe(gulp.dest('../dist'))
134
+ .pipe(rename('jmgraph.min.js'))
135
+ .pipe(uglify())
136
+ .pipe(gulp.dest('../dist'));
137
+ });
138
+
139
+ let tasks = ['build-js-core', 'build-js-cmd'];// 'docs', 'build-js-core', 'build-js-cmd'
140
+
141
+ gulp.task('default', gulp.parallel(tasks, function(done) {
142
+ done();
143
+ }));