1

Namespacing grapher and utilities

This commit is contained in:
Alex Yatskov 2014-09-27 10:10:45 +09:00
parent bf0faad5ed
commit 797005c9a5
2 changed files with 581 additions and 579 deletions

View File

@ -49,7 +49,7 @@
ctx.hintSteps = query.hintSteps; ctx.hintSteps = query.hintSteps;
ctx.maxResults = query.maxResults; ctx.maxResults = query.maxResults;
ctx.grapher = new Grapher('grapher', ctx.searchRange, 150, true, true); ctx.grapher = new grapher.Grapher('grapher', ctx.searchRange, 150, true, true);
ctx.grapher.setColumns(results.columns); ctx.grapher.setColumns(results.columns);
ctx.grapher.setValueChangedListener(onAdjust); ctx.grapher.setValueChangedListener(onAdjust);

View File

@ -1,6 +1,7 @@
'use strict'; 'use strict';
(function(grapher) {
// //
// Coord // Coord
// //
@ -460,7 +461,7 @@ function Column(canvas, name, params, scale, range, bounds) {
// Grapher // Grapher
// //
function Grapher(canvas, range, columnWidth, useLocalScale, useRelativeScale) { grapher.Grapher = function(canvas, range, columnWidth, useLocalScale, useRelativeScale) {
this.setColumns = function(columns) { this.setColumns = function(columns) {
this.clearColumns(); this.clearColumns();
@ -661,3 +662,4 @@ function Grapher(canvas, range, columnWidth, useLocalScale, useRelativeScale) {
c.addEventListener('dblclick', this.mouseDoubleClick, false); c.addEventListener('dblclick', this.mouseDoubleClick, false);
c.grapher = this; c.grapher = this;
} }
}(window.grapher = window.grapher || {}));