sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
2da75be4a3f8ceed5351bb74cc7069c71d153ff350e93893dc00d7929b7229ad
JavaScript
3,290
119
/** * jsPsych plugin for showing scenes that mimic the experiments described in * * Fiser, J., & Aslin, R. N. (2001). Unsupervised statistical learning of * higher-order spatial structures from visual scenes. Psychological science, * 12(6), 499-504. * * Josh de Leeuw * * documentation: docs.jspsych.org * */ ...
f80432c4c3cb1873b6b3aceef17d948d39457c9e24e3ffc36662e978e7a72534
JavaScript
3,309
81
c3_chart_internal_fn.drag = function (mouse) { var $$ = this, config = $$.config, main = $$.main, d3 = $$.d3; var sx, sy, mx, my, minX, maxX, minY, maxY; if ($$.hasArcType()) { return; } if (! config.data_selection_enabled) { return; } // do nothing if not selectable if (config.zoom_enabled && ! $$...
384587f0cd84f32ebe7a915d866e9306277321b5dd86f2d15bb27ebc5535f910
JavaScript
3,367
91
c3_chart_internal_fn.setTargetType = function (targetIds, type) { var $$ = this, config = $$.config; $$.mapToTargetIds(targetIds).forEach(function (id) { $$.withoutFadeIn[id] = (type === config.data_types[id]); config.data_types[id] = type; }); if (!targetIds) { config.data_type ...
ede2699be986145ab2471f69b762e3666f69887feaabba7297ff9d61d8c71fb1
JavaScript
3,383
95
function getTitleObjects() { var labels = document.getElementById("gLabels"); var alnRows = document.getElementById("alnRows"); var titles = []; if (labels) { // find matching label at right in choose-sites mode for(const o of labels.children) { titles.push(o); } ...
512a718f7ba121e50b41cfc4a7b1aaa2d5e34dcb73895e1de1036556eea00859
JavaScript
3,394
75
c3_chart_internal_fn.selectPoint = function (target, d, i) { var $$ = this, config = $$.config, cx = (config.axis_rotated ? $$.circleY : $$.circleX).bind($$), cy = (config.axis_rotated ? $$.circleX : $$.circleY).bind($$), r = $$.pointSelectR.bind($$); config.data_onselected.call($$.api, ...
f7d85cc79e3f8d9befba9dea915cfd997f90d6464d5a7a99a8033d3fd9ae231c
JavaScript
3,455
99
describe('c3 chart shape line', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('shape-rendering for line chart', function () { it('should update args', function () { args = { ...
a3d35a8a8585ba9adc729d0af65d21d26efe5d8773f87a5bb955b8ac4cfcfa02
JavaScript
3,463
121
import "../core/identity"; import "../core/rebind"; import "../math/trigonometry"; import "clip-antimeridian"; import "clip-circle"; import "clip-extent"; import "compose"; import "geo"; import "path"; import "resample"; import "rotation"; import "transform"; d3.geo.projection = d3_geo_projection; d3.geo.projectionMut...
f39b50e5f7509585895bb2d84d431d5abe071f243e4e1e3f286c54e3db2302a0
JavaScript
3,482
123
/** * jsPsych plugin for showing animations and recording keyboard responses * Josh de Leeuw * * documentation: docs.jspsych.org */ jsPsych.plugins.animation = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('animation', 'stimuli', 'image'); plugin.trial = function(display_element, trial...
5efba6fadf719679278829fec0e13dcec67be75c2d27acfee49e97a531ece986
JavaScript
3,510
110
import "../arrays/bisect"; import "../arrays/min"; import "../arrays/max"; import "../core/functor"; import "layout"; d3.layout.histogram = function() { var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; function histogram(data, i) {...
a1f784b39a213cd147f9cfcc112ffc6f5a76db567e58616b32417c58539fe4f1
JavaScript
3,512
115
describe('c3 api zoom', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('zoom', function () { it('should update args', function () { args = { data: { ...
984c202347a01e472378065dfa6c6645e12d0d29bff4544d141f2f18f5f63b0d
JavaScript
3,525
136
import "../arrays/merge"; import "../core/rebind"; import "layout"; d3.layout.hierarchy = function() { var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; function hierarchy(root) { var stack = [root], nodes = [], node; ...
ce8b2bf8243c9e8b2bfb64f1845d85f6719d5611200675c6f8f45a8f16188d37
JavaScript
3,574
157
import "../arrays/range"; import "../math/trigonometry"; import "layout"; d3.layout.chord = function() { var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; function relayout() { var subgroups = {}, groupSums = ...
b4a3c7af855da7f48bf1e63de5f8ab63d0a527aba9809863b8afb2135f5e3f69
JavaScript
3,578
125
/* ************************************ */ /* Define helper functions */ /* ************************************ */ ITIs = [0.272, 0.8] var get_ITI = function() { return 9000 + ITIs.shift()*1000 //500 minimum ITI } /* ************************************ */ /* Define experimental variables */ /* ********************...
d160d0b38ee164a8d17a0d84e80ec6d7226f5a8534af2f72ef63a92640c98487
JavaScript
3,643
105
/** * jspsych-radio-buttonlist * a jspsych plugin for displaying a form with a list of radio buttons * * A. Zeynep Enkavi NOTE: survey-multi-choice might be a better plugin for most cases. This plugin requires more raw html work when specifying questions (thouhg this may cater to more flexible formatting needs...
84eef98ac5545f6026f5dee2f51100e58164aa63e292f95a28eaaf9920ca3ce7
JavaScript
3,741
128
/** * jspsych-writing * Ian Eisenberg * * plugin for writing text * * documentation: docs.jspsych.org * **/ jsPsych.plugins["writing"] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { // if any trial variables are functions // this evaluates the function and r...
5508f3182138cb6eefd5585e3436fbe1b686990e6ee60b165718a44bb7fc26d1
JavaScript
3,767
137
/** * jspsych-single-stim * Josh de Leeuw * * plugin for displaying a stimulus and getting a keyboard response * * documentation: docs.jspsych.org * **/ jsPsych.plugins["single-stim"] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('single-stim', 'stimulus', 'image'); plugin.trial ...
2392f8f830752956660518debf6f28d77dcef84cc3c92c9eb055a333b99737d0
JavaScript
3,779
136
import "../arrays/set"; import "../xhr/xhr"; d3.dsv = function(delimiter, mimeType) { var reFormat = new RegExp("[\"" + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); function dsv(url, row, callback) { if (arguments.length < 3) callback = row, row = null; var xhr = d3_xhr(url, mimeType...
5aead129e73af73c9c29147ade7f5b616aaeba02e34b821fc3f0a51a06172be2
JavaScript
3,780
101
describe('c3 chart tooltip', function () { 'use strict'; var chart; var tooltipConfiguration; var args = function () { return { data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2', 50, 20, 10, 40, 15, 25], ...
d022e6dbe4fa98597b4aaf451b46a338e799366649d5771d8cb0720791951295
JavaScript
3,858
89
c3_chart_internal_fn.getScale = function (min, max, forTimeseries) { return (forTimeseries ? this.d3.time.scale() : this.d3.scale.linear()).range([min, max]); }; c3_chart_internal_fn.getX = function (min, max, domain, offset) { var $$ = this, scale = $$.getScale(min, max, $$.isTimeSeries()), _sc...
bbea7003bb2f87728da2435a16a145ba96d7b74ecbdd4d9c75544e9a3c44c646
JavaScript
3,902
139
/** * jspsych-free-sort * plugin for drag-and-drop sorting of a collection of images * Josh de Leeuw * * documentation: docs.jspsych.org */ jsPsych.plugins['free-sort'] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('free-sort', 'stimuli', 'image'); plugin.trial = function(display_e...
4306a8275fdae42c531d12656d2886c577d75fbe41f25ccd6207a3eda6f9bf75
JavaScript
3,903
129
import "albers"; import "conic-equal-area"; import "geo"; // A composite projection for the United States, configured by default for // 960×500. Also works quite well at 960×600 with scale 1285. The set of // standard parallels for each region comes from USGS, which is published here: // http://egsc.usgs.gov/isb/pubs/...
7f9032416c77ad9be47e533edba4fe31435ae1900557436639eed6e30dd2687a
JavaScript
3,942
92
// based on // https://www.w3schools.com/howto/howto_js_autocomplete.asp function autocomplete(inp) { var arr = []; function closeAllLists(elmnt) { var x = document.getElementsByClassName("autocomplete-items"); for (var i = 0; i < x.length; i++) { if (elmnt != x[i] && elmnt != inp) ...
b0f018cf8f42e13effd4e60fd97b33175bf40339025aa7541afb1ca90263f806
JavaScript
3,996
148
/* ************************************ */ /* Define helper functions */ /* ************************************ */ ITIs = [0,0.136,0.136,0.612] var get_ITI = function() { return 4500 + ITIs.shift()*1000 } var randomDraw = function(lst) { var index = Math.floor(Math.random() * (lst.length)) return lst[index]...
06456340425999d5128ad649d34708318ac32db07e1d999cdafe25fd00a78dae
JavaScript
4,022
119
describe('c3 api grid', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('ygrid.add and ygrid.remove', function () { it('should update args', function () { args = { data...
614dbc23b339161810dcbbda063c5072b01a47e813182558318904ea45ecebf3
JavaScript
4,036
161
import "../arrays/map"; import "../core/subclass"; import "../core/true"; import "../event/dispatch"; import "../event/timer"; import "../selection/selection"; import "../selection/transition"; import "../selection/interrupt"; function d3_transition(groups, ns, id) { d3_subclass(groups, d3_transitionPrototype); /...
d7b5ce01c49c172927ea60adbbdd3b49fc21e69a65ffda0ac0db8e673f3d1d22
JavaScript
4,037
116
describe('c3 chart interaction', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('generate event rects', function () { describe('custom x', function () { it('should generate bar chart...
f3143a4a04f375c538280942128fe3d00650f560644a988cba9aea13fc2d49e6
JavaScript
4,043
126
import "../core/array"; import "../core/document"; import "../core/identity"; import "../core/rebind"; import "../event/dispatch"; d3.xhr = d3_xhrType(d3_identity); function d3_xhrType(response) { return function(url, mimeType, callback) { if (arguments.length === 2 && typeof mimeType === "function") callback =...
f8553db84e871454daeecad6e773aedbae8b4027d65a939893742c7ca55adffb
JavaScript
4,191
137
describe('c3 chart types', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('internal.hasArcType', function () { describe('with data', function () { it('should update args', function (...
213a7d4f5ec49592dba46f7f1e7f1b0f9db67829a8331564be6e0b21ad5ee8fb
JavaScript
4,195
100
describe('c3 chart arc', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('show pie chart', function () { it('should update args to have pie chart', function () { args = { ...
3bf498d0fee3633e5f40f8395cc4f7cfd82f0f7eea99e7a7625e1d8afdb4ba82
JavaScript
4,241
141
/** * jspsych-multi-button * Ian Eisenberg * * plugin for displaying stimuli and getting mouse responses * * modified by Zeynep Enkavi * to be tested **/ jsPsych.plugins["single-stim-button"] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('single-stim-button', 'stimulus', 'image') ...
a8bd795209faec893c7a40fdbf88c2bc11267d4d13f3df2f5cb8921b2c6fb34a
JavaScript
4,267
149
import "../arrays/merge"; import "../core/noop"; import "../math/trigonometry"; import "clip-polygon"; function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) { return function(rotate, listener) { var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]); ...
92727fbe9f3709ede901c512410aae8186ad91300859d1b6c5651607f24043e7
JavaScript
4,290
150
describe('c3 chart', function () { 'use strict'; var chart; var args = { data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2', 50, 20, 10, 40, 15, 25], ['data3', 150, 120, 110, 140, 115, 125] ] } }; ...
c969b3d3cc7f54badb4548bbd71b9c96ba408077d3061eafa95044dafe673842
JavaScript
4,319
148
/** * jspsych plugin for categorization trials with feedback and animated stimuli * Josh de Leeuw * * documentation: docs.jspsych.org **/ jsPsych.plugins["categorize-animation"] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('categorize-animation', 'stimuli', 'image'); plugin.trial =...
43c1b40f14db0773f5d480b61780d11228482e420e797b7bcccf45cd8875d127
JavaScript
4,322
141
/** * jspsych-survey-multi-choice * a jspsych plugin for multiple choice survey questions * * Shane Martin * * documentation: docs.jspsych.org * */ jsPsych.plugins['survey-multi-choice'] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { var plugin_id_name = "jspsych...
b663c66d457adf1e71652a83bc848c27de006b90f9980ebbdcac83ecebbf751f
JavaScript
4,378
146
/** * jspsych-same-different * Josh de Leeuw * * plugin for showing two stimuli sequentially and getting a same / different judgment * * documentation: docs.jspsych.org * */ jsPsych.plugins['same-different'] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('same-different', 'stimuli', '...
6ba3ab8c1456dab0684dfc10ab0fbb9f319e69eb4591718d36fa4155e465a6c0
JavaScript
4,394
155
import "../arrays/bisect"; import "../arrays/range"; import "../core/identity"; import "../core/true"; import "../scale/linear"; import "../scale/nice"; import "format"; import "day"; import "hour"; import "minute"; import "month"; import "second"; import "time"; import "week"; import "year"; function d3_time_scale(li...
42b3b4e3d1654ca07bc117264ec0f7f70327babaf3e15125f4542920ecb3edcd
JavaScript
4,438
121
describe('c3 api load', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('indexed data', function () { describe('as column', function () { it('should update args', function () { ...
e467849f15d44f872b6a0f976b77ffdbb37a384f6bda7be17deb85d6ee31877a
JavaScript
4,443
150
/** * jsPsych plugin for showing animations that mimic the experiment described in * * Fiser, J., & Aslin, R. N. (2002). Statistical learning of higher-order * temporal structure from visual shape sequences. Journal of Experimental * Psychology: Learning, Memory, and Cognition, 28(3), 458. * * Josh de Leeuw * ...
9890bbd684736f5570cccb199c54c89778c8cea7a892e21edf7f14591885c750
JavaScript
4,464
164
/* jspsych-text.js * Josh de Leeuw * * This plugin displays text (including HTML formatted strings) during the experiment. * Use it to show instructions, provide performance feedback, etc... * * documentation: docs.jspsych.org * * */ jsPsych.plugins.instructions = (function() { var plugin = {}; plugin.t...
5745c39256b019fbd0d4103d25158b0a80ec31eefac4c45a61318ad5d9cb604b
JavaScript
4,590
155
/** * jspsych-poldrack-single-stim * Josh de Leeuw * * plugin for displaying a stimulus and getting a keyboard response * * documentation: docs.jspsych.org * * Modified by Ian Eisenberg to record more trial parameters **/ jsPsych.plugins["poldrack-single-stim"] = (function() { var plugin = {}; jsPsych...
8cde280a45299ca66bbe4346a7c8094d1ded13468ea305e43d0e187b8f9ef80e
JavaScript
4,667
104
c3_chart_internal_fn.getCurrentWidth = function () { var $$ = this, config = $$.config; return config.size_width ? config.size_width : $$.getParentWidth(); }; c3_chart_internal_fn.getCurrentHeight = function () { var $$ = this, config = $$.config, h = config.size_height ? config.size_height : $$.get...
e80160e71e88675ad0a83b6f62e7640d75027002a311f1386588cdb741949438
JavaScript
4,681
152
/** * jspsych-button-response * Josh de Leeuw * * plugin for displaying a stimulus and getting a keyboard response * * documentation: docs.jspsych.org * **/ jsPsych.plugins["button-response"] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { // default trial paramete...
2b823a738d2972e712c43503bfc3a0e371ccaa81ebf1c54b8da6e97bbd01c340
JavaScript
4,691
149
import "../core/noop"; import "../math/trigonometry"; import "geo"; import "stream"; d3.geo.centroid = function(object) { d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_ce...
1ddb72f18f90ac6023c649ed931e4debbc6486544b18e34d0abb2d4a73787958
JavaScript
4,710
186
import "../../math/abs"; function d3_geom_voronoiBeach() { d3_geom_voronoiRedBlackNode(this); this.edge = this.site = this.circle = null; } function d3_geom_voronoiCreateBeach(site) { var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach; beach.site = site; return beach; } function d3_...
703b6bb8d2948c7a73720e1a8a934e449bcf1ad2a02b3e58828d9872f627d8b9
JavaScript
4,797
160
import "../arrays/range"; import "../core/rebind"; import "../interpolate/interpolate"; import "../interpolate/round"; import "../interpolate/uninterpolate"; import "../format/format"; import "../math/abs"; import "bilinear"; import "nice"; import "polylinear"; import "scale"; d3.scale.linear = function() { return d...
73aad3bd47b163f696fc4f1eb942293f818bab54c34f60c9042a191bfd3ab5d0
JavaScript
4,803
159
/* * sidebar.js * ~~~~~~~~~~ * * This script makes the Sphinx sidebar collapsible. * * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton * used to collapse and expand the sidebar. * * When the sidebar is collapsed the .sphinxsi...
05d30e97f6f8e95420c47e82ec5e433ad2b6443fe82357360760d395191a603f
JavaScript
4,804
122
c3_chart_internal_fn.initText = function () { var $$ = this; $$.main.select('.' + CLASS.chart).append("g") .attr("class", CLASS.chartTexts); $$.mainText = $$.d3.selectAll([]); }; c3_chart_internal_fn.updateTargetsForText = function (targets) { var $$ = this, mainTextUpdate, mainTextEnter, ...
f2293dc4b7cd04b60e2777fd38505429eef2071b0c15a721e6104edae5d6a298
JavaScript
4,841
168
import "../math/abs"; import "geo"; import "stream"; import "area"; import "cartesian"; import "spherical"; d3.geo.bounds = (function() { var λ0, φ0, λ1, φ1, // bounds λ_, // previous λ-coordinate λ__, φ__, // first point p0, // previous 3D point dλSum, ranges, range; var bound...
3aac7c7881bb6477a79e64296500c02cd9bb7573f1c849745154b1729644aa58
JavaScript
5,070
113
c3_chart_internal_fn.initTooltip = function () { var $$ = this, config = $$.config, i; $$.tooltip = $$.selectChart .style("position", "relative") .append("div") .attr('class', CLASS.tooltipContainer) .style("position", "absolute") .style("pointer-events", "none") .s...
225c04e5e1698ad1bed5bf0a47c66b6eadf72ae9fcb1aaa54631b7c65010c42d
JavaScript
5,087
177
/** * jspsych-stop-signal * Ian Eisenberg * * plugin for displaying a stimulus and getting a keyboard response * * documentation: docs.jspsych.org * **/ jsPsych.plugins["stop-signal"] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('stop-signal', 'stimulus', 'image'); plugin.trial = function(d...
8f3bb8f1eb3d29adad504a91d4f55cbf81fa13cc71eaa9686e9e3b110adca973
JavaScript
5,196
122
c3_chart_internal_fn.initBar = function () { var $$ = this; $$.main.select('.' + CLASS.chart).append("g") .attr("class", CLASS.chartBars); }; c3_chart_internal_fn.updateTargetsForBar = function (targets) { var $$ = this, config = $$.config, mainBarUpdate, mainBarEnter, classChartBar ...
c69ebcf9eee1a3769298e399a0679552459897a4b34b9d2f21352976016c3a88
JavaScript
5,280
211
import "layout"; import "hierarchy"; d3.layout.pack = function() { var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [1, 1], radius; function pack(d, i) { var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[...
302344a1a48c38c5f6b91bdb87c36447fc3f7125ea6f64733eca10bab696e040
JavaScript
5,310
183
var clusterfck = (function() { var module = { exports: {}}; var exports = module.exports; module.exports = (function() { var module = { exports: {}}; var exports = module.exports; var HierarchicalClustering = function(distance, merge, threshold) { this.distance = distance || clusterfck.EUCLIDEAN_DIST...
6db439473018e9de6d07f7c8615dc83a6177969a843224033650a6c561a0dd6f
JavaScript
5,364
164
describe('c3 api data', function () { 'use strict'; var chart; var args = { data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2', 5000, 2000, 1000, 4000, 1500, 2500] ], names: { data1: 'Data Name 1',...
3457b5199e95e83c64fa4b3466b8788334c586a80fd3712e5b917d66d9d0de6d
JavaScript
5,400
160
import "../core/array"; import "../core/identity"; import "../math/trigonometry"; import "../scale/linear"; import "../scale/scale"; import "../selection/selection"; import "../transition/transition"; import "svg"; d3.svg.axis = function() { var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, ...
a4fdfb5665db89d553112ee48a3ebb46c9d2fe2e286268ad6cea867314974e6c
JavaScript
5,412
184
/* jspsych-text.js * Josh de Leeuw * * This plugin displays text (including HTML formatted strings) during the experiment. * Use it to show instructions, provide performance feedback, etc... * * documentation: docs.jspsych.org * * Modification by Ian Eisenberg - changed navigation buttons such that the "Next" b...
5fbdbd821ba5bf4974d2489a3fca7206f90f7f71c8710fadd0e3abf62564a0ee
JavaScript
5,478
247
import "../arrays/map"; import "../arrays/permute"; import "../arrays/range"; import "../core/identity"; import "layout"; // data is two-dimensional array of x,y; we populate y0 d3.layout.stack = function() { var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZer...
d763baaf20c73f93650eebfcf7776499f67b99b4b595475a9e7075e94f42a857
JavaScript
5,483
196
import "../arrays/merge"; import "../math/abs"; import "../math/trigonometry"; import "../geom/clip-line"; import "geo"; import "clip"; import "clip-polygon"; var d3_geo_clipExtentMAX = 1e9; d3.geo.clipExtent = function() { var x0, y0, x1, y1, stream, clip, clipExtent = { stream: function(...
c95bcbcd0071a7ca688e7d927267bae48deb58bd23898fc3a842122623559e39
JavaScript
5,507
235
function d3_geom_voronoiRedBlackTree() { this._ = null; // root node } function d3_geom_voronoiRedBlackNode(node) { node.U = // parent node node.C = // color - true for red, false for black node.L = // left node node.R = // right node node.P = // previous node node.N = null; // next node } d3_geom_voron...
0047cfb65333d3765fcb33c5a5d51cd46af8d7c6f570f2c3c869557e7f157ab8
JavaScript
5,616
223
/* * Requires: * psiturk.js * utils.js */ // Initalize psiturk object var psiTurk = new PsiTurk(uniqueId, adServerLoc, mode); var mycondition = condition; // these two variables are passed by the psiturk server process var mycounterbalance = counterbalance; // they tell you which condition you have been...
d9b9cecb644447871adceeb32e47caf1ab854db00ee0a07106fd95add2c29736
JavaScript
5,642
155
import "../arrays/map"; import "../core/identity"; import "../format/formatPrefix"; import "../format/precision"; import "../format/round"; function d3_locale_numberFormat(locale) { var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_c...
1612e0a0e249f4fa90e2cb25c26c649a144a4cd766c718e78887ef1e032b3cc1
JavaScript
5,694
181
/** * jspsych-categorize-audio * Ian Eisenberg * * plugin for playing an audio file, getting a keyboard response, and giving feedback * * modified by Zeynep Enkavi and Ian Eisenberg * to be tested **/ jsPsych.plugins["categorize-audio"] = (function() { var plugin = {}; var context = new AudioContext(); ...
aa79e0756f4bc85619242e2d239d427d92f610264b85c7d7fc67aa94a59be24e
JavaScript
5,744
225
(function(){science = {version: "1.7.0"}; // semver science.ascending = function(a, b) { return a - b; }; // Euler's constant. science.EULER = .5772156649015329; // Compute exp(x) - 1 accurately for small x. science.expm1 = function(x) { return (x < 1e-5 && x > -1e-5) ? x + .5 * x * x : Math.exp(x) - 1; }; science....
358cc0d590a3c68b9a3453cb0edf80e6bfc490abd3bf24d438cd4cff9326bedb
JavaScript
5,840
182
/** * jspsych plugin for categorization trials with feedback * Josh de Leeuw * * documentation: docs.jspsych.org **/ jsPsych.plugins.categorize = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('animation', 'stimulus', 'image'); plugin.trial = function(display_element, trial) { // ...
833dc1a2c787d2c32a310c1f470ca4e6fc1a6d447a9d5172883e862ab7a8a9fe
JavaScript
5,883
178
import "../math/abs"; import "../math/trigonometry"; import "cartesian"; import "clip"; import "circle"; import "spherical"; import "point-in-polygon"; // Clip features against a small circle centered at [0°, 0°]. function d3_geo_clipCircle(radius) { var cr = Math.cos(radius), smallRadius = cr > 0, notHe...
5376de2dd660283cb993b44107f7f5e258ad2021575cd60ebd5ad13ce5df667e
JavaScript
6,014
236
import speakerViewHTML from './speaker-view.html'; import { marked } from 'marked'; /** * Handles opening of and synchronization with the reveal.js * notes window. * * Handshake process: * 1. This window posts 'connect' to notes window * - Includes URL of presentation to show * 2. Notes window responds with...
a34411104b184421480294827844778bc51b2765455a99fbcde300593c028624
JavaScript
6,014
207
/** * jspsych-muli-stim-multi-response * Josh de Leeuw * * plugin for displaying a set of stimuli and collecting a set of responses * via the keyboard * * documentation: docs.jspsych.org * **/ jsPsych.plugins["multi-stim-multi-response"] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreloa...
e4bf340cc73a38e68fac11339fcbfc1be47a2266563a650cb262e4ea497c56af
JavaScript
6,030
191
/* jspsych-xab.js * Josh de Leeuw * * This plugin runs a single XAB trial, where X is an image presented in isolation, and A and B are choices, with A or B being equal to X. * The subject's goal is to identify whether A or B is identical to X. * * documentation: docs.jspsych.org * */ jsPsych.plugins.xab = (f...
9a23821c2567c9a4c35e3bc3bb934e897fbef686b9094b9fcf163a1f9eb1c595
JavaScript
6,045
204
/** * jspsych-similarity.js * Josh de Leeuw * * This plugin create a trial where two images are shown sequentially, and the subject rates their similarity using a slider controlled with the mouse. * * documentation: docs.jspsych.org * */ jsPsych.plugins.similarity = (function() { var plugin = {}; jsPsyc...
68d526258ccc3b7e59b91cf62a910102a8d66723b836d0b074f25d626c870806
JavaScript
6,444
1
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94941,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return d}});let r=e.r(91788),o="undefined"==typeof window,i=o?()=>...
46de2b5d27221d03c841eef7a6be9405ea3d0d2fa4da7ab820b62090b6fb3701
JavaScript
6,457
174
var CLASS = c3_chart_internal_fn.CLASS = { target: 'c3-target', chart: 'c3-chart', chartLine: 'c3-chart-line', chartLines: 'c3-chart-lines', chartBar: 'c3-chart-bar', chartBars: 'c3-chart-bars', chartText: 'c3-chart-text', chartTexts: 'c3-chart-texts', chartArc: 'c3-chart-arc', c...
c6b73b7775259b8fdeae3da3578899627a0f99e7d11819740a5723607dfb5309
JavaScript
6,490
243
/*! * Handles finding a text string anywhere in the slides and showing the next occurrence to the user * by navigatating to that slide and highlighting it. * * @author Jon Snyder <snyder.jon@gmail.com>, February 2013 */ const Plugin = () => { // The reveal.js instance this plugin is attached to let deck; let...
db1b043235bb17a45aebd7fff9e88b0ed69ba60fd34963f4adffa65d44798842
JavaScript
6,586
229
import "layout"; import "hierarchy"; // Squarified Treemaps by Mark Bruls, Kees Huizing, and Jarke J. van Wijk // Modified to support a target aspect ratio by Jeff Heer d3.layout.treemap = function() { var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [1, 1], // width, height paddin...
95c494d468a41a4a23155b1147cec11a1bd0e1ff71d29d197a34278bbcddb729
JavaScript
6,667
225
/** * * jspsych-visual-search-circle * Josh de Leeuw * * display a set of objects, with or without a target, equidistant from fixation * subject responds to whether or not the target is present * * based on code written for psychtoolbox by Ben Motz * * requires Snap.svg library (snapsvg.io) * * documentatio...
89fd23a151776db6dd47c9dc3efa6e28c9ffd4441747f54cf1940bea0b054442
JavaScript
6,745
280
// d3.tip // Copyright (c) 2013 Justin Palmer // // Tooltips for d3.js SVG visualizations // Public - contructs a new tooltip // // Returns a tip d3.tip = function() { var direction = d3_tip_direction, offset = d3_tip_offset, html = d3_tip_html, node = initNode(), svg = nul...
01826f83b492ebe3ef90f78964218c31c6ab3d864f8f66d2f0b941bc0de35475
JavaScript
6,779
264
/*! * reveal.js Zoom plugin */ const Plugin = { id: 'zoom', init: function( reveal ) { reveal.getRevealElement().addEventListener( 'mousedown', function( event ) { var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt'; var modifier = ( reveal.getConfig().zoomKey ? reveal.getCo...
33f7e31c9191e119ce29159223a63e1b6d8971bd1449b97ccb2f8f6d41b1c710
JavaScript
6,916
191
c3_chart_internal_fn.convertUrlToData = function (url, mimeType, keys, done) { var $$ = this, type = mimeType ? mimeType : 'csv'; $$.d3.xhr(url, function (error, data) { var d; if (!data) { throw new Error(error.responseURL + ' ' + error.status + ' (' + error.statusText + ')'); ...
c97c5643da67e203803b4b4051536539f8d781763bbccdb43b7820d096a47acf
JavaScript
6,955
243
import "../core/functor"; import "../math/abs"; import "geom"; import "point"; d3.geom.quadtree = function(points, x1, y1, x2, y2) { var x = d3_geom_pointX, y = d3_geom_pointY, compat; // For backwards-compatibility. if (compat = arguments.length) { x = d3_geom_quadtreeCompatX; y = d3_geom_q...
6a7f687276ab38798e8a94b5d8974dc374bbba7a158d2c604f627504fb5d28b0
JavaScript
7,070
220
describe('c3 chart legend', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('legend when multiple charts rendered', function () { it('should update args', function () { args = { ...
8f6806d07a1e8a1f400c20b0a2ea79c4eb643249a03a79d600943b1e0c7ba4b2
JavaScript
7,081
1
(function(){function h(a,b){var c=b+1;while(c<a.length&&a[c]===0)c++;return c}function g(a,b,c,d){var e=d[0],f=d[1],g=h(b,f);if(g<a.length&&a[g]-a[c]<a[c]-a[e]){var i=h(b,e);d[0]=i,d[1]=g}}function f(a){return(a=1-a*a*a)*a*a}function e(a){var b=a.length,c=0;while(++c<b)if(a[c-1]>=a[c])return!1;return!0}function d(a){va...
6b2f151e0b15c5eb1b06f7594fa68ba4bb3e7b01b44fcfd9b24f12b05038b235
JavaScript
7,165
183
/* ************************************ */ /* Define helper functions */ /* ************************************ */ ITIs = [0.816,0.068,0.136,0.408,0.0,0.476,0.408,0.068,0.0,1.7,0.204,0.544,0.544,0.68,0.476,0.272,0.272,0.68,0.68,0.748,0.068,0.0,0.408,0.068,1.7,0.408,0.748,0.544,0.136,0.204,0.136,0.068,0.068,0.408,0.34...
b895d199ff0c6a3710ff590aa9f286248d8fbd11e146831b7f7c96f708e72e8d
JavaScript
7,238
235
/** * jspsych-muli-stim-multi-response * Josh de Leeuw * * plugin for displaying a set of stimuli and collecting a set of responses * via the keyboard * * documentation: docs.jspsych.org * **/ jsPsych.plugins["poldrack-multi-stim-multi-response"] = (function() { var plugin = {}; jsPsych.pluginAPI.regis...
10339e8018699c6afd9063083d84fd18af95c9243a50edf62f5ad2ff62dc4de8
JavaScript
7,306
244
// // Vivado(TM) // ISEWrap.js: Vivado Runs Script for WSH 5.1/5.6 // Copyright 1986-1999, 2001-2013,2015 Xilinx, Inc. All Rights Reserved. // // GLOBAL VARIABLES var ISEShell = new ActiveXObject( "WScript.Shell" ); var ISEFileSys = new ActiveXObject( "Scripting.FileSystemObject" ); var ISERunDir = ""; var ISELogF...
ad7414cff7fa92c131f180cbe675bb12527b5943d4db33adb33990efe2cdb84e
JavaScript
7,360
230
c3_chart_internal_fn.getDefaultConfig = function () { var config = { bindto: '#chart', size_width: undefined, size_height: undefined, padding_left: undefined, padding_right: undefined, padding_top: undefined, padding_bottom: undefined, zoom_enabled: fa...
25944d4e8b563352de4963066b87b93e09e9df4718a1659a211c81c69a8bca70
JavaScript
7,536
301
import "../arrays/map"; import "color"; import "hsl"; import "lab"; import "xyz"; d3.rgb = d3_rgb; function d3_rgb(r, g, b) { return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? (r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d...
64acbaa6a5e3ddc0a51915b764c76cb37d94c0ca50c9b1cc9ab64803564b00a0
JavaScript
7,592
240
import "layout"; import "hierarchy"; // Node-link tree diagram using the Reingold-Tilford "tidy" algorithm d3.layout.tree = function() { var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [1, 1], // width, height nodeSize = null; function ...
d3a96b76e02a21c8a4317c55e89e577164042090c38b5c2f3559c0eff7943f25
JavaScript
7,680
262
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o]...
d5335e3109994b17653d5fdab1af85bfa52c9f6bd9597e4a320b6a4b71f42630
JavaScript
7,739
219
var SMALL = 1e-10; /** Returns the intersection area of a bunch of circles (where each circle is an object having an x,y and radius property) */ export function intersectionArea(circles, stats) { // get all the intersection points of the circles var intersectionPoints = getIntersectionPoints(circles); //...
0b9ec63989bef79235307fe2a2480dbdc6f5a82a1279fb7b6530e286004255e4
JavaScript
7,790
225
/** * rtd-version-shim.js * * Emulates the Read the Docs Addons "readthedocs-addons-data-ready" CustomEvent * for self-hosted Sphinx documentation using sphinx_rtd_theme >= 3.0. * * The RTD theme v3 removed its own version display in favour of listening for * a CustomEvent that the Read the Docs hosting platform...
845a077ab6f65e7dc4b2d630388fb260dd6e4e536bc13b132f9b157c99f0db74
JavaScript
7,805
1
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define("d3-array",["exports"],r):r(n.d3_array={})}(this,function(n){"use strict";function r(n,r){return r>n?-1:n>r?1:n>=r?0:NaN}function t(n){return 1===n.length&&(n=e(n)),{left:function(r,t,e,u){for(arg...
a58969d3ad8a3e12930079383d29eedcd851d7ac6297d1fba3d828855813f263
JavaScript
7,871
227
/** * jspsych plugin for categorization trials with feedback * Josh de Leeuw * * documentation: docs.jspsych.org * * Modified by Ian Eisenberg to record more trial parameters **/ jsPsych.plugins["poldrack-categorize"] = (function() { var plugin = {}; jsPsych.pluginAPI.registerPreload('animation', 'stimu...
79a5fe0b3ffdebcdd8274fa029731c1a2d33c49950c1471e90bbef7abedeb661
JavaScript
7,932
191
/* ************************************ */ /* Define helper functions */ /* ************************************ */ ITIs = [1.36,0.68,1.156,0.204,2.176,0.272,0.612,0.068,0.0,5.304,0.068,1.292,2.788,0.204,0.476,0.952,2.856,0.204,2.516,0.0,0.136,0.612,0.612,1.292,1.088,0.068,1.156,0.884,0.68,0.544,2.312,0.612,0.204,0.544...
d9b718e589fb6dc604e6b422bd28f663c03f838672965e2d2d62dc57d4d89b38
JavaScript
8,016
173
/** * jspsych-attention-check * attention-check **/ jsPsych.plugins["attention-check"] = (function() { var randomDraw = function(lst) { var index = Math.floor(Math.random()*(lst.length)) return lst[index] } var questions = [{'Q': 'Press the Left Arrow</p>', 'A': 37}, {'Q': '<p>Press the Right A...
c6348abc27b34e03d94e870b0162297b55e890d179f0ddbf6586874704379678
JavaScript
8,266
204
c3_chart_internal_fn.initBrush = function () { var $$ = this, d3 = $$.d3; $$.brush = d3.svg.brush().on("brush", function () { $$.redrawForBrush(); }); $$.brush.update = function () { if ($$.context) { $$.context.select('.' + CLASS.brush).call(this); } return this; }; $$.brush.scale =...
ef6c0c9c40fb3ddd322b14186a5838012f5dd699776339a10d3e50ec7ca425dc
JavaScript
8,887
292
import "../core/functor"; import "../core/zero"; import "../math/trigonometry"; import "../geom/polygon"; import "svg"; d3.svg.arc = function() { var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_s...
76d297c10c783e66fe2fad34361c7529043e4788d7787ea4e408ff5baffc2d8e
JavaScript
9,054
315
/* ************************************ */ /* Define helper functions */ /* ************************************ */ var ITIs = [0.0,0.136,0.272,0.0,0.952,0.0,0.272,0.408,0.0,0.408,0.136,0.136,0.272,0.0,0.0,0.952,0.272,0.408,0.0,0.272] var get_ITI = function() { return 2000 + ITIs.shift()*1000 } var getPracticeTria...
61810f3a59936e63f849d70373bb149e2a7927cd0bffdbb072e66e44cf00cb63
JavaScript
9,278
310
/** finds the zeros of a function, given two starting points (which must * have opposite signs */ export function bisect(f, a, b, parameters) { parameters = parameters || {}; var maxIterations = parameters.maxIterations || 100, tolerance = parameters.tolerance || 1e-10, fA = f(a), fB = ...
eebc5a00168b2e14b5e3ca25211c1d1a499b0bb3521fea9cd7e112379ad1679b
JavaScript
9,298
290
// catch all plugin for various quarto features window.QuartoSupport = function () { function isPrintView() { return /print-pdf/gi.test(window.location.search); } // implement controlsAudo function controlsAuto(deck) { const config = deck.getConfig(); if (config.controlsAuto === true) { const...
8a1ebfbf9815a8ebd248a2679e450b3f414930eb0c3344b67deadc2b2b8d4a2f
JavaScript
9,354
315
/* * doctools.js * ~~~~~~~~~~~ * * Sphinx JavaScript utilities for all documentation. * * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * select a different prefix for underscore */ $u = _.noConflict(); /** * make the code below compati...
c7581dde67527fe9cc914823d652ff4b6e4c1d17768b84788ab10c98c86d2eb8
JavaScript
9,592
321
/* * doctools.js * ~~~~~~~~~~~ * * Sphinx JavaScript utilities for all documentation. * * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * select a different prefix for underscore */ $u = _.noConflict(); /** * make the code below compati...