ECharts.js 784 Bytes
Newer Older
Mael NICOLAS's avatar
Mael NICOLAS committed
1 2 3 4 5
"use strict";

var ReactEcharts = require("echarts-for-react");

exports.eChartsClass = ReactEcharts.default;
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

/**
 * @XXX "echarts-for-react" unsuitable to proper PureScript implementation
 *       regarding event listeners
 * @name listenerFn1
 * @param {function} fn
 * @returns
 */
exports.listenerFn1 = function(fn) {
  return function() {
    var args = Array.prototype.slice.call(arguments);
    fn(args[0])()
  }
};
/**
 * @link https://echarts.apache.org/en/api.html#echartsInstance.dispatchAction
 * @name dispatchAction
 * @param {object} eChartsInstance instanceof ECharts
 * @param {object} opts
 * @returns
 */
exports.dispatchAction = function(eChartsInstance) {
  return function(opts) {
    return function() {
      eChartsInstance.dispatchAction(opts);
    }
  }
}