This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview | |
* 兼容用法 | |
* 用 Hack 的方式支持 guide().html(); | |
* @author iNahoo | |
* @since 2020-04-21. | |
*/ | |
import { registerComponentController } from '@antv/g2'; | |
import Annotation from '@antv/g2/lib/chart/controller/annotation'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 以回调函数反馈Key的方式,实现数组去重 | |
* @param a {Array} | |
* @param key {Function} | |
*/ | |
function uniqBy(a, key) { | |
var seen = {}; | |
return a.filter(function(item) { | |
var k = key(item); | |
return seen.hasOwnProperty(k) ? false : (seen[k] = true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var easingEffects = { | |
linear: function (n) { | |
return n; | |
}, | |
easeIn: function (n) { | |
return pow(n, 1.7); | |
}, | |
easeOut: function (n) { | |
return pow(n, 0.48); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview | |
* 统计代码行数, | |
* 适用 JS/HTML/CSS | |
* @author iNahoo | |
* @since 2017/3/21. | |
*/ | |
"use strict"; | |
const FS = require('fs'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview | |
* 二阶贝塞尔曲线 | |
* -------------------- | |
* 快速计算一组点的平滑曲线控制点 , 用于Canvas绘图 | |
* @author iNahoo | |
* @since 2017/2/17. | |
*/ | |
"use strict"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview | |
* rgb & rgba & hexColor transfer | |
* @author iNahoo | |
* @since 2017/2/10. | |
*/ | |
"use strict"; | |
export const rgb2hex = (r, g, b)=> { | |
return '#' + [r, g, b].map(v=>v.toString(16)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview | |
* 提供全局的事件绑定 | |
* -------------------------- | |
* 用于解决某些情况下, touchend / touchmove 等事件不应触发在组件内的DOM上的情况 | |
* | |
* @author iNahoo | |
* @since 2017/2/13. | |
*/ | |
"use strict"; |