MCPcopy Create free account
hub / github.com/csskit/csskit / buildZoomEvents

Function buildZoomEvents

website/script/benchmarks.js:400–415  ·  view source on GitHub ↗
(sampledEntries, seriesBuilder, getChartRef)

Source from the content-addressed store, hash-verified

398}
399
400function buildZoomEvents(sampledEntries, seriesBuilder, getChartRef) {
401 const { min, max } = sampledTimeRange(sampledEntries);
402 return {
403 beforeZoom: function (_ctx, { xaxis }) {
404 return {
405 xaxis: {
406 min: Math.max(xaxis.min, min),
407 max: Math.min(xaxis.max, max),
408 },
409 };
410 },
411 beforeResetZoom: function (_ctx) {
412 return { xaxis: { min, max } };
413 },
414 };
415}
416
417function initializeCharts() {
418 const data = window.benchmarkData;

Callers 4

createTimeChartFunction · 0.85
createCompressionChartFunction · 0.85
createThroughputChartFunction · 0.85

Calls 1

sampledTimeRangeFunction · 0.85

Tested by

no test coverage detected