code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function createTooltipItem(element) {
var xScale = element._xScale;
var yScale = element._yScale || element._scale; // handle radar || polarArea charts
var index = element._index;
var datasetIndex = element._datasetIndex;
return {
xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',
yLabel: ySc... | Returns array of strings split by newline
@param {String} value - The value to split by newline.
@returns {Array} value if newline present - Returned from String split() method
@function | createTooltipItem | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getBaseModel(tooltipOpts) {
var globalDefaults = defaults.global;
var valueOrDefault = helpers.valueOrDefault;
return {
// Positioning
xPadding: tooltipOpts.xPadding,
yPadding: tooltipOpts.yPadding,
xAlign: tooltipOpts.xAlign,
yAlign: tooltipOpts.yAlign,
// Body
bodyFontColor: tooltipOpts.bo... | Helper to get the reset model for the tooltip
@param tooltipOpts {Object} the tooltip options | getBaseModel | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getTooltipSize(tooltip, model) {
var ctx = tooltip._chart.ctx;
var height = model.yPadding * 2; // Tooltip Padding
var width = 0;
// Count of all lines in the body
var body = model.body;
var combinedBodyLength = body.reduce(function(count, bodyItem) {
return count + bodyItem.before.length + bodyItem.... | Get the size of the tooltip | getTooltipSize | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
maxLineWidth = function(line) {
width = Math.max(width, ctx.measureText(line).width + widthPadding);
} | Get the size of the tooltip | maxLineWidth | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineAlignment(tooltip, size) {
var model = tooltip._model;
var chart = tooltip._chart;
var chartArea = tooltip._chart.chartArea;
var xAlign = 'center';
var yAlign = 'center';
if (model.y < size.height) {
yAlign = 'top';
} else if (model.y > (chart.height - size.height)) {
yAlign = 'bottom';
}... | Helper to get the alignment of a tooltip given the size | determineAlignment | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getBackgroundPoint(vm, size, alignment, chart) {
// Background Position
var x = vm.x;
var y = vm.y;
var caretSize = vm.caretSize;
var caretPadding = vm.caretPadding;
var cornerRadius = vm.cornerRadius;
var xAlign = alignment.xAlign;
var yAlign = alignment.yAlign;
var paddingAndSize = caretSize + care... | Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment | getBackgroundPoint | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getBeforeAfterBodyLines(callback) {
return pushOrConcat([], splitNewlines(callback));
} | Helper to build before and after body lines | getBeforeAfterBodyLines | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
fillLineOfText = function(line) {
ctx.fillText(line, pt.x + xLinePadding, pt.y);
pt.y += bodyFontSize + bodySpacing;
} | Helper to build before and after body lines | fillLineOfText | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getBarBounds(bar) {
var vm = bar._view;
var x1, x2, y1, y2;
if (isVertical(bar)) {
// vertical
var halfWidth = vm.width / 2;
x1 = vm.x - halfWidth;
x2 = vm.x + halfWidth;
y1 = Math.min(vm.y, vm.base);
y2 = Math.max(vm.y, vm.base);
} else {
// horizontal bar
var halfHeight = vm.height / 2;
... | Helper function to get the bounds of the bar regardless of the orientation
@param bar {Chart.Element.Rectangle} the bar
@return {Bounds} bounds of the bar
@private | getBarBounds | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function cornerAt(index) {
return corners[(startCorner + index) % 4];
} | Helper function to get the bounds of the bar regardless of the orientation
@param bar {Chart.Element.Rectangle} the bar
@return {Bounds} bounds of the bar
@private | cornerAt | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
setFn = function(value, key) {
target[key] = value;
} | Applies the contents of two or more objects together into the first object.
@param {Object} target - The target object in which all objects are merged into.
@param {Object} arg1 - Object containing additional properties to merge in target.
@param {Object} argN - Additional objects containing properties to merge in targ... | setFn | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
Surrogate = function() {
this.constructor = ChartElement;
} | Basic javascript inheritance based on the model created in Backbone.js | Surrogate | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function initCanvas(canvas, config) {
var style = canvas.style;
// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
// returns null or '' if no explicit value has been set to the canvas attribute.
var renderHeight = canvas.getAttribute('height');
var renderWidth = canvas.getAttribute('... | Initializes the canvas style and render size without modifying the canvas display size,
since responsiveness is handled by the controller.resize() method. The config is used
to determine the aspect ratio to apply in case no explicit height has been specified. | initCanvas | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function decodeFill(el, index, count) {
var model = el._model || {};
var fill = model.fill;
var target;
if (fill === undefined) {
fill = !!model.backgroundColor;
}
if (fill === false || fill === null) {
return false;
}
if (fill === true) {
return 'origin';
}
target = parseFloat(fill, 10);
if (isFin... | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | decodeFill | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function computeBoundary(source) {
var model = source.el._model || {};
var scale = source.el._scale || {};
var fill = source.fill;
var target = null;
var horizontal;
if (isFinite(fill)) {
return null;
}
// Backward compatibility: until v3, we still need to support boundary values set on
// the model (scale... | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | computeBoundary | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function resolveTarget(sources, index, propagate) {
var source = sources[index];
var fill = source.fill;
var visited = [index];
var target;
if (!propagate) {
return fill;
}
while (fill !== false && visited.indexOf(fill) === -1) {
if (!isFinite(fill)) {
return fill;
}
target = sources[fill];
if (!... | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | resolveTarget | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function createMapper(source) {
var fill = source.fill;
var type = 'dataset';
if (fill === false) {
return null;
}
if (!isFinite(fill)) {
type = 'boundary';
}
return mappers[type](source);
} | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | createMapper | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function isDrawable(point) {
return point && !point.skip;
} | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | isDrawable | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function drawArea(ctx, curve0, curve1, len0, len1) {
var i;
if (!len0 || !len1) {
return;
}
// building first area curve (normal)
ctx.moveTo(curve0[0].x, curve0[0].y);
for (i = 1; i < len0; ++i) {
helpers.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);
}
// joining the two area curves
ctx.lineTo(curve1[le... | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | drawArea | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function doFill(ctx, points, mapper, view, color, loop) {
var count = points.length;
var span = view.spanGaps;
var curve0 = [];
var curve1 = [];
var len0 = 0;
var len1 = 0;
var i, ilen, index, p0, p1, d0, d1;
ctx.beginPath();
for (i = 0, ilen = (count + !!loop); i < ilen; ++i) {
index = i % count;
p0 = p... | Plugin based on discussion from the following Chart.js issues:
@see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569
@see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897 | doFill | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getBoxWidth(labelOpts, fontSize) {
return labelOpts.usePointStyle ?
fontSize * Math.SQRT2 :
labelOpts.boxWidth;
} | Helper function to get the box width based on the usePointStyle option
@param labelopts {Object} the label options on the legend
@param fontSize {Number} the label font size
@return {Number} width of the color box area | getBoxWidth | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
drawLegendBox = function(x, y, legendItem) {
if (isNaN(boxWidth) || boxWidth <= 0) {
return;
}
// Set the ctx for the box
ctx.save();
ctx.fillStyle = valueOrDefault(legendItem.fillStyle, globalDefault.defaultColor);
ctx.lineCap = valueOrDefault(legendItem.lineCap, lineDefault.borderCapSty... | IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required! | drawLegendBox | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
fillText = function(x, y, legendItem, textWidth) {
var halfFontSize = fontSize / 2;
var xLeft = boxWidth + halfFontSize + x;
var yMiddle = y + halfFontSize;
ctx.fillText(legendItem.text, xLeft, yMiddle);
if (legendItem.hidden) {
// Strikethrough the text if hidden
ctx.beginPath();
c... | IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required! | fillText | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function createNewLegendAndAttach(chart, legendOpts) {
var legend = new Legend({
ctx: chart.ctx,
options: legendOpts,
chart: chart
});
layouts.configure(chart, legend, legendOpts);
layouts.addBox(chart, legend);
chart.legend = legend;
} | Handle an event
@private
@param {IEvent} event - The event to handle
@return {Boolean} true if a change occured | createNewLegendAndAttach | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function createNewTitleBlockAndAttach(chart, titleOpts) {
var title = new Title({
ctx: chart.ctx,
options: titleOpts,
chart: chart
});
layouts.configure(chart, title, titleOpts);
layouts.addBox(chart, title);
chart.titleBlock = title;
} | IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required! | createNewTitleBlockAndAttach | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function IDMatches(meta) {
return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
} | Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those
else fall back to data.labels
@private | IDMatches | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function generateTicks(generationOptions, dataRange) {
var ticks = [];
// To get a "nice" value for the tick spacing, we will use the appropriately named
// "nice number" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
// for details.
var factor;
var p... | Generate a set of linear ticks
@param generationOptions the options used to generate the ticks
@param dataRange the range of the data
@returns {Array<Number>} array of tick values | generateTicks | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function generateTicks(generationOptions, dataRange) {
var ticks = [];
var valueOrDefault = helpers.valueOrDefault;
// Figure out what the max number of ticks we can support it is based on the size of
// the axis area. For now, we say that the minimum tick spacing in pixels must be 50
// We also limit the maximum... | Generate a set of logarithmic ticks
@param generationOptions the options used to generate the ticks
@param dataRange the range of the data
@returns {Array<Number>} array of tick values | generateTicks | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function IDMatches(meta) {
return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
} | Generate a set of logarithmic ticks
@param generationOptions the options used to generate the ticks
@param dataRange the range of the data
@returns {Array<Number>} array of tick values | IDMatches | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getValueCount(scale) {
var opts = scale.options;
return opts.angleLines.display || opts.pointLabels.display ? scale.chart.data.labels.length : 0;
} | Returns the value of the first tick.
@param {Number} value - The minimum not zero value.
@return {Number} The first tick value.
@private | getValueCount | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getPointLabelFontOptions(scale) {
var pointLabelOptions = scale.options.pointLabels;
var fontSize = helpers.valueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);
var fontStyle = helpers.valueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);
var fontFamily = ... | Returns the value of the first tick.
@param {Number} value - The minimum not zero value.
@return {Number} The first tick value.
@private | getPointLabelFontOptions | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function measureLabelSize(ctx, fontSize, label) {
if (helpers.isArray(label)) {
return {
w: helpers.longestText(ctx, ctx.font, label),
h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)
};
}
return {
w: ctx.measureText(label).width,
h: fontSize
};
} | Returns the value of the first tick.
@param {Number} value - The minimum not zero value.
@return {Number} The first tick value.
@private | measureLabelSize | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineLimits(angle, pos, size, min, max) {
if (angle === min || angle === max) {
return {
start: pos - (size / 2),
end: pos + (size / 2)
};
} else if (angle < min || angle > max) {
return {
start: pos - size - 5,
end: pos
};
}
return {
start: pos,
end: pos + size +... | Returns the value of the first tick.
@param {Number} value - The minimum not zero value.
@return {Number} The first tick value.
@private | determineLimits | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function fitWithPointLabels(scale) {
/*
* Right, this is really confusing and there is a lot of maths going on here
* The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
*
* Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
*
* Solution:
*
... | Helper function to fit a radial linear scale with point labels | fitWithPointLabels | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function fit(scale) {
var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
scale.drawingArea = Math.round(largestPossibleRadius);
scale.setCenterPoint(0, 0, 0, 0);
} | Helper function to fit a radial linear scale with no point labels | fit | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function getTextAlignForAngle(angle) {
if (angle === 0 || angle === 180) {
return 'center';
} else if (angle < 180) {
return 'left';
}
return 'right';
} | Helper function to fit a radial linear scale with no point labels | getTextAlignForAngle | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function fillText(ctx, text, position, fontSize) {
if (helpers.isArray(text)) {
var y = position.y;
var spacing = 1.5 * fontSize;
for (var i = 0; i < text.length; ++i) {
ctx.fillText(text[i], position.x, y);
y += spacing;
}
} else {
ctx.fillText(text, position.x, position.y);
}
} | Helper function to fit a radial linear scale with no point labels | fillText | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function adjustPointPositionForLabelHeight(angle, textSize, position) {
if (angle === 90 || angle === 270) {
position.y -= (textSize.h / 2);
} else if (angle > 270 || angle < 90) {
position.y -= textSize.h;
}
} | Helper function to fit a radial linear scale with no point labels | adjustPointPositionForLabelHeight | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function drawPointLabels(scale) {
var ctx = scale.ctx;
var opts = scale.options;
var angleLineOpts = opts.angleLines;
var pointLabelOpts = opts.pointLabels;
ctx.lineWidth = angleLineOpts.lineWidth;
ctx.strokeStyle = angleLineOpts.color;
var outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.... | Helper function to fit a radial linear scale with no point labels | drawPointLabels | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function drawRadiusLine(scale, gridLineOpts, radius, index) {
var ctx = scale.ctx;
ctx.strokeStyle = helpers.valueAtIndexOrDefault(gridLineOpts.color, index - 1);
ctx.lineWidth = helpers.valueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);
if (scale.options.gridLines.circular) {
// Draw circular arcs b... | Helper function to fit a radial linear scale with no point labels | drawRadiusLine | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function numberOrZero(param) {
return helpers.isNumber(param) ? param : 0;
} | Helper function to fit a radial linear scale with no point labels | numberOrZero | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function sorter(a, b) {
return a - b;
} | Set radius reductions and determine new radius and center point
@private | sorter | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function arrayUnique(items) {
var hash = {};
var out = [];
var i, ilen, item;
for (i = 0, ilen = items.length; i < ilen; ++i) {
item = items[i];
if (!hash[item]) {
hash[item] = true;
out.push(item);
}
}
return out;
} | Set radius reductions and determine new radius and center point
@private | arrayUnique | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function interpolate(table, skey, sval, tkey) {
var range = lookup(table, skey, sval);
// Note: the lookup table ALWAYS contains at least 2 items (min and max)
var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;
var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : r... | Linearly interpolates the given source `value` using the table items `skey` values and
returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')
returns the position for a timestamp equal to 42. If value is out of bounds, values at
index [0, 1] or [n - 1, n] are used for the interpolation. | interpolate | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function momentify(value, options) {
var parser = options.parser;
var format = options.parser || options.format;
if (typeof parser === 'function') {
return parser(value);
}
if (typeof value === 'string' && typeof format === 'string') {
return moment(value, format);
}
if (!(value instanceof moment)) {
va... | Convert the given value to a moment object using the given time options.
@see http://momentjs.com/docs/#/parsing/ | momentify | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function parse(input, scale) {
if (helpers.isNullOrUndef(input)) {
return null;
}
var options = scale.options.time;
var value = momentify(scale.getRightValue(input), options);
if (!value.isValid()) {
return null;
}
if (options.round) {
value.startOf(options.round);
}
return value.valueOf();
} | Convert the given value to a moment object using the given time options.
@see http://momentjs.com/docs/#/parsing/ | parse | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineStepSize(min, max, unit, capacity) {
var range = max - min;
var interval = INTERVALS[unit];
var milliseconds = interval.size;
var steps = interval.steps;
var i, ilen, factor;
if (!steps) {
return Math.ceil(range / (capacity * milliseconds));
}
for (i = 0, ilen = steps.length; i < ilen; ++i... | Returns the number of unit to skip to be able to display up to `capacity` number of ticks
in `unit` for the given `min` / `max` range and respecting the interval steps constraints. | determineStepSize | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineUnitForAutoTicks(minUnit, min, max, capacity) {
var ilen = UNITS.length;
var i, interval, factor;
for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {
interval = INTERVALS[UNITS[i]];
factor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;
if (interval.common && M... | Figures out what unit results in an appropriate number of auto-generated ticks | determineUnitForAutoTicks | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineUnitForFormatting(ticks, minUnit, min, max) {
var duration = moment.duration(moment(max).diff(moment(min)));
var ilen = UNITS.length;
var i, unit;
for (i = ilen - 1; i >= UNITS.indexOf(minUnit); i--) {
unit = UNITS[i];
if (INTERVALS[unit].common && duration.as(unit) >= ticks.length) {
retu... | Figures out what unit to format a set of ticks with | determineUnitForFormatting | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineMajorUnit(unit) {
for (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {
if (INTERVALS[UNITS[i]].common) {
return UNITS[i];
}
}
} | Figures out what unit to format a set of ticks with | determineMajorUnit | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function generate(min, max, capacity, options) {
var timeOpts = options.time;
var minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);
var major = determineMajorUnit(minor);
var stepSize = helpers.valueOrDefault(timeOpts.stepSize, timeOpts.unitStepSize);
var weekday = minor ===... | Generates a maximum of `capacity` timestamps between min and max, rounded to the
`minor` unit, aligned on the `major` unit and using the given scale time `options`.
Important: this method can return ticks outside the min and max range, it's the
responsibility of the calling code to clamp values if needed. | generate | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function computeOffsets(table, ticks, min, max, options) {
var left = 0;
var right = 0;
var upper, lower;
if (options.offset && ticks.length) {
if (!options.time.min) {
upper = ticks.length > 1 ? ticks[1] : max;
lower = ticks[0];
left = (
interpolate(table, 'time', upper, 'pos') -
interpolate(ta... | Returns the right and left offsets from edges in the form of {left, right}.
Offsets are added when the `offset` option is true. | computeOffsets | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function ticksFromTimestamps(values, majorUnit) {
var ticks = [];
var i, ilen, value, major;
for (i = 0, ilen = values.length; i < ilen; ++i) {
value = values[i];
major = majorUnit ? value === +moment(value).startOf(majorUnit) : false;
ticks.push({
value: value,
major: major
});
}
return ticks;
} | Returns the right and left offsets from edges in the form of {left, right}.
Offsets are added when the `offset` option is true. | ticksFromTimestamps | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function determineLabelFormat(data, timeOpts) {
var i, momentDate, hasTime;
var ilen = data.length;
// find the label with the most parts (milliseconds, minutes, etc.)
// format all labels with the same level of detail as the most specific label
for (i = 0; i < ilen; i++) {
momentDate = momentify(data[i], timeO... | Returns the right and left offsets from edges in the form of {left, right}.
Offsets are added when the `offset` option is true. | determineLabelFormat | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.bundle.js | MIT |
function rgb2hsl(rgb) {
var r = rgb[0]/255,
g = rgb[1]/255,
b = rgb[2]/255,
min = Math.min(r, g, b),
max = Math.max(r, g, b),
delta = max - min,
h, s, l;
if (max == min)
h = 0;
else if (r == max)
h = (g - b) / delta;
else if (g == max)
h = 2 + (b - r) / delta;
... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2hsl | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2hsv(rgb) {
var r = rgb[0],
g = rgb[1],
b = rgb[2],
min = Math.min(r, g, b),
max = Math.max(r, g, b),
delta = max - min,
h, s, v;
if (max == 0)
s = 0;
else
s = (delta/max * 1000)/10;
if (max == min)
h = 0;
else if (r == max)
h = (g - b) / delta... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2hsv | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2hwb(rgb) {
var r = rgb[0],
g = rgb[1],
b = rgb[2],
h = rgb2hsl(rgb)[0],
w = 1/255 * Math.min(r, Math.min(g, b)),
b = 1 - 1/255 * Math.max(r, Math.max(g, b));
return [h, w * 100, b * 100];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2hwb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2cmyk(rgb) {
var r = rgb[0] / 255,
g = rgb[1] / 255,
b = rgb[2] / 255,
c, m, y, k;
k = Math.min(1 - r, 1 - g, 1 - b);
c = (1 - r - k) / (1 - k) || 0;
m = (1 - g - k) / (1 - k) || 0;
y = (1 - b - k) / (1 - k) || 0;
return [c * 100, m * 100, y * 100, k * 100];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2cmyk | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2keyword(rgb) {
return reverseKeywords[JSON.stringify(rgb)];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2keyword | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2xyz(rgb) {
var r = rgb[0] / 255,
g = rgb[1] / 255,
b = rgb[2] / 255;
// assume sRGB
r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b ... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2xyz | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2lab(rgb) {
var xyz = rgb2xyz(rgb),
x = xyz[0],
y = xyz[1],
z = xyz[2],
l, a, b;
x /= 95.047;
y /= 100;
z /= 108.883;
x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
z = z > 0.0088... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2lab | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function rgb2lch(args) {
return lab2lch(rgb2lab(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | rgb2lch | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsl2rgb(hsl) {
var h = hsl[0] / 360,
s = hsl[1] / 100,
l = hsl[2] / 100,
t1, t2, t3, rgb, val;
if (s == 0) {
val = l * 255;
return [val, val, val];
}
if (l < 0.5)
t2 = l * (1 + s);
else
t2 = l + s - l * s;
t1 = 2 * l - t2;
rgb = [0, 0, 0];
for (var i = 0; i ... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsl2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsl2hsv(hsl) {
var h = hsl[0],
s = hsl[1] / 100,
l = hsl[2] / 100,
sv, v;
if(l === 0) {
// no need to do calc on black
// also avoids divide by 0 error
return [0, 0, 0];
}
l *= 2;
s *= (l <= 1) ? l : 2 - l;
v = (l + s) / 2;
sv = (2 * s) / (l + s);
return [h... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsl2hsv | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsl2hwb(args) {
return rgb2hwb(hsl2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsl2hwb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsl2cmyk(args) {
return rgb2cmyk(hsl2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsl2cmyk | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsl2keyword(args) {
return rgb2keyword(hsl2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsl2keyword | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsv2rgb(hsv) {
var h = hsv[0] / 60,
s = hsv[1] / 100,
v = hsv[2] / 100,
hi = Math.floor(h) % 6;
var f = h - Math.floor(h),
p = 255 * v * (1 - s),
q = 255 * v * (1 - (s * f)),
t = 255 * v * (1 - (s * (1 - f))),
v = 255 * v;
switch(hi) {
case 0:
return ... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsv2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsv2hsl(hsv) {
var h = hsv[0],
s = hsv[1] / 100,
v = hsv[2] / 100,
sl, l;
l = (2 - s) * v;
sl = s * v;
sl /= (l <= 1) ? l : 2 - l;
sl = sl || 0;
l /= 2;
return [h, sl * 100, l * 100];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsv2hsl | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsv2hwb(args) {
return rgb2hwb(hsv2rgb(args))
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsv2hwb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsv2cmyk(args) {
return rgb2cmyk(hsv2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsv2cmyk | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hsv2keyword(args) {
return rgb2keyword(hsv2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hsv2keyword | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hwb2rgb(hwb) {
var h = hwb[0] / 360,
wh = hwb[1] / 100,
bl = hwb[2] / 100,
ratio = wh + bl,
i, v, f, n;
// wh + bl cant be > 1
if (ratio > 1) {
wh /= ratio;
bl /= ratio;
}
i = Math.floor(6 * h);
v = 1 - bl;
f = 6 * h - i;
if ((i & 0x01) != 0) {
f = 1 - f;
... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hwb2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hwb2hsl(args) {
return rgb2hsl(hwb2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hwb2hsl | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hwb2hsv(args) {
return rgb2hsv(hwb2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hwb2hsv | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hwb2cmyk(args) {
return rgb2cmyk(hwb2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hwb2cmyk | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function hwb2keyword(args) {
return rgb2keyword(hwb2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | hwb2keyword | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function cmyk2rgb(cmyk) {
var c = cmyk[0] / 100,
m = cmyk[1] / 100,
y = cmyk[2] / 100,
k = cmyk[3] / 100,
r, g, b;
r = 1 - Math.min(1, c * (1 - k) + k);
g = 1 - Math.min(1, m * (1 - k) + k);
b = 1 - Math.min(1, y * (1 - k) + k);
return [r * 255, g * 255, b * 255];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | cmyk2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function cmyk2hsl(args) {
return rgb2hsl(cmyk2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | cmyk2hsl | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function cmyk2hsv(args) {
return rgb2hsv(cmyk2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | cmyk2hsv | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function cmyk2hwb(args) {
return rgb2hwb(cmyk2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | cmyk2hwb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function cmyk2keyword(args) {
return rgb2keyword(cmyk2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | cmyk2keyword | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function xyz2rgb(xyz) {
var x = xyz[0] / 100,
y = xyz[1] / 100,
z = xyz[2] / 100,
r, g, b;
r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
// assume sRGB
r = r > 0.0031308 ? ((1.055 * Math... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | xyz2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function xyz2lab(xyz) {
var x = xyz[0],
y = xyz[1],
z = xyz[2],
l, a, b;
x /= 95.047;
y /= 100;
z /= 108.883;
x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | xyz2lab | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function xyz2lch(args) {
return lab2lch(xyz2lab(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | xyz2lch | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function lab2xyz(lab) {
var l = lab[0],
a = lab[1],
b = lab[2],
x, y, z, y2;
if (l <= 8) {
y = (l * 100) / 903.3;
y2 = (7.787 * (y / 100)) + (16 / 116);
} else {
y = 100 * Math.pow((l + 16) / 116, 3);
y2 = Math.pow(y / 100, 1/3);
}
x = x / 95.047 <= 0.008856 ? x = (95.047 *... | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | lab2xyz | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function lab2lch(lab) {
var l = lab[0],
a = lab[1],
b = lab[2],
hr, h, c;
hr = Math.atan2(b, a);
h = hr * 360 / 2 / Math.PI;
if (h < 0) {
h += 360;
}
c = Math.sqrt(a * a + b * b);
return [l, c, h];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | lab2lch | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function lab2rgb(args) {
return xyz2rgb(lab2xyz(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | lab2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function lch2lab(lch) {
var l = lch[0],
c = lch[1],
h = lch[2],
a, b, hr;
hr = h / 360 * 2 * Math.PI;
a = c * Math.cos(hr);
b = c * Math.sin(hr);
return [l, a, b];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | lch2lab | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function lch2xyz(args) {
return lab2xyz(lch2lab(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | lch2xyz | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function lch2rgb(args) {
return lab2rgb(lch2lab(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | lch2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2rgb(keyword) {
return cssKeywords[keyword];
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2rgb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2hsl(args) {
return rgb2hsl(keyword2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2hsl | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2hsv(args) {
return rgb2hsv(keyword2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2hsv | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2hwb(args) {
return rgb2hwb(keyword2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2hwb | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2cmyk(args) {
return rgb2cmyk(keyword2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2cmyk | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2lab(args) {
return rgb2lab(keyword2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2lab | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
function keyword2xyz(args) {
return rgb2xyz(keyword2rgb(args));
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | keyword2xyz | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
convert = function() {
return new Converter();
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | convert | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
Converter = function() {
this.convs = {};
} | Ported from sass implementation in C
https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209 | Converter | javascript | syzoj/syzoj | static/cdnjs/Chart.js/2.7.3/Chart.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/Chart.js/2.7.3/Chart.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.