diff --git a/html/climate.html b/html/climate.html index 624720c..5b59077 100644 --- a/html/climate.html +++ b/html/climate.html @@ -2116,6 +2116,15 @@ var table = $table.DataTable(options); $el.data('datatable', table); + if ('rowGroup' in options) { + // Maintain RowGroup dataSrc when columns are reordered (#1109) + table.on('column-reorder', function(e, settings, details) { + var oldDataSrc = table.rowGroup().dataSrc(); + var newDataSrc = details.mapping[oldDataSrc]; + table.rowGroup().dataSrc(newDataSrc); + }); + } + // Unregister previous Crosstalk event subscriptions, if they exist if (instance.ctfilterSubscription) { instance.ctfilterHandle.off("change", instance.ctfilterSubscription); @@ -2206,6 +2215,7 @@ }; if (data.filter !== 'none') { + if (!data.hasOwnProperty('filterSettings')) data.filterSettings = {}; filterRow.each(function(i, td) { @@ -2269,7 +2279,7 @@ } }); var $input2 = $x.children('select'); - filter = $input2.selectize({ + filter = $input2.selectize($.extend({ options: $input2.data('options').map(function(v, i) { return ({text: v, value: v}); }), @@ -2288,8 +2298,7 @@ $td.data('filter', value.length > 0); table.draw(); // redraw table, and filters will be applied } - }); - if (searchCol) filter[0].selectize.setValue(JSON.parse(searchCol)); + }, data.filterSettings.select)); filter[0].selectize.on('blur', function() { $x.hide().trigger('hide'); $input.parent().show(); $input.trigger('blur'); }); @@ -2298,10 +2307,12 @@ var fun = function() { searchColumn(i, $input.val()).draw(); }; - if (server) { - fun = $.fn.dataTable.util.throttle(fun, options.searchDelay); - } - $input.on('input', fun); + // throttle searching for server-side processing + var throttledFun = $.fn.dataTable.util.throttle(fun, options.searchDelay); + $input.on('input', function(e, immediate) { + // always bypass throttling when immediate = true (via the updateSearch method) + (immediate || !server) ? fun() : throttledFun(); + }); } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { var $x0 = $x; $x = $x0.children('div').first(); @@ -2387,13 +2398,11 @@ filter.val(v); } }); - var formatDate = function(d, isoFmt) { + var formatDate = function(d) { d = scaleBack(d, scale); if (type === 'number') return d; if (type === 'integer') return parseInt(d); var x = new Date(+d); - var fmt = ('filterDateFmt' in data) ? data.filterDateFmt[i] : undefined; - if (fmt !== undefined && isoFmt === false) return x[fmt.method].apply(x, fmt.params); if (type === 'date') { var pad0 = function(x) { return ('0' + x).substr(-2, 2); @@ -2414,7 +2423,7 @@ start: [r1, r2], range: {min: r1, max: r2}, connect: true - }, opts)); + }, opts, data.filterSettings.slider)); if (scale > 1) (function() { var t1 = r1, t2 = r2; var val = filter.val(); @@ -2429,13 +2438,28 @@ start: [t1, t2], range: {min: t1, max: t2}, connect: true - }, opts), true); + }, opts, data.filterSettings.slider), true); val = filter.val(); } r1 = t1; r2 = t2; })(); + // format with active column renderer, if defined + var colDef = data.options.columnDefs.find(function(def) { + return (def.targets === i || inArray(i, def.targets)) && 'render' in def; + }); var updateSliderText = function(v1, v2) { - $span1.text(formatDate(v1, false)); $span2.text(formatDate(v2, false)); + // we only know how to use function renderers + if (colDef && typeof colDef.render === 'function') { + var restore = function(v) { + v = scaleBack(v, scale); + return inArray(type, ['date', 'time']) ? new Date(+v) : v; + } + $span1.text(colDef.render(restore(v1), 'display')); + $span2.text(colDef.render(restore(v2), 'display')); + } else { + $span1.text(formatDate(v1)); + $span2.text(formatDate(v2)); + } }; updateSliderText(r1, r2); var updateSlider = function(e) { @@ -2468,7 +2492,7 @@ // processing if (server) { // if a search string has been pre-set, search now - if (searchCol) searchColumn(i, searchCol).draw(); + if (searchCol) $input.trigger('input').trigger('change'); return; } @@ -2514,15 +2538,7 @@ $.fn.dataTable.ext.search.push(customFilter); // search for the preset search strings if it is non-empty - if (searchCol) { - if (inArray(type, ['factor', 'logical'])) { - filter[0].selectize.setValue(JSON.parse(searchCol)); - } else if (type === 'character') { - $input.trigger('input'); - } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { - $input.trigger('change'); - } - } + if (searchCol) $input.trigger('input').trigger('change'); }); @@ -3170,8 +3186,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v).trigger('input'); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -5101,8 +5118,8 @@

ays-v0

-
- +
+

ays-v0 implements the AYS model first described in Kittel et al. that phenomenologically models emissions, economic output and growth of @@ -5126,8 +5143,8 @@

dice-v0

-
- +
+

dice-v0 implements Nordhaus’ DICE model which is a richly detailed integrated assessment model. diff --git a/html/conservation.html b/html/conservation.html index fe2ad53..54576ce 100644 --- a/html/conservation.html +++ b/html/conservation.html @@ -2116,6 +2116,15 @@ var table = $table.DataTable(options); $el.data('datatable', table); + if ('rowGroup' in options) { + // Maintain RowGroup dataSrc when columns are reordered (#1109) + table.on('column-reorder', function(e, settings, details) { + var oldDataSrc = table.rowGroup().dataSrc(); + var newDataSrc = details.mapping[oldDataSrc]; + table.rowGroup().dataSrc(newDataSrc); + }); + } + // Unregister previous Crosstalk event subscriptions, if they exist if (instance.ctfilterSubscription) { instance.ctfilterHandle.off("change", instance.ctfilterSubscription); @@ -2206,6 +2215,7 @@ }; if (data.filter !== 'none') { + if (!data.hasOwnProperty('filterSettings')) data.filterSettings = {}; filterRow.each(function(i, td) { @@ -2269,7 +2279,7 @@ } }); var $input2 = $x.children('select'); - filter = $input2.selectize({ + filter = $input2.selectize($.extend({ options: $input2.data('options').map(function(v, i) { return ({text: v, value: v}); }), @@ -2288,8 +2298,7 @@ $td.data('filter', value.length > 0); table.draw(); // redraw table, and filters will be applied } - }); - if (searchCol) filter[0].selectize.setValue(JSON.parse(searchCol)); + }, data.filterSettings.select)); filter[0].selectize.on('blur', function() { $x.hide().trigger('hide'); $input.parent().show(); $input.trigger('blur'); }); @@ -2298,10 +2307,12 @@ var fun = function() { searchColumn(i, $input.val()).draw(); }; - if (server) { - fun = $.fn.dataTable.util.throttle(fun, options.searchDelay); - } - $input.on('input', fun); + // throttle searching for server-side processing + var throttledFun = $.fn.dataTable.util.throttle(fun, options.searchDelay); + $input.on('input', function(e, immediate) { + // always bypass throttling when immediate = true (via the updateSearch method) + (immediate || !server) ? fun() : throttledFun(); + }); } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { var $x0 = $x; $x = $x0.children('div').first(); @@ -2387,13 +2398,11 @@ filter.val(v); } }); - var formatDate = function(d, isoFmt) { + var formatDate = function(d) { d = scaleBack(d, scale); if (type === 'number') return d; if (type === 'integer') return parseInt(d); var x = new Date(+d); - var fmt = ('filterDateFmt' in data) ? data.filterDateFmt[i] : undefined; - if (fmt !== undefined && isoFmt === false) return x[fmt.method].apply(x, fmt.params); if (type === 'date') { var pad0 = function(x) { return ('0' + x).substr(-2, 2); @@ -2414,7 +2423,7 @@ start: [r1, r2], range: {min: r1, max: r2}, connect: true - }, opts)); + }, opts, data.filterSettings.slider)); if (scale > 1) (function() { var t1 = r1, t2 = r2; var val = filter.val(); @@ -2429,13 +2438,28 @@ start: [t1, t2], range: {min: t1, max: t2}, connect: true - }, opts), true); + }, opts, data.filterSettings.slider), true); val = filter.val(); } r1 = t1; r2 = t2; })(); + // format with active column renderer, if defined + var colDef = data.options.columnDefs.find(function(def) { + return (def.targets === i || inArray(i, def.targets)) && 'render' in def; + }); var updateSliderText = function(v1, v2) { - $span1.text(formatDate(v1, false)); $span2.text(formatDate(v2, false)); + // we only know how to use function renderers + if (colDef && typeof colDef.render === 'function') { + var restore = function(v) { + v = scaleBack(v, scale); + return inArray(type, ['date', 'time']) ? new Date(+v) : v; + } + $span1.text(colDef.render(restore(v1), 'display')); + $span2.text(colDef.render(restore(v2), 'display')); + } else { + $span1.text(formatDate(v1)); + $span2.text(formatDate(v2)); + } }; updateSliderText(r1, r2); var updateSlider = function(e) { @@ -2468,7 +2492,7 @@ // processing if (server) { // if a search string has been pre-set, search now - if (searchCol) searchColumn(i, searchCol).draw(); + if (searchCol) $input.trigger('input').trigger('change'); return; } @@ -2514,15 +2538,7 @@ $.fn.dataTable.ext.search.push(customFilter); // search for the preset search strings if it is non-empty - if (searchCol) { - if (inArray(type, ['factor', 'logical'])) { - filter[0].selectize.setValue(JSON.parse(searchCol)); - } else if (type === 'character') { - $input.trigger('input'); - } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { - $input.trigger('change'); - } - } + if (searchCol) $input.trigger('input').trigger('change'); }); @@ -3170,8 +3186,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v).trigger('input'); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -5101,8 +5118,8 @@

conservation-v0

-
- +
+

conservation-v0 considers a single species conservation problem in which the agent can increase the population at a cost.

@@ -5122,8 +5139,8 @@

conservation-v2

-
- +
+

conservation-v2 considers a single species conservation problem in which the agent can increase the population at a cost.

@@ -5143,8 +5160,8 @@

conservation-v3

-
- +
+

conservation-v3 considers a single species conservation problem that has a non-stationary model.

@@ -5166,8 +5183,8 @@

conservation-v5

-
- +
+

conservation-v5 considers a single species conservation problem that has a non-stationary model.

@@ -5190,8 +5207,8 @@

conservation-v6

-
- +
+

conservation-v6 considers a single species conservation problem that has a non-stationary model.

@@ -5216,8 +5233,8 @@

conservation-v7

-
- +
+

conservation-v7 considers a conservation problem that has a non-stationary model. It is similar to conservation-v5 but works on an diff --git a/html/epidemic.html b/html/epidemic.html index 46fc5d0..e75aff8 100644 --- a/html/epidemic.html +++ b/html/epidemic.html @@ -2116,6 +2116,15 @@ var table = $table.DataTable(options); $el.data('datatable', table); + if ('rowGroup' in options) { + // Maintain RowGroup dataSrc when columns are reordered (#1109) + table.on('column-reorder', function(e, settings, details) { + var oldDataSrc = table.rowGroup().dataSrc(); + var newDataSrc = details.mapping[oldDataSrc]; + table.rowGroup().dataSrc(newDataSrc); + }); + } + // Unregister previous Crosstalk event subscriptions, if they exist if (instance.ctfilterSubscription) { instance.ctfilterHandle.off("change", instance.ctfilterSubscription); @@ -2206,6 +2215,7 @@ }; if (data.filter !== 'none') { + if (!data.hasOwnProperty('filterSettings')) data.filterSettings = {}; filterRow.each(function(i, td) { @@ -2269,7 +2279,7 @@ } }); var $input2 = $x.children('select'); - filter = $input2.selectize({ + filter = $input2.selectize($.extend({ options: $input2.data('options').map(function(v, i) { return ({text: v, value: v}); }), @@ -2288,8 +2298,7 @@ $td.data('filter', value.length > 0); table.draw(); // redraw table, and filters will be applied } - }); - if (searchCol) filter[0].selectize.setValue(JSON.parse(searchCol)); + }, data.filterSettings.select)); filter[0].selectize.on('blur', function() { $x.hide().trigger('hide'); $input.parent().show(); $input.trigger('blur'); }); @@ -2298,10 +2307,12 @@ var fun = function() { searchColumn(i, $input.val()).draw(); }; - if (server) { - fun = $.fn.dataTable.util.throttle(fun, options.searchDelay); - } - $input.on('input', fun); + // throttle searching for server-side processing + var throttledFun = $.fn.dataTable.util.throttle(fun, options.searchDelay); + $input.on('input', function(e, immediate) { + // always bypass throttling when immediate = true (via the updateSearch method) + (immediate || !server) ? fun() : throttledFun(); + }); } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { var $x0 = $x; $x = $x0.children('div').first(); @@ -2387,13 +2398,11 @@ filter.val(v); } }); - var formatDate = function(d, isoFmt) { + var formatDate = function(d) { d = scaleBack(d, scale); if (type === 'number') return d; if (type === 'integer') return parseInt(d); var x = new Date(+d); - var fmt = ('filterDateFmt' in data) ? data.filterDateFmt[i] : undefined; - if (fmt !== undefined && isoFmt === false) return x[fmt.method].apply(x, fmt.params); if (type === 'date') { var pad0 = function(x) { return ('0' + x).substr(-2, 2); @@ -2414,7 +2423,7 @@ start: [r1, r2], range: {min: r1, max: r2}, connect: true - }, opts)); + }, opts, data.filterSettings.slider)); if (scale > 1) (function() { var t1 = r1, t2 = r2; var val = filter.val(); @@ -2429,13 +2438,28 @@ start: [t1, t2], range: {min: t1, max: t2}, connect: true - }, opts), true); + }, opts, data.filterSettings.slider), true); val = filter.val(); } r1 = t1; r2 = t2; })(); + // format with active column renderer, if defined + var colDef = data.options.columnDefs.find(function(def) { + return (def.targets === i || inArray(i, def.targets)) && 'render' in def; + }); var updateSliderText = function(v1, v2) { - $span1.text(formatDate(v1, false)); $span2.text(formatDate(v2, false)); + // we only know how to use function renderers + if (colDef && typeof colDef.render === 'function') { + var restore = function(v) { + v = scaleBack(v, scale); + return inArray(type, ['date', 'time']) ? new Date(+v) : v; + } + $span1.text(colDef.render(restore(v1), 'display')); + $span2.text(colDef.render(restore(v2), 'display')); + } else { + $span1.text(formatDate(v1)); + $span2.text(formatDate(v2)); + } }; updateSliderText(r1, r2); var updateSlider = function(e) { @@ -2468,7 +2492,7 @@ // processing if (server) { // if a search string has been pre-set, search now - if (searchCol) searchColumn(i, searchCol).draw(); + if (searchCol) $input.trigger('input').trigger('change'); return; } @@ -2514,15 +2538,7 @@ $.fn.dataTable.ext.search.push(customFilter); // search for the preset search strings if it is non-empty - if (searchCol) { - if (inArray(type, ['factor', 'logical'])) { - filter[0].selectize.setValue(JSON.parse(searchCol)); - } else if (type === 'character') { - $input.trigger('input'); - } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { - $input.trigger('change'); - } - } + if (searchCol) $input.trigger('input').trigger('change'); }); @@ -3170,8 +3186,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v).trigger('input'); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -5101,8 +5118,8 @@

sir-v0

-
- +
+

sir-v0 implements a compartmental SIR epidemic model and is closely based off of the implementation from Morris @@ -5130,8 +5147,8 @@

sir_multi-v0

-
- +
+

sir_multi-v0 implements a compartmental SIR epidemic model and is closely based off of the implementation from Morris diff --git a/html/errors.html b/html/errors.html index c705a39..5cdade1 100644 --- a/html/errors.html +++ b/html/errors.html @@ -2639,25 +2639,42 @@

-
https://github.com/mchxo/rl-fishing-test -> ModuleNotFoundError: No module named 'stable_baselines3'
+
https://github.com/cboettig/rl-tipping-points -> ModuleNotFoundError: No module named 'stable_baselines3'
 
-https://github.com/mlap/test-rl-leaderboard -> ModuleNotFoundError: No module named 'stable_baselines3'
-
-https://github.com/cboettig/rl-tipping-points -> ModuleNotFoundError: No module named 'stable_baselines3'
-
-https://github.com/Brandons42/rl-leaderboard-output -> ModuleNotFoundError: No module named 'stable_baselines3'
+https://github.com/milliechapman/millie-conservation-agents -> ModuleNotFoundError: No module named 'stable_baselines3'
 
 https://github.com/Brandons42/rl-leaderboard-output-fishing-v0 -> ModuleNotFoundError: No module named 'stable_baselines3'
 
-https://github.com/milliechapman/millie-conservation-agents -> ModuleNotFoundError: No module named 'stable_baselines3'
+https://github.com/tim08526/conservation-vanilla -> ModuleNotFoundError: No module named 'stable_baselines3'
 
-https://github.com/cboettig/carl-climate-agents/ -> ModuleNotFoundError: No module named 'stable_baselines3'
+https://github.com/mlap/test-rl-leaderboard -> ModuleNotFoundError: No module named 'stable_baselines3'
+
+https://github.com/mlap/test-rl-leaderboard1 -> ModuleNotFoundError: No module named 'stable_baselines3'
 
-https://github.com/mlap/test-rl-leaderboard1 -> ModuleNotFoundError: No module named 'stable_baselines3'
+https://github.com/mchxo/rl-fishing-test -> ModuleNotFoundError: No module named 'stable_baselines3'

Models that have thrown errors during evaluation:

+
fishing-v1-TRPO-team_brandon.zip -> No module named 'algs'
+
+
+fishing-v1-DDPG-team_brandon.zip -> No module named 'algs'
+
+
+fishing-v1-TQC-team_brandon.zip -> No module named 'algs'
+
+
+fishing-v1-ARS-team_brandon.zip -> No module named 'algs'
+
+
+fishing-v1-TD3-team_brandon.zip -> No module named 'algs'
+
+
+fishing-v1-A2C-team_brandon.zip -> No module named 'algs'
+
+
+fishing-v1-SAC-team_brandon.zip -> No module named 'algs'
diff --git a/html/fishing.html b/html/fishing.html index ea14dce..a5fefb5 100644 --- a/html/fishing.html +++ b/html/fishing.html @@ -2116,6 +2116,15 @@ var table = $table.DataTable(options); $el.data('datatable', table); + if ('rowGroup' in options) { + // Maintain RowGroup dataSrc when columns are reordered (#1109) + table.on('column-reorder', function(e, settings, details) { + var oldDataSrc = table.rowGroup().dataSrc(); + var newDataSrc = details.mapping[oldDataSrc]; + table.rowGroup().dataSrc(newDataSrc); + }); + } + // Unregister previous Crosstalk event subscriptions, if they exist if (instance.ctfilterSubscription) { instance.ctfilterHandle.off("change", instance.ctfilterSubscription); @@ -2206,6 +2215,7 @@ }; if (data.filter !== 'none') { + if (!data.hasOwnProperty('filterSettings')) data.filterSettings = {}; filterRow.each(function(i, td) { @@ -2269,7 +2279,7 @@ } }); var $input2 = $x.children('select'); - filter = $input2.selectize({ + filter = $input2.selectize($.extend({ options: $input2.data('options').map(function(v, i) { return ({text: v, value: v}); }), @@ -2288,8 +2298,7 @@ $td.data('filter', value.length > 0); table.draw(); // redraw table, and filters will be applied } - }); - if (searchCol) filter[0].selectize.setValue(JSON.parse(searchCol)); + }, data.filterSettings.select)); filter[0].selectize.on('blur', function() { $x.hide().trigger('hide'); $input.parent().show(); $input.trigger('blur'); }); @@ -2298,10 +2307,12 @@ var fun = function() { searchColumn(i, $input.val()).draw(); }; - if (server) { - fun = $.fn.dataTable.util.throttle(fun, options.searchDelay); - } - $input.on('input', fun); + // throttle searching for server-side processing + var throttledFun = $.fn.dataTable.util.throttle(fun, options.searchDelay); + $input.on('input', function(e, immediate) { + // always bypass throttling when immediate = true (via the updateSearch method) + (immediate || !server) ? fun() : throttledFun(); + }); } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { var $x0 = $x; $x = $x0.children('div').first(); @@ -2387,13 +2398,11 @@ filter.val(v); } }); - var formatDate = function(d, isoFmt) { + var formatDate = function(d) { d = scaleBack(d, scale); if (type === 'number') return d; if (type === 'integer') return parseInt(d); var x = new Date(+d); - var fmt = ('filterDateFmt' in data) ? data.filterDateFmt[i] : undefined; - if (fmt !== undefined && isoFmt === false) return x[fmt.method].apply(x, fmt.params); if (type === 'date') { var pad0 = function(x) { return ('0' + x).substr(-2, 2); @@ -2414,7 +2423,7 @@ start: [r1, r2], range: {min: r1, max: r2}, connect: true - }, opts)); + }, opts, data.filterSettings.slider)); if (scale > 1) (function() { var t1 = r1, t2 = r2; var val = filter.val(); @@ -2429,13 +2438,28 @@ start: [t1, t2], range: {min: t1, max: t2}, connect: true - }, opts), true); + }, opts, data.filterSettings.slider), true); val = filter.val(); } r1 = t1; r2 = t2; })(); + // format with active column renderer, if defined + var colDef = data.options.columnDefs.find(function(def) { + return (def.targets === i || inArray(i, def.targets)) && 'render' in def; + }); var updateSliderText = function(v1, v2) { - $span1.text(formatDate(v1, false)); $span2.text(formatDate(v2, false)); + // we only know how to use function renderers + if (colDef && typeof colDef.render === 'function') { + var restore = function(v) { + v = scaleBack(v, scale); + return inArray(type, ['date', 'time']) ? new Date(+v) : v; + } + $span1.text(colDef.render(restore(v1), 'display')); + $span2.text(colDef.render(restore(v2), 'display')); + } else { + $span1.text(formatDate(v1)); + $span2.text(formatDate(v2)); + } }; updateSliderText(r1, r2); var updateSlider = function(e) { @@ -2468,7 +2492,7 @@ // processing if (server) { // if a search string has been pre-set, search now - if (searchCol) searchColumn(i, searchCol).draw(); + if (searchCol) $input.trigger('input').trigger('change'); return; } @@ -2514,15 +2538,7 @@ $.fn.dataTable.ext.search.push(customFilter); // search for the preset search strings if it is non-empty - if (searchCol) { - if (inArray(type, ['factor', 'logical'])) { - filter[0].selectize.setValue(JSON.parse(searchCol)); - } else if (type === 'character') { - $input.trigger('input'); - } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { - $input.trigger('change'); - } - } + if (searchCol) $input.trigger('input').trigger('change'); }); @@ -3170,8 +3186,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v).trigger('input'); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -5101,8 +5118,8 @@

fishing-v0

-
- +
+

fishing-v0 implements a simple, single species logistic growth-based fishery.

@@ -5123,8 +5140,8 @@

fishing-v1

-
- +
+

fishing-v1 implements a simple, single species logistic growth-based fishery.

@@ -5144,8 +5161,8 @@

fishing-v2

-
- +
+

fishing-v2 implements a single species logistic growth-based fishery with a tipping point.

@@ -5166,8 +5183,8 @@

fishing-v4

-
- +
+

fishing-v4 implements a single species logistic growth-based fishery with model error.

@@ -5188,8 +5205,8 @@

fishing-v5

-
- +
+

fishing-v5 implements a single species Allen model-based fishery.

Observation Space The agent observes the fish @@ -5207,8 +5224,8 @@

fishing-v6

-
- +
+

fishing-v6 implements a single species Beverton-Holt model-based fishery.

@@ -5228,8 +5245,8 @@

fishing-v7

-
- +
+

fishing-v7 implements a single species May model-based fishery.

Observation Space The agent observes the fish @@ -5247,8 +5264,8 @@

fishing-v8

-
- +
+

fishing-v8 implements a single species Myers model-based fishery.

Observation Space The agent observes the fish @@ -5266,8 +5283,8 @@

fishing-v9

-
- +
+

fishing-v9 implements a single species Ricker model-based fishery.

@@ -5286,8 +5303,8 @@

fishing-v10

-
- +
+

fishing-v10 implements a single species non-stationary Beverton-Holt model-based fishery.

@@ -5308,8 +5325,8 @@

fishing-v11

-
- +
+

fishing-v11 implements a fishery where the transition dynamics vary each episode.

diff --git a/html/wildfire.html b/html/wildfire.html index 5edde4f..7149374 100644 --- a/html/wildfire.html +++ b/html/wildfire.html @@ -2116,6 +2116,15 @@ var table = $table.DataTable(options); $el.data('datatable', table); + if ('rowGroup' in options) { + // Maintain RowGroup dataSrc when columns are reordered (#1109) + table.on('column-reorder', function(e, settings, details) { + var oldDataSrc = table.rowGroup().dataSrc(); + var newDataSrc = details.mapping[oldDataSrc]; + table.rowGroup().dataSrc(newDataSrc); + }); + } + // Unregister previous Crosstalk event subscriptions, if they exist if (instance.ctfilterSubscription) { instance.ctfilterHandle.off("change", instance.ctfilterSubscription); @@ -2206,6 +2215,7 @@ }; if (data.filter !== 'none') { + if (!data.hasOwnProperty('filterSettings')) data.filterSettings = {}; filterRow.each(function(i, td) { @@ -2269,7 +2279,7 @@ } }); var $input2 = $x.children('select'); - filter = $input2.selectize({ + filter = $input2.selectize($.extend({ options: $input2.data('options').map(function(v, i) { return ({text: v, value: v}); }), @@ -2288,8 +2298,7 @@ $td.data('filter', value.length > 0); table.draw(); // redraw table, and filters will be applied } - }); - if (searchCol) filter[0].selectize.setValue(JSON.parse(searchCol)); + }, data.filterSettings.select)); filter[0].selectize.on('blur', function() { $x.hide().trigger('hide'); $input.parent().show(); $input.trigger('blur'); }); @@ -2298,10 +2307,12 @@ var fun = function() { searchColumn(i, $input.val()).draw(); }; - if (server) { - fun = $.fn.dataTable.util.throttle(fun, options.searchDelay); - } - $input.on('input', fun); + // throttle searching for server-side processing + var throttledFun = $.fn.dataTable.util.throttle(fun, options.searchDelay); + $input.on('input', function(e, immediate) { + // always bypass throttling when immediate = true (via the updateSearch method) + (immediate || !server) ? fun() : throttledFun(); + }); } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { var $x0 = $x; $x = $x0.children('div').first(); @@ -2387,13 +2398,11 @@ filter.val(v); } }); - var formatDate = function(d, isoFmt) { + var formatDate = function(d) { d = scaleBack(d, scale); if (type === 'number') return d; if (type === 'integer') return parseInt(d); var x = new Date(+d); - var fmt = ('filterDateFmt' in data) ? data.filterDateFmt[i] : undefined; - if (fmt !== undefined && isoFmt === false) return x[fmt.method].apply(x, fmt.params); if (type === 'date') { var pad0 = function(x) { return ('0' + x).substr(-2, 2); @@ -2414,7 +2423,7 @@ start: [r1, r2], range: {min: r1, max: r2}, connect: true - }, opts)); + }, opts, data.filterSettings.slider)); if (scale > 1) (function() { var t1 = r1, t2 = r2; var val = filter.val(); @@ -2429,13 +2438,28 @@ start: [t1, t2], range: {min: t1, max: t2}, connect: true - }, opts), true); + }, opts, data.filterSettings.slider), true); val = filter.val(); } r1 = t1; r2 = t2; })(); + // format with active column renderer, if defined + var colDef = data.options.columnDefs.find(function(def) { + return (def.targets === i || inArray(i, def.targets)) && 'render' in def; + }); var updateSliderText = function(v1, v2) { - $span1.text(formatDate(v1, false)); $span2.text(formatDate(v2, false)); + // we only know how to use function renderers + if (colDef && typeof colDef.render === 'function') { + var restore = function(v) { + v = scaleBack(v, scale); + return inArray(type, ['date', 'time']) ? new Date(+v) : v; + } + $span1.text(colDef.render(restore(v1), 'display')); + $span2.text(colDef.render(restore(v2), 'display')); + } else { + $span1.text(formatDate(v1)); + $span2.text(formatDate(v2)); + } }; updateSliderText(r1, r2); var updateSlider = function(e) { @@ -2468,7 +2492,7 @@ // processing if (server) { // if a search string has been pre-set, search now - if (searchCol) searchColumn(i, searchCol).draw(); + if (searchCol) $input.trigger('input').trigger('change'); return; } @@ -2514,15 +2538,7 @@ $.fn.dataTable.ext.search.push(customFilter); // search for the preset search strings if it is non-empty - if (searchCol) { - if (inArray(type, ['factor', 'logical'])) { - filter[0].selectize.setValue(JSON.parse(searchCol)); - } else if (type === 'character') { - $input.trigger('input'); - } else if (inArray(type, ['number', 'integer', 'date', 'time'])) { - $input.trigger('change'); - } - } + if (searchCol) $input.trigger('input').trigger('change'); }); @@ -3170,8 +3186,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v).trigger('input'); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -5101,8 +5118,8 @@

wildfireCA-v0

-
- +
+

wildfireCA-v0 is based on a wildfire cellular automata model from Alexandridis et al.