svelte-heatmap
Advanced tools
Comparing version 1.0.1 to 1.0.2
'use strict'; | ||
var internal = require('svelte/internal'); | ||
function noop() { } | ||
function run(fn) { | ||
return fn(); | ||
} | ||
function blank_object() { | ||
return Object.create(null); | ||
} | ||
function run_all(fns) { | ||
fns.forEach(run); | ||
} | ||
function is_function(thing) { | ||
return typeof thing === 'function'; | ||
} | ||
function safe_not_equal(a, b) { | ||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); | ||
} | ||
function append(target, node) { | ||
target.appendChild(node); | ||
} | ||
function insert(target, node, anchor) { | ||
target.insertBefore(node, anchor || null); | ||
} | ||
function detach(node) { | ||
node.parentNode.removeChild(node); | ||
} | ||
function destroy_each(iterations, detaching) { | ||
for (let i = 0; i < iterations.length; i += 1) { | ||
if (iterations[i]) | ||
iterations[i].d(detaching); | ||
} | ||
} | ||
function svg_element(name) { | ||
return document.createElementNS('http://www.w3.org/2000/svg', name); | ||
} | ||
function text(data) { | ||
return document.createTextNode(data); | ||
} | ||
function empty() { | ||
return text(''); | ||
} | ||
function attr(node, attribute, value) { | ||
if (value == null) | ||
node.removeAttribute(attribute); | ||
else if (node.getAttribute(attribute) !== value) | ||
node.setAttribute(attribute, value); | ||
} | ||
function children(element) { | ||
return Array.from(element.childNodes); | ||
} | ||
function set_data(text, data) { | ||
data = '' + data; | ||
if (text.data !== data) | ||
text.data = data; | ||
} | ||
let current_component; | ||
function set_current_component(component) { | ||
current_component = component; | ||
} | ||
const dirty_components = []; | ||
const binding_callbacks = []; | ||
const render_callbacks = []; | ||
const flush_callbacks = []; | ||
const resolved_promise = Promise.resolve(); | ||
let update_scheduled = false; | ||
function schedule_update() { | ||
if (!update_scheduled) { | ||
update_scheduled = true; | ||
resolved_promise.then(flush); | ||
} | ||
} | ||
function add_render_callback(fn) { | ||
render_callbacks.push(fn); | ||
} | ||
let flushing = false; | ||
const seen_callbacks = new Set(); | ||
function flush() { | ||
if (flushing) | ||
return; | ||
flushing = true; | ||
do { | ||
// first, call beforeUpdate functions | ||
// and update components | ||
for (let i = 0; i < dirty_components.length; i += 1) { | ||
const component = dirty_components[i]; | ||
set_current_component(component); | ||
update(component.$$); | ||
} | ||
dirty_components.length = 0; | ||
while (binding_callbacks.length) | ||
binding_callbacks.pop()(); | ||
// then, once components are updated, call | ||
// afterUpdate functions. This may cause | ||
// subsequent updates... | ||
for (let i = 0; i < render_callbacks.length; i += 1) { | ||
const callback = render_callbacks[i]; | ||
if (!seen_callbacks.has(callback)) { | ||
// ...so guard against infinite loops | ||
seen_callbacks.add(callback); | ||
callback(); | ||
} | ||
} | ||
render_callbacks.length = 0; | ||
} while (dirty_components.length); | ||
while (flush_callbacks.length) { | ||
flush_callbacks.pop()(); | ||
} | ||
update_scheduled = false; | ||
flushing = false; | ||
seen_callbacks.clear(); | ||
} | ||
function update($$) { | ||
if ($$.fragment !== null) { | ||
$$.update(); | ||
run_all($$.before_update); | ||
const dirty = $$.dirty; | ||
$$.dirty = [-1]; | ||
$$.fragment && $$.fragment.p($$.ctx, dirty); | ||
$$.after_update.forEach(add_render_callback); | ||
} | ||
} | ||
const outroing = new Set(); | ||
let outros; | ||
function group_outros() { | ||
outros = { | ||
r: 0, | ||
c: [], | ||
p: outros // parent group | ||
}; | ||
} | ||
function check_outros() { | ||
if (!outros.r) { | ||
run_all(outros.c); | ||
} | ||
outros = outros.p; | ||
} | ||
function transition_in(block, local) { | ||
if (block && block.i) { | ||
outroing.delete(block); | ||
block.i(local); | ||
} | ||
} | ||
function transition_out(block, local, detach, callback) { | ||
if (block && block.o) { | ||
if (outroing.has(block)) | ||
return; | ||
outroing.add(block); | ||
outros.c.push(() => { | ||
outroing.delete(block); | ||
if (callback) { | ||
if (detach) | ||
block.d(1); | ||
callback(); | ||
} | ||
}); | ||
block.o(local); | ||
} | ||
} | ||
function create_component(block) { | ||
block && block.c(); | ||
} | ||
function mount_component(component, target, anchor) { | ||
const { fragment, on_mount, on_destroy, after_update } = component.$$; | ||
fragment && fragment.m(target, anchor); | ||
// onMount happens before the initial afterUpdate | ||
add_render_callback(() => { | ||
const new_on_destroy = on_mount.map(run).filter(is_function); | ||
if (on_destroy) { | ||
on_destroy.push(...new_on_destroy); | ||
} | ||
else { | ||
// Edge case - component was destroyed immediately, | ||
// most likely as a result of a binding initialising | ||
run_all(new_on_destroy); | ||
} | ||
component.$$.on_mount = []; | ||
}); | ||
after_update.forEach(add_render_callback); | ||
} | ||
function destroy_component(component, detaching) { | ||
const $$ = component.$$; | ||
if ($$.fragment !== null) { | ||
run_all($$.on_destroy); | ||
$$.fragment && $$.fragment.d(detaching); | ||
// TODO null out other refs, including component.$$ (but need to | ||
// preserve final state?) | ||
$$.on_destroy = $$.fragment = null; | ||
$$.ctx = []; | ||
} | ||
} | ||
function make_dirty(component, i) { | ||
if (component.$$.dirty[0] === -1) { | ||
dirty_components.push(component); | ||
schedule_update(); | ||
component.$$.dirty.fill(0); | ||
} | ||
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); | ||
} | ||
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { | ||
const parent_component = current_component; | ||
set_current_component(component); | ||
const prop_values = options.props || {}; | ||
const $$ = component.$$ = { | ||
fragment: null, | ||
ctx: null, | ||
// state | ||
props, | ||
update: noop, | ||
not_equal, | ||
bound: blank_object(), | ||
// lifecycle | ||
on_mount: [], | ||
on_destroy: [], | ||
before_update: [], | ||
after_update: [], | ||
context: new Map(parent_component ? parent_component.$$.context : []), | ||
// everything else | ||
callbacks: blank_object(), | ||
dirty | ||
}; | ||
let ready = false; | ||
$$.ctx = instance | ||
? instance(component, prop_values, (i, ret, ...rest) => { | ||
const value = rest.length ? rest[0] : ret; | ||
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { | ||
if ($$.bound[i]) | ||
$$.bound[i](value); | ||
if (ready) | ||
make_dirty(component, i); | ||
} | ||
return ret; | ||
}) | ||
: []; | ||
$$.update(); | ||
ready = true; | ||
run_all($$.before_update); | ||
// `false` as a special case of no DOM component | ||
$$.fragment = create_fragment ? create_fragment($$.ctx) : false; | ||
if (options.target) { | ||
if (options.hydrate) { | ||
const nodes = children(options.target); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
$$.fragment && $$.fragment.l(nodes); | ||
nodes.forEach(detach); | ||
} | ||
else { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
$$.fragment && $$.fragment.c(); | ||
} | ||
if (options.intro) | ||
transition_in(component.$$.fragment); | ||
mount_component(component, options.target, options.anchor); | ||
flush(); | ||
} | ||
set_current_component(parent_component); | ||
} | ||
class SvelteComponent { | ||
$destroy() { | ||
destroy_component(this, 1); | ||
this.$destroy = noop; | ||
} | ||
$on(type, callback) { | ||
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); | ||
callbacks.push(callback); | ||
return () => { | ||
const index = callbacks.indexOf(callback); | ||
if (index !== -1) | ||
callbacks.splice(index, 1); | ||
}; | ||
} | ||
$set() { | ||
// overridden by instance, if it has props | ||
} | ||
} | ||
/** | ||
@@ -268,3 +543,3 @@ * Get the last day of the month. | ||
/* src/views/Cell.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Cell.svelte generated by Svelte v3.23.0 */ | ||
@@ -277,52 +552,52 @@ function create_fragment(ctx) { | ||
c() { | ||
rect = internal.svg_element("rect"); | ||
internal.attr(rect, "data-date", rect_data_date_value = stringifyDate(/*date*/ ctx[1])); | ||
internal.attr(rect, "data-value", /*value*/ ctx[4]); | ||
internal.attr(rect, "fill", /*color*/ ctx[0]); | ||
internal.attr(rect, "height", /*size*/ ctx[3]); | ||
internal.attr(rect, "rx", /*radius*/ ctx[2]); | ||
internal.attr(rect, "width", /*size*/ ctx[3]); | ||
internal.attr(rect, "x", /*x*/ ctx[5]); | ||
internal.attr(rect, "y", /*y*/ ctx[6]); | ||
rect = svg_element("rect"); | ||
attr(rect, "data-date", rect_data_date_value = stringifyDate(/*date*/ ctx[1])); | ||
attr(rect, "data-value", /*value*/ ctx[4]); | ||
attr(rect, "fill", /*color*/ ctx[0]); | ||
attr(rect, "height", /*size*/ ctx[3]); | ||
attr(rect, "rx", /*radius*/ ctx[2]); | ||
attr(rect, "width", /*size*/ ctx[3]); | ||
attr(rect, "x", /*x*/ ctx[5]); | ||
attr(rect, "y", /*y*/ ctx[6]); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, rect, anchor); | ||
insert(target, rect, anchor); | ||
}, | ||
p(ctx, [dirty]) { | ||
if (dirty & /*date*/ 2 && rect_data_date_value !== (rect_data_date_value = stringifyDate(/*date*/ ctx[1]))) { | ||
internal.attr(rect, "data-date", rect_data_date_value); | ||
attr(rect, "data-date", rect_data_date_value); | ||
} | ||
if (dirty & /*value*/ 16) { | ||
internal.attr(rect, "data-value", /*value*/ ctx[4]); | ||
attr(rect, "data-value", /*value*/ ctx[4]); | ||
} | ||
if (dirty & /*color*/ 1) { | ||
internal.attr(rect, "fill", /*color*/ ctx[0]); | ||
attr(rect, "fill", /*color*/ ctx[0]); | ||
} | ||
if (dirty & /*size*/ 8) { | ||
internal.attr(rect, "height", /*size*/ ctx[3]); | ||
attr(rect, "height", /*size*/ ctx[3]); | ||
} | ||
if (dirty & /*radius*/ 4) { | ||
internal.attr(rect, "rx", /*radius*/ ctx[2]); | ||
attr(rect, "rx", /*radius*/ ctx[2]); | ||
} | ||
if (dirty & /*size*/ 8) { | ||
internal.attr(rect, "width", /*size*/ ctx[3]); | ||
attr(rect, "width", /*size*/ ctx[3]); | ||
} | ||
if (dirty & /*x*/ 32) { | ||
internal.attr(rect, "x", /*x*/ ctx[5]); | ||
attr(rect, "x", /*x*/ ctx[5]); | ||
} | ||
if (dirty & /*y*/ 64) { | ||
internal.attr(rect, "y", /*y*/ ctx[6]); | ||
attr(rect, "y", /*y*/ ctx[6]); | ||
} | ||
}, | ||
i: internal.noop, | ||
o: internal.noop, | ||
i: noop, | ||
o: noop, | ||
d(detaching) { | ||
if (detaching) internal.detach(rect); | ||
if (detaching) detach(rect); | ||
} | ||
@@ -354,7 +629,7 @@ }; | ||
class Cell extends internal.SvelteComponent { | ||
class Cell extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init(this, options, instance, create_fragment, internal.safe_not_equal, { | ||
init(this, options, instance, create_fragment, safe_not_equal, { | ||
color: 0, | ||
@@ -371,3 +646,3 @@ date: 1, | ||
/* src/views/Month.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Month.svelte generated by Svelte v3.23.0 */ | ||
@@ -398,6 +673,6 @@ function get_each_context(ctx, list, i) { | ||
c() { | ||
internal.create_component(cell.$$.fragment); | ||
create_component(cell.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(cell, target, anchor); | ||
mount_component(cell, target, anchor); | ||
current = true; | ||
@@ -418,11 +693,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(cell.$$.fragment, local); | ||
transition_in(cell.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(cell.$$.fragment, local); | ||
transition_out(cell.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(cell, detaching); | ||
destroy_component(cell, detaching); | ||
} | ||
@@ -440,32 +715,32 @@ }; | ||
c() { | ||
text_1 = internal.svg_element("text"); | ||
t = internal.text(t_value); | ||
internal.attr(text_1, "alignment-baseline", "hanging"); | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
internal.attr(text_1, "x", "0"); | ||
internal.attr(text_1, "y", "0"); | ||
text_1 = svg_element("text"); | ||
t = text(t_value); | ||
attr(text_1, "alignment-baseline", "hanging"); | ||
attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
attr(text_1, "x", "0"); | ||
attr(text_1, "y", "0"); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, text_1, anchor); | ||
internal.append(text_1, t); | ||
insert(target, text_1, anchor); | ||
append(text_1, t); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty & /*monthLabels, days*/ 264 && t_value !== (t_value = /*monthLabels*/ ctx[8][/*days*/ ctx[3][0].date.getMonth()] + "")) internal.set_data(t, t_value); | ||
if (dirty & /*monthLabels, days*/ 264 && t_value !== (t_value = /*monthLabels*/ ctx[8][/*days*/ ctx[3][0].date.getMonth()] + "")) set_data(t, t_value); | ||
if (dirty & /*fontColor*/ 16) { | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
} | ||
if (dirty & /*fontFamily*/ 32) { | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
} | ||
if (dirty & /*fontSize*/ 64) { | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(text_1); | ||
if (detaching) detach(text_1); | ||
} | ||
@@ -487,3 +762,3 @@ }; | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -496,3 +771,3 @@ }); | ||
c() { | ||
g = internal.svg_element("g"); | ||
g = svg_element("g"); | ||
@@ -503,8 +778,8 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_1_anchor = internal.empty(); | ||
each_1_anchor = empty(); | ||
if (if_block) if_block.c(); | ||
internal.attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[9]}, 0)`); | ||
attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[9]}, 0)`); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, g, anchor); | ||
insert(target, g, anchor); | ||
@@ -515,3 +790,3 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.append(g, each_1_anchor); | ||
append(g, each_1_anchor); | ||
if (if_block) if_block.m(g, null); | ||
@@ -530,7 +805,7 @@ current = true; | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(g, each_1_anchor); | ||
@@ -540,3 +815,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -547,3 +822,3 @@ for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
@@ -565,3 +840,3 @@ | ||
if (!current || dirty & /*translation*/ 512 && g_transform_value !== (g_transform_value = `translate(${/*translation*/ ctx[9]}, 0)`)) { | ||
internal.attr(g, "transform", g_transform_value); | ||
attr(g, "transform", g_transform_value); | ||
} | ||
@@ -573,3 +848,3 @@ }, | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -583,3 +858,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -590,4 +865,4 @@ | ||
d(detaching) { | ||
if (detaching) internal.detach(g); | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) detach(g); | ||
destroy_each(each_blocks, detaching); | ||
if (if_block) if_block.d(); | ||
@@ -652,7 +927,7 @@ } | ||
class Month extends internal.SvelteComponent { | ||
class Month extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init(this, options, instance$1, create_fragment$1, internal.safe_not_equal, { | ||
init(this, options, instance$1, create_fragment$1, safe_not_equal, { | ||
cellGap: 10, | ||
@@ -674,3 +949,3 @@ cellRadius: 0, | ||
/* src/views/Week.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Week.svelte generated by Svelte v3.23.0 */ | ||
@@ -701,6 +976,6 @@ function get_each_context$1(ctx, list, i) { | ||
c() { | ||
internal.create_component(cell.$$.fragment); | ||
create_component(cell.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(cell, target, anchor); | ||
mount_component(cell, target, anchor); | ||
current = true; | ||
@@ -720,11 +995,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(cell.$$.fragment, local); | ||
transition_in(cell.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(cell.$$.fragment, local); | ||
transition_out(cell.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(cell, detaching); | ||
destroy_component(cell, detaching); | ||
} | ||
@@ -745,3 +1020,3 @@ }; | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -752,3 +1027,3 @@ }); | ||
c() { | ||
g = internal.svg_element("g"); | ||
g = svg_element("g"); | ||
@@ -759,6 +1034,6 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[5]}, ${/*monthLabelHeight*/ ctx[4]})`); | ||
attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[5]}, ${/*monthLabelHeight*/ ctx[4]})`); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, g, anchor); | ||
insert(target, g, anchor); | ||
@@ -781,7 +1056,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block$1(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(g, null); | ||
@@ -791,3 +1066,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -798,7 +1073,7 @@ for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
if (!current || dirty & /*translation, monthLabelHeight*/ 48 && g_transform_value !== (g_transform_value = `translate(${/*translation*/ ctx[5]}, ${/*monthLabelHeight*/ ctx[4]})`)) { | ||
internal.attr(g, "transform", g_transform_value); | ||
attr(g, "transform", g_transform_value); | ||
} | ||
@@ -810,3 +1085,3 @@ }, | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -820,3 +1095,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -827,4 +1102,4 @@ | ||
d(detaching) { | ||
if (detaching) internal.detach(g); | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) detach(g); | ||
destroy_each(each_blocks, detaching); | ||
} | ||
@@ -862,7 +1137,7 @@ }; | ||
class Week extends internal.SvelteComponent { | ||
class Week extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init(this, options, instance$2, create_fragment$2, internal.safe_not_equal, { | ||
init(this, options, instance$2, create_fragment$2, safe_not_equal, { | ||
cellRadius: 0, | ||
@@ -878,3 +1153,3 @@ cellRect: 1, | ||
/* src/SvelteHeatmap.svelte generated by Svelte v3.20.1 */ | ||
/* src/SvelteHeatmap.svelte generated by Svelte v3.23.0 */ | ||
@@ -915,3 +1190,3 @@ function get_each_context_1(ctx, list, i) { | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -923,3 +1198,3 @@ }); | ||
if (if_block) if_block.c(); | ||
g = internal.svg_element("g"); | ||
g = svg_element("g"); | ||
@@ -930,7 +1205,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.attr(g, "transform", g_transform_value = `translate(${/*dayLabelWidth*/ ctx[3]})`); | ||
attr(g, "transform", g_transform_value = `translate(${/*dayLabelWidth*/ ctx[3]})`); | ||
}, | ||
m(target, anchor) { | ||
if (if_block) if_block.m(target, anchor); | ||
internal.insert(target, g, anchor); | ||
insert(target, g, anchor); | ||
@@ -966,7 +1241,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block_1(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(g, null); | ||
@@ -976,3 +1251,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -983,7 +1258,7 @@ for (i = each_value_1.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
if (!current || dirty[0] & /*dayLabelWidth*/ 8 && g_transform_value !== (g_transform_value = `translate(${/*dayLabelWidth*/ ctx[3]})`)) { | ||
internal.attr(g, "transform", g_transform_value); | ||
attr(g, "transform", g_transform_value); | ||
} | ||
@@ -995,3 +1270,3 @@ }, | ||
for (let i = 0; i < each_value_1.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -1005,3 +1280,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -1013,4 +1288,4 @@ | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) internal.detach(g); | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) detach(g); | ||
destroy_each(each_blocks, detaching); | ||
} | ||
@@ -1031,3 +1306,3 @@ }; | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -1042,3 +1317,3 @@ }); | ||
each_1_anchor = internal.empty(); | ||
each_1_anchor = empty(); | ||
}, | ||
@@ -1050,3 +1325,3 @@ m(target, anchor) { | ||
internal.insert(target, each_1_anchor, anchor); | ||
insert(target, each_1_anchor, anchor); | ||
current = true; | ||
@@ -1064,7 +1339,7 @@ }, | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block$2(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); | ||
@@ -1074,3 +1349,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -1081,3 +1356,3 @@ for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
@@ -1089,3 +1364,3 @@ }, | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -1099,3 +1374,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -1106,4 +1381,4 @@ | ||
d(detaching) { | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) internal.detach(each_1_anchor); | ||
destroy_each(each_blocks, detaching); | ||
if (detaching) detach(each_1_anchor); | ||
} | ||
@@ -1129,3 +1404,3 @@ }; | ||
each_1_anchor = internal.empty(); | ||
each_1_anchor = empty(); | ||
}, | ||
@@ -1137,3 +1412,3 @@ m(target, anchor) { | ||
internal.insert(target, each_1_anchor, anchor); | ||
insert(target, each_1_anchor, anchor); | ||
}, | ||
@@ -1165,4 +1440,4 @@ p(ctx, dirty) { | ||
d(detaching) { | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) internal.detach(each_1_anchor); | ||
destroy_each(each_blocks, detaching); | ||
if (detaching) detach(each_1_anchor); | ||
} | ||
@@ -1181,36 +1456,36 @@ }; | ||
c() { | ||
text_1 = internal.svg_element("text"); | ||
t = internal.text(t_value); | ||
internal.attr(text_1, "alignment-baseline", "middle"); | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
internal.attr(text_1, "x", "0"); | ||
internal.attr(text_1, "y", text_1_y_value = /*dayLabelPosition*/ ctx[16](/*index*/ ctx[28])); | ||
text_1 = svg_element("text"); | ||
t = text(t_value); | ||
attr(text_1, "alignment-baseline", "middle"); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "x", "0"); | ||
attr(text_1, "y", text_1_y_value = /*dayLabelPosition*/ ctx[16](/*index*/ ctx[28])); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, text_1, anchor); | ||
internal.append(text_1, t); | ||
insert(target, text_1, anchor); | ||
append(text_1, t); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*dayLabels*/ 16 && t_value !== (t_value = /*label*/ ctx[30] + "")) internal.set_data(t, t_value); | ||
if (dirty[0] & /*dayLabels*/ 16 && t_value !== (t_value = /*label*/ ctx[30] + "")) set_data(t, t_value); | ||
if (dirty[0] & /*fontColor*/ 32) { | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
} | ||
if (dirty[0] & /*fontFamily*/ 64) { | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
} | ||
if (dirty[0] & /*fontSize*/ 128) { | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
} | ||
if (dirty[0] & /*dayLabelPosition*/ 65536 && text_1_y_value !== (text_1_y_value = /*dayLabelPosition*/ ctx[16](/*index*/ ctx[28]))) { | ||
internal.attr(text_1, "y", text_1_y_value); | ||
attr(text_1, "y", text_1_y_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(text_1); | ||
if (detaching) detach(text_1); | ||
} | ||
@@ -1229,35 +1504,35 @@ }; | ||
c() { | ||
text_1 = internal.svg_element("text"); | ||
t = internal.text(t_value); | ||
internal.attr(text_1, "alignment-baseline", "hanging"); | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
internal.attr(text_1, "x", text_1_x_value = /*cellRect*/ ctx[12] * /*index*/ ctx[28]); | ||
text_1 = svg_element("text"); | ||
t = text(t_value); | ||
attr(text_1, "alignment-baseline", "hanging"); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "x", text_1_x_value = /*cellRect*/ ctx[12] * /*index*/ ctx[28]); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, text_1, anchor); | ||
internal.append(text_1, t); | ||
insert(target, text_1, anchor); | ||
append(text_1, t); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*monthLabels, chunks*/ 9216 && t_value !== (t_value = /*monthLabels*/ ctx[10][/*chunk*/ ctx[26][0].date.getMonth()] + "")) internal.set_data(t, t_value); | ||
if (dirty[0] & /*monthLabels, chunks*/ 9216 && t_value !== (t_value = /*monthLabels*/ ctx[10][/*chunk*/ ctx[26][0].date.getMonth()] + "")) set_data(t, t_value); | ||
if (dirty[0] & /*fontColor*/ 32) { | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
} | ||
if (dirty[0] & /*fontFamily*/ 64) { | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
} | ||
if (dirty[0] & /*fontSize*/ 128) { | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
} | ||
if (dirty[0] & /*cellRect*/ 4096 && text_1_x_value !== (text_1_x_value = /*cellRect*/ ctx[12] * /*index*/ ctx[28])) { | ||
internal.attr(text_1, "x", text_1_x_value); | ||
attr(text_1, "x", text_1_x_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(text_1); | ||
if (detaching) detach(text_1); | ||
} | ||
@@ -1288,10 +1563,10 @@ }; | ||
c() { | ||
internal.create_component(week.$$.fragment); | ||
create_component(week.$$.fragment); | ||
if (if_block) if_block.c(); | ||
if_block_anchor = internal.empty(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(week, target, anchor); | ||
mount_component(week, target, anchor); | ||
if (if_block) if_block.m(target, anchor); | ||
internal.insert(target, if_block_anchor, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
current = true; | ||
@@ -1324,13 +1599,13 @@ }, | ||
if (current) return; | ||
internal.transition_in(week.$$.fragment, local); | ||
transition_in(week.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(week.$$.fragment, local); | ||
transition_out(week.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(week, detaching); | ||
destroy_component(week, detaching); | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) internal.detach(if_block_anchor); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
@@ -1363,6 +1638,6 @@ }; | ||
c() { | ||
internal.create_component(month.$$.fragment); | ||
create_component(month.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(month, target, anchor); | ||
mount_component(month, target, anchor); | ||
current = true; | ||
@@ -1387,11 +1662,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(month.$$.fragment, local); | ||
transition_in(month.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(month.$$.fragment, local); | ||
transition_out(month.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(month, detaching); | ||
destroy_component(month, detaching); | ||
} | ||
@@ -1420,8 +1695,8 @@ }; | ||
c() { | ||
svg = internal.svg_element("svg"); | ||
svg = svg_element("svg"); | ||
if_block.c(); | ||
internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*width*/ ctx[15]} ${/*height*/ ctx[14]}`); | ||
attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*width*/ ctx[15]} ${/*height*/ ctx[14]}`); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, svg, anchor); | ||
insert(target, svg, anchor); | ||
if_blocks[current_block_type_index].m(svg, null); | ||
@@ -1437,9 +1712,9 @@ current = true; | ||
} else { | ||
internal.group_outros(); | ||
group_outros(); | ||
internal.transition_out(if_blocks[previous_block_index], 1, 1, () => { | ||
transition_out(if_blocks[previous_block_index], 1, 1, () => { | ||
if_blocks[previous_block_index] = null; | ||
}); | ||
internal.check_outros(); | ||
check_outros(); | ||
if_block = if_blocks[current_block_type_index]; | ||
@@ -1452,3 +1727,3 @@ | ||
internal.transition_in(if_block, 1); | ||
transition_in(if_block, 1); | ||
if_block.m(svg, null); | ||
@@ -1458,3 +1733,3 @@ } | ||
if (!current || dirty[0] & /*width, height*/ 49152 && svg_viewBox_value !== (svg_viewBox_value = `0 0 ${/*width*/ ctx[15]} ${/*height*/ ctx[14]}`)) { | ||
internal.attr(svg, "viewBox", svg_viewBox_value); | ||
attr(svg, "viewBox", svg_viewBox_value); | ||
} | ||
@@ -1464,11 +1739,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(if_block); | ||
transition_in(if_block); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(if_block); | ||
transition_out(if_block); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(svg); | ||
if (detaching) detach(svg); | ||
if_blocks[current_block_type_index].d(); | ||
@@ -1644,7 +1919,7 @@ } | ||
class SvelteHeatmap extends internal.SvelteComponent { | ||
class SvelteHeatmap extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init( | ||
init( | ||
this, | ||
@@ -1654,3 +1929,3 @@ options, | ||
create_fragment$3, | ||
internal.safe_not_equal, | ||
safe_not_equal, | ||
{ | ||
@@ -1681,4 +1956,4 @@ allowOverflow: 18, | ||
SvelteHeatmap.VERSION = '1.0.1'; | ||
SvelteHeatmap.VERSION = '1.0.2'; | ||
module.exports = SvelteHeatmap; |
@@ -1,3 +0,278 @@ | ||
import { SvelteComponent, init, safe_not_equal, svg_element, attr, insert, noop, detach, create_component, mount_component, transition_in, transition_out, destroy_component, text, append, set_data, empty, group_outros, check_outros, destroy_each } from 'svelte/internal'; | ||
function noop() { } | ||
function run(fn) { | ||
return fn(); | ||
} | ||
function blank_object() { | ||
return Object.create(null); | ||
} | ||
function run_all(fns) { | ||
fns.forEach(run); | ||
} | ||
function is_function(thing) { | ||
return typeof thing === 'function'; | ||
} | ||
function safe_not_equal(a, b) { | ||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); | ||
} | ||
function append(target, node) { | ||
target.appendChild(node); | ||
} | ||
function insert(target, node, anchor) { | ||
target.insertBefore(node, anchor || null); | ||
} | ||
function detach(node) { | ||
node.parentNode.removeChild(node); | ||
} | ||
function destroy_each(iterations, detaching) { | ||
for (let i = 0; i < iterations.length; i += 1) { | ||
if (iterations[i]) | ||
iterations[i].d(detaching); | ||
} | ||
} | ||
function svg_element(name) { | ||
return document.createElementNS('http://www.w3.org/2000/svg', name); | ||
} | ||
function text(data) { | ||
return document.createTextNode(data); | ||
} | ||
function empty() { | ||
return text(''); | ||
} | ||
function attr(node, attribute, value) { | ||
if (value == null) | ||
node.removeAttribute(attribute); | ||
else if (node.getAttribute(attribute) !== value) | ||
node.setAttribute(attribute, value); | ||
} | ||
function children(element) { | ||
return Array.from(element.childNodes); | ||
} | ||
function set_data(text, data) { | ||
data = '' + data; | ||
if (text.data !== data) | ||
text.data = data; | ||
} | ||
let current_component; | ||
function set_current_component(component) { | ||
current_component = component; | ||
} | ||
const dirty_components = []; | ||
const binding_callbacks = []; | ||
const render_callbacks = []; | ||
const flush_callbacks = []; | ||
const resolved_promise = Promise.resolve(); | ||
let update_scheduled = false; | ||
function schedule_update() { | ||
if (!update_scheduled) { | ||
update_scheduled = true; | ||
resolved_promise.then(flush); | ||
} | ||
} | ||
function add_render_callback(fn) { | ||
render_callbacks.push(fn); | ||
} | ||
let flushing = false; | ||
const seen_callbacks = new Set(); | ||
function flush() { | ||
if (flushing) | ||
return; | ||
flushing = true; | ||
do { | ||
// first, call beforeUpdate functions | ||
// and update components | ||
for (let i = 0; i < dirty_components.length; i += 1) { | ||
const component = dirty_components[i]; | ||
set_current_component(component); | ||
update(component.$$); | ||
} | ||
dirty_components.length = 0; | ||
while (binding_callbacks.length) | ||
binding_callbacks.pop()(); | ||
// then, once components are updated, call | ||
// afterUpdate functions. This may cause | ||
// subsequent updates... | ||
for (let i = 0; i < render_callbacks.length; i += 1) { | ||
const callback = render_callbacks[i]; | ||
if (!seen_callbacks.has(callback)) { | ||
// ...so guard against infinite loops | ||
seen_callbacks.add(callback); | ||
callback(); | ||
} | ||
} | ||
render_callbacks.length = 0; | ||
} while (dirty_components.length); | ||
while (flush_callbacks.length) { | ||
flush_callbacks.pop()(); | ||
} | ||
update_scheduled = false; | ||
flushing = false; | ||
seen_callbacks.clear(); | ||
} | ||
function update($$) { | ||
if ($$.fragment !== null) { | ||
$$.update(); | ||
run_all($$.before_update); | ||
const dirty = $$.dirty; | ||
$$.dirty = [-1]; | ||
$$.fragment && $$.fragment.p($$.ctx, dirty); | ||
$$.after_update.forEach(add_render_callback); | ||
} | ||
} | ||
const outroing = new Set(); | ||
let outros; | ||
function group_outros() { | ||
outros = { | ||
r: 0, | ||
c: [], | ||
p: outros // parent group | ||
}; | ||
} | ||
function check_outros() { | ||
if (!outros.r) { | ||
run_all(outros.c); | ||
} | ||
outros = outros.p; | ||
} | ||
function transition_in(block, local) { | ||
if (block && block.i) { | ||
outroing.delete(block); | ||
block.i(local); | ||
} | ||
} | ||
function transition_out(block, local, detach, callback) { | ||
if (block && block.o) { | ||
if (outroing.has(block)) | ||
return; | ||
outroing.add(block); | ||
outros.c.push(() => { | ||
outroing.delete(block); | ||
if (callback) { | ||
if (detach) | ||
block.d(1); | ||
callback(); | ||
} | ||
}); | ||
block.o(local); | ||
} | ||
} | ||
function create_component(block) { | ||
block && block.c(); | ||
} | ||
function mount_component(component, target, anchor) { | ||
const { fragment, on_mount, on_destroy, after_update } = component.$$; | ||
fragment && fragment.m(target, anchor); | ||
// onMount happens before the initial afterUpdate | ||
add_render_callback(() => { | ||
const new_on_destroy = on_mount.map(run).filter(is_function); | ||
if (on_destroy) { | ||
on_destroy.push(...new_on_destroy); | ||
} | ||
else { | ||
// Edge case - component was destroyed immediately, | ||
// most likely as a result of a binding initialising | ||
run_all(new_on_destroy); | ||
} | ||
component.$$.on_mount = []; | ||
}); | ||
after_update.forEach(add_render_callback); | ||
} | ||
function destroy_component(component, detaching) { | ||
const $$ = component.$$; | ||
if ($$.fragment !== null) { | ||
run_all($$.on_destroy); | ||
$$.fragment && $$.fragment.d(detaching); | ||
// TODO null out other refs, including component.$$ (but need to | ||
// preserve final state?) | ||
$$.on_destroy = $$.fragment = null; | ||
$$.ctx = []; | ||
} | ||
} | ||
function make_dirty(component, i) { | ||
if (component.$$.dirty[0] === -1) { | ||
dirty_components.push(component); | ||
schedule_update(); | ||
component.$$.dirty.fill(0); | ||
} | ||
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); | ||
} | ||
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { | ||
const parent_component = current_component; | ||
set_current_component(component); | ||
const prop_values = options.props || {}; | ||
const $$ = component.$$ = { | ||
fragment: null, | ||
ctx: null, | ||
// state | ||
props, | ||
update: noop, | ||
not_equal, | ||
bound: blank_object(), | ||
// lifecycle | ||
on_mount: [], | ||
on_destroy: [], | ||
before_update: [], | ||
after_update: [], | ||
context: new Map(parent_component ? parent_component.$$.context : []), | ||
// everything else | ||
callbacks: blank_object(), | ||
dirty | ||
}; | ||
let ready = false; | ||
$$.ctx = instance | ||
? instance(component, prop_values, (i, ret, ...rest) => { | ||
const value = rest.length ? rest[0] : ret; | ||
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { | ||
if ($$.bound[i]) | ||
$$.bound[i](value); | ||
if (ready) | ||
make_dirty(component, i); | ||
} | ||
return ret; | ||
}) | ||
: []; | ||
$$.update(); | ||
ready = true; | ||
run_all($$.before_update); | ||
// `false` as a special case of no DOM component | ||
$$.fragment = create_fragment ? create_fragment($$.ctx) : false; | ||
if (options.target) { | ||
if (options.hydrate) { | ||
const nodes = children(options.target); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
$$.fragment && $$.fragment.l(nodes); | ||
nodes.forEach(detach); | ||
} | ||
else { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
$$.fragment && $$.fragment.c(); | ||
} | ||
if (options.intro) | ||
transition_in(component.$$.fragment); | ||
mount_component(component, options.target, options.anchor); | ||
flush(); | ||
} | ||
set_current_component(parent_component); | ||
} | ||
class SvelteComponent { | ||
$destroy() { | ||
destroy_component(this, 1); | ||
this.$destroy = noop; | ||
} | ||
$on(type, callback) { | ||
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); | ||
callbacks.push(callback); | ||
return () => { | ||
const index = callbacks.indexOf(callback); | ||
if (index !== -1) | ||
callbacks.splice(index, 1); | ||
}; | ||
} | ||
$set() { | ||
// overridden by instance, if it has props | ||
} | ||
} | ||
/** | ||
@@ -266,3 +541,3 @@ * Get the last day of the month. | ||
/* src/views/Cell.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Cell.svelte generated by Svelte v3.23.0 */ | ||
@@ -367,3 +642,3 @@ function create_fragment(ctx) { | ||
/* src/views/Month.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Month.svelte generated by Svelte v3.23.0 */ | ||
@@ -655,3 +930,3 @@ function get_each_context(ctx, list, i) { | ||
/* src/views/Week.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Week.svelte generated by Svelte v3.23.0 */ | ||
@@ -847,3 +1122,3 @@ function get_each_context$1(ctx, list, i) { | ||
/* src/SvelteHeatmap.svelte generated by Svelte v3.20.1 */ | ||
/* src/SvelteHeatmap.svelte generated by Svelte v3.23.0 */ | ||
@@ -1616,4 +1891,4 @@ function get_each_context_1(ctx, list, i) { | ||
SvelteHeatmap.VERSION = '1.0.1'; | ||
SvelteHeatmap.VERSION = '1.0.2'; | ||
export default SvelteHeatmap; |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('svelte/internal')) : | ||
typeof define === 'function' && define.amd ? define(['svelte/internal'], factory) : | ||
(global = global || self, global.SvelteHeatmap = factory(global.internal)); | ||
}(this, (function (internal) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.SvelteHeatmap = factory()); | ||
}(this, (function () { 'use strict'; | ||
function noop() { } | ||
function run(fn) { | ||
return fn(); | ||
} | ||
function blank_object() { | ||
return Object.create(null); | ||
} | ||
function run_all(fns) { | ||
fns.forEach(run); | ||
} | ||
function is_function(thing) { | ||
return typeof thing === 'function'; | ||
} | ||
function safe_not_equal(a, b) { | ||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); | ||
} | ||
function append(target, node) { | ||
target.appendChild(node); | ||
} | ||
function insert(target, node, anchor) { | ||
target.insertBefore(node, anchor || null); | ||
} | ||
function detach(node) { | ||
node.parentNode.removeChild(node); | ||
} | ||
function destroy_each(iterations, detaching) { | ||
for (let i = 0; i < iterations.length; i += 1) { | ||
if (iterations[i]) | ||
iterations[i].d(detaching); | ||
} | ||
} | ||
function svg_element(name) { | ||
return document.createElementNS('http://www.w3.org/2000/svg', name); | ||
} | ||
function text(data) { | ||
return document.createTextNode(data); | ||
} | ||
function empty() { | ||
return text(''); | ||
} | ||
function attr(node, attribute, value) { | ||
if (value == null) | ||
node.removeAttribute(attribute); | ||
else if (node.getAttribute(attribute) !== value) | ||
node.setAttribute(attribute, value); | ||
} | ||
function children(element) { | ||
return Array.from(element.childNodes); | ||
} | ||
function set_data(text, data) { | ||
data = '' + data; | ||
if (text.data !== data) | ||
text.data = data; | ||
} | ||
let current_component; | ||
function set_current_component(component) { | ||
current_component = component; | ||
} | ||
const dirty_components = []; | ||
const binding_callbacks = []; | ||
const render_callbacks = []; | ||
const flush_callbacks = []; | ||
const resolved_promise = Promise.resolve(); | ||
let update_scheduled = false; | ||
function schedule_update() { | ||
if (!update_scheduled) { | ||
update_scheduled = true; | ||
resolved_promise.then(flush); | ||
} | ||
} | ||
function add_render_callback(fn) { | ||
render_callbacks.push(fn); | ||
} | ||
let flushing = false; | ||
const seen_callbacks = new Set(); | ||
function flush() { | ||
if (flushing) | ||
return; | ||
flushing = true; | ||
do { | ||
// first, call beforeUpdate functions | ||
// and update components | ||
for (let i = 0; i < dirty_components.length; i += 1) { | ||
const component = dirty_components[i]; | ||
set_current_component(component); | ||
update(component.$$); | ||
} | ||
dirty_components.length = 0; | ||
while (binding_callbacks.length) | ||
binding_callbacks.pop()(); | ||
// then, once components are updated, call | ||
// afterUpdate functions. This may cause | ||
// subsequent updates... | ||
for (let i = 0; i < render_callbacks.length; i += 1) { | ||
const callback = render_callbacks[i]; | ||
if (!seen_callbacks.has(callback)) { | ||
// ...so guard against infinite loops | ||
seen_callbacks.add(callback); | ||
callback(); | ||
} | ||
} | ||
render_callbacks.length = 0; | ||
} while (dirty_components.length); | ||
while (flush_callbacks.length) { | ||
flush_callbacks.pop()(); | ||
} | ||
update_scheduled = false; | ||
flushing = false; | ||
seen_callbacks.clear(); | ||
} | ||
function update($$) { | ||
if ($$.fragment !== null) { | ||
$$.update(); | ||
run_all($$.before_update); | ||
const dirty = $$.dirty; | ||
$$.dirty = [-1]; | ||
$$.fragment && $$.fragment.p($$.ctx, dirty); | ||
$$.after_update.forEach(add_render_callback); | ||
} | ||
} | ||
const outroing = new Set(); | ||
let outros; | ||
function group_outros() { | ||
outros = { | ||
r: 0, | ||
c: [], | ||
p: outros // parent group | ||
}; | ||
} | ||
function check_outros() { | ||
if (!outros.r) { | ||
run_all(outros.c); | ||
} | ||
outros = outros.p; | ||
} | ||
function transition_in(block, local) { | ||
if (block && block.i) { | ||
outroing.delete(block); | ||
block.i(local); | ||
} | ||
} | ||
function transition_out(block, local, detach, callback) { | ||
if (block && block.o) { | ||
if (outroing.has(block)) | ||
return; | ||
outroing.add(block); | ||
outros.c.push(() => { | ||
outroing.delete(block); | ||
if (callback) { | ||
if (detach) | ||
block.d(1); | ||
callback(); | ||
} | ||
}); | ||
block.o(local); | ||
} | ||
} | ||
function create_component(block) { | ||
block && block.c(); | ||
} | ||
function mount_component(component, target, anchor) { | ||
const { fragment, on_mount, on_destroy, after_update } = component.$$; | ||
fragment && fragment.m(target, anchor); | ||
// onMount happens before the initial afterUpdate | ||
add_render_callback(() => { | ||
const new_on_destroy = on_mount.map(run).filter(is_function); | ||
if (on_destroy) { | ||
on_destroy.push(...new_on_destroy); | ||
} | ||
else { | ||
// Edge case - component was destroyed immediately, | ||
// most likely as a result of a binding initialising | ||
run_all(new_on_destroy); | ||
} | ||
component.$$.on_mount = []; | ||
}); | ||
after_update.forEach(add_render_callback); | ||
} | ||
function destroy_component(component, detaching) { | ||
const $$ = component.$$; | ||
if ($$.fragment !== null) { | ||
run_all($$.on_destroy); | ||
$$.fragment && $$.fragment.d(detaching); | ||
// TODO null out other refs, including component.$$ (but need to | ||
// preserve final state?) | ||
$$.on_destroy = $$.fragment = null; | ||
$$.ctx = []; | ||
} | ||
} | ||
function make_dirty(component, i) { | ||
if (component.$$.dirty[0] === -1) { | ||
dirty_components.push(component); | ||
schedule_update(); | ||
component.$$.dirty.fill(0); | ||
} | ||
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); | ||
} | ||
function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { | ||
const parent_component = current_component; | ||
set_current_component(component); | ||
const prop_values = options.props || {}; | ||
const $$ = component.$$ = { | ||
fragment: null, | ||
ctx: null, | ||
// state | ||
props, | ||
update: noop, | ||
not_equal, | ||
bound: blank_object(), | ||
// lifecycle | ||
on_mount: [], | ||
on_destroy: [], | ||
before_update: [], | ||
after_update: [], | ||
context: new Map(parent_component ? parent_component.$$.context : []), | ||
// everything else | ||
callbacks: blank_object(), | ||
dirty | ||
}; | ||
let ready = false; | ||
$$.ctx = instance | ||
? instance(component, prop_values, (i, ret, ...rest) => { | ||
const value = rest.length ? rest[0] : ret; | ||
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { | ||
if ($$.bound[i]) | ||
$$.bound[i](value); | ||
if (ready) | ||
make_dirty(component, i); | ||
} | ||
return ret; | ||
}) | ||
: []; | ||
$$.update(); | ||
ready = true; | ||
run_all($$.before_update); | ||
// `false` as a special case of no DOM component | ||
$$.fragment = create_fragment ? create_fragment($$.ctx) : false; | ||
if (options.target) { | ||
if (options.hydrate) { | ||
const nodes = children(options.target); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
$$.fragment && $$.fragment.l(nodes); | ||
nodes.forEach(detach); | ||
} | ||
else { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
$$.fragment && $$.fragment.c(); | ||
} | ||
if (options.intro) | ||
transition_in(component.$$.fragment); | ||
mount_component(component, options.target, options.anchor); | ||
flush(); | ||
} | ||
set_current_component(parent_component); | ||
} | ||
class SvelteComponent { | ||
$destroy() { | ||
destroy_component(this, 1); | ||
this.$destroy = noop; | ||
} | ||
$on(type, callback) { | ||
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); | ||
callbacks.push(callback); | ||
return () => { | ||
const index = callbacks.indexOf(callback); | ||
if (index !== -1) | ||
callbacks.splice(index, 1); | ||
}; | ||
} | ||
$set() { | ||
// overridden by instance, if it has props | ||
} | ||
} | ||
/** | ||
@@ -270,3 +547,3 @@ * Get the last day of the month. | ||
/* src/views/Cell.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Cell.svelte generated by Svelte v3.23.0 */ | ||
@@ -279,52 +556,52 @@ function create_fragment(ctx) { | ||
c() { | ||
rect = internal.svg_element("rect"); | ||
internal.attr(rect, "data-date", rect_data_date_value = stringifyDate(/*date*/ ctx[1])); | ||
internal.attr(rect, "data-value", /*value*/ ctx[4]); | ||
internal.attr(rect, "fill", /*color*/ ctx[0]); | ||
internal.attr(rect, "height", /*size*/ ctx[3]); | ||
internal.attr(rect, "rx", /*radius*/ ctx[2]); | ||
internal.attr(rect, "width", /*size*/ ctx[3]); | ||
internal.attr(rect, "x", /*x*/ ctx[5]); | ||
internal.attr(rect, "y", /*y*/ ctx[6]); | ||
rect = svg_element("rect"); | ||
attr(rect, "data-date", rect_data_date_value = stringifyDate(/*date*/ ctx[1])); | ||
attr(rect, "data-value", /*value*/ ctx[4]); | ||
attr(rect, "fill", /*color*/ ctx[0]); | ||
attr(rect, "height", /*size*/ ctx[3]); | ||
attr(rect, "rx", /*radius*/ ctx[2]); | ||
attr(rect, "width", /*size*/ ctx[3]); | ||
attr(rect, "x", /*x*/ ctx[5]); | ||
attr(rect, "y", /*y*/ ctx[6]); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, rect, anchor); | ||
insert(target, rect, anchor); | ||
}, | ||
p(ctx, [dirty]) { | ||
if (dirty & /*date*/ 2 && rect_data_date_value !== (rect_data_date_value = stringifyDate(/*date*/ ctx[1]))) { | ||
internal.attr(rect, "data-date", rect_data_date_value); | ||
attr(rect, "data-date", rect_data_date_value); | ||
} | ||
if (dirty & /*value*/ 16) { | ||
internal.attr(rect, "data-value", /*value*/ ctx[4]); | ||
attr(rect, "data-value", /*value*/ ctx[4]); | ||
} | ||
if (dirty & /*color*/ 1) { | ||
internal.attr(rect, "fill", /*color*/ ctx[0]); | ||
attr(rect, "fill", /*color*/ ctx[0]); | ||
} | ||
if (dirty & /*size*/ 8) { | ||
internal.attr(rect, "height", /*size*/ ctx[3]); | ||
attr(rect, "height", /*size*/ ctx[3]); | ||
} | ||
if (dirty & /*radius*/ 4) { | ||
internal.attr(rect, "rx", /*radius*/ ctx[2]); | ||
attr(rect, "rx", /*radius*/ ctx[2]); | ||
} | ||
if (dirty & /*size*/ 8) { | ||
internal.attr(rect, "width", /*size*/ ctx[3]); | ||
attr(rect, "width", /*size*/ ctx[3]); | ||
} | ||
if (dirty & /*x*/ 32) { | ||
internal.attr(rect, "x", /*x*/ ctx[5]); | ||
attr(rect, "x", /*x*/ ctx[5]); | ||
} | ||
if (dirty & /*y*/ 64) { | ||
internal.attr(rect, "y", /*y*/ ctx[6]); | ||
attr(rect, "y", /*y*/ ctx[6]); | ||
} | ||
}, | ||
i: internal.noop, | ||
o: internal.noop, | ||
i: noop, | ||
o: noop, | ||
d(detaching) { | ||
if (detaching) internal.detach(rect); | ||
if (detaching) detach(rect); | ||
} | ||
@@ -356,7 +633,7 @@ }; | ||
class Cell extends internal.SvelteComponent { | ||
class Cell extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init(this, options, instance, create_fragment, internal.safe_not_equal, { | ||
init(this, options, instance, create_fragment, safe_not_equal, { | ||
color: 0, | ||
@@ -373,3 +650,3 @@ date: 1, | ||
/* src/views/Month.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Month.svelte generated by Svelte v3.23.0 */ | ||
@@ -400,6 +677,6 @@ function get_each_context(ctx, list, i) { | ||
c() { | ||
internal.create_component(cell.$$.fragment); | ||
create_component(cell.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(cell, target, anchor); | ||
mount_component(cell, target, anchor); | ||
current = true; | ||
@@ -420,11 +697,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(cell.$$.fragment, local); | ||
transition_in(cell.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(cell.$$.fragment, local); | ||
transition_out(cell.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(cell, detaching); | ||
destroy_component(cell, detaching); | ||
} | ||
@@ -442,32 +719,32 @@ }; | ||
c() { | ||
text_1 = internal.svg_element("text"); | ||
t = internal.text(t_value); | ||
internal.attr(text_1, "alignment-baseline", "hanging"); | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
internal.attr(text_1, "x", "0"); | ||
internal.attr(text_1, "y", "0"); | ||
text_1 = svg_element("text"); | ||
t = text(t_value); | ||
attr(text_1, "alignment-baseline", "hanging"); | ||
attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
attr(text_1, "x", "0"); | ||
attr(text_1, "y", "0"); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, text_1, anchor); | ||
internal.append(text_1, t); | ||
insert(target, text_1, anchor); | ||
append(text_1, t); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty & /*monthLabels, days*/ 264 && t_value !== (t_value = /*monthLabels*/ ctx[8][/*days*/ ctx[3][0].date.getMonth()] + "")) internal.set_data(t, t_value); | ||
if (dirty & /*monthLabels, days*/ 264 && t_value !== (t_value = /*monthLabels*/ ctx[8][/*days*/ ctx[3][0].date.getMonth()] + "")) set_data(t, t_value); | ||
if (dirty & /*fontColor*/ 16) { | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
attr(text_1, "fill", /*fontColor*/ ctx[4]); | ||
} | ||
if (dirty & /*fontFamily*/ 32) { | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[5]); | ||
} | ||
if (dirty & /*fontSize*/ 64) { | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[6]); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(text_1); | ||
if (detaching) detach(text_1); | ||
} | ||
@@ -489,3 +766,3 @@ }; | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -498,3 +775,3 @@ }); | ||
c() { | ||
g = internal.svg_element("g"); | ||
g = svg_element("g"); | ||
@@ -505,8 +782,8 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_1_anchor = internal.empty(); | ||
each_1_anchor = empty(); | ||
if (if_block) if_block.c(); | ||
internal.attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[9]}, 0)`); | ||
attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[9]}, 0)`); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, g, anchor); | ||
insert(target, g, anchor); | ||
@@ -517,3 +794,3 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.append(g, each_1_anchor); | ||
append(g, each_1_anchor); | ||
if (if_block) if_block.m(g, null); | ||
@@ -532,7 +809,7 @@ current = true; | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(g, each_1_anchor); | ||
@@ -542,3 +819,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -549,3 +826,3 @@ for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
@@ -567,3 +844,3 @@ | ||
if (!current || dirty & /*translation*/ 512 && g_transform_value !== (g_transform_value = `translate(${/*translation*/ ctx[9]}, 0)`)) { | ||
internal.attr(g, "transform", g_transform_value); | ||
attr(g, "transform", g_transform_value); | ||
} | ||
@@ -575,3 +852,3 @@ }, | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -585,3 +862,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -592,4 +869,4 @@ | ||
d(detaching) { | ||
if (detaching) internal.detach(g); | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) detach(g); | ||
destroy_each(each_blocks, detaching); | ||
if (if_block) if_block.d(); | ||
@@ -654,7 +931,7 @@ } | ||
class Month extends internal.SvelteComponent { | ||
class Month extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init(this, options, instance$1, create_fragment$1, internal.safe_not_equal, { | ||
init(this, options, instance$1, create_fragment$1, safe_not_equal, { | ||
cellGap: 10, | ||
@@ -676,3 +953,3 @@ cellRadius: 0, | ||
/* src/views/Week.svelte generated by Svelte v3.20.1 */ | ||
/* src/views/Week.svelte generated by Svelte v3.23.0 */ | ||
@@ -703,6 +980,6 @@ function get_each_context$1(ctx, list, i) { | ||
c() { | ||
internal.create_component(cell.$$.fragment); | ||
create_component(cell.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(cell, target, anchor); | ||
mount_component(cell, target, anchor); | ||
current = true; | ||
@@ -722,11 +999,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(cell.$$.fragment, local); | ||
transition_in(cell.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(cell.$$.fragment, local); | ||
transition_out(cell.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(cell, detaching); | ||
destroy_component(cell, detaching); | ||
} | ||
@@ -747,3 +1024,3 @@ }; | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -754,3 +1031,3 @@ }); | ||
c() { | ||
g = internal.svg_element("g"); | ||
g = svg_element("g"); | ||
@@ -761,6 +1038,6 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[5]}, ${/*monthLabelHeight*/ ctx[4]})`); | ||
attr(g, "transform", g_transform_value = `translate(${/*translation*/ ctx[5]}, ${/*monthLabelHeight*/ ctx[4]})`); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, g, anchor); | ||
insert(target, g, anchor); | ||
@@ -783,7 +1060,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block$1(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(g, null); | ||
@@ -793,3 +1070,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -800,7 +1077,7 @@ for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
if (!current || dirty & /*translation, monthLabelHeight*/ 48 && g_transform_value !== (g_transform_value = `translate(${/*translation*/ ctx[5]}, ${/*monthLabelHeight*/ ctx[4]})`)) { | ||
internal.attr(g, "transform", g_transform_value); | ||
attr(g, "transform", g_transform_value); | ||
} | ||
@@ -812,3 +1089,3 @@ }, | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -822,3 +1099,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -829,4 +1106,4 @@ | ||
d(detaching) { | ||
if (detaching) internal.detach(g); | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) detach(g); | ||
destroy_each(each_blocks, detaching); | ||
} | ||
@@ -864,7 +1141,7 @@ }; | ||
class Week extends internal.SvelteComponent { | ||
class Week extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init(this, options, instance$2, create_fragment$2, internal.safe_not_equal, { | ||
init(this, options, instance$2, create_fragment$2, safe_not_equal, { | ||
cellRadius: 0, | ||
@@ -880,3 +1157,3 @@ cellRect: 1, | ||
/* src/SvelteHeatmap.svelte generated by Svelte v3.20.1 */ | ||
/* src/SvelteHeatmap.svelte generated by Svelte v3.23.0 */ | ||
@@ -917,3 +1194,3 @@ function get_each_context_1(ctx, list, i) { | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -925,3 +1202,3 @@ }); | ||
if (if_block) if_block.c(); | ||
g = internal.svg_element("g"); | ||
g = svg_element("g"); | ||
@@ -932,7 +1209,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.attr(g, "transform", g_transform_value = `translate(${/*dayLabelWidth*/ ctx[3]})`); | ||
attr(g, "transform", g_transform_value = `translate(${/*dayLabelWidth*/ ctx[3]})`); | ||
}, | ||
m(target, anchor) { | ||
if (if_block) if_block.m(target, anchor); | ||
internal.insert(target, g, anchor); | ||
insert(target, g, anchor); | ||
@@ -968,7 +1245,7 @@ for (let i = 0; i < each_blocks.length; i += 1) { | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block_1(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(g, null); | ||
@@ -978,3 +1255,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -985,7 +1262,7 @@ for (i = each_value_1.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
if (!current || dirty[0] & /*dayLabelWidth*/ 8 && g_transform_value !== (g_transform_value = `translate(${/*dayLabelWidth*/ ctx[3]})`)) { | ||
internal.attr(g, "transform", g_transform_value); | ||
attr(g, "transform", g_transform_value); | ||
} | ||
@@ -997,3 +1274,3 @@ }, | ||
for (let i = 0; i < each_value_1.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -1007,3 +1284,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -1015,4 +1292,4 @@ | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) internal.detach(g); | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) detach(g); | ||
destroy_each(each_blocks, detaching); | ||
} | ||
@@ -1033,3 +1310,3 @@ }; | ||
const out = i => internal.transition_out(each_blocks[i], 1, 1, () => { | ||
const out = i => transition_out(each_blocks[i], 1, 1, () => { | ||
each_blocks[i] = null; | ||
@@ -1044,3 +1321,3 @@ }); | ||
each_1_anchor = internal.empty(); | ||
each_1_anchor = empty(); | ||
}, | ||
@@ -1052,3 +1329,3 @@ m(target, anchor) { | ||
internal.insert(target, each_1_anchor, anchor); | ||
insert(target, each_1_anchor, anchor); | ||
current = true; | ||
@@ -1066,7 +1343,7 @@ }, | ||
each_blocks[i].p(child_ctx, dirty); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
} else { | ||
each_blocks[i] = create_each_block$2(child_ctx); | ||
each_blocks[i].c(); | ||
internal.transition_in(each_blocks[i], 1); | ||
transition_in(each_blocks[i], 1); | ||
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); | ||
@@ -1076,3 +1353,3 @@ } | ||
internal.group_outros(); | ||
group_outros(); | ||
@@ -1083,3 +1360,3 @@ for (i = each_value.length; i < each_blocks.length; i += 1) { | ||
internal.check_outros(); | ||
check_outros(); | ||
} | ||
@@ -1091,3 +1368,3 @@ }, | ||
for (let i = 0; i < each_value.length; i += 1) { | ||
internal.transition_in(each_blocks[i]); | ||
transition_in(each_blocks[i]); | ||
} | ||
@@ -1101,3 +1378,3 @@ | ||
for (let i = 0; i < each_blocks.length; i += 1) { | ||
internal.transition_out(each_blocks[i]); | ||
transition_out(each_blocks[i]); | ||
} | ||
@@ -1108,4 +1385,4 @@ | ||
d(detaching) { | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) internal.detach(each_1_anchor); | ||
destroy_each(each_blocks, detaching); | ||
if (detaching) detach(each_1_anchor); | ||
} | ||
@@ -1131,3 +1408,3 @@ }; | ||
each_1_anchor = internal.empty(); | ||
each_1_anchor = empty(); | ||
}, | ||
@@ -1139,3 +1416,3 @@ m(target, anchor) { | ||
internal.insert(target, each_1_anchor, anchor); | ||
insert(target, each_1_anchor, anchor); | ||
}, | ||
@@ -1167,4 +1444,4 @@ p(ctx, dirty) { | ||
d(detaching) { | ||
internal.destroy_each(each_blocks, detaching); | ||
if (detaching) internal.detach(each_1_anchor); | ||
destroy_each(each_blocks, detaching); | ||
if (detaching) detach(each_1_anchor); | ||
} | ||
@@ -1183,36 +1460,36 @@ }; | ||
c() { | ||
text_1 = internal.svg_element("text"); | ||
t = internal.text(t_value); | ||
internal.attr(text_1, "alignment-baseline", "middle"); | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
internal.attr(text_1, "x", "0"); | ||
internal.attr(text_1, "y", text_1_y_value = /*dayLabelPosition*/ ctx[16](/*index*/ ctx[28])); | ||
text_1 = svg_element("text"); | ||
t = text(t_value); | ||
attr(text_1, "alignment-baseline", "middle"); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "x", "0"); | ||
attr(text_1, "y", text_1_y_value = /*dayLabelPosition*/ ctx[16](/*index*/ ctx[28])); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, text_1, anchor); | ||
internal.append(text_1, t); | ||
insert(target, text_1, anchor); | ||
append(text_1, t); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*dayLabels*/ 16 && t_value !== (t_value = /*label*/ ctx[30] + "")) internal.set_data(t, t_value); | ||
if (dirty[0] & /*dayLabels*/ 16 && t_value !== (t_value = /*label*/ ctx[30] + "")) set_data(t, t_value); | ||
if (dirty[0] & /*fontColor*/ 32) { | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
} | ||
if (dirty[0] & /*fontFamily*/ 64) { | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
} | ||
if (dirty[0] & /*fontSize*/ 128) { | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
} | ||
if (dirty[0] & /*dayLabelPosition*/ 65536 && text_1_y_value !== (text_1_y_value = /*dayLabelPosition*/ ctx[16](/*index*/ ctx[28]))) { | ||
internal.attr(text_1, "y", text_1_y_value); | ||
attr(text_1, "y", text_1_y_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(text_1); | ||
if (detaching) detach(text_1); | ||
} | ||
@@ -1231,35 +1508,35 @@ }; | ||
c() { | ||
text_1 = internal.svg_element("text"); | ||
t = internal.text(t_value); | ||
internal.attr(text_1, "alignment-baseline", "hanging"); | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
internal.attr(text_1, "x", text_1_x_value = /*cellRect*/ ctx[12] * /*index*/ ctx[28]); | ||
text_1 = svg_element("text"); | ||
t = text(t_value); | ||
attr(text_1, "alignment-baseline", "hanging"); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "x", text_1_x_value = /*cellRect*/ ctx[12] * /*index*/ ctx[28]); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, text_1, anchor); | ||
internal.append(text_1, t); | ||
insert(target, text_1, anchor); | ||
append(text_1, t); | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*monthLabels, chunks*/ 9216 && t_value !== (t_value = /*monthLabels*/ ctx[10][/*chunk*/ ctx[26][0].date.getMonth()] + "")) internal.set_data(t, t_value); | ||
if (dirty[0] & /*monthLabels, chunks*/ 9216 && t_value !== (t_value = /*monthLabels*/ ctx[10][/*chunk*/ ctx[26][0].date.getMonth()] + "")) set_data(t, t_value); | ||
if (dirty[0] & /*fontColor*/ 32) { | ||
internal.attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
attr(text_1, "fill", /*fontColor*/ ctx[5]); | ||
} | ||
if (dirty[0] & /*fontFamily*/ 64) { | ||
internal.attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
attr(text_1, "font-family", /*fontFamily*/ ctx[6]); | ||
} | ||
if (dirty[0] & /*fontSize*/ 128) { | ||
internal.attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
attr(text_1, "font-size", /*fontSize*/ ctx[7]); | ||
} | ||
if (dirty[0] & /*cellRect*/ 4096 && text_1_x_value !== (text_1_x_value = /*cellRect*/ ctx[12] * /*index*/ ctx[28])) { | ||
internal.attr(text_1, "x", text_1_x_value); | ||
attr(text_1, "x", text_1_x_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(text_1); | ||
if (detaching) detach(text_1); | ||
} | ||
@@ -1290,10 +1567,10 @@ }; | ||
c() { | ||
internal.create_component(week.$$.fragment); | ||
create_component(week.$$.fragment); | ||
if (if_block) if_block.c(); | ||
if_block_anchor = internal.empty(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(week, target, anchor); | ||
mount_component(week, target, anchor); | ||
if (if_block) if_block.m(target, anchor); | ||
internal.insert(target, if_block_anchor, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
current = true; | ||
@@ -1326,13 +1603,13 @@ }, | ||
if (current) return; | ||
internal.transition_in(week.$$.fragment, local); | ||
transition_in(week.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(week.$$.fragment, local); | ||
transition_out(week.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(week, detaching); | ||
destroy_component(week, detaching); | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) internal.detach(if_block_anchor); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
@@ -1365,6 +1642,6 @@ }; | ||
c() { | ||
internal.create_component(month.$$.fragment); | ||
create_component(month.$$.fragment); | ||
}, | ||
m(target, anchor) { | ||
internal.mount_component(month, target, anchor); | ||
mount_component(month, target, anchor); | ||
current = true; | ||
@@ -1389,11 +1666,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(month.$$.fragment, local); | ||
transition_in(month.$$.fragment, local); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(month.$$.fragment, local); | ||
transition_out(month.$$.fragment, local); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
internal.destroy_component(month, detaching); | ||
destroy_component(month, detaching); | ||
} | ||
@@ -1422,8 +1699,8 @@ }; | ||
c() { | ||
svg = internal.svg_element("svg"); | ||
svg = svg_element("svg"); | ||
if_block.c(); | ||
internal.attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*width*/ ctx[15]} ${/*height*/ ctx[14]}`); | ||
attr(svg, "viewBox", svg_viewBox_value = `0 0 ${/*width*/ ctx[15]} ${/*height*/ ctx[14]}`); | ||
}, | ||
m(target, anchor) { | ||
internal.insert(target, svg, anchor); | ||
insert(target, svg, anchor); | ||
if_blocks[current_block_type_index].m(svg, null); | ||
@@ -1439,9 +1716,9 @@ current = true; | ||
} else { | ||
internal.group_outros(); | ||
group_outros(); | ||
internal.transition_out(if_blocks[previous_block_index], 1, 1, () => { | ||
transition_out(if_blocks[previous_block_index], 1, 1, () => { | ||
if_blocks[previous_block_index] = null; | ||
}); | ||
internal.check_outros(); | ||
check_outros(); | ||
if_block = if_blocks[current_block_type_index]; | ||
@@ -1454,3 +1731,3 @@ | ||
internal.transition_in(if_block, 1); | ||
transition_in(if_block, 1); | ||
if_block.m(svg, null); | ||
@@ -1460,3 +1737,3 @@ } | ||
if (!current || dirty[0] & /*width, height*/ 49152 && svg_viewBox_value !== (svg_viewBox_value = `0 0 ${/*width*/ ctx[15]} ${/*height*/ ctx[14]}`)) { | ||
internal.attr(svg, "viewBox", svg_viewBox_value); | ||
attr(svg, "viewBox", svg_viewBox_value); | ||
} | ||
@@ -1466,11 +1743,11 @@ }, | ||
if (current) return; | ||
internal.transition_in(if_block); | ||
transition_in(if_block); | ||
current = true; | ||
}, | ||
o(local) { | ||
internal.transition_out(if_block); | ||
transition_out(if_block); | ||
current = false; | ||
}, | ||
d(detaching) { | ||
if (detaching) internal.detach(svg); | ||
if (detaching) detach(svg); | ||
if_blocks[current_block_type_index].d(); | ||
@@ -1646,7 +1923,7 @@ } | ||
class SvelteHeatmap extends internal.SvelteComponent { | ||
class SvelteHeatmap extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
internal.init( | ||
init( | ||
this, | ||
@@ -1656,3 +1933,3 @@ options, | ||
create_fragment$3, | ||
internal.safe_not_equal, | ||
safe_not_equal, | ||
{ | ||
@@ -1683,3 +1960,3 @@ allowOverflow: 18, | ||
SvelteHeatmap.VERSION = '1.0.1'; | ||
SvelteHeatmap.VERSION = '1.0.2'; | ||
@@ -1686,0 +1963,0 @@ return SvelteHeatmap; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("svelte/internal")):"function"==typeof define&&define.amd?define(["svelte/internal"],e):(t=t||self).SvelteHeatmap=e(t.internal)}(this,(function(t){"use strict";function e(t){const e=new Date(t.getFullYear(),t.getMonth(),1).getDay(),n=t.getDate()+e-1;return Math.floor(n/7)}function n(t){if(t instanceof Date)return t;if(["number","string"].includes(typeof t))return new Date(t);throw new Error("Invalid date value")}function l(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function a({colors:t,data:e,emptyColor:l,endDate:a,startDate:o,view:r}){var i;o=o?n(o):new Date,a=a?n(a):new Date,"monthly"===r?(i=o,o=new Date(i.getFullYear(),i.getMonth(),1),a=function(t){return new Date(t.getFullYear(),t.getMonth()+1,0)}(a)):(o=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay())}(o),a=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+(6-t.getDay()))}(a));let s=0;const c=o.getDate(),u=Math.floor((a-o)/864e5)+1;return new Array(u).fill().map((t,l)=>{const a=function({data:t,offset:e,startDate:l,startDayOfMonth:a}){const o=new Date(l);o.setDate(a+e);const r=new Date(o);r.setDate(o.getDate()+1);const i=t.reduce((t,e)=>{const l=n(e.date);return l>=o&&l<r?t+e.value:t},0);return{date:o,value:i}}({data:e,offset:l,startDate:o,startDayOfMonth:c});return a.value>s&&(s=a.value),a}).map(({date:e,value:n})=>({color:function({colors:t,max:e,value:n}){if(t.length&&n){let l=t[0];const a=n/e;for(let e=1;e<t.length;e++){if(a<e/t.length)return l;l=t[e]}return t[t.length-1]}return null}({colors:t,max:s,value:n})||l,date:e,value:n}))}function o(e){let n,a;return{c(){n=t.svg_element("rect"),t.attr(n,"data-date",a=l(e[1])),t.attr(n,"data-value",e[4]),t.attr(n,"fill",e[0]),t.attr(n,"height",e[3]),t.attr(n,"rx",e[2]),t.attr(n,"width",e[3]),t.attr(n,"x",e[5]),t.attr(n,"y",e[6])},m(e,l){t.insert(e,n,l)},p(e,[o]){2&o&&a!==(a=l(e[1]))&&t.attr(n,"data-date",a),16&o&&t.attr(n,"data-value",e[4]),1&o&&t.attr(n,"fill",e[0]),8&o&&t.attr(n,"height",e[3]),4&o&&t.attr(n,"rx",e[2]),8&o&&t.attr(n,"width",e[3]),32&o&&t.attr(n,"x",e[5]),64&o&&t.attr(n,"y",e[6])},i:t.noop,o:t.noop,d(e){e&&t.detach(n)}}}function r(t,e,n){let{color:l}=e,{date:a}=e,{radius:o}=e,{size:r}=e,{value:i}=e,{x:s}=e,{y:c}=e;return t.$set=t=>{"color"in t&&n(0,l=t.color),"date"in t&&n(1,a=t.date),"radius"in t&&n(2,o=t.radius),"size"in t&&n(3,r=t.size),"value"in t&&n(4,i=t.value),"x"in t&&n(5,s=t.x),"y"in t&&n(6,c=t.y)},[l,a,o,r,i,s,c]}class i extends t.SvelteComponent{constructor(e){super(),t.init(this,e,r,o,t.safe_not_equal,{color:0,date:1,radius:2,size:3,value:4,x:5,y:6})}}function s(t,e,n){const l=t.slice();return l[13]=e[n],l}function c(n){let l;const a=new i({props:{color:n[13].color,date:n[13].date,radius:n[0],size:n[2],value:n[13].value,x:n[13].date.getDay()*n[1],y:e(n[13].date)*n[1]+n[7]}});return{c(){t.create_component(a.$$.fragment)},m(e,n){t.mount_component(a,e,n),l=!0},p(t,n){const l={};8&n&&(l.color=t[13].color),8&n&&(l.date=t[13].date),1&n&&(l.radius=t[0]),4&n&&(l.size=t[2]),8&n&&(l.value=t[13].value),10&n&&(l.x=t[13].date.getDay()*t[1]),138&n&&(l.y=e(t[13].date)*t[1]+t[7]),a.$set(l)},i(e){l||(t.transition_in(a.$$.fragment,e),l=!0)},o(e){t.transition_out(a.$$.fragment,e),l=!1},d(e){t.destroy_component(a,e)}}}function u(e){let n,l,a=e[8][e[3][0].date.getMonth()]+"";return{c(){n=t.svg_element("text"),l=t.text(a),t.attr(n,"alignment-baseline","hanging"),t.attr(n,"fill",e[4]),t.attr(n,"font-family",e[5]),t.attr(n,"font-size",e[6]),t.attr(n,"x","0"),t.attr(n,"y","0")},m(e,a){t.insert(e,n,a),t.append(n,l)},p(e,o){264&o&&a!==(a=e[8][e[3][0].date.getMonth()]+"")&&t.set_data(l,a),16&o&&t.attr(n,"fill",e[4]),32&o&&t.attr(n,"font-family",e[5]),64&o&&t.attr(n,"font-size",e[6])},d(e){e&&t.detach(n)}}}function d(e){let n,l,a,o,r=e[3],i=[];for(let t=0;t<r.length;t+=1)i[t]=c(s(e,r,t));const d=e=>t.transition_out(i[e],1,1,()=>{i[e]=null});let f=e[7]>0&&u(e);return{c(){n=t.svg_element("g");for(let t=0;t<i.length;t+=1)i[t].c();l=t.empty(),f&&f.c(),t.attr(n,"transform",a=`translate(${e[9]}, 0)`)},m(e,a){t.insert(e,n,a);for(let t=0;t<i.length;t+=1)i[t].m(n,null);t.append(n,l),f&&f.m(n,null),o=!0},p(e,[h]){if(143&h){let a;for(r=e[3],a=0;a<r.length;a+=1){const o=s(e,r,a);i[a]?(i[a].p(o,h),t.transition_in(i[a],1)):(i[a]=c(o),i[a].c(),t.transition_in(i[a],1),i[a].m(n,l))}for(t.group_outros(),a=r.length;a<i.length;a+=1)d(a);t.check_outros()}e[7]>0?f?f.p(e,h):(f=u(e),f.c(),f.m(n,null)):f&&(f.d(1),f=null),(!o||512&h&&a!==(a=`translate(${e[9]}, 0)`))&&t.attr(n,"transform",a)},i(e){if(!o){for(let e=0;e<r.length;e+=1)t.transition_in(i[e]);o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)t.transition_out(i[e]);o=!1},d(e){e&&t.detach(n),t.destroy_each(i,e),f&&f.d()}}}function f(t,e,n){let l,{cellGap:a}=e,{cellRadius:o}=e,{cellRect:r}=e,{cellSize:i}=e,{days:s}=e,{fontColor:c}=e,{fontFamily:u}=e,{fontSize:d}=e,{index:f}=e,{monthGap:h}=e,{monthLabelHeight:m}=e,{monthLabels:g}=e;return t.$set=t=>{"cellGap"in t&&n(10,a=t.cellGap),"cellRadius"in t&&n(0,o=t.cellRadius),"cellRect"in t&&n(1,r=t.cellRect),"cellSize"in t&&n(2,i=t.cellSize),"days"in t&&n(3,s=t.days),"fontColor"in t&&n(4,c=t.fontColor),"fontFamily"in t&&n(5,u=t.fontFamily),"fontSize"in t&&n(6,d=t.fontSize),"index"in t&&n(11,f=t.index),"monthGap"in t&&n(12,h=t.monthGap),"monthLabelHeight"in t&&n(7,m=t.monthLabelHeight),"monthLabels"in t&&n(8,g=t.monthLabels)},t.$$.update=()=>{7170&t.$$.dirty&&n(9,l=(7*r-a+h)*f)},[o,r,i,s,c,u,d,m,g,l,a,f,h]}class h extends t.SvelteComponent{constructor(e){super(),t.init(this,e,f,d,t.safe_not_equal,{cellGap:10,cellRadius:0,cellRect:1,cellSize:2,days:3,fontColor:4,fontFamily:5,fontSize:6,index:11,monthGap:12,monthLabelHeight:7,monthLabels:8})}}function m(t,e,n){const l=t.slice();return l[7]=e[n],l[6]=n,l}function g(e){let n;const l=new i({props:{color:e[7].color,date:e[7].date,radius:e[0],size:e[2],value:e[7].value,y:e[7].date.getDay()*e[1]}});return{c(){t.create_component(l.$$.fragment)},m(e,a){t.mount_component(l,e,a),n=!0},p(t,e){const n={};8&e&&(n.color=t[7].color),8&e&&(n.date=t[7].date),1&e&&(n.radius=t[0]),4&e&&(n.size=t[2]),8&e&&(n.value=t[7].value),10&e&&(n.y=t[7].date.getDay()*t[1]),l.$set(n)},i(e){n||(t.transition_in(l.$$.fragment,e),n=!0)},o(e){t.transition_out(l.$$.fragment,e),n=!1},d(e){t.destroy_component(l,e)}}}function p(e){let n,l,a,o=e[3],r=[];for(let t=0;t<o.length;t+=1)r[t]=g(m(e,o,t));const i=e=>t.transition_out(r[e],1,1,()=>{r[e]=null});return{c(){n=t.svg_element("g");for(let t=0;t<r.length;t+=1)r[t].c();t.attr(n,"transform",l=`translate(${e[5]}, ${e[4]})`)},m(e,l){t.insert(e,n,l);for(let t=0;t<r.length;t+=1)r[t].m(n,null);a=!0},p(e,[s]){if(15&s){let l;for(o=e[3],l=0;l<o.length;l+=1){const a=m(e,o,l);r[l]?(r[l].p(a,s),t.transition_in(r[l],1)):(r[l]=g(a),r[l].c(),t.transition_in(r[l],1),r[l].m(n,null))}for(t.group_outros(),l=o.length;l<r.length;l+=1)i(l);t.check_outros()}(!a||48&s&&l!==(l=`translate(${e[5]}, ${e[4]})`))&&t.attr(n,"transform",l)},i(e){if(!a){for(let e=0;e<o.length;e+=1)t.transition_in(r[e]);a=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)t.transition_out(r[e]);a=!1},d(e){e&&t.detach(n),t.destroy_each(r,e)}}}function y(t,e,n){let l,{cellRadius:a}=e,{cellRect:o}=e,{cellSize:r}=e,{days:i}=e,{index:s}=e,{monthLabelHeight:c}=e;return t.$set=t=>{"cellRadius"in t&&n(0,a=t.cellRadius),"cellRect"in t&&n(1,o=t.cellRect),"cellSize"in t&&n(2,r=t.cellSize),"days"in t&&n(3,i=t.days),"index"in t&&n(6,s=t.index),"monthLabelHeight"in t&&n(4,c=t.monthLabelHeight)},t.$$.update=()=>{66&t.$$.dirty&&n(5,l=o*s)},[a,o,r,i,c,l,s]}class _ extends t.SvelteComponent{constructor(e){super(),t.init(this,e,y,p,t.safe_not_equal,{cellRadius:0,cellRect:1,cellSize:2,days:3,index:6,monthLabelHeight:4})}}function $(t,e,n){const l=t.slice();return l[26]=e[n],l[28]=n,l}function v(t,e,n){const l=t.slice();return l[30]=e[n],l[28]=n,l}function D(t,e,n){const l=t.slice();return l[26]=e[n],l[28]=n,l}function w(e){let n,l,a,o=e[3]>0&&x(e),r=e[13],i=[];for(let t=0;t<r.length;t+=1)i[t]=L($(e,r,t));const s=e=>t.transition_out(i[e],1,1,()=>{i[e]=null});return{c(){o&&o.c(),n=t.svg_element("g");for(let t=0;t<i.length;t+=1)i[t].c();t.attr(n,"transform",l=`translate(${e[3]})`)},m(e,l){o&&o.m(e,l),t.insert(e,n,l);for(let t=0;t<i.length;t+=1)i[t].m(n,null);a=!0},p(e,c){if(e[3]>0?o?o.p(e,c):(o=x(e),o.c(),o.m(n.parentNode,n)):o&&(o.d(1),o=null),145126&c[0]){let l;for(r=e[13],l=0;l<r.length;l+=1){const a=$(e,r,l);i[l]?(i[l].p(a,c),t.transition_in(i[l],1)):(i[l]=L(a),i[l].c(),t.transition_in(i[l],1),i[l].m(n,null))}for(t.group_outros(),l=r.length;l<i.length;l+=1)s(l);t.check_outros()}(!a||8&c[0]&&l!==(l=`translate(${e[3]})`))&&t.attr(n,"transform",l)},i(e){if(!a){for(let e=0;e<r.length;e+=1)t.transition_in(i[e]);a=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)t.transition_out(i[e]);a=!1},d(e){o&&o.d(e),e&&t.detach(n),t.destroy_each(i,e)}}}function b(e){let n,l,a=e[13],o=[];for(let t=0;t<a.length;t+=1)o[t]=R(D(e,a,t));const r=e=>t.transition_out(o[e],1,1,()=>{o[e]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();n=t.empty()},m(e,a){for(let t=0;t<o.length;t+=1)o[t].m(e,a);t.insert(e,n,a),l=!0},p(e,l){if(14311&l[0]){let i;for(a=e[13],i=0;i<a.length;i+=1){const r=D(e,a,i);o[i]?(o[i].p(r,l),t.transition_in(o[i],1)):(o[i]=R(r),o[i].c(),t.transition_in(o[i],1),o[i].m(n.parentNode,n))}for(t.group_outros(),i=a.length;i<o.length;i+=1)r(i);t.check_outros()}},i(e){if(!l){for(let e=0;e<a.length;e+=1)t.transition_in(o[e]);l=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)t.transition_out(o[e]);l=!1},d(e){t.destroy_each(o,e),e&&t.detach(n)}}}function x(e){let n,l=e[4],a=[];for(let t=0;t<l.length;t+=1)a[t]=z(v(e,l,t));return{c(){for(let t=0;t<a.length;t+=1)a[t].c();n=t.empty()},m(e,l){for(let t=0;t<a.length;t+=1)a[t].m(e,l);t.insert(e,n,l)},p(t,e){if(65776&e[0]){let o;for(l=t[4],o=0;o<l.length;o+=1){const r=v(t,l,o);a[o]?a[o].p(r,e):(a[o]=z(r),a[o].c(),a[o].m(n.parentNode,n))}for(;o<a.length;o+=1)a[o].d(1);a.length=l.length}},d(e){t.destroy_each(a,e),e&&t.detach(n)}}}function z(e){let n,l,a,o=e[30]+"";return{c(){n=t.svg_element("text"),l=t.text(o),t.attr(n,"alignment-baseline","middle"),t.attr(n,"fill",e[5]),t.attr(n,"font-family",e[6]),t.attr(n,"font-size",e[7]),t.attr(n,"x","0"),t.attr(n,"y",a=e[16](e[28]))},m(e,a){t.insert(e,n,a),t.append(n,l)},p(e,r){16&r[0]&&o!==(o=e[30]+"")&&t.set_data(l,o),32&r[0]&&t.attr(n,"fill",e[5]),64&r[0]&&t.attr(n,"font-family",e[6]),128&r[0]&&t.attr(n,"font-size",e[7]),65536&r[0]&&a!==(a=e[16](e[28]))&&t.attr(n,"y",a)},d(e){e&&t.detach(n)}}}function S(e){let n,l,a,o=e[10][e[26][0].date.getMonth()]+"";return{c(){n=t.svg_element("text"),l=t.text(o),t.attr(n,"alignment-baseline","hanging"),t.attr(n,"fill",e[5]),t.attr(n,"font-family",e[6]),t.attr(n,"font-size",e[7]),t.attr(n,"x",a=e[12]*e[28])},m(e,a){t.insert(e,n,a),t.append(n,l)},p(e,r){9216&r[0]&&o!==(o=e[10][e[26][0].date.getMonth()]+"")&&t.set_data(l,o),32&r[0]&&t.attr(n,"fill",e[5]),64&r[0]&&t.attr(n,"font-family",e[6]),128&r[0]&&t.attr(n,"font-size",e[7]),4096&r[0]&&a!==(a=e[12]*e[28])&&t.attr(n,"x",a)},d(e){e&&t.detach(n)}}}function L(e){let n,l,a=e[9]>0&&e[17](e[13],e[28]);const o=new _({props:{cellRadius:e[1],cellRect:e[12],cellSize:e[2],days:e[26],index:e[28],monthLabelHeight:e[9]}});let r=a&&S(e);return{c(){t.create_component(o.$$.fragment),r&&r.c(),n=t.empty()},m(e,a){t.mount_component(o,e,a),r&&r.m(e,a),t.insert(e,n,a),l=!0},p(t,e){const l={};2&e[0]&&(l.cellRadius=t[1]),4096&e[0]&&(l.cellRect=t[12]),4&e[0]&&(l.cellSize=t[2]),8192&e[0]&&(l.days=t[26]),512&e[0]&&(l.monthLabelHeight=t[9]),o.$set(l),8704&e[0]&&(a=t[9]>0&&t[17](t[13],t[28])),a?r?r.p(t,e):(r=S(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i(e){l||(t.transition_in(o.$$.fragment,e),l=!0)},o(e){t.transition_out(o.$$.fragment,e),l=!1},d(e){t.destroy_component(o,e),r&&r.d(e),e&&t.detach(n)}}}function R(e){let n;const l=new h({props:{cellGap:e[0],cellRadius:e[1],cellRect:e[12],cellSize:e[2],days:e[26],fontColor:e[5],fontFamily:e[6],fontSize:e[7],index:e[28],monthGap:e[8],monthLabelHeight:e[9],monthLabels:e[10]}});return{c(){t.create_component(l.$$.fragment)},m(e,a){t.mount_component(l,e,a),n=!0},p(t,e){const n={};1&e[0]&&(n.cellGap=t[0]),2&e[0]&&(n.cellRadius=t[1]),4096&e[0]&&(n.cellRect=t[12]),4&e[0]&&(n.cellSize=t[2]),8192&e[0]&&(n.days=t[26]),32&e[0]&&(n.fontColor=t[5]),64&e[0]&&(n.fontFamily=t[6]),128&e[0]&&(n.fontSize=t[7]),256&e[0]&&(n.monthGap=t[8]),512&e[0]&&(n.monthLabelHeight=t[9]),1024&e[0]&&(n.monthLabels=t[10]),l.$set(n)},i(e){n||(t.transition_in(l.$$.fragment,e),n=!0)},o(e){t.transition_out(l.$$.fragment,e),n=!1},d(e){t.destroy_component(l,e)}}}function C(e){let n,l,a,o,r;const i=[b,w],s=[];function c(t,e){return"monthly"===t[11]?0:1}return l=c(e),a=s[l]=i[l](e),{c(){n=t.svg_element("svg"),a.c(),t.attr(n,"viewBox",o=`0 0 ${e[15]} ${e[14]}`)},m(e,a){t.insert(e,n,a),s[l].m(n,null),r=!0},p(e,u){let d=l;l=c(e),l===d?s[l].p(e,u):(t.group_outros(),t.transition_out(s[d],1,1,()=>{s[d]=null}),t.check_outros(),a=s[l],a||(a=s[l]=i[l](e),a.c()),t.transition_in(a,1),a.m(n,null)),(!r||49152&u[0]&&o!==(o=`0 0 ${e[15]} ${e[14]}`))&&t.attr(n,"viewBox",o)},i(e){r||(t.transition_in(a),r=!0)},o(e){t.transition_out(a),r=!1},d(e){e&&t.detach(n),s[l].d()}}}function G(t,e,l){let{allowOverflow:o=!1}=e,{cellGap:r=2}=e,{cellRadius:i=0}=e,{cellSize:s=10}=e,{colors:c=["#c6e48b","#7bc96f","#239a3b","#196127"]}=e,{data:u=[]}=e,{dayLabelWidth:d=20}=e,{dayLabels:f=["","Mon","","Wed","","Fri",""]}=e,{emptyColor:h="#ebedf0"}=e,{endDate:m=null}=e,{fontColor:g="#333"}=e,{fontFamily:p="sans-serif"}=e,{fontSize:y=8}=e,{monthGap:_=2}=e,{monthLabelHeight:$=12}=e,{monthLabels:v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}=e,{startDate:D=null}=e,{view:w="weekly"}=e;let b,x,z,S,L,R,C;return t.$set=t=>{"allowOverflow"in t&&l(18,o=t.allowOverflow),"cellGap"in t&&l(0,r=t.cellGap),"cellRadius"in t&&l(1,i=t.cellRadius),"cellSize"in t&&l(2,s=t.cellSize),"colors"in t&&l(19,c=t.colors),"data"in t&&l(20,u=t.data),"dayLabelWidth"in t&&l(3,d=t.dayLabelWidth),"dayLabels"in t&&l(4,f=t.dayLabels),"emptyColor"in t&&l(21,h=t.emptyColor),"endDate"in t&&l(22,m=t.endDate),"fontColor"in t&&l(5,g=t.fontColor),"fontFamily"in t&&l(6,p=t.fontFamily),"fontSize"in t&&l(7,y=t.fontSize),"monthGap"in t&&l(8,_=t.monthGap),"monthLabelHeight"in t&&l(9,$=t.monthLabelHeight),"monthLabels"in t&&l(10,v=t.monthLabels),"startDate"in t&&l(23,D=t.startDate),"view"in t&&l(11,w=t.view)},t.$$.update=()=>{5&t.$$.dirty[0]&&l(12,b=s+r),16517120&t.$$.dirty[0]&&l(24,x=a({allowOverflow:o,colors:c,data:u,emptyColor:h,endDate:m,startDate:D,view:w})),29624320&t.$$.dirty[0]&&l(13,z="monthly"===w?function({allowOverflow:t,calendar:e,endDate:l,startDate:a}){let o=-1;return a=n(a),l=n(l),e.reduce((e,n)=>{const r=n.date.getMonth();return o!==r&&(e.push([]),o=r),(t||(!a||n.date>=a)&&(!l||n.date<=l))&&e[e.length-1].push(n),e},[])}({allowOverflow:o,calendar:x,endDate:m,startDate:D}):function({allowOverflow:t,calendar:e,endDate:l,startDate:a}){return a=n(a),l=n(l),e.reduce((e,n,o)=>(o%7==0&&e.push([]),(t||(!a||n.date>=a)&&(!l||n.date<=l))&&e[e.length-1].push(n),e),[])}({allowOverflow:o,calendar:x,endDate:m,startDate:D})),4097&t.$$.dirty[0]&&l(25,S=7*b-r),33561089&t.$$.dirty[0]&&l(14,L="monthly"===w?6*b-r+$:S+$),33569033&t.$$.dirty[0]&&l(15,R="monthly"===w?(S+_)*z.length-_:b*z.length-r+d),4608&t.$$.dirty[0]&&l(16,C=t=>b*t+b/2+$)},[r,i,s,d,f,g,p,y,_,$,v,w,b,z,L,R,C,(t,e)=>{const n=t[e],l=t[e-1];if(!l)return!0;if(!l.length||!n.length)return!1;const a=n[0].date.getMonth(),o=l[0].date.getMonth();return e<t.length&&e<t.length-1&&(a>o||0===a&&11===o)},o,c,u,h,m,D]}class M extends t.SvelteComponent{constructor(e){super(),t.init(this,e,G,C,t.safe_not_equal,{allowOverflow:18,cellGap:0,cellRadius:1,cellSize:2,colors:19,data:20,dayLabelWidth:3,dayLabels:4,emptyColor:21,endDate:22,fontColor:5,fontFamily:6,fontSize:7,monthGap:8,monthLabelHeight:9,monthLabels:10,startDate:23,view:11},[-1,-1])}}return M.VERSION="1.0.1",M})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).SvelteHeatmap=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function l(t){t.forEach(e)}function o(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function r(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function f(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function u(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function s(t){return document.createTextNode(t)}function d(){return s("")}function h(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t,e){e=""+e,t.data!==e&&(t.data=e)}let m;function p(t){m=t}const y=[],$=[],b=[],w=[],D=Promise.resolve();let v=!1;function x(t){b.push(t)}let z=!1;const S=new Set;function L(){if(!z){z=!0;do{for(let t=0;t<y.length;t+=1){const e=y[t];p(e),R(e.$$)}for(y.length=0;$.length;)$.pop()();for(let t=0;t<b.length;t+=1){const e=b[t];S.has(e)||(S.add(e),e())}b.length=0}while(y.length);for(;w.length;)w.pop()();v=!1,z=!1,S.clear()}}function R(t){if(null!==t.fragment){t.update(),l(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}const M=new Set;let G;function C(){G={r:0,c:[],p:G}}function F(){G.r||l(G.c),G=G.p}function H(t,e){t&&t.i&&(M.delete(t),t.i(e))}function O(t,e,n,l){if(t&&t.o){if(M.has(t))return;M.add(t),G.c.push(()=>{M.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}}function _(t){t&&t.c()}function N(t,n,a){const{fragment:r,on_mount:i,on_destroy:c,after_update:f}=t.$$;r&&r.m(n,a),x(()=>{const n=i.map(e).filter(o);c?c.push(...n):l(n),t.$$.on_mount=[]}),f.forEach(x)}function A(t,e){const n=t.$$;null!==n.fragment&&(l(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function B(t,e){-1===t.$$.dirty[0]&&(y.push(t),v||(v=!0,D.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function E(e,o,a,r,i,f,u=[-1]){const s=m;p(e);const d=o.props||{},h=e.$$={fragment:null,ctx:null,props:f,update:t,not_equal:i,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:[]),callbacks:n(),dirty:u};let g=!1;if(h.ctx=a?a(e,d,(t,n,...l)=>{const o=l.length?l[0]:n;return h.ctx&&i(h.ctx[t],h.ctx[t]=o)&&(h.bound[t]&&h.bound[t](o),g&&B(e,t)),n}):[],h.update(),g=!0,l(h.before_update),h.fragment=!!r&&r(h.ctx),o.target){if(o.hydrate){const t=(y=o.target,Array.from(y.childNodes));h.fragment&&h.fragment.l(t),t.forEach(c)}else h.fragment&&h.fragment.c();o.intro&&H(e.$$.fragment),N(e,o.target,o.anchor),L()}var y;p(s)}class Y{$destroy(){A(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}function W(t){const e=new Date(t.getFullYear(),t.getMonth(),1).getDay(),n=t.getDate()+e-1;return Math.floor(n/7)}function k(t){if(t instanceof Date)return t;if(["number","string"].includes(typeof t))return new Date(t);throw new Error("Invalid date value")}function j(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function J({colors:t,data:e,emptyColor:n,endDate:l,startDate:o,view:a}){var r;o=o?k(o):new Date,l=l?k(l):new Date,"monthly"===a?(r=o,o=new Date(r.getFullYear(),r.getMonth(),1),l=function(t){return new Date(t.getFullYear(),t.getMonth()+1,0)}(l)):(o=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay())}(o),l=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+(6-t.getDay()))}(l));let i=0;const c=o.getDate(),f=Math.floor((l-o)/864e5)+1;return new Array(f).fill().map((t,n)=>{const l=function({data:t,offset:e,startDate:n,startDayOfMonth:l}){const o=new Date(n);o.setDate(l+e);const a=new Date(o);a.setDate(o.getDate()+1);const r=t.reduce((t,e)=>{const n=k(e.date);return n>=o&&n<a?t+e.value:t},0);return{date:o,value:r}}({data:e,offset:n,startDate:o,startDayOfMonth:c});return l.value>i&&(i=l.value),l}).map(({date:e,value:l})=>({color:function({colors:t,max:e,value:n}){if(t.length&&n){let l=t[0];const o=n/e;for(let e=1;e<t.length;e++){if(o<e/t.length)return l;l=t[e]}return t[t.length-1]}return null}({colors:t,max:i,value:l})||n,date:e,value:l}))}function I(e){let n,l;return{c(){n=u("rect"),h(n,"data-date",l=j(e[1])),h(n,"data-value",e[4]),h(n,"fill",e[0]),h(n,"height",e[3]),h(n,"rx",e[2]),h(n,"width",e[3]),h(n,"x",e[5]),h(n,"y",e[6])},m(t,e){i(t,n,e)},p(t,[e]){2&e&&l!==(l=j(t[1]))&&h(n,"data-date",l),16&e&&h(n,"data-value",t[4]),1&e&&h(n,"fill",t[0]),8&e&&h(n,"height",t[3]),4&e&&h(n,"rx",t[2]),8&e&&h(n,"width",t[3]),32&e&&h(n,"x",t[5]),64&e&&h(n,"y",t[6])},i:t,o:t,d(t){t&&c(n)}}}function q(t,e,n){let{color:l}=e,{date:o}=e,{radius:a}=e,{size:r}=e,{value:i}=e,{x:c}=e,{y:f}=e;return t.$set=t=>{"color"in t&&n(0,l=t.color),"date"in t&&n(1,o=t.date),"radius"in t&&n(2,a=t.radius),"size"in t&&n(3,r=t.size),"value"in t&&n(4,i=t.value),"x"in t&&n(5,c=t.x),"y"in t&&n(6,f=t.y)},[l,o,a,r,i,c,f]}class P extends Y{constructor(t){super(),E(this,t,q,I,a,{color:0,date:1,radius:2,size:3,value:4,x:5,y:6})}}function T(t,e,n){const l=t.slice();return l[13]=e[n],l}function V(t){let e;const n=new P({props:{color:t[13].color,date:t[13].date,radius:t[0],size:t[2],value:t[13].value,x:t[13].date.getDay()*t[1],y:W(t[13].date)*t[1]+t[7]}});return{c(){_(n.$$.fragment)},m(t,l){N(n,t,l),e=!0},p(t,e){const l={};8&e&&(l.color=t[13].color),8&e&&(l.date=t[13].date),1&e&&(l.radius=t[0]),4&e&&(l.size=t[2]),8&e&&(l.value=t[13].value),10&e&&(l.x=t[13].date.getDay()*t[1]),138&e&&(l.y=W(t[13].date)*t[1]+t[7]),n.$set(l)},i(t){e||(H(n.$$.fragment,t),e=!0)},o(t){O(n.$$.fragment,t),e=!1},d(t){A(n,t)}}}function K(t){let e,n,l=t[8][t[3][0].date.getMonth()]+"";return{c(){e=u("text"),n=s(l),h(e,"alignment-baseline","hanging"),h(e,"fill",t[4]),h(e,"font-family",t[5]),h(e,"font-size",t[6]),h(e,"x","0"),h(e,"y","0")},m(t,l){i(t,e,l),r(e,n)},p(t,o){264&o&&l!==(l=t[8][t[3][0].date.getMonth()]+"")&&g(n,l),16&o&&h(e,"fill",t[4]),32&o&&h(e,"font-family",t[5]),64&o&&h(e,"font-size",t[6])},d(t){t&&c(e)}}}function Q(t){let e,n,l,o,a=t[3],s=[];for(let e=0;e<a.length;e+=1)s[e]=V(T(t,a,e));const g=t=>O(s[t],1,1,()=>{s[t]=null});let m=t[7]>0&&K(t);return{c(){e=u("g");for(let t=0;t<s.length;t+=1)s[t].c();n=d(),m&&m.c(),h(e,"transform",l=`translate(${t[9]}, 0)`)},m(t,l){i(t,e,l);for(let t=0;t<s.length;t+=1)s[t].m(e,null);r(e,n),m&&m.m(e,null),o=!0},p(t,[r]){if(143&r){let l;for(a=t[3],l=0;l<a.length;l+=1){const o=T(t,a,l);s[l]?(s[l].p(o,r),H(s[l],1)):(s[l]=V(o),s[l].c(),H(s[l],1),s[l].m(e,n))}for(C(),l=a.length;l<s.length;l+=1)g(l);F()}t[7]>0?m?m.p(t,r):(m=K(t),m.c(),m.m(e,null)):m&&(m.d(1),m=null),(!o||512&r&&l!==(l=`translate(${t[9]}, 0)`))&&h(e,"transform",l)},i(t){if(!o){for(let t=0;t<a.length;t+=1)H(s[t]);o=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)O(s[t]);o=!1},d(t){t&&c(e),f(s,t),m&&m.d()}}}function U(t,e,n){let l,{cellGap:o}=e,{cellRadius:a}=e,{cellRect:r}=e,{cellSize:i}=e,{days:c}=e,{fontColor:f}=e,{fontFamily:u}=e,{fontSize:s}=e,{index:d}=e,{monthGap:h}=e,{monthLabelHeight:g}=e,{monthLabels:m}=e;return t.$set=t=>{"cellGap"in t&&n(10,o=t.cellGap),"cellRadius"in t&&n(0,a=t.cellRadius),"cellRect"in t&&n(1,r=t.cellRect),"cellSize"in t&&n(2,i=t.cellSize),"days"in t&&n(3,c=t.days),"fontColor"in t&&n(4,f=t.fontColor),"fontFamily"in t&&n(5,u=t.fontFamily),"fontSize"in t&&n(6,s=t.fontSize),"index"in t&&n(11,d=t.index),"monthGap"in t&&n(12,h=t.monthGap),"monthLabelHeight"in t&&n(7,g=t.monthLabelHeight),"monthLabels"in t&&n(8,m=t.monthLabels)},t.$$.update=()=>{7170&t.$$.dirty&&n(9,l=(7*r-o+h)*d)},[a,r,i,c,f,u,s,g,m,l,o,d,h]}class X extends Y{constructor(t){super(),E(this,t,U,Q,a,{cellGap:10,cellRadius:0,cellRect:1,cellSize:2,days:3,fontColor:4,fontFamily:5,fontSize:6,index:11,monthGap:12,monthLabelHeight:7,monthLabels:8})}}function Z(t,e,n){const l=t.slice();return l[7]=e[n],l[6]=n,l}function tt(t){let e;const n=new P({props:{color:t[7].color,date:t[7].date,radius:t[0],size:t[2],value:t[7].value,y:t[7].date.getDay()*t[1]}});return{c(){_(n.$$.fragment)},m(t,l){N(n,t,l),e=!0},p(t,e){const l={};8&e&&(l.color=t[7].color),8&e&&(l.date=t[7].date),1&e&&(l.radius=t[0]),4&e&&(l.size=t[2]),8&e&&(l.value=t[7].value),10&e&&(l.y=t[7].date.getDay()*t[1]),n.$set(l)},i(t){e||(H(n.$$.fragment,t),e=!0)},o(t){O(n.$$.fragment,t),e=!1},d(t){A(n,t)}}}function et(t){let e,n,l,o=t[3],a=[];for(let e=0;e<o.length;e+=1)a[e]=tt(Z(t,o,e));const r=t=>O(a[t],1,1,()=>{a[t]=null});return{c(){e=u("g");for(let t=0;t<a.length;t+=1)a[t].c();h(e,"transform",n=`translate(${t[5]}, ${t[4]})`)},m(t,n){i(t,e,n);for(let t=0;t<a.length;t+=1)a[t].m(e,null);l=!0},p(t,[i]){if(15&i){let n;for(o=t[3],n=0;n<o.length;n+=1){const l=Z(t,o,n);a[n]?(a[n].p(l,i),H(a[n],1)):(a[n]=tt(l),a[n].c(),H(a[n],1),a[n].m(e,null))}for(C(),n=o.length;n<a.length;n+=1)r(n);F()}(!l||48&i&&n!==(n=`translate(${t[5]}, ${t[4]})`))&&h(e,"transform",n)},i(t){if(!l){for(let t=0;t<o.length;t+=1)H(a[t]);l=!0}},o(t){a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)O(a[t]);l=!1},d(t){t&&c(e),f(a,t)}}}function nt(t,e,n){let l,{cellRadius:o}=e,{cellRect:a}=e,{cellSize:r}=e,{days:i}=e,{index:c}=e,{monthLabelHeight:f}=e;return t.$set=t=>{"cellRadius"in t&&n(0,o=t.cellRadius),"cellRect"in t&&n(1,a=t.cellRect),"cellSize"in t&&n(2,r=t.cellSize),"days"in t&&n(3,i=t.days),"index"in t&&n(6,c=t.index),"monthLabelHeight"in t&&n(4,f=t.monthLabelHeight)},t.$$.update=()=>{66&t.$$.dirty&&n(5,l=a*c)},[o,a,r,i,f,l,c]}class lt extends Y{constructor(t){super(),E(this,t,nt,et,a,{cellRadius:0,cellRect:1,cellSize:2,days:3,index:6,monthLabelHeight:4})}}function ot(t,e,n){const l=t.slice();return l[26]=e[n],l[28]=n,l}function at(t,e,n){const l=t.slice();return l[30]=e[n],l[28]=n,l}function rt(t,e,n){const l=t.slice();return l[26]=e[n],l[28]=n,l}function it(t){let e,n,l,o=t[3]>0&&ft(t),a=t[13],r=[];for(let e=0;e<a.length;e+=1)r[e]=dt(ot(t,a,e));const s=t=>O(r[t],1,1,()=>{r[t]=null});return{c(){o&&o.c(),e=u("g");for(let t=0;t<r.length;t+=1)r[t].c();h(e,"transform",n=`translate(${t[3]})`)},m(t,n){o&&o.m(t,n),i(t,e,n);for(let t=0;t<r.length;t+=1)r[t].m(e,null);l=!0},p(t,i){if(t[3]>0?o?o.p(t,i):(o=ft(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),145126&i[0]){let n;for(a=t[13],n=0;n<a.length;n+=1){const l=ot(t,a,n);r[n]?(r[n].p(l,i),H(r[n],1)):(r[n]=dt(l),r[n].c(),H(r[n],1),r[n].m(e,null))}for(C(),n=a.length;n<r.length;n+=1)s(n);F()}(!l||8&i[0]&&n!==(n=`translate(${t[3]})`))&&h(e,"transform",n)},i(t){if(!l){for(let t=0;t<a.length;t+=1)H(r[t]);l=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)O(r[t]);l=!1},d(t){o&&o.d(t),t&&c(e),f(r,t)}}}function ct(t){let e,n,l=t[13],o=[];for(let e=0;e<l.length;e+=1)o[e]=ht(rt(t,l,e));const a=t=>O(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=d()},m(t,l){for(let e=0;e<o.length;e+=1)o[e].m(t,l);i(t,e,l),n=!0},p(t,n){if(14311&n[0]){let r;for(l=t[13],r=0;r<l.length;r+=1){const a=rt(t,l,r);o[r]?(o[r].p(a,n),H(o[r],1)):(o[r]=ht(a),o[r].c(),H(o[r],1),o[r].m(e.parentNode,e))}for(C(),r=l.length;r<o.length;r+=1)a(r);F()}},i(t){if(!n){for(let t=0;t<l.length;t+=1)H(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)O(o[t]);n=!1},d(t){f(o,t),t&&c(e)}}}function ft(t){let e,n=t[4],l=[];for(let e=0;e<n.length;e+=1)l[e]=ut(at(t,n,e));return{c(){for(let t=0;t<l.length;t+=1)l[t].c();e=d()},m(t,n){for(let e=0;e<l.length;e+=1)l[e].m(t,n);i(t,e,n)},p(t,o){if(65776&o[0]){let a;for(n=t[4],a=0;a<n.length;a+=1){const r=at(t,n,a);l[a]?l[a].p(r,o):(l[a]=ut(r),l[a].c(),l[a].m(e.parentNode,e))}for(;a<l.length;a+=1)l[a].d(1);l.length=n.length}},d(t){f(l,t),t&&c(e)}}}function ut(t){let e,n,l,o=t[30]+"";return{c(){e=u("text"),n=s(o),h(e,"alignment-baseline","middle"),h(e,"fill",t[5]),h(e,"font-family",t[6]),h(e,"font-size",t[7]),h(e,"x","0"),h(e,"y",l=t[16](t[28]))},m(t,l){i(t,e,l),r(e,n)},p(t,a){16&a[0]&&o!==(o=t[30]+"")&&g(n,o),32&a[0]&&h(e,"fill",t[5]),64&a[0]&&h(e,"font-family",t[6]),128&a[0]&&h(e,"font-size",t[7]),65536&a[0]&&l!==(l=t[16](t[28]))&&h(e,"y",l)},d(t){t&&c(e)}}}function st(t){let e,n,l,o=t[10][t[26][0].date.getMonth()]+"";return{c(){e=u("text"),n=s(o),h(e,"alignment-baseline","hanging"),h(e,"fill",t[5]),h(e,"font-family",t[6]),h(e,"font-size",t[7]),h(e,"x",l=t[12]*t[28])},m(t,l){i(t,e,l),r(e,n)},p(t,a){9216&a[0]&&o!==(o=t[10][t[26][0].date.getMonth()]+"")&&g(n,o),32&a[0]&&h(e,"fill",t[5]),64&a[0]&&h(e,"font-family",t[6]),128&a[0]&&h(e,"font-size",t[7]),4096&a[0]&&l!==(l=t[12]*t[28])&&h(e,"x",l)},d(t){t&&c(e)}}}function dt(t){let e,n,l=t[9]>0&&t[17](t[13],t[28]);const o=new lt({props:{cellRadius:t[1],cellRect:t[12],cellSize:t[2],days:t[26],index:t[28],monthLabelHeight:t[9]}});let a=l&&st(t);return{c(){_(o.$$.fragment),a&&a.c(),e=d()},m(t,l){N(o,t,l),a&&a.m(t,l),i(t,e,l),n=!0},p(t,n){const r={};2&n[0]&&(r.cellRadius=t[1]),4096&n[0]&&(r.cellRect=t[12]),4&n[0]&&(r.cellSize=t[2]),8192&n[0]&&(r.days=t[26]),512&n[0]&&(r.monthLabelHeight=t[9]),o.$set(r),8704&n[0]&&(l=t[9]>0&&t[17](t[13],t[28])),l?a?a.p(t,n):(a=st(t),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null)},i(t){n||(H(o.$$.fragment,t),n=!0)},o(t){O(o.$$.fragment,t),n=!1},d(t){A(o,t),a&&a.d(t),t&&c(e)}}}function ht(t){let e;const n=new X({props:{cellGap:t[0],cellRadius:t[1],cellRect:t[12],cellSize:t[2],days:t[26],fontColor:t[5],fontFamily:t[6],fontSize:t[7],index:t[28],monthGap:t[8],monthLabelHeight:t[9],monthLabels:t[10]}});return{c(){_(n.$$.fragment)},m(t,l){N(n,t,l),e=!0},p(t,e){const l={};1&e[0]&&(l.cellGap=t[0]),2&e[0]&&(l.cellRadius=t[1]),4096&e[0]&&(l.cellRect=t[12]),4&e[0]&&(l.cellSize=t[2]),8192&e[0]&&(l.days=t[26]),32&e[0]&&(l.fontColor=t[5]),64&e[0]&&(l.fontFamily=t[6]),128&e[0]&&(l.fontSize=t[7]),256&e[0]&&(l.monthGap=t[8]),512&e[0]&&(l.monthLabelHeight=t[9]),1024&e[0]&&(l.monthLabels=t[10]),n.$set(l)},i(t){e||(H(n.$$.fragment,t),e=!0)},o(t){O(n.$$.fragment,t),e=!1},d(t){A(n,t)}}}function gt(t){let e,n,l,o,a;const r=[ct,it],f=[];function s(t,e){return"monthly"===t[11]?0:1}return n=s(t),l=f[n]=r[n](t),{c(){e=u("svg"),l.c(),h(e,"viewBox",o=`0 0 ${t[15]} ${t[14]}`)},m(t,l){i(t,e,l),f[n].m(e,null),a=!0},p(t,i){let c=n;n=s(t),n===c?f[n].p(t,i):(C(),O(f[c],1,1,()=>{f[c]=null}),F(),l=f[n],l||(l=f[n]=r[n](t),l.c()),H(l,1),l.m(e,null)),(!a||49152&i[0]&&o!==(o=`0 0 ${t[15]} ${t[14]}`))&&h(e,"viewBox",o)},i(t){a||(H(l),a=!0)},o(t){O(l),a=!1},d(t){t&&c(e),f[n].d()}}}function mt(t,e,n){let{allowOverflow:l=!1}=e,{cellGap:o=2}=e,{cellRadius:a=0}=e,{cellSize:r=10}=e,{colors:i=["#c6e48b","#7bc96f","#239a3b","#196127"]}=e,{data:c=[]}=e,{dayLabelWidth:f=20}=e,{dayLabels:u=["","Mon","","Wed","","Fri",""]}=e,{emptyColor:s="#ebedf0"}=e,{endDate:d=null}=e,{fontColor:h="#333"}=e,{fontFamily:g="sans-serif"}=e,{fontSize:m=8}=e,{monthGap:p=2}=e,{monthLabelHeight:y=12}=e,{monthLabels:$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}=e,{startDate:b=null}=e,{view:w="weekly"}=e;let D,v,x,z,S,L,R;return t.$set=t=>{"allowOverflow"in t&&n(18,l=t.allowOverflow),"cellGap"in t&&n(0,o=t.cellGap),"cellRadius"in t&&n(1,a=t.cellRadius),"cellSize"in t&&n(2,r=t.cellSize),"colors"in t&&n(19,i=t.colors),"data"in t&&n(20,c=t.data),"dayLabelWidth"in t&&n(3,f=t.dayLabelWidth),"dayLabels"in t&&n(4,u=t.dayLabels),"emptyColor"in t&&n(21,s=t.emptyColor),"endDate"in t&&n(22,d=t.endDate),"fontColor"in t&&n(5,h=t.fontColor),"fontFamily"in t&&n(6,g=t.fontFamily),"fontSize"in t&&n(7,m=t.fontSize),"monthGap"in t&&n(8,p=t.monthGap),"monthLabelHeight"in t&&n(9,y=t.monthLabelHeight),"monthLabels"in t&&n(10,$=t.monthLabels),"startDate"in t&&n(23,b=t.startDate),"view"in t&&n(11,w=t.view)},t.$$.update=()=>{5&t.$$.dirty[0]&&n(12,D=r+o),16517120&t.$$.dirty[0]&&n(24,v=J({allowOverflow:l,colors:i,data:c,emptyColor:s,endDate:d,startDate:b,view:w})),29624320&t.$$.dirty[0]&&n(13,x="monthly"===w?function({allowOverflow:t,calendar:e,endDate:n,startDate:l}){let o=-1;return l=k(l),n=k(n),e.reduce((e,a)=>{const r=a.date.getMonth();return o!==r&&(e.push([]),o=r),(t||(!l||a.date>=l)&&(!n||a.date<=n))&&e[e.length-1].push(a),e},[])}({allowOverflow:l,calendar:v,endDate:d,startDate:b}):function({allowOverflow:t,calendar:e,endDate:n,startDate:l}){return l=k(l),n=k(n),e.reduce((e,o,a)=>(a%7==0&&e.push([]),(t||(!l||o.date>=l)&&(!n||o.date<=n))&&e[e.length-1].push(o),e),[])}({allowOverflow:l,calendar:v,endDate:d,startDate:b})),4097&t.$$.dirty[0]&&n(25,z=7*D-o),33561089&t.$$.dirty[0]&&n(14,S="monthly"===w?6*D-o+y:z+y),33569033&t.$$.dirty[0]&&n(15,L="monthly"===w?(z+p)*x.length-p:D*x.length-o+f),4608&t.$$.dirty[0]&&n(16,R=t=>D*t+D/2+y)},[o,a,r,f,u,h,g,m,p,y,$,w,D,x,S,L,R,(t,e)=>{const n=t[e],l=t[e-1];if(!l)return!0;if(!l.length||!n.length)return!1;const o=n[0].date.getMonth(),a=l[0].date.getMonth();return e<t.length&&e<t.length-1&&(o>a||0===o&&11===a)},l,i,c,s,d,b]}class pt extends Y{constructor(t){super(),E(this,t,mt,gt,a,{allowOverflow:18,cellGap:0,cellRadius:1,cellSize:2,colors:19,data:20,dayLabelWidth:3,dayLabels:4,emptyColor:21,endDate:22,fontColor:5,fontFamily:6,fontSize:7,monthGap:8,monthLabelHeight:9,monthLabels:10,startDate:23,view:11},[-1,-1])}}return pt.VERSION="1.0.2",pt})); |
@@ -8,13 +8,14 @@ { | ||
"devDependencies": { | ||
"@babel/core": "^7.9.0", | ||
"@babel/preset-env": "^7.9.5", | ||
"babel-jest": "^25.3.0", | ||
"consola": "^2.11.3", | ||
"fs-extra": "^9.0.0", | ||
"jest": "^25.3.0", | ||
"rollup": "^2.4.0", | ||
"@babel/core": "^7.10.2", | ||
"@babel/preset-env": "^7.10.2", | ||
"@rollup/plugin-node-resolve": "^8.0.1", | ||
"babel-jest": "^26.0.1", | ||
"consola": "^2.12.2", | ||
"fs-extra": "^9.0.1", | ||
"jest": "^26.0.1", | ||
"rollup": "^2.13.1", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-svelte": "^5.2.1", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"svelte": "^3.20.1" | ||
"rollup-plugin-svelte": "^5.2.2", | ||
"rollup-plugin-terser": "^6.1.0", | ||
"svelte": "^3.23.0" | ||
}, | ||
@@ -45,3 +46,3 @@ "files": [ | ||
"unpkg": "dist/index.umd.min.js", | ||
"version": "1.0.1" | ||
"version": "1.0.2" | ||
} |
@@ -6,2 +6,3 @@ # svelte-heatmap | ||
[![Dev dependencies](https://img.shields.io/david/dev/scottbedard/svelte-heatmap)](https://david-dm.org/scottbedard/svelte-heatmap?type=dev) | ||
[![Size](https://img.shields.io/bundlephobia/minzip/svelte-heatmap?color=yellow&label=size)](https://bundlephobia.com/result?p=svelte-heatmap) | ||
[![NPM](https://img.shields.io/npm/v/svelte-heatmap)](https://www.npmjs.com/package/svelte-heatmap) | ||
@@ -12,3 +13,3 @@ [![License](https://img.shields.io/github/license/scottbedard/svelte-heatmap?color=blue)](https://github.com/scottbedard/svelte-heatmap/blob/master/LICENSE) | ||
![Heatmap examples](https://user-images.githubusercontent.com/7980426/78958159-27d55280-7a9c-11ea-9b08-8b5d7df31d7a.png) | ||
[![Heatmap examples](https://user-images.githubusercontent.com/7980426/78958159-27d55280-7a9c-11ea-9b08-8b5d7df31d7a.png)](https://svelte-heatmap.netlify.app/) | ||
@@ -23,3 +24,3 @@ ## 📦 Installation | ||
Alternatively, you use this script tag to install via the CDN. When choosing the CDN, the package will be exposed globally as `SvelteHeatmap`. | ||
Alternatively, you may access it via the CDN. When using the CDN, this package will be exposed globally as `SvelteHeatmap`. | ||
@@ -77,3 +78,3 @@ ```html | ||
Array of CSS colors to use for the chart, ordered from lowest to highest. Default colors match the GitHub contribution graph. | ||
Array of CSS colors to use for the chart, ordered from lowest to highest. Default colors match GitHub's contribution graph with `['#c6e48b', '#7bc96f', '#239a3b', '#196127']`. | ||
@@ -80,0 +81,0 @@ ##### `data` |
import SvelteHeatmap from './SvelteHeatmap.svelte'; | ||
SvelteHeatmap.VERSION = '1.0.1'; | ||
SvelteHeatmap.VERSION = '1.0.2'; | ||
export default SvelteHeatmap; |
@@ -74,3 +74,3 @@ import { | ||
// | ||
describe.only('getWeekIndex', () => { | ||
describe('getWeekIndex', () => { | ||
Object.entries({ | ||
@@ -77,0 +77,0 @@ '2020-01-01': 0, |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
198673
5483
0
134
12