mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-03-28 05:12:02 +01:00
Start again
This commit is contained in:
134
vendors/echarts/src/view/Chart.js
vendored
Normal file
134
vendors/echarts/src/view/Chart.js
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
define(function (require) {
|
||||
|
||||
var Group = require('zrender/container/Group');
|
||||
var componentUtil = require('../util/component');
|
||||
var clazzUtil = require('../util/clazz');
|
||||
|
||||
function Chart() {
|
||||
|
||||
/**
|
||||
* @type {module:zrender/container/Group}
|
||||
* @readOnly
|
||||
*/
|
||||
this.group = new Group();
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @readOnly
|
||||
*/
|
||||
this.uid = componentUtil.getUID('viewChart');
|
||||
}
|
||||
|
||||
Chart.prototype = {
|
||||
|
||||
type: 'chart',
|
||||
|
||||
/**
|
||||
* Init the chart
|
||||
* @param {module:echarts/model/Global} ecModel
|
||||
* @param {module:echarts/ExtensionAPI} api
|
||||
*/
|
||||
init: function (ecModel, api) {},
|
||||
|
||||
/**
|
||||
* Render the chart
|
||||
* @param {module:echarts/model/Series} seriesModel
|
||||
* @param {module:echarts/model/Global} ecModel
|
||||
* @param {module:echarts/ExtensionAPI} api
|
||||
* @param {Object} payload
|
||||
*/
|
||||
render: function (seriesModel, ecModel, api, payload) {},
|
||||
|
||||
/**
|
||||
* Highlight series or specified data item
|
||||
* @param {module:echarts/model/Series} seriesModel
|
||||
* @param {module:echarts/model/Global} ecModel
|
||||
* @param {module:echarts/ExtensionAPI} api
|
||||
* @param {Object} payload
|
||||
*/
|
||||
highlight: function (seriesModel, ecModel, api, payload) {
|
||||
toggleHighlight(seriesModel.getData(), payload, 'emphasis');
|
||||
},
|
||||
|
||||
/**
|
||||
* Downplay series or specified data item
|
||||
* @param {module:echarts/model/Series} seriesModel
|
||||
* @param {module:echarts/model/Global} ecModel
|
||||
* @param {module:echarts/ExtensionAPI} api
|
||||
* @param {Object} payload
|
||||
*/
|
||||
downplay: function (seriesModel, ecModel, api, payload) {
|
||||
toggleHighlight(seriesModel.getData(), payload, 'normal');
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove self
|
||||
* @param {module:echarts/model/Global} ecModel
|
||||
* @param {module:echarts/ExtensionAPI} api
|
||||
*/
|
||||
remove: function (ecModel, api) {
|
||||
this.group.removeAll();
|
||||
},
|
||||
|
||||
/**
|
||||
* Dispose self
|
||||
* @param {module:echarts/model/Global} ecModel
|
||||
* @param {module:echarts/ExtensionAPI} api
|
||||
*/
|
||||
dispose: function () {}
|
||||
};
|
||||
|
||||
var chartProto = Chart.prototype;
|
||||
chartProto.updateView
|
||||
= chartProto.updateLayout
|
||||
= chartProto.updateVisual
|
||||
= function (seriesModel, ecModel, api, payload) {
|
||||
this.render(seriesModel, ecModel, api, payload);
|
||||
};
|
||||
|
||||
/**
|
||||
* Set state of single element
|
||||
* @param {module:zrender/Element} el
|
||||
* @param {string} state
|
||||
*/
|
||||
function elSetState(el, state) {
|
||||
if (el) {
|
||||
el.trigger(state);
|
||||
if (el.type === 'group') {
|
||||
for (var i = 0; i < el.childCount(); i++) {
|
||||
elSetState(el.childAt(i), state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {module:echarts/data/List} data
|
||||
* @param {Object} payload
|
||||
* @param {string} state 'normal'|'emphasis'
|
||||
* @inner
|
||||
*/
|
||||
function toggleHighlight(data, payload, state) {
|
||||
if (payload.dataIndex != null) {
|
||||
var el = data.getItemGraphicEl(payload.dataIndex);
|
||||
elSetState(el, state);
|
||||
}
|
||||
else if (payload.name) {
|
||||
var dataIndex = data.indexOfName(payload.name);
|
||||
var el = data.getItemGraphicEl(dataIndex);
|
||||
elSetState(el, state);
|
||||
}
|
||||
else {
|
||||
data.eachItemGraphicEl(function (el) {
|
||||
elSetState(el, state);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Enable Chart.extend.
|
||||
clazzUtil.enableClassExtend(Chart);
|
||||
|
||||
// Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.
|
||||
clazzUtil.enableClassManagement(Chart, {registerWhenExtend: true});
|
||||
|
||||
return Chart;
|
||||
});
|
||||
46
vendors/echarts/src/view/Component.js
vendored
Normal file
46
vendors/echarts/src/view/Component.js
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
define(function (require) {
|
||||
|
||||
var Group = require('zrender/container/Group');
|
||||
var componentUtil = require('../util/component');
|
||||
var clazzUtil = require('../util/clazz');
|
||||
|
||||
var Component = function () {
|
||||
/**
|
||||
* @type {module:zrender/container/Group}
|
||||
* @readOnly
|
||||
*/
|
||||
this.group = new Group();
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @readOnly
|
||||
*/
|
||||
this.uid = componentUtil.getUID('viewComponent');
|
||||
};
|
||||
|
||||
Component.prototype = {
|
||||
|
||||
constructor: Component,
|
||||
|
||||
init: function (ecModel, api) {},
|
||||
|
||||
render: function (componentModel, ecModel, api, payload) {},
|
||||
|
||||
dispose: function () {}
|
||||
};
|
||||
|
||||
var componentProto = Component.prototype;
|
||||
componentProto.updateView
|
||||
= componentProto.updateLayout
|
||||
= componentProto.updateVisual
|
||||
= function (seriesModel, ecModel, api, payload) {
|
||||
// Do nothing;
|
||||
};
|
||||
// Enable Component.extend.
|
||||
clazzUtil.enableClassExtend(Component);
|
||||
|
||||
// Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.
|
||||
clazzUtil.enableClassManagement(Component, {registerWhenExtend: true});
|
||||
|
||||
return Component;
|
||||
});
|
||||
Reference in New Issue
Block a user