projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
split out IFrameTarp
[dygraphs.git]
/
src
/
plugins
/
legend.js
diff --git
a/src/plugins/legend.js
b/src/plugins/legend.js
index
95a161c
..
2e667d2
100644
(file)
--- a/
src/plugins/legend.js
+++ b/
src/plugins/legend.js
@@
-26,12
+26,12
@@
import * as utils from '../dygraph-utils';
*
* @constructor
*/
*
* @constructor
*/
-var
l
egend = function() {
+var
L
egend = function() {
this.legend_div_ = null;
this.is_generated_div_ = false; // do we own this div, or was it user-specified?
};
this.legend_div_ = null;
this.is_generated_div_ = false; // do we own this div, or was it user-specified?
};
-
l
egend.prototype.toString = function() {
+
L
egend.prototype.toString = function() {
return "Legend Plugin";
};
return "Legend Plugin";
};
@@
-50,7
+50,7
@@
var generateLegendDashHTML;
* @param {Dygraph} g Graph instance.
* @return {object.<string, function(ev)>} Mapping of event names to callbacks.
*/
* @param {Dygraph} g Graph instance.
* @return {object.<string, function(ev)>} Mapping of event names to callbacks.
*/
-
l
egend.prototype.activate = function(g) {
+
L
egend.prototype.activate = function(g) {
var div;
var divWidth = g.getOption('labelsDivWidth');
var div;
var divWidth = g.getOption('labelsDivWidth');
@@
-77,7
+77,7
@@
legend.prototype.activate = function(g) {
"overflow": "hidden"};
// TODO(danvk): get rid of labelsDivStyles? CSS is better.
"overflow": "hidden"};
// TODO(danvk): get rid of labelsDivStyles? CSS is better.
-
Dygraph
.update(messagestyle, g.getOption('labelsDivStyles'));
+
utils
.update(messagestyle, g.getOption('labelsDivStyles'));
div = document.createElement("div");
div.className = "dygraph-legend";
for (var name in messagestyle) {
div = document.createElement("div");
div.className = "dygraph-legend";
for (var name in messagestyle) {
@@
-122,7
+122,7
@@
var escapeHTML = function(str) {
return str.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
};
return str.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
};
-
l
egend.prototype.select = function(e) {
+
L
egend.prototype.select = function(e) {
var xValue = e.selectedX;
var points = e.selectedPoints;
var row = e.selectedRow;
var xValue = e.selectedX;
var points = e.selectedPoints;
var row = e.selectedRow;
@@
-156,12
+156,12
@@
legend.prototype.select = function(e) {
this.legend_div_.style.top = topLegend + "px";
}
this.legend_div_.style.top = topLegend + "px";
}
- var html =
l
egend.generateLegendHTML(e.dygraph, xValue, points, this.one_em_width_, row);
+ var html =
L
egend.generateLegendHTML(e.dygraph, xValue, points, this.one_em_width_, row);
this.legend_div_.innerHTML = html;
this.legend_div_.style.display = '';
};
this.legend_div_.innerHTML = html;
this.legend_div_.style.display = '';
};
-
l
egend.prototype.deselect = function(e) {
+
L
egend.prototype.deselect = function(e) {
var legendMode = e.dygraph.getOption('legend');
if (legendMode !== 'always') {
this.legend_div_.style.display = "none";
var legendMode = e.dygraph.getOption('legend');
if (legendMode !== 'always') {
this.legend_div_.style.display = "none";
@@
-171,11
+171,11
@@
legend.prototype.deselect = function(e) {
var oneEmWidth = calculateEmWidthInDiv(this.legend_div_);
this.one_em_width_ = oneEmWidth;
var oneEmWidth = calculateEmWidthInDiv(this.legend_div_);
this.one_em_width_ = oneEmWidth;
- var html =
l
egend.generateLegendHTML(e.dygraph, undefined, undefined, oneEmWidth, null);
+ var html =
L
egend.generateLegendHTML(e.dygraph, undefined, undefined, oneEmWidth, null);
this.legend_div_.innerHTML = html;
};
this.legend_div_.innerHTML = html;
};
-
l
egend.prototype.didDrawChart = function(e) {
+
L
egend.prototype.didDrawChart = function(e) {
this.deselect(e);
};
this.deselect(e);
};
@@
-188,7
+188,7
@@
legend.prototype.didDrawChart = function(e) {
* - its top edge is flush with the top edge of the charting area
* @private
*/
* - its top edge is flush with the top edge of the charting area
* @private
*/
-
l
egend.prototype.predraw = function(e) {
+
L
egend.prototype.predraw = function(e) {
// Don't touch a user-specified labelsDiv.
if (!this.is_generated_div_) return;
// Don't touch a user-specified labelsDiv.
if (!this.is_generated_div_) return;
@@
-205,7
+205,7
@@
legend.prototype.predraw = function(e) {
* Called when dygraph.destroy() is called.
* You should null out any references and detach any DOM elements.
*/
* Called when dygraph.destroy() is called.
* You should null out any references and detach any DOM elements.
*/
-
l
egend.prototype.destroy = function() {
+
L
egend.prototype.destroy = function() {
this.legend_div_ = null;
};
this.legend_div_ = null;
};
@@
-222,7
+222,7
@@
legend.prototype.destroy = function() {
* 'always'}) and with dashed lines.
* @param {number} row The selected row index.
*/
* 'always'}) and with dashed lines.
* @param {number} row The selected row index.
*/
-
l
egend.generateLegendHTML = function(g, x, sel_points, oneEmWidth, row) {
+
L
egend.generateLegendHTML = function(g, x, sel_points, oneEmWidth, row) {
// TODO(danvk): deprecate this option in place of {legend: 'never'}
if (g.getOption('showLabelsOnHighlight') !== true) return '';
// TODO(danvk): deprecate this option in place of {legend: 'never'}
if (g.getOption('showLabelsOnHighlight') !== true) return '';
@@
-362,4
+362,4
@@
generateLegendDashHTML = function(strokePattern, color, oneEmWidth) {
return dash;
};
return dash;
};
-export default
l
egend;
+export default
L
egend;