sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
fd0391350953c93c5820e7fc288ba8c85f4ddb742127196596f34a8f290ff9bc
JavaScript
1,289
57
import "linear"; import "scale"; d3.scale.pow = function() { return d3_scale_pow(d3.scale.linear(), 1, [0, 1]); }; function d3_scale_pow(linear, exponent, domain) { var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); function scale(x) { return linear(powp(x)); } scale.inv...
b1b3fda846e07c1c2f636678a9e8ebafb87e52cd79225402c18c0dc99c5bcf1b
JavaScript
1,308
47
function initDom() { 'use strict'; var div = document.createElement('div'); div.id = 'chart'; div.style.width = '640px'; div.style.height = '480px'; document.body.appendChild(div); document.body.style.margin = '0px'; } typeof initDom !== 'undefined'; function setMouseEvent(chart, name, x, ...
3df726758c44032ce14476ca882300d5af47d570115d340d5b9cd903a81e376d
JavaScript
1,319
39
import "../core/document"; import "event"; d3.mouse = function(container) { return d3_mousePoint(container, d3_eventSource()); }; // https://bugs.webkit.org/show_bug.cgi?id=44083 var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; function d3_mousePoint(container, e) { if ...
d26efd4c92ac8e565672db5f0db366261ef68a99bb18e1004ee45a4ab820067a
JavaScript
1,337
66
import "../math/trigonometry"; // Liang–Barsky line clipping. function d3_geom_clipLine(x0, y0, x1, y1) { return function(line) { var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay,...
8358763ac078d9719bfc2d9248985a3b8206de4b1abe5fe4ad8c4b8228a3d29e
JavaScript
1,345
59
function d3_geo_pathBuffer() { var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; var stream = { point: point, // While inside a line, override point to moveTo then lineTo. lineStart: function() { stream.point = pointLineStart; }, lineEnd: lineEnd, // While inside a polygon, o...
24285b3707b90538fb6f1fe00cab8f753e6d0547ceb7f02d3546fd9a6c0cbef6
JavaScript
1,351
36
// // Vivado(TM) // rundef.js: a Vivado-generated Runs Script for WSH 5.1/5.6 // Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // var WshShell = new ActiveXObject( "WScript.Shell" ); var ProcEnv = WshShell.Environment( "Process" ); var PathVal = ProcEnv("PATH"); if ( PathVal.length == 0 ) { PathVal = "D:/sof...
fcfa1103bf5a68a9526c0fc001ed7d06dd461593190e19ee14938b72dde280f4
JavaScript
1,360
40
c3_chart_fn.regions = function (regions) { var $$ = this.internal, config = $$.config; if (!regions) { return config.regions; } config.regions = regions; $$.redrawWithoutRescale(); return config.regions; }; c3_chart_fn.regions.add = function (regions) { var $$ = this.internal, config = $$.config...
0a38314ca6113f0cf4b3384461ee320a0acb6baf1ad8348651527ef165f93f36
JavaScript
1,361
36
// // Vivado(TM) // rundef.js: a Vivado-generated Runs Script for WSH 5.1/5.6 // Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // var WshShell = new ActiveXObject( "WScript.Shell" ); var ProcEnv = WshShell.Environment( "Process" ); var PathVal = ProcEnv("PATH"); if ( PathVal.length == 0 ) { PathVal = "D:/sof...
91fce420201017334ff044ac240a9371403d53505b87381bd637b972f9af743b
JavaScript
1,363
36
// // Vivado(TM) // rundef.js: a Vivado-generated Runs Script for WSH 5.1/5.6 // Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // var WshShell = new ActiveXObject( "WScript.Shell" ); var ProcEnv = WshShell.Environment( "Process" ); var PathVal = ProcEnv("PATH"); if ( PathVal.length == 0 ) { PathVal = "D:/sof...
d7c5fab0a31b292bc5a061edc6458827e994c0c9ec61c495bf94d496a0ee1658
JavaScript
1,379
43
import "selection"; d3_selectionPrototype.property = function(name, value) { if (arguments.length < 2) { // For property(string), return the property value for the first node. if (typeof name === "string") return this.node()[name]; // For property(object), the object specifies the names and values of t...
26854e314b2486486c4953856c7f17a6e3af88d33a5ab06a37a5635c6139f6b4
JavaScript
1,418
40
// // Vivado(TM) // rundef.js: a Vivado-generated Runs Script for WSH 5.1/5.6 // Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. // var WshShell = new ActiveXObject( "WScript.Shell" ); var ProcEnv = WshShell.Environment( "Process" ); var PathVal = ProcEnv("PATH"); if ( PathVal.length == 0 ) { PathVal = "D:/sof...
77a195564e035dd0a83c5c9720d51be3bd2dbcc29ec3f3f235c2a8a07068ff41
JavaScript
1,429
56
import "color"; import "rgb"; d3.hsl = d3_hsl; function d3_hsl(h, s, l) { return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? (h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl)) : new d3_hsl(h, s, l); } var...
17d9e70a31ef76b3128f5573bba1867c0f28bff7f7b7c903c3163eb3487bf5a5
JavaScript
1,496
50
c3_chart_fn.show = function (targetIds, options) { var $$ = this.internal, targets; targetIds = $$.mapToTargetIds(targetIds); options = options || {}; $$.removeHiddenTargetIds(targetIds); targets = $$.svg.selectAll($$.selectorTargets(targetIds)); targets.transition() .style('opacity',...
e5b96f9f28dd30116b1d85965835f0f53431967c5e0451752c924fb7a3582de7
JavaScript
1,501
58
import "../color/rgb"; import "ordinal"; import "scale"; /* * This product includes color specifications and designs developed by Cynthia * Brewer (http://colorbrewer.org/). See lib/colorbrewer for more information. */ d3.scale.category10 = function() { return d3.scale.ordinal().range(d3_category10); }; d3.scal...
c1b5e804681bcdd2907577c91683bf3ccd54b84750f2da3f2960388c3acdd602
JavaScript
1,505
71
import "time"; function d3_time_interval(local, step, number) { function round(date) { var d0 = local(date), d1 = offset(d0, 1); return date - d0 < d1 - date ? d0 : d1; } function ceil(date) { step(date = local(new d3_date(date - 1)), 1); return date; } function offset(date, k) { step(...
ded098db0ff90964a447ae426ac8eeb4238651db165178dc4a9cf07a1ebc460e
JavaScript
1,518
59
import "layout"; // Implements hierarchical edge bundling using Holten's algorithm. For each // input link, a path is computed that travels through the tree, up the parent // hierarchy to the least common ancestor, and then back down to the destination // node. Each path is simply an array of nodes. d3.layout.bundle =...
2da6648717795c0647b36beb621031e75e7c9eed118ff2a28c8adb455ff7a62a
JavaScript
1,530
59
import "../../math/trigonometry"; var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = []; import "beach"; import "cell"; import "circle"; import "clip"; import "ed...
b8f8fd1bb20c401085cfb091bbcc27d93b9a541f6a21b7a591c89dfadccc0f17
JavaScript
1,573
50
function d3_geom_voronoiEdge(lSite, rSite) { this.l = lSite; this.r = rSite; this.a = this.b = null; // for border edges } function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) { var edge = new d3_geom_voronoiEdge(lSite, rSite); d3_geom_voronoiEdges.push(edge); if (va) d3_geom_voronoiSetEdgeEnd(edge, lS...
d6e23ceb94058f6554182ac6fc51e61eea07e842ffa262d4f711f92913b3fdec
JavaScript
1,586
71
/* 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.text = (function() { var plugin = {}; plugin.trial = f...
dc069e204412eced16106b293b1defc1585259abe66b88f97766a0a83c5759d7
JavaScript
1,635
69
import "../arrays/map"; d3.dispatch = function() { var dispatch = new d3_dispatch, i = -1, n = arguments.length; while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); return dispatch; }; function d3_dispatch() {} d3_dispatch.prototype.on = function(type, listener) { var i = type.i...
94e4902cf034bf98f19179556a6539cb2fee7519459fa082c4557012c62c5b87
JavaScript
1,636
54
describe('c3 api axis', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('axis.labels', function () { it('should update args', function () { args = { data: { ...
a851c3fe818d6aca21b96e34be706ebb997b8c95999d1adf892876f0adece36e
JavaScript
1,652
33
var d3_time = d3.time = {}, d3_date = Date; function d3_date_utc() { this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); } d3_date_utc.prototype = { getDate: function() { return this._.getUTCDate(); }, getDay: function() { return this._.getUTCDay(); }, get...
c1ef70211e04e3d5456a057918c4e379136c53e612c8c836dc2e7e26fa66dd81
JavaScript
1,666
46
c3_chart_internal_fn.generateColor = function () { var $$ = this, config = $$.config, d3 = $$.d3, colors = config.data_colors, pattern = notEmpty(config.color_pattern) ? config.color_pattern : d3.scale.category10().range(), callback = config.data_color, ids = []; return function...
b7608b87053ac9c061a19a69950dcc2ab68b1ef5e5df7b4d402d7548a7c78992
JavaScript
1,676
60
import "../math/trigonometry"; import "color"; import "hcl"; import "rgb"; d3.lab = d3_lab; function d3_lab(l, a, b) { return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? (l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : (l instanceof d3_hcl ? d3_hcl_la...
afc68bb28310783379c5cee8028330ff49ba8344d74b2061de5bc794b6181aee
JavaScript
1,683
73
function d3_geom_voronoiCircle() { d3_geom_voronoiRedBlackNode(this); this.x = this.y = this.arc = this.site = this.cy = null; } function d3_geom_voronoiAttachCircle(arc) { var lArc = arc.P, rArc = arc.N; if (!lArc || !rArc) return; var lSite = lArc.site, cSite = arc.site, rSite =...
2f3d437c3b839ec7c17ce3bded386eb4b5ad4b37768ab65169bc7efe1a496fed
JavaScript
1,686
64
import "../core/document"; import "../core/ns"; d3.transform = function(string) { var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); return (d3.transform = function(string) { if (string != null) { g.setAttribute("transform", string); var t = g.transform.baseVal.consolidate(); } ret...
0e2c6d41a876def70496aa588014b98d0b044f5a2d16b942cd150acffd8576e1
JavaScript
1,703
50
import "dispatch"; d3.event = null; function d3_eventPreventDefault() { d3.event.preventDefault(); } function d3_eventSource() { var e = d3.event, s; while (s = e.sourceEvent) e = s; return e; } // Like d3.dispatch, but for custom events abstracting native UI events. These // events have a target component ...
b0884ec9247d084d073bc9ddc920753e3adca9d1a97913b2ff8b72abf591b25a
JavaScript
1,711
52
/** (July 2012, Erik Weitnauer) The html-plugin will load and display an arbitrary number of html pages. To proceed to the next, the user might either press a button on the page or a specific key. Afterwards, the page get hidden and the plugin will wait of a specified time before it proceeds. documentation: docs.jspsy...
03e1599e5e4cd95860160963dd54d982355e96203bda16b695fbe0462ecb86ad
JavaScript
1,729
42
c3_chart_internal_fn.getYFormat = function (forArc) { var $$ = this, formatForY = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.yFormat, formatForY2 = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.y2Format; return function (v, ratio, id) { var format = $...
56c250a1b2c5e3c877abc42122408e6270f84246431acf2eed14b21552ed3159
JavaScript
1,793
67
describe('c3 chart zoom', function () { 'use strict'; var chart; var args = { data: { columns: [ ['data1', 30, 200, 100, 400, 3150, 250], ['data2', 50, 20, 10, 40, 15, 6025] ] }, axis: { x: { extent...
8930f6f93df08c8c519141144b69247dda61b8d6da88ebe6735528da7c29f46d
JavaScript
1,825
64
import "../../math/abs"; function d3_geom_voronoiCell(site) { this.site = site; this.edges = []; } d3_geom_voronoiCell.prototype.prepare = function() { var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge; while (iHalfEdge--) { edge = halfEdges[iHalfEdge].edge; if (!edge.b || !e...
dd5d45df42cf18340b6977cefc19cb0afdd48cc63ba88ced69b692503d0409b5
JavaScript
1,828
57
c3_chart_fn.load = function (args) { var $$ = this.internal, config = $$.config; // update xs if specified if (args.xs) { $$.addXs(args.xs); } // update classes if exists if ('classes' in args) { Object.keys(args.classes).forEach(function (id) { config.data_classes[id...
44dfe89ea88fa2654b2a29e294dd18f9861f07e215afb82652ae528dc68071c9
JavaScript
1,881
54
import "number"; d3.interpolateString = d3_interpolateString; function d3_interpolateString(a, b) { var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, // scan index for next number in b am, // current match in a bm, // current match in b bs, // string preceding curre...
c566078a7a1adc09b3bed2d7a4872a342e3a95f8f6f9d288ee537fe41b94545f
JavaScript
1,902
46
var isValue = c3_chart_internal_fn.isValue = function (v) { return v || v === 0; }, isFunction = c3_chart_internal_fn.isFunction = function (o) { return typeof o === 'function'; }, isString = c3_chart_internal_fn.isString = function (o) { return typeof o === 'string'; }, isUndefi...
bc753f6752a761e8270f802f36b32114524d21f444ff9fd73a897b2011700564
JavaScript
1,936
80
import "../../math/abs"; import "../clip-line"; function d3_geom_voronoiClipEdges(extent) { var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e; while (i--) { e = edges[i]; if (!d3_geom_voronoiConnectEdge(e...
85ca2443fc30c6e3f6202dd80dc2c916c604077070c6855b190defe246e737db
JavaScript
1,943
81
import "../core/array"; import "../core/document"; import "../core/subclass"; import "../core/vendor"; function d3_selection(groups) { d3_subclass(groups, d3_selectionPrototype); return groups; } var d3_select = function(s, n) { return n.querySelector(s); }, d3_selectAll = function(s, n) { return n.querySelec...
1c3c43242bed750410a9e80b22f9e62eca6c17ffe43f79f57ef5881683eff111
JavaScript
1,972
60
c3_chart_fn.axis = function () {}; c3_chart_fn.axis.labels = function (labels) { var $$ = this.internal; if (arguments.length) { Object.keys(labels).forEach(function (axisId) { $$.axis.setLabelText(axisId, labels[axisId]); }); $$.axis.updateLabels(); } // TODO: return...
0308b23dc441539318f26b0a6f0daee71f1cba0496d777de3eb4ceaeba0e91bd
JavaScript
1,974
84
import "../core/class"; d3.map = function(object, f) { var map = new d3_Map; if (object instanceof d3_Map) { object.forEach(function(key, value) { map.set(key, value); }); } else if (Array.isArray(object)) { var i = -1, n = object.length, o; if (arguments.length === 1) while (++i < n)...
e8908cd864136844ebd873d9059db72f5e5f1c797b9a4f95d7e4609e3211368c
JavaScript
1,974
62
import "../core/ns"; import "selection"; d3_selectionPrototype.attr = function(name, value) { if (arguments.length < 2) { // For attr(string), return the attribute value for the first node. if (typeof name === "string") { var node = this.node(); name = d3.ns.qualify(name); return name.loca...
45b9a35e84d6577287d315a2920180b7364ed2ec3b2bb95aa1143e90d92c590d
JavaScript
1,983
60
c3_chart_fn.focus = function (targetIds) { var $$ = this.internal, candidates; targetIds = $$.mapToTargetIds(targetIds); candidates = $$.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$))), this.revert(); this.defocus(); candidates.classed(CLASS.focused, true).classed(CL...
f27fa022d1b7ff6218bfb06d00d585ab30c5fa7a28dba6fe8c93186231f37162
JavaScript
1,989
78
import "../arrays/range"; import "../arrays/sum"; import "../math/trigonometry"; import "layout"; d3.layout.pie = function() { var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0; function pie(data) { var n = data.length, values = dat...
e95858c863f5524ca18c5b960d4d0674d289178a501b2f25fa7449855fbd8b9c
JavaScript
1,998
53
import "../core/document"; import "../interpolate/interpolate"; import "transition"; import "tween"; d3_transitionPrototype.style = function(name, value, priority) { var n = arguments.length; if (n < 3) { // For style(object) or style(object, string), the object specifies the // names and values of the at...
759365bcc4781c1aeb43f14b66ac102cd2df302df44aa40d182cd8bbc600d732
JavaScript
1,999
61
describe('c3 chart class', function () { 'use strict'; var chart; var args = { data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2 prefix', 50, 20, 10, 40, 15, 25], ['data3 мужчины', 150, 120, 110, 140, 115, 125] ...
882a87a8f739642d4c6430a30cbfa79305349cec5aea77d196ee7cac1e72fc47
JavaScript
2,045
69
import "../core/noop"; import "../math/adder"; import "../math/trigonometry"; import "geo"; import "stream"; d3.geo.area = function(object) { d3_geo_areaSum = 0; d3.geo.stream(object, d3_geo_area); return d3_geo_areaSum; }; var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder; var d3_geo_area = { sphere...
78ddf0ba10ea711597ea86f4e10487c96874cd47b0c31976a694d819527691b5
JavaScript
2,046
58
import "../core/ns"; import "../interpolate/interpolate"; import "../interpolate/transform"; import "transition"; import "tween"; d3_transitionPrototype.attr = function(nameNS, value) { if (arguments.length < 2) { // For attr(object), the object specifies the names and values of the // attributes to transit...
592c0a7fcd4c8bf78bcbaad46ca6fb18193c3f4650a02a51b0c922346842ab7e
JavaScript
2,067
90
import "../core/functor"; import "../core/source"; import "../core/target"; import "../math/trigonometry"; import "arc"; import "svg"; d3.svg.chord = function() { var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcE...
d6a815785bd6bb2a93284eca1f7f633c49e97025c10774ca396b9ccc846c60ad
JavaScript
2,078
59
import "../math/transform"; import "number"; d3.interpolateTransform = d3_interpolateTransform; function d3_interpolateTransformPop(s) { return s.length ? s.pop() + "," : ""; } function d3_interpolateTranslate(ta, tb, s, q) { if (ta[0] !== tb[0] || ta[1] !== tb[1]) { var i = s.push("translate(", null, ",", n...
4f55240f274f0be6a77b6911e0a6790c8115bcba9aeba30e38df73d4e1c18b7b
JavaScript
2,088
82
import "../core/document"; import "../core/vendor"; var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, // is an interval (or frame) active? d3_timer_timeout, // is a timeout active? d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) { setTimeout(call...
8f4e74ea68e9f9f4238ce8d516d6602cb532224bd4e99eed6127f855a9ac578e
JavaScript
2,094
89
/** * A plugin which enables rendering of math equations inside * of reveal.js slides. Essentially a thin wrapper for MathJax. * * @author Hakim El Hattab */ export const MathJax2 = () => { // The reveal.js instance this plugin is attached to let deck; let defaultOptions = { messageStyle: 'none', tex2jax:...
5adba82fde9d8876ed4e71fa466f2bbb4abba2e882d9b53bc1964ebdd39597d7
JavaScript
2,116
97
import "map"; d3.nest = function() { var nest = {}, keys = [], sortKeys = [], sortValues, rollup; function map(mapType, array, depth) { if (depth >= keys.length) return rollup ? rollup.call(nest, array) : (sortValues ? array.sort(sortValues) : array); var i...
37636684c107513ea6304b474cefa2d9c2b3d21ca199fc9c333ce9f7165a8fa4
JavaScript
2,125
59
import "../core/document"; import "selection"; d3_selectionPrototype.style = function(name, value, priority) { var n = arguments.length; if (n < 3) { // For style(object) or style(object, string), the object specifies the // names and values of the attributes to set or remove. The values may be // fun...
7f3ba0d866722d6f39c363eef6522c8100c7896567c62bf026f86950150eb9ad
JavaScript
2,163
81
var chart; function refresh() { if (suspendRefresh) return; chart.load({ columns: [ ["Value"].concat(zoom(column, currentZoom, "t=>Math.round(t.avg())".toLambda())), ["xColumn"].concat(zoom(xColumn, currentZoom, "t=>t[0]".toLambda())), ] }); } function getCha...
7e2d07fbe7cf73e304222b6c79304becf0e0ec789bec2a0ba2fc3d08482ce47b
JavaScript
2,171
78
import "centroid"; // TODO Unify this code with d3.geom.polygon centroid? // TODO Enforce positive area for exterior, negative area for interior? var d3_geo_pathCentroid = { point: d3_geo_pathCentroidPoint, // For lines, weight by length. lineStart: d3_geo_pathCentroidLineStart, lineEnd: d3_geo_pathCentroidL...
bbcee6b4ecd796b7291f791cbd3785646bd1a4a099548e98d7d3eab17e88e2c7
JavaScript
2,216
77
/** * A plugin which enables rendering of math equations inside * of reveal.js slides. Essentially a thin wrapper for MathJax 3 * * @author Hakim El Hattab * @author Gerhard Burger */ export const MathJax3 = () => { // The reveal.js instance this plugin is attached to let deck; let defaultOptions = ...
03b198e7013284c902d0d74c2a4389124f053379497c6cab9c1bb861d4a4a4a5
JavaScript
2,221
72
/* jspsych-consent a jspsych plugin to create a consent page and check for response without requring an external html page Ayse Zeynep Enkavi*/ jsPsych.plugins["consent"] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { // set default values for parameters trial.conse...
190f7290c8636b8f684d3440201734d6926ff0c3aa45eefbc5c69f26c5f868af
JavaScript
2,276
81
import "../math/trigonometry"; import "cartesian"; import "geo"; import "rotation"; import "spherical"; d3.geo.circle = function() { var origin = [0, 0], angle, precision = 6, interpolate; function circle() { var center = typeof origin === "function" ? origin.apply(this, arguments) : origin,...
fc53c8354ee60a0658221baa95adc092deff6e250c6659b4d0394545a7623a8f
JavaScript
2,332
58
c3_chart_internal_fn.getClipPath = function (id) { var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0; return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")"; }; c3_chart_internal_fn.appendClip = function (parent, id) { return parent.append("clipPath").attr("id...
36f1386f4fb2bd8d658df00f0d040c2f14bbec13080d91735ba79ac4b1989128
JavaScript
2,351
79
import "../math/trigonometry"; import "compose"; import "equirectangular"; import "geo"; d3.geo.rotation = function(rotate) { rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); function forward(coordinates) { coordinates = rotate(coo...
c369ea07e39afac090a9d3e23921217a83d8aab4e20d27dc847b71807da44e63
JavaScript
2,395
64
/* * 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 .sphinxsidebarwrapper is hidden * and t...
f00fd58a6cf18220013fb173d24ed43b2195d1cee114f7bc3b1c3b1d67dcd4ce
JavaScript
2,405
105
import "../arrays/map"; import "../core/functor"; import "../math/trigonometry"; import "svg"; d3.svg.symbol = function() { var type = d3_svg_symbolType, size = d3_svg_symbolSize; function symbol(d, i) { return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle) (size.call...
7db2a43199d88cd3467b2dc9261ed7ce32a281e0fe4aa72199f24e546b5ae39f
JavaScript
2,474
105
import "../core/subclass"; import "geom"; d3.geom.polygon = function(coordinates) { d3_subclass(coordinates, d3_geom_polygonPrototype); return coordinates; }; var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; d3_geom_polygonPrototype.area = function() { var i = -1, n = this.length, a, ...
758348d7464dbecdf09969475a8353499330cf948cdc8a7f0807554d1ffe0cd1
JavaScript
2,478
71
import "geo"; import "area"; import "cartesian"; import "../math/abs"; import "../math/trigonometry"; function d3_geo_pointInPolygon(point, polygon) { var meridian = point[0], parallel = point[1], meridianNormal = [Math.sin(meridian), -Math.cos(meridian), 0], polarAngle = 0, winding = 0; d3...
6e21c14be3478475f6a3f00d0ca02709be4dbcf6e78f030213e7817f8cbd6dfb
JavaScript
2,500
95
/* 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 * * Modified by Ian Eisenberg to allow timing response to be set */ jsPsych.plugins...
1408828f1c297c4d5803cdf2a9c19c3a5d0d39d528807212cfca50dc0f9ad2d0
JavaScript
2,512
76
import "../format/collapse"; import "../format/requote"; import "selection"; d3_selectionPrototype.classed = function(name, value) { if (arguments.length < 2) { // For classed(string), return true only if the first node has the specified // class or classes. Note that even if the browser supports DOMTokenLi...
0614fd51d8db6e1fad6c5e10ef2cda0e0fe179a7282f549a2ca34370727dcc72
JavaScript
2,514
71
import "geo"; d3.geo.stream = function(object, listener) { if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { d3_geo_streamObjectType[object.type](object, listener); } else { d3_geo_streamGeometry(object, listener); } }; function d3_geo_streamGeometry(geometry, listener) { if (geomet...
5a3b3c08a7aee2c27b82cbb6a1f1407f23ccdedee65bc21faa182fdb383ff034
JavaScript
2,574
96
/** * A plugin which enables rendering of math equations inside * of reveal.js slides. Essentially a thin wrapper for KaTeX. * * @author Hakim El Hattab * @author Gerhard Burger */ export const KaTeX = () => { let deck; let defaultOptions = { version: 'latest', delimiters: [ {left: '$$', right: '$$', di...
9a89de559d0a8e5083f784073ba5f90a7cfb790ec82dcd4098af01ba6a89974c
JavaScript
2,583
111
import "../arrays/map"; import "../core/array"; import "../core/identity"; import "../math/trigonometry"; var d3_ease_default = function() { return d3_identity; }; var d3_ease = d3.map({ linear: d3_ease_default, poly: d3_ease_poly, quad: function() { return d3_ease_quad; }, cubic: function() { return d3_ease_...
177c18ef9b8c3651536895a74d45fb153729fe587437f8b8dff3721f5ccda0e7
JavaScript
2,590
54
c3_chart_fn.selected = function (targetId) { var $$ = this.internal, d3 = $$.d3; return d3.merge( $$.main.selectAll('.' + CLASS.shapes + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS.shape) .filter(function () { return d3.select(this).classed(CLASS.SELECTED); }) .ma...
5a3850ad2073022a07c0b4c6d1a3a0c35b1b56ab487190ac9a14ee91de74c5db
JavaScript
2,634
92
import "../format/format"; import "linear"; import "nice"; import "scale"; d3.scale.log = function() { return d3_scale_log(d3.scale.linear().domain([0, 1]), 10, true, [1, 10]); }; function d3_scale_log(linear, base, positive, domain) { function log(x) { return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(...
0402d08ae5509ec33de2b4d74eb1fd4db1796361a7eccd5df5e2ebdf5b13fd5d
JavaScript
2,670
92
import "../arrays/max"; import "layout"; import "hierarchy"; import "tree"; // Implements a hierarchical layout using the cluster (or dendrogram) // algorithm. d3.layout.cluster = function() { var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [1, ...
5648f084cfe9b181d14de149d570492f69f9c8d9d175ae7021b45a9dd0d68f8a
JavaScript
2,702
69
c3_chart_internal_fn.initZoom = function () { var $$ = this, d3 = $$.d3, config = $$.config, startEvent; $$.zoom = d3.behavior.zoom() .on("zoomstart", function () { startEvent = d3.event.sourceEvent; $$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null; ...
9307e3d7fb4676225b0647b0185c453c24faa82fb2070f88e03702ba08ea6f39
JavaScript
2,718
4
/*! * reveal.js Zoom plugin */ var e={id:"zoom",init:function(e){e.getRevealElement().addEventListener("mousedown",(function(n){var o=/Linux/.test(window.navigator.platform)?"ctrl":"alt",i=(e.getConfig().zoomKey?e.getConfig().zoomKey:o)+"Key",d=e.getConfig().zoomLevel?e.getConfig().zoomLevel:2;n[i]&&!e.isOverview()&&...
a14319c649c2eac4dcfe32f762c78ac5bc8416737aa07c461d5c2dface96ca77
JavaScript
2,734
97
/** * jspsych-survey-text * a jspsych plugin for free response survey questions * * Josh de Leeuw * * documentation: docs.jspsych.org * */ jsPsych.plugins['survey-text'] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { trial.preamble = typeof trial.preamble == 'und...
25856b6854d4021ce0b46fc9d60303a7221867b39db9c5eed7c4f554b2d6175f
JavaScript
2,812
91
import "../core/functor"; import "../math/trigonometry"; import "geom"; import "point"; /** * Computes the 2D convex hull of a set of points using the monotone chain * algorithm: * http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain) * * The runtime of this algorithm is O(n l...
77ff05a12b4bb503c4ecc6f1ee5628c13e9fb49002cefaba0043713444a72159
JavaScript
2,820
121
import "../core/functor"; import "../core/identity"; import "../core/true"; import "../geom/point"; import "svg"; import "line"; function d3_svg_area(projection) { var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLine...
323828fc6a54b2c383edea947d381532f73c01dd2757159acd1a925648bd13fe
JavaScript
2,838
71
c3_chart_internal_fn.getShapeIndices = function (typeFilter) { var $$ = this, config = $$.config, indices = {}, i = 0, j, k; $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$)).forEach(function (d) { for (j = 0; j < config.data_groups.length; j++) { if (config.data_groups[...
d7232b827e309587b1042af397ee337425e7cf0841f697c1116b25910ce23de5
JavaScript
2,875
89
/** * jspsych-survey-likert * a jspsych plugin for measuring items on a likert scale * * Josh de Leeuw * * documentation: docs.jspsych.org * */ jsPsych.plugins['survey-likert'] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { // default parameters for the trial ...
15f433477365577930535116b18b25fe732fe65479ece8bdda553c5dd6862dd9
JavaScript
2,878
106
import "../arrays/map"; import "../core/array"; import "../core/document"; import "../core/noop"; import "../event/event"; import "../format/requote"; import "selection"; d3_selectionPrototype.on = function(type, listener, capture) { var n = arguments.length; if (n < 3) { // For on(object) or on(object, boole...
55ff26bb30c5b0443852196c9c180bd79db00bba8287c4746b1594e8161d7f4e
JavaScript
2,882
95
import "../core/true"; import "../math/abs"; import "../math/trigonometry"; import "clip"; var d3_geo_clipAntimeridian = d3_geo_clip( d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [-π, -π / 2]); // Takes a line and cuts into visible segments. Return values: // 0: there we...
919b76dd29104ed4c3c259dd9647c56f8e46c1b1cfe6bd605156537a00adce57
JavaScript
2,897
88
import "../core/document"; import "../core/identity"; import "../core/rebind"; import "../event/drag"; import "../event/event"; import "../event/mouse"; import "../event/touch"; import "behavior"; d3.behavior.drag = function() { var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null,...
8fd02c4e937c94c9cc55cccad69626188416e412f81013583e891b9474b73e4f
JavaScript
2,915
88
c3_chart_internal_fn.load = function (targets, args) { var $$ = this; if (targets) { // filter loading targets if needed if (args.filter) { targets = targets.filter(args.filter); } // set type if args.types || args.type specified if (args.type || args.types) {...
e073e3849eed5b5639460f6131a98efbc99d13f99c62d0a9bbccda1763544791
JavaScript
2,921
111
var PdfExport = ( function( _Reveal ){ var Reveal = _Reveal; var setStylesheet = null; var installAltKeyBindings = null; function getRevealJsPath(){ var regex = /\b[^/]+\/reveal.css$/i; var script = Array.from( document.querySelectorAll( 'link' ) ).find( function( e ){ return e.attributes.href && e.attribu...
3268615c95f50342de316e5d665cfa39b4fb8974a0ac8f27839d1b1fdf0d4d25
JavaScript
2,922
117
import "../arrays/map"; import "../arrays/set"; import "selection"; d3_selectionPrototype.data = function(value, key) { var i = -1, n = this.length, group, node; // If no value is specified, return the first value. if (!arguments.length) { value = new Array(n = (group = this[0]).length); ...
68905642e756a99b45cdb27ce0172facf87cd05841e6a29f89f281cd6ae1eea9
JavaScript
2,939
87
import "../core/identity"; import "../math/trigonometry"; import "albers-usa"; import "area"; import "bounds"; import "centroid"; import "geo"; import "path-area"; import "path-bounds"; import "path-buffer"; import "path-centroid"; import "path-context"; import "projection"; import "resample"; import "stream"; d3.geo....
c8e0985b56e66476212c84c170a63ab4a495fcbae54777f1cf6adb0c68c6c934
JavaScript
2,951
4
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).RevealZoom=t()}(this,(function(){"use strict"; /*! * reveal.js Zoom plugin */var e={id:"zoom",init:function(e){e.getRevealEleme...
aafbb14d08000c4b084b9928237c4206195d3e9272edf391a5324e5dbaa0a704
JavaScript
2,963
106
/** * jspsych-reconstruction * a jspsych plugin for a reconstruction task where the subject recreates * a stimulus from memory * * Josh de Leeuw * * documentation: docs.jspsych.org * */ jsPsych.plugins['reconstruction'] = (function() { var plugin = {}; plugin.trial = function(display_element, trial) { ...
9c26423e03543aab7cb4e1eb3e59c1b04826a2c58e3acc51c15df53a381cfefd
JavaScript
3,009
110
import "../core/functor"; import "voronoi/"; import "geom"; import "point"; d3.geom.voronoi = function(points) { var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent; // @deprecated; use voronoi(data) instead. if (points) return voronoi(point...
1d8e163c44ad57147071e749bb57c34efa7b2bb36444d0cc2d7d51fc3310f047
JavaScript
3,028
103
import "../arrays/range"; import "../math/abs"; import "../math/trigonometry"; import "geo"; d3.geo.graticule = function() { var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; function graticule() { return {type: "MultiLineString", coo...
dd98c7d91922b9e6a5756e54b1460c65c892402bb52520a26683d36a0ad0ae33
JavaScript
3,056
104
import "../math/trigonometry"; import "spherical"; // General spherical polygon clipping algorithm: takes a polygon, cuts it into // visible line segments and rejoins the segments by interpolating along the // clip edge. function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) { var sub...
2bece6887bc6c442f2482ed729786fbba47ed3d3b4d1506260ed957f1039e879
JavaScript
3,086
110
describe('c3 chart domain', function () { 'use strict'; var chart; var args = { data: { columns: [ ['data1', 30, 200, 100, 400, 150, 250], ['data2', 50, 20, 10, 40, 15, 25] ] }, axis: { y: {}, y2: {} ...
fee0d69601410a7cd69cd6dea82aee7d0dfd867b15feb10623d4123a32b64beb
JavaScript
3,087
1
(function(){science={version:"1.7.0"},science.ascending=function(a,b){return a-b},science.EULER=.5772156649015329,science.expm1=function(a){return a<1e-5&&a>-0.00001?a+.5*a*a:Math.exp(a)-1},science.functor=function(a){return typeof a=="function"?a:function(){return a}},science.hypot=function(a,b){a=Math.abs(a),b=Math.a...
44c4ad6ca19763ac5fc7d12d4fe0cb1913286bdbeb45eb2be5453ecf1e1e2c0c
JavaScript
3,134
88
var setMouseEvent = window.setMouseEvent; describe('c3 chart shape bar', function () { 'use strict'; var chart, args; beforeEach(function (done) { chart = window.initChart(chart, args, done); }); describe('internal.isWithinBar', function () { describe('with normal axis', functio...
ec2d0f5430764df3d0258fa50b019e703d4e8d0fcbb50cd2fd4dbccb003efa84
JavaScript
3,155
127
/* ************************************ */ /* Setup fMRI trigger listener and functions */ /* ************************************ */ var trigger_times = [] document.onkeypress = function(evt) { evt = evt || window.event; var charCode = evt.keyCode || evt.which; var which_key = String.fromCharCode(charCode); if (...
68c515f0bd3481080ad26e805b648765bcdd0ed68a1497ea06457e1f536c3762
JavaScript
3,170
117
/** * jspsych-single-audio * Josh de Leeuw * * plugin for playing an audio file and getting a keyboard response * * documentation: docs.jspsych.org * **/ jsPsych.plugins["single-audio"] = (function() { var plugin = {}; var context = new AudioContext(); jsPsych.pluginAPI.registerPreload('single-audio',...
b4185a00390535ec264233b8a8cbd99bc11244e43c5c1a1079354593d75ac87f
JavaScript
3,192
103
/** * Newick format parser in JavaScript. * * Copyright (c) Jason Davies 2010. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the...
68ae14fc658e92f8c12208d8adf76531d976f520fcdc716fb5372f1fb8db77c4
JavaScript
3,206
140
/** * PNG\JPEG exporter for C3.js, version 0.2 * (c) 2014 Yuval Bar-On * * usage: path/to/phantomjs output options [WxH] * */ // useful python-styled string formatting, "hello {0}! Javascript is {1}".format("world", "awesome"); if (!String.prototype.format) { String.prototype.format = function() { var args = a...
0bf6c022b4e373ae7f26e9198a8c0c89d2f41302eecd0d3fd238795665c8a94d
JavaScript
3,232
108
/* http://gregfranko.com/blog/jquery-best-practices/ */ (function($) { $(function() { $('.navbar-fixed-top').headroom(); $('body').css('padding-top', $('.navbar').height() + 10); $(window).resize(function(){ $('body').css('padding-top', $('.navbar').height() + 10); }); $('[data-toggle="to...
81f82cce110c07f450d1752dd289576c0983f1b08739e95cad5b897870f91c2e
JavaScript
3,232
109
import "../math/abs"; import "../math/trigonometry"; import "cartesian"; function d3_geo_resample(project) { var δ2 = 0.5, // precision, px² cosMinDistance = Math.cos(30 * d3_radians), // cos(minimum angular distance) maxDepth = 16; function resample(stream) { return (maxDepth ? resampleRecursive ...
85b72509c6ea784f27f7ab391b808a018a4f87caefcd309167da52ff69b66106
JavaScript
3,242
81
c3_chart_internal_fn.initRegion = function () { var $$ = this; $$.region = $$.main.append('g') .attr("clip-path", $$.clipPath) .attr("class", CLASS.regions); }; c3_chart_internal_fn.updateRegion = function (duration) { var $$ = this, config = $$.config; // hide if arc type $$.region...
a100a69f5dd5860e5000833ceb6d632c4ccebd18cb18c1539cbaf575e8478a32
JavaScript
3,260
102
import "../arrays/map"; import "../arrays/range"; import "scale"; d3.scale.ordinal = function() { return d3_scale_ordinal([], {t: "range", a: [[]]}); }; function d3_scale_ordinal(domain, ranger) { var index, range, rangeBand; function scale(x) { return range[((index.get(x) || (ranger.t === "ran...