Skip to content

Commit

Permalink
Naming tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Mar 28, 2016
1 parent fa89024 commit a0e0c3a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/chart/graph/GraphView.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ define(function (require) {
lineDraw.updateData(edgeData, null, null);
edgeData.eachItemGraphicEl(function (el) {
el.traverse(function (child) {
child.tooltipFormatModel = formatModel;
child.dataModel = formatModel;
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/chart/sankey/SankeyView.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ define(function (require) {
var curve = new SankeyShape();

curve.dataIndex = edge.dataIndex;
curve.tooltipFormatModel = formatModel;
curve.dataModel = formatModel;

var lineStyleModel = edge.getModel('lineStyle.normal');
var curvature = lineStyleModel.get('curveness');
Expand Down
2 changes: 1 addition & 1 deletion src/component/marker/MarkLineView.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ define(function (require) {
// FIXME
mlData.line.eachItemGraphicEl(function (el, idx) {
el.traverse(function (child) {
child.tooltipFormatModel = mlModel;
child.dataModel = mlModel;
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/component/marker/MarkPointView.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ define(function (require) {
// FIXME
mpData.eachItemGraphicEl(function (el) {
el.traverse(function (child) {
child.tooltipFormatModel = mpModel;
child.dataModel = mpModel;
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/component/timeline/SliderTimelineView.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ define(function (require) {

if (itemModel.get('tooltip')) {
el.dataIndex = dataIndex;
el.tooltipFormatModel = tooltipHostModel;
el.dataModel = tooltipHostModel;
}
else {
el.dataIndex = el.tooltipFormatModel = null;
el.dataIndex = el.dataModel = null;
}

}, this);
Expand Down
8 changes: 4 additions & 4 deletions src/component/tooltip/TooltipView.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,12 @@ define(function (require) {

// Always show item tooltip if mouse is on the element with dataIndex
if (el && el.dataIndex != null) {
// Use tooltipFormatModel in element if possible
// Use dataModel in element if possible
// Used when mouseover on a element like markPoint or edge
// In which case, the data is not main data in series.
var tooltipFormatModel = el.tooltipFormatModel || ecModel.getSeriesByIndex(el.seriesIndex);
var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);
var dataIndex = el.dataIndex;
var itemModel = tooltipFormatModel.getData().getItemModel(dataIndex);
var itemModel = dataModel.getData().getItemModel(dataIndex);
// Series or single data may use item trigger when global is axis trigger
if ((itemModel.get('tooltip.trigger') || globalTrigger) === 'axis') {
this._showAxisTooltip(tooltipModel, ecModel, e);
Expand All @@ -430,7 +430,7 @@ define(function (require) {
// Reset last hover and dispatch downplay action
this._resetLastHover();

this._showItemTooltipContent(tooltipFormatModel, dataIndex, e);
this._showItemTooltipContent(dataModel, dataIndex, e);
}

api.dispatchAction({
Expand Down
4 changes: 2 additions & 2 deletions src/echarts.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ define(function (require) {
var ecModel = this.getModel();
var el = e.target;
if (el && el.dataIndex != null) {
var hostModel = el.hostModel || ecModel.getSeriesByIndex(el.seriesIndex);
var params = hostModel && hostModel.getDataParams(el.dataIndex) || {};
var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);
var params = dataModel && dataModel.getDataParams(el.dataIndex) || {};
params.event = e;
params.type = eveName;
this.trigger(eveName, params);
Expand Down

0 comments on commit a0e0c3a

Please sign in to comment.