Skip to content

Commit

Permalink
release 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantin committed Dec 8, 2014
1 parent 9ba6afe commit 69b393f
Show file tree
Hide file tree
Showing 9 changed files with 625 additions and 581 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tauCharts",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/TargetProcess/tauCharts",
"description": "Simple charts library based on d3",
"keywords": [
Expand Down
28 changes: 19 additions & 9 deletions build/plugins/tauCharts.tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,39 @@
return _.compact(fields.concat(y, x).reverse());

},
isLine: function (data) {
return data.elementData.key && Array.isArray(data.elementData.values);
},
onElementMouseOver: function (chart, data) {
clearInterval(this._interval);
var coord = d3.mouse(data.element);
var key = this._generateKey(data.cellData.$where);
var item = _.min(this._dataWithCoords[key], function (a) {
return this._calculateLength(a.x, a.y, coord[0], coord[1]);
}, this);
var coord = d3.mouse(data.element);
var item = data.elementData;
var isLine = this.isLine(data);
if (isLine) {
var dataWithCoord = this._dataWithCoords[key];
var filteredData = dataWithCoord.filter(function (value) {
return _.contains(item.values, value.item);
});
var itemWithCoord = _.min(filteredData, function (a) {
return this._calculateLength(a.x, a.y, coord[0], coord[1]);
}, this);
item = itemWithCoord.item;
this._drawPoint(d3.select(data.element.parentNode), itemWithCoord.x, itemWithCoord.y, this._unitMeta[key].options.color.get(data.elementData.key));
}
if (this._currentElement === item) {
return;
}
if (data.elementData.key && Array.isArray(data.elementData.values)) {
this._drawPoint(d3.select(data.element.parentNode), item.x, item.y, this._unitMeta[key].options.color.get(data.elementData.key));
}
var content = this._elementTooltip.querySelectorAll('.i-role-content');
if (content[0]) {
var fields = this._getFields(this._unitMeta[key]);
content[0].innerHTML = this.render(item.item, fields);
content[0].innerHTML = this.render(item, fields);
} else {
console.log('template should contain i-role-content class');
}

this._show();
this._currentElement = item.item;
this._currentElement = item;
},
onElementMouseOut: function () {
this._hide();
Expand Down
4 changes: 2 additions & 2 deletions build/plugins/tauCharts.tooltip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 69b393f

Please sign in to comment.