diff --git a/js/module/array1d.js b/js/module/array1d.js index 2aafb8ee37e7c1cc2488099dbf2dfaed33739253..bf6cd5c745dd0bab56de03f79180639701cae62d 100644 --- a/js/module/array1d.js +++ b/js/module/array1d.js @@ -1,53 +1,54 @@ const { - Array2D, - Array2DTracer + Array2D, + Array2DTracer } = require('./array2d'); function Array1DTracer() { - return Array2DTracer.apply(this, arguments); + return Array2DTracer.apply(this, arguments); } Array1DTracer.prototype = $.extend(true, Object.create(Array2DTracer.prototype), { - constructor: Array1DTracer, - _notify: function(idx, v) { - Array2DTracer.prototype._notify.call(this, 0, idx, v); - return this; - }, - _denotify: function(idx) { - Array2DTracer.prototype._denotify.call(this, 0, idx); - return this; - }, - _select: function(s, e) { - if (e === undefined) { - Array2DTracer.prototype._select.call(this, 0, s); - } else { - Array2DTracer.prototype._selectRow.call(this, 0, s, e); - } - return this; - }, - _deselect: function(s, e) { - if (e === undefined) { - Array2DTracer.prototype._deselect.call(this, 0, s); - } else { - Array2DTracer.prototype._deselectRow.call(this, 0, s, e); - } - return this; - }, - setData: function(D) { - return Array2DTracer.prototype.setData.call(this, [D]); + constructor: Array1DTracer, + name: "Array1DTracer", + _notify: function (idx, v) { + Array2DTracer.prototype._notify.call(this, 0, idx, v); + return this; + }, + _denotify: function (idx) { + Array2DTracer.prototype._denotify.call(this, 0, idx); + return this; + }, + _select: function (s, e) { + if (e === undefined) { + Array2DTracer.prototype._select.call(this, 0, s); + } else { + Array2DTracer.prototype._selectRow.call(this, 0, s, e); } + return this; + }, + _deselect: function (s, e) { + if (e === undefined) { + Array2DTracer.prototype._deselect.call(this, 0, s); + } else { + Array2DTracer.prototype._deselectRow.call(this, 0, s, e); + } + return this; + }, + setData: function (D) { + return Array2DTracer.prototype.setData.call(this, [D]); + } }); var Array1D = { - random: function(N, min, max) { - return Array2D.random(1, N, min, max)[0]; - }, - randomSorted: function(N, min, max) { - return Array2D.randomSorted(1, N, min, max)[0]; - } + random: function (N, min, max) { + return Array2D.random(1, N, min, max)[0]; + }, + randomSorted: function (N, min, max) { + return Array2D.randomSorted(1, N, min, max)[0]; + } }; module.exports = { - Array1D, - Array1DTracer + Array1D, + Array1DTracer }; \ No newline at end of file diff --git a/js/module/array2d.js b/js/module/array2d.js index fd724de783fa95e2a463e5d0582b0ce543a13639..05a19cdb7c4076a523aa94de7a07a2ebccee92e1 100644 --- a/js/module/array2d.js +++ b/js/module/array2d.js @@ -1,332 +1,333 @@ const Tracer = require('./tracer'); const { - refineByType + refineByType } = require('../tracer_manager/util'); function Array2DTracer() { - if (Tracer.apply(this, arguments)) { - Array2DTracer.prototype.init.call(this); - return true; - } - return false; + if (Tracer.apply(this, arguments)) { + Array2DTracer.prototype.init.call(this); + return true; + } + return false; } Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), { - constructor: Array2DTracer, - init: function() { - this.$table = this.capsule.$table = $('