Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
history = function(_) {
var proxy,
dispatcher,
events,
url_handler;
// bare object to act as an API proxy to the internal dispatcher
proxy = Object.create(null);
// create a dispatcher using the input as a list of event names
events = Array.prototype.slice.call(arguments);
dispatcher = dispatch.apply(this, events);
// default url handler; note that the order of the arguments to d3.history
// is inverted compared to the HTML5 history API in order to parallel
// d3.dispatch
url_handler = function(data, title, url) {
if (window && window.history) {
window.history.pushState(data, title, url);
}
};
// get or set the url processing function, useful for tapping in to insert
// custom functionality
proxy.url = function(new_url_handler) {
if (new_url_handler && typeof new_url_handler !== 'function') {
console.error('optional argument to the .url() method of d3.history object must be a function');
}
if (typeof new_url_handler === 'function') {
url_handler = new_url_handler;
function Chartlet(enter, update, exit, customEvents) {
update = update || NOOP;
exit = exit || NOOP;
customEvents = customEvents || [];
const _propertyCache = {};
const _dispatch = dispatch.apply(this, ['enterDone', 'updateDone', 'exitDone'].concat(customEvents));
// getter and setter of chartlet properties
function property(name, value) {
// if functioning as a setter, set property in cache
if (arguments.length > 1) {
_propertyCache[name] = functor(value);
return this;
}
// functioning as a getter, return property accessor
return functor(_propertyCache[name]);
}
function getPropertyValue(name, d, i) {
return property(name)(d, i);
const sideEffects = (config, ps, flags) =>
dispatch.apply(this, Object.keys(config));
// .on('brush', data => {
if (userConfig && userConfig.dimensionTitles) {
console.warn('dimensionTitles passed in userConfig is deprecated. Add title to dimension object.');
entries(userConfig.dimensionTitles).forEach(function (d) {
if (config.dimensions[d.key]) {
config.dimensions[d.key].title = config.dimensions[d.key].title ? config.dimensions[d.key].title : d.value;
} else {
config.dimensions[d.key] = {
title: d.value
};
}
});
}
var eventTypes = ['render', 'resize', 'highlight', 'mark', 'brush', 'brushend', 'brushstart', 'axesreorder'].concat(keys(config));
var events = dispatch.apply(_this$4, eventTypes),
flags = {
brushable: false,
reorderable: false,
axes: false,
interactive: false,
debug: false
},
xscale = scalePoint(),
dragging = {},
axis = axisLeft().ticks(5),
ctx = {},
canvas = {};
var brush = {
modes: {
None: {
const sideEffects = (
config,
ctx,
pc,
xscale,
axis,
flags,
brushedQueue,
markedQueue,
foregroundQueue
) =>
dispatch
.apply(this, Object.keys(config))
.on('composite', d => {
ctx.foreground.globalCompositeOperation = d.value;
ctx.brushed.globalCompositeOperation = d.value;
})
.on('alpha', d => {
ctx.foreground.globalAlpha = d.value;
ctx.brushed.globalAlpha = d.value;
})
.on('brushedColor', d => {
ctx.brushed.strokeStyle = d.value;
})
.on('width', d => pc.resize())
.on('height', d => pc.resize())
.on('margin', d => pc.resize())
.on('rate', d => {
setupDispatcher(eventNames) {
this.eventNames = Skeleton.DEFAULT_EVENTS.concat(eventNames);
this.dispatcher = dispatch.apply(this, this.eventNames);
}
const sideEffects = (
config,
ctx,
pc,
xscale,
flags,
brushedQueue,
foregroundQueue
) =>
dispatch
.apply(this, keys(config))
.on('composite', d => {
ctx.foreground.globalCompositeOperation = d.value;
ctx.brushed.globalCompositeOperation = d.value;
})
.on('alpha', d => {
ctx.foreground.globalAlpha = d.value;
ctx.brushed.globalAlpha = d.value;
})
.on('brushedColor', d => {
ctx.brushed.strokeStyle = d.value;
})
.on('width', d => pc.resize())
.on('height', d => pc.resize())
.on('margin', d => pc.resize())
.on('rate', d => {
value: function setupDispatcher() {
var customEventNames = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
this._customEventNames = customEventNames;
this._eventNames = AbstractChart.DEFAULT_EVENTS.concat(customEventNames);
this.dispatcher = dispatch.apply(this, this._eventNames);
return this;
}
}, {
};
}
});
}
const eventTypes = [
'render',
'resize',
'highlight',
'brush',
'brushend',
'brushstart',
'axesreorder',
].concat(keys(config));
const events = dispatch.apply(this, eventTypes),
flags = {
brushable: false,
reorderable: false,
axes: false,
interactive: false,
debug: false,
},
xscale = scalePoint(),
dragging = {},
axis = axisLeft().ticks(5),
ctx = {},
canvas = {};
const brush = {
modes: {
None: {