vap-visual
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
{"name":"vap-visual","version":"0.3.1","description":"vap-visual - A Visual FrameWork base on d3","main":"index.js","author":"Xiang da"} | ||
{"name":"vap-visual","version":"0.3.2","description":"vap-visual - A Visual FrameWork base on d3","main":"index.js","author":"Xiang da"} |
@@ -6,3 +6,2 @@ import * as d3 from 'd3'; | ||
protected __ClassName: string; | ||
protected id: string; | ||
protected CONTAINER: d3.Selection<any, any, any, any>; | ||
@@ -9,0 +8,0 @@ protected EXT_TOP: d3.Selection<any, any, any, any>; |
@@ -77,4 +77,2 @@ "use strict"; | ||
this.__ClassName = ''; | ||
// 唯一标识 | ||
this.id = "_visual_" + _utils_1.DataUtil.random(); | ||
// 容器,根据 传入的 id 获取 | ||
@@ -116,2 +114,3 @@ this.CONTAINER = null; | ||
} | ||
this.CONTAINER.classed('_visual', true); | ||
this.props = _utils_1.DataUtil.merge({}, conf); | ||
@@ -136,3 +135,3 @@ this._init(selector); | ||
console.debug('-------------------- setState --------------------'); | ||
console.log('setState / state keys : ', Object.keys(state)); | ||
// console.log('setState / state keys : ', Object.keys(state)) | ||
Object.keys(this.state).map(function (key) { | ||
@@ -316,3 +315,2 @@ if (_utils_1.DataUtil.has(state, key)) { | ||
spot.cloneNode(true); | ||
; | ||
spots.push(spot); | ||
@@ -340,3 +338,3 @@ div.removeChild(div.children[0]); | ||
}; | ||
this.CONTAINER.classed('_visual', true).classed(this.__ClassName, true); | ||
this.CONTAINER.classed(this.__ClassName, true); | ||
if (_utils_1.DataUtil.has(this.props, 'className')) | ||
@@ -343,0 +341,0 @@ this.CONTAINER.classed(this.props.className, true).classed(this.__ClassName, true); |
@@ -42,5 +42,5 @@ "use strict"; | ||
var _this = this; | ||
if (!_utils_1.DataUtil.has(this.props, 'labelField') || !_utils_1.DataUtil.has(this.props, 'valueField')) { | ||
return; | ||
} | ||
// if (!DataUtil.has(this.props, 'labelField') || !DataUtil.has(this.props, 'valueField')) { | ||
// return; | ||
// } | ||
this.ROOT.classed('_root_cursor', _utils_1.DataUtil.has(this.props, 'onClick') || _utils_1.DataUtil.has(this.props, 'onSelect')); | ||
@@ -99,3 +99,3 @@ if (this.props.tip !== null) { | ||
} | ||
_this.props.onClick(data, name); | ||
_this.props.onClick(data, _fullName); | ||
}); | ||
@@ -102,0 +102,0 @@ } |
@@ -231,3 +231,2 @@ "use strict"; | ||
} | ||
_utils_1.console.error('mustSetDATA ', mustSetData, mustUpdate); | ||
if (mustSetData) { | ||
@@ -386,5 +385,3 @@ this.setData(conf.data || this.state.DATA_ORGIN); | ||
if (this.props.tip !== null) { | ||
enter.on('mouseover', function (d, i) { | ||
Event.call(EVENT_ITEM_HOVER + "." + _this.id, d, i); | ||
}); | ||
enter.on('mouseover', function (d, i) { return Event.call(EVENT_ITEM_HOVER + "." + _this.id, d, i); }); | ||
enter.on('mouseout', function () { | ||
@@ -396,5 +393,3 @@ _components_1.ToolTip.hide(); | ||
if (typeof this.props.onClick === 'function') { | ||
enter.on('click', function (d, i) { | ||
Event.call(Event_1.EVENT_ITEM_CLICK + "." + _this.id, d, i); | ||
}); | ||
enter.on('click', function (d, i) { return Event.call(Event_1.EVENT_ITEM_CLICK + "." + _this.id, d, i); }); | ||
} | ||
@@ -401,0 +396,0 @@ }; |
519841
0.38%199
1.02%12016
0.49%