svelte-plots-basic 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,4047 @@
1
+ function noop() { }
2
+ function assign(tar, src) {
3
+ // @ts-ignore
4
+ for (const k in src)
5
+ tar[k] = src[k];
6
+ return tar;
7
+ }
8
+ function run(fn) {
9
+ return fn();
10
+ }
11
+ function blank_object() {
12
+ return Object.create(null);
13
+ }
14
+ function run_all(fns) {
15
+ fns.forEach(run);
16
+ }
17
+ function is_function(thing) {
18
+ return typeof thing === 'function';
19
+ }
20
+ function safe_not_equal(a, b) {
21
+ return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
22
+ }
23
+ function is_empty(obj) {
24
+ return Object.keys(obj).length === 0;
25
+ }
26
+ function subscribe(store, ...callbacks) {
27
+ if (store == null) {
28
+ return noop;
29
+ }
30
+ const unsub = store.subscribe(...callbacks);
31
+ return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
32
+ }
33
+ function component_subscribe(component, store, callback) {
34
+ component.$$.on_destroy.push(subscribe(store, callback));
35
+ }
36
+ function create_slot(definition, ctx, $$scope, fn) {
37
+ if (definition) {
38
+ const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
39
+ return definition[0](slot_ctx);
40
+ }
41
+ }
42
+ function get_slot_context(definition, ctx, $$scope, fn) {
43
+ return definition[1] && fn
44
+ ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
45
+ : $$scope.ctx;
46
+ }
47
+ function get_slot_changes(definition, $$scope, dirty, fn) {
48
+ if (definition[2] && fn) {
49
+ const lets = definition[2](fn(dirty));
50
+ if ($$scope.dirty === undefined) {
51
+ return lets;
52
+ }
53
+ if (typeof lets === 'object') {
54
+ const merged = [];
55
+ const len = Math.max($$scope.dirty.length, lets.length);
56
+ for (let i = 0; i < len; i += 1) {
57
+ merged[i] = $$scope.dirty[i] | lets[i];
58
+ }
59
+ return merged;
60
+ }
61
+ return $$scope.dirty | lets;
62
+ }
63
+ return $$scope.dirty;
64
+ }
65
+ function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
66
+ if (slot_changes) {
67
+ const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
68
+ slot.p(slot_context, slot_changes);
69
+ }
70
+ }
71
+ function get_all_dirty_from_scope($$scope) {
72
+ if ($$scope.ctx.length > 32) {
73
+ const dirty = [];
74
+ const length = $$scope.ctx.length / 32;
75
+ for (let i = 0; i < length; i++) {
76
+ dirty[i] = -1;
77
+ }
78
+ return dirty;
79
+ }
80
+ return -1;
81
+ }
82
+ function append(target, node) {
83
+ target.appendChild(node);
84
+ }
85
+ function append_styles(target, style_sheet_id, styles) {
86
+ const append_styles_to = get_root_for_style(target);
87
+ if (!append_styles_to.getElementById(style_sheet_id)) {
88
+ const style = element('style');
89
+ style.id = style_sheet_id;
90
+ style.textContent = styles;
91
+ append_stylesheet(append_styles_to, style);
92
+ }
93
+ }
94
+ function get_root_for_style(node) {
95
+ if (!node)
96
+ return document;
97
+ const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
98
+ if (root && root.host) {
99
+ return root;
100
+ }
101
+ return node.ownerDocument;
102
+ }
103
+ function append_stylesheet(node, style) {
104
+ append(node.head || node, style);
105
+ }
106
+ function insert(target, node, anchor) {
107
+ target.insertBefore(node, anchor || null);
108
+ }
109
+ function detach(node) {
110
+ node.parentNode.removeChild(node);
111
+ }
112
+ function destroy_each(iterations, detaching) {
113
+ for (let i = 0; i < iterations.length; i += 1) {
114
+ if (iterations[i])
115
+ iterations[i].d(detaching);
116
+ }
117
+ }
118
+ function element(name) {
119
+ return document.createElement(name);
120
+ }
121
+ function svg_element(name) {
122
+ return document.createElementNS('http://www.w3.org/2000/svg', name);
123
+ }
124
+ function text(data) {
125
+ return document.createTextNode(data);
126
+ }
127
+ function space() {
128
+ return text(' ');
129
+ }
130
+ function empty() {
131
+ return text('');
132
+ }
133
+ function attr(node, attribute, value) {
134
+ if (value == null)
135
+ node.removeAttribute(attribute);
136
+ else if (node.getAttribute(attribute) !== value)
137
+ node.setAttribute(attribute, value);
138
+ }
139
+ function children(element) {
140
+ return Array.from(element.childNodes);
141
+ }
142
+ function set_data(text, data) {
143
+ data = '' + data;
144
+ if (text.wholeText !== data)
145
+ text.data = data;
146
+ }
147
+ function set_style(node, key, value, important) {
148
+ if (value === null) {
149
+ node.style.removeProperty(key);
150
+ }
151
+ else {
152
+ node.style.setProperty(key, value, important ? 'important' : '');
153
+ }
154
+ }
155
+ function toggle_class(element, name, toggle) {
156
+ element.classList[toggle ? 'add' : 'remove'](name);
157
+ }
158
+
159
+ let current_component;
160
+ function set_current_component(component) {
161
+ current_component = component;
162
+ }
163
+ function get_current_component() {
164
+ if (!current_component)
165
+ throw new Error('Function called outside component initialization');
166
+ return current_component;
167
+ }
168
+ function onMount(fn) {
169
+ get_current_component().$$.on_mount.push(fn);
170
+ }
171
+ function setContext(key, context) {
172
+ get_current_component().$$.context.set(key, context);
173
+ }
174
+ function getContext(key) {
175
+ return get_current_component().$$.context.get(key);
176
+ }
177
+
178
+ const dirty_components = [];
179
+ const binding_callbacks = [];
180
+ const render_callbacks = [];
181
+ const flush_callbacks = [];
182
+ const resolved_promise = Promise.resolve();
183
+ let update_scheduled = false;
184
+ function schedule_update() {
185
+ if (!update_scheduled) {
186
+ update_scheduled = true;
187
+ resolved_promise.then(flush);
188
+ }
189
+ }
190
+ function add_render_callback(fn) {
191
+ render_callbacks.push(fn);
192
+ }
193
+ // flush() calls callbacks in this order:
194
+ // 1. All beforeUpdate callbacks, in order: parents before children
195
+ // 2. All bind:this callbacks, in reverse order: children before parents.
196
+ // 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
197
+ // for afterUpdates called during the initial onMount, which are called in
198
+ // reverse order: children before parents.
199
+ // Since callbacks might update component values, which could trigger another
200
+ // call to flush(), the following steps guard against this:
201
+ // 1. During beforeUpdate, any updated components will be added to the
202
+ // dirty_components array and will cause a reentrant call to flush(). Because
203
+ // the flush index is kept outside the function, the reentrant call will pick
204
+ // up where the earlier call left off and go through all dirty components. The
205
+ // current_component value is saved and restored so that the reentrant call will
206
+ // not interfere with the "parent" flush() call.
207
+ // 2. bind:this callbacks cannot trigger new flush() calls.
208
+ // 3. During afterUpdate, any updated components will NOT have their afterUpdate
209
+ // callback called a second time; the seen_callbacks set, outside the flush()
210
+ // function, guarantees this behavior.
211
+ const seen_callbacks = new Set();
212
+ let flushidx = 0; // Do *not* move this inside the flush() function
213
+ function flush() {
214
+ const saved_component = current_component;
215
+ do {
216
+ // first, call beforeUpdate functions
217
+ // and update components
218
+ while (flushidx < dirty_components.length) {
219
+ const component = dirty_components[flushidx];
220
+ flushidx++;
221
+ set_current_component(component);
222
+ update(component.$$);
223
+ }
224
+ set_current_component(null);
225
+ dirty_components.length = 0;
226
+ flushidx = 0;
227
+ while (binding_callbacks.length)
228
+ binding_callbacks.pop()();
229
+ // then, once components are updated, call
230
+ // afterUpdate functions. This may cause
231
+ // subsequent updates...
232
+ for (let i = 0; i < render_callbacks.length; i += 1) {
233
+ const callback = render_callbacks[i];
234
+ if (!seen_callbacks.has(callback)) {
235
+ // ...so guard against infinite loops
236
+ seen_callbacks.add(callback);
237
+ callback();
238
+ }
239
+ }
240
+ render_callbacks.length = 0;
241
+ } while (dirty_components.length);
242
+ while (flush_callbacks.length) {
243
+ flush_callbacks.pop()();
244
+ }
245
+ update_scheduled = false;
246
+ seen_callbacks.clear();
247
+ set_current_component(saved_component);
248
+ }
249
+ function update($$) {
250
+ if ($$.fragment !== null) {
251
+ $$.update();
252
+ run_all($$.before_update);
253
+ const dirty = $$.dirty;
254
+ $$.dirty = [-1];
255
+ $$.fragment && $$.fragment.p($$.ctx, dirty);
256
+ $$.after_update.forEach(add_render_callback);
257
+ }
258
+ }
259
+ const outroing = new Set();
260
+ let outros;
261
+ function group_outros() {
262
+ outros = {
263
+ r: 0,
264
+ c: [],
265
+ p: outros // parent group
266
+ };
267
+ }
268
+ function check_outros() {
269
+ if (!outros.r) {
270
+ run_all(outros.c);
271
+ }
272
+ outros = outros.p;
273
+ }
274
+ function transition_in(block, local) {
275
+ if (block && block.i) {
276
+ outroing.delete(block);
277
+ block.i(local);
278
+ }
279
+ }
280
+ function transition_out(block, local, detach, callback) {
281
+ if (block && block.o) {
282
+ if (outroing.has(block))
283
+ return;
284
+ outroing.add(block);
285
+ outros.c.push(() => {
286
+ outroing.delete(block);
287
+ if (callback) {
288
+ if (detach)
289
+ block.d(1);
290
+ callback();
291
+ }
292
+ });
293
+ block.o(local);
294
+ }
295
+ }
296
+ function create_component(block) {
297
+ block && block.c();
298
+ }
299
+ function mount_component(component, target, anchor, customElement) {
300
+ const { fragment, on_mount, on_destroy, after_update } = component.$$;
301
+ fragment && fragment.m(target, anchor);
302
+ if (!customElement) {
303
+ // onMount happens before the initial afterUpdate
304
+ add_render_callback(() => {
305
+ const new_on_destroy = on_mount.map(run).filter(is_function);
306
+ if (on_destroy) {
307
+ on_destroy.push(...new_on_destroy);
308
+ }
309
+ else {
310
+ // Edge case - component was destroyed immediately,
311
+ // most likely as a result of a binding initialising
312
+ run_all(new_on_destroy);
313
+ }
314
+ component.$$.on_mount = [];
315
+ });
316
+ }
317
+ after_update.forEach(add_render_callback);
318
+ }
319
+ function destroy_component(component, detaching) {
320
+ const $$ = component.$$;
321
+ if ($$.fragment !== null) {
322
+ run_all($$.on_destroy);
323
+ $$.fragment && $$.fragment.d(detaching);
324
+ // TODO null out other refs, including component.$$ (but need to
325
+ // preserve final state?)
326
+ $$.on_destroy = $$.fragment = null;
327
+ $$.ctx = [];
328
+ }
329
+ }
330
+ function make_dirty(component, i) {
331
+ if (component.$$.dirty[0] === -1) {
332
+ dirty_components.push(component);
333
+ schedule_update();
334
+ component.$$.dirty.fill(0);
335
+ }
336
+ component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
337
+ }
338
+ function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
339
+ const parent_component = current_component;
340
+ set_current_component(component);
341
+ const $$ = component.$$ = {
342
+ fragment: null,
343
+ ctx: null,
344
+ // state
345
+ props,
346
+ update: noop,
347
+ not_equal,
348
+ bound: blank_object(),
349
+ // lifecycle
350
+ on_mount: [],
351
+ on_destroy: [],
352
+ on_disconnect: [],
353
+ before_update: [],
354
+ after_update: [],
355
+ context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
356
+ // everything else
357
+ callbacks: blank_object(),
358
+ dirty,
359
+ skip_bound: false,
360
+ root: options.target || parent_component.$$.root
361
+ };
362
+ append_styles && append_styles($$.root);
363
+ let ready = false;
364
+ $$.ctx = instance
365
+ ? instance(component, options.props || {}, (i, ret, ...rest) => {
366
+ const value = rest.length ? rest[0] : ret;
367
+ if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
368
+ if (!$$.skip_bound && $$.bound[i])
369
+ $$.bound[i](value);
370
+ if (ready)
371
+ make_dirty(component, i);
372
+ }
373
+ return ret;
374
+ })
375
+ : [];
376
+ $$.update();
377
+ ready = true;
378
+ run_all($$.before_update);
379
+ // `false` as a special case of no DOM component
380
+ $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
381
+ if (options.target) {
382
+ if (options.hydrate) {
383
+ const nodes = children(options.target);
384
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
385
+ $$.fragment && $$.fragment.l(nodes);
386
+ nodes.forEach(detach);
387
+ }
388
+ else {
389
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
390
+ $$.fragment && $$.fragment.c();
391
+ }
392
+ if (options.intro)
393
+ transition_in(component.$$.fragment);
394
+ mount_component(component, options.target, options.anchor, options.customElement);
395
+ flush();
396
+ }
397
+ set_current_component(parent_component);
398
+ }
399
+ /**
400
+ * Base class for Svelte components. Used when dev=false.
401
+ */
402
+ class SvelteComponent {
403
+ $destroy() {
404
+ destroy_component(this, 1);
405
+ this.$destroy = noop;
406
+ }
407
+ $on(type, callback) {
408
+ const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
409
+ callbacks.push(callback);
410
+ return () => {
411
+ const index = callbacks.indexOf(callback);
412
+ if (index !== -1)
413
+ callbacks.splice(index, 1);
414
+ };
415
+ }
416
+ $set($$props) {
417
+ if (this.$$set && !is_empty($$props)) {
418
+ this.$$.skip_bound = true;
419
+ this.$$set($$props);
420
+ this.$$.skip_bound = false;
421
+ }
422
+ }
423
+ }
424
+
425
+ const subscriber_queue = [];
426
+ /**
427
+ * Create a `Writable` store that allows both updating and reading by subscription.
428
+ * @param {*=}value initial value
429
+ * @param {StartStopNotifier=}start start and stop notifications for subscriptions
430
+ */
431
+ function writable(value, start = noop) {
432
+ let stop;
433
+ const subscribers = new Set();
434
+ function set(new_value) {
435
+ if (safe_not_equal(value, new_value)) {
436
+ value = new_value;
437
+ if (stop) { // store is ready
438
+ const run_queue = !subscriber_queue.length;
439
+ for (const subscriber of subscribers) {
440
+ subscriber[1]();
441
+ subscriber_queue.push(subscriber, value);
442
+ }
443
+ if (run_queue) {
444
+ for (let i = 0; i < subscriber_queue.length; i += 2) {
445
+ subscriber_queue[i][0](subscriber_queue[i + 1]);
446
+ }
447
+ subscriber_queue.length = 0;
448
+ }
449
+ }
450
+ }
451
+ }
452
+ function update(fn) {
453
+ set(fn(value));
454
+ }
455
+ function subscribe(run, invalidate = noop) {
456
+ const subscriber = [run, invalidate];
457
+ subscribers.add(subscriber);
458
+ if (subscribers.size === 1) {
459
+ stop = start(set) || noop;
460
+ }
461
+ run(value);
462
+ return () => {
463
+ subscribers.delete(subscriber);
464
+ if (subscribers.size === 0) {
465
+ stop();
466
+ stop = null;
467
+ }
468
+ };
469
+ }
470
+ return { set, update, subscribe };
471
+ }
472
+
473
+ /* src/Axes.svelte generated by Svelte v3.46.3 */
474
+
475
+ function add_css$2(target) {
476
+ append_styles(target, "svelte-vuzab", ".plot{font-family:Arial, Helvetica, sans-serif;display:grid;grid-template-columns:min-content 1fr;grid-template-rows:auto 1fr auto;grid-template-areas:\". title\"\n \"ylab axes\"\n \". xlab\";box-sizing:border-box;background:#fefefe;min-width:100px;min-height:50px;width:100%;height:100%;padding:0;margin:0}.plot_small{font-size:11px}.plot_medium{font-size:13px}.plot_large{font-size:16px}.plot_error{display:flex}.plot_error > .axes-wrapper{display:none}.message_error{font-size:1.2em;color:crimson;padding:20px;text-align:center}.axes-wrapper{grid-area:axes;position:relative;box-sizing:border-box;display:flex;padding:0;margin:0}.axes{display:block;box-sizing:border-box;position:absolute;padding:0;margin:0;height:100%;width:100%;max-height:100%;max-width:100%;min-height:100%;min-width:100%}.axes__xlabel{grid-area:xlab;font-size:1.0em;font-weight:600;padding:0.25em;text-align:center}.axes__ylabel{grid-area:ylab;font-size:1.0em;font-weight:600;padding:0.25em;text-align:center;vertical-align:middle;display:flex}.axes__ylabel > span{width:1.5em;line-height:1.5em;display:inline-block;writing-mode:vertical-rl;transform:rotate(180deg)}.axes__title{background:transparent;grid-area:title;font-size:1.3em;font-weight:bold;line-height:1.2em;padding:0.5em 0;text-align:center}.axis-labels{fill:#303030;font-size:0.95em}.labels{fill:#606060;font-size:0.90em}.labels{visibility:hidden;transition:visibility 0.25s linear, opacity 0.25s linear;opacity:0}");
477
+ }
478
+
479
+ const get_box_slot_changes = dirty => ({});
480
+ const get_box_slot_context = ctx => ({});
481
+ const get_yaxis_slot_changes = dirty => ({});
482
+ const get_yaxis_slot_context = ctx => ({});
483
+ const get_xaxis_slot_changes = dirty => ({});
484
+ const get_xaxis_slot_context = ctx => ({});
485
+
486
+ // (311:3) {#if title !== ""}
487
+ function create_if_block_3(ctx) {
488
+ let div;
489
+
490
+ return {
491
+ c() {
492
+ div = element("div");
493
+ attr(div, "class", "axes__title");
494
+ },
495
+ m(target, anchor) {
496
+ insert(target, div, anchor);
497
+ div.innerHTML = /*title*/ ctx[0];
498
+ },
499
+ p(ctx, dirty) {
500
+ if (dirty[0] & /*title*/ 1) div.innerHTML = /*title*/ ctx[0]; },
501
+ d(detaching) {
502
+ if (detaching) detach(div);
503
+ }
504
+ };
505
+ }
506
+
507
+ // (312:3) {#if yLabel !== ""}
508
+ function create_if_block_2(ctx) {
509
+ let div;
510
+ let span;
511
+
512
+ return {
513
+ c() {
514
+ div = element("div");
515
+ span = element("span");
516
+ attr(div, "class", "axes__ylabel");
517
+ },
518
+ m(target, anchor) {
519
+ insert(target, div, anchor);
520
+ append(div, span);
521
+ span.innerHTML = /*yLabel*/ ctx[2];
522
+ },
523
+ p(ctx, dirty) {
524
+ if (dirty[0] & /*yLabel*/ 4) span.innerHTML = /*yLabel*/ ctx[2]; },
525
+ d(detaching) {
526
+ if (detaching) detach(div);
527
+ }
528
+ };
529
+ }
530
+
531
+ // (313:3) {#if xLabel !== ""}
532
+ function create_if_block_1(ctx) {
533
+ let div;
534
+ let span;
535
+
536
+ return {
537
+ c() {
538
+ div = element("div");
539
+ span = element("span");
540
+ attr(div, "class", "axes__xlabel");
541
+ },
542
+ m(target, anchor) {
543
+ insert(target, div, anchor);
544
+ append(div, span);
545
+ span.innerHTML = /*xLabel*/ ctx[1];
546
+ },
547
+ p(ctx, dirty) {
548
+ if (dirty[0] & /*xLabel*/ 2) span.innerHTML = /*xLabel*/ ctx[1]; },
549
+ d(detaching) {
550
+ if (detaching) detach(div);
551
+ }
552
+ };
553
+ }
554
+
555
+ // (341:3) {#if !$isOk}
556
+ function create_if_block$9(ctx) {
557
+ let p;
558
+
559
+ return {
560
+ c() {
561
+ p = element("p");
562
+
563
+ p.innerHTML = `Axes component was not properly initialized. <br/>
564
+ Add plot series (check that coordinates are numeric) or define axes limits manually.`;
565
+
566
+ attr(p, "class", "message_error");
567
+ },
568
+ m(target, anchor) {
569
+ insert(target, p, anchor);
570
+ },
571
+ d(detaching) {
572
+ if (detaching) detach(p);
573
+ }
574
+ };
575
+ }
576
+
577
+ function create_fragment$b(ctx) {
578
+ let div1;
579
+ let t0;
580
+ let t1;
581
+ let t2;
582
+ let div0;
583
+ let svg;
584
+ let defs;
585
+ let clipPath;
586
+ let rect;
587
+ let rect_x_value;
588
+ let rect_y_value;
589
+ let rect_width_value;
590
+ let rect_height_value;
591
+ let g;
592
+ let t3;
593
+ let div1_class_value;
594
+ let current;
595
+ let if_block0 = /*title*/ ctx[0] !== "" && create_if_block_3(ctx);
596
+ let if_block1 = /*yLabel*/ ctx[2] !== "" && create_if_block_2(ctx);
597
+ let if_block2 = /*xLabel*/ ctx[1] !== "" && create_if_block_1(ctx);
598
+ const xaxis_slot_template = /*#slots*/ ctx[24].xaxis;
599
+ const xaxis_slot = create_slot(xaxis_slot_template, ctx, /*$$scope*/ ctx[23], get_xaxis_slot_context);
600
+ const yaxis_slot_template = /*#slots*/ ctx[24].yaxis;
601
+ const yaxis_slot = create_slot(yaxis_slot_template, ctx, /*$$scope*/ ctx[23], get_yaxis_slot_context);
602
+ const default_slot_template = /*#slots*/ ctx[24].default;
603
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[23], null);
604
+ const box_slot_template = /*#slots*/ ctx[24].box;
605
+ const box_slot = create_slot(box_slot_template, ctx, /*$$scope*/ ctx[23], get_box_slot_context);
606
+ let if_block3 = !/*$isOk*/ ctx[3] && create_if_block$9();
607
+
608
+ return {
609
+ c() {
610
+ div1 = element("div");
611
+ if (if_block0) if_block0.c();
612
+ t0 = space();
613
+ if (if_block1) if_block1.c();
614
+ t1 = space();
615
+ if (if_block2) if_block2.c();
616
+ t2 = space();
617
+ div0 = element("div");
618
+ svg = svg_element("svg");
619
+ defs = svg_element("defs");
620
+ clipPath = svg_element("clipPath");
621
+ rect = svg_element("rect");
622
+ if (xaxis_slot) xaxis_slot.c();
623
+ if (yaxis_slot) yaxis_slot.c();
624
+ g = svg_element("g");
625
+ if (default_slot) default_slot.c();
626
+ if (box_slot) box_slot.c();
627
+ t3 = space();
628
+ if (if_block3) if_block3.c();
629
+ attr(rect, "x", rect_x_value = /*cpx*/ ctx[7][0]);
630
+ attr(rect, "y", rect_y_value = /*cpy*/ ctx[6][1]);
631
+ attr(rect, "width", rect_width_value = /*cpx*/ ctx[7][1] - /*cpx*/ ctx[7][0]);
632
+ attr(rect, "height", rect_height_value = /*cpy*/ ctx[6][0] - /*cpy*/ ctx[6][1]);
633
+ attr(clipPath, "id", /*clipPathID*/ ctx[8]);
634
+ attr(g, "clip-path", "url(#" + /*clipPathID*/ ctx[8] + ")");
635
+ attr(svg, "preserveAspectRatio", "none");
636
+ attr(svg, "class", "axes");
637
+ attr(div0, "class", "axes-wrapper");
638
+ attr(div1, "class", div1_class_value = "plot " + ('plot_' + /*$scale*/ ctx[4]));
639
+ toggle_class(div1, "plot_error", !/*$isOk*/ ctx[3]);
640
+ },
641
+ m(target, anchor) {
642
+ insert(target, div1, anchor);
643
+ if (if_block0) if_block0.m(div1, null);
644
+ append(div1, t0);
645
+ if (if_block1) if_block1.m(div1, null);
646
+ append(div1, t1);
647
+ if (if_block2) if_block2.m(div1, null);
648
+ append(div1, t2);
649
+ append(div1, div0);
650
+ append(div0, svg);
651
+ append(svg, defs);
652
+ append(defs, clipPath);
653
+ append(clipPath, rect);
654
+
655
+ if (xaxis_slot) {
656
+ xaxis_slot.m(svg, null);
657
+ }
658
+
659
+ if (yaxis_slot) {
660
+ yaxis_slot.m(svg, null);
661
+ }
662
+
663
+ append(svg, g);
664
+
665
+ if (default_slot) {
666
+ default_slot.m(g, null);
667
+ }
668
+
669
+ if (box_slot) {
670
+ box_slot.m(svg, null);
671
+ }
672
+
673
+ /*div0_binding*/ ctx[25](div0);
674
+ append(div1, t3);
675
+ if (if_block3) if_block3.m(div1, null);
676
+ current = true;
677
+ },
678
+ p(ctx, dirty) {
679
+ if (/*title*/ ctx[0] !== "") {
680
+ if (if_block0) {
681
+ if_block0.p(ctx, dirty);
682
+ } else {
683
+ if_block0 = create_if_block_3(ctx);
684
+ if_block0.c();
685
+ if_block0.m(div1, t0);
686
+ }
687
+ } else if (if_block0) {
688
+ if_block0.d(1);
689
+ if_block0 = null;
690
+ }
691
+
692
+ if (/*yLabel*/ ctx[2] !== "") {
693
+ if (if_block1) {
694
+ if_block1.p(ctx, dirty);
695
+ } else {
696
+ if_block1 = create_if_block_2(ctx);
697
+ if_block1.c();
698
+ if_block1.m(div1, t1);
699
+ }
700
+ } else if (if_block1) {
701
+ if_block1.d(1);
702
+ if_block1 = null;
703
+ }
704
+
705
+ if (/*xLabel*/ ctx[1] !== "") {
706
+ if (if_block2) {
707
+ if_block2.p(ctx, dirty);
708
+ } else {
709
+ if_block2 = create_if_block_1(ctx);
710
+ if_block2.c();
711
+ if_block2.m(div1, t2);
712
+ }
713
+ } else if (if_block2) {
714
+ if_block2.d(1);
715
+ if_block2 = null;
716
+ }
717
+
718
+ if (!current || dirty[0] & /*cpx*/ 128 && rect_x_value !== (rect_x_value = /*cpx*/ ctx[7][0])) {
719
+ attr(rect, "x", rect_x_value);
720
+ }
721
+
722
+ if (!current || dirty[0] & /*cpy*/ 64 && rect_y_value !== (rect_y_value = /*cpy*/ ctx[6][1])) {
723
+ attr(rect, "y", rect_y_value);
724
+ }
725
+
726
+ if (!current || dirty[0] & /*cpx*/ 128 && rect_width_value !== (rect_width_value = /*cpx*/ ctx[7][1] - /*cpx*/ ctx[7][0])) {
727
+ attr(rect, "width", rect_width_value);
728
+ }
729
+
730
+ if (!current || dirty[0] & /*cpy*/ 64 && rect_height_value !== (rect_height_value = /*cpy*/ ctx[6][0] - /*cpy*/ ctx[6][1])) {
731
+ attr(rect, "height", rect_height_value);
732
+ }
733
+
734
+ if (xaxis_slot) {
735
+ if (xaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
736
+ update_slot_base(
737
+ xaxis_slot,
738
+ xaxis_slot_template,
739
+ ctx,
740
+ /*$$scope*/ ctx[23],
741
+ !current
742
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
743
+ : get_slot_changes(xaxis_slot_template, /*$$scope*/ ctx[23], dirty, get_xaxis_slot_changes),
744
+ get_xaxis_slot_context
745
+ );
746
+ }
747
+ }
748
+
749
+ if (yaxis_slot) {
750
+ if (yaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
751
+ update_slot_base(
752
+ yaxis_slot,
753
+ yaxis_slot_template,
754
+ ctx,
755
+ /*$$scope*/ ctx[23],
756
+ !current
757
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
758
+ : get_slot_changes(yaxis_slot_template, /*$$scope*/ ctx[23], dirty, get_yaxis_slot_changes),
759
+ get_yaxis_slot_context
760
+ );
761
+ }
762
+ }
763
+
764
+ if (default_slot) {
765
+ if (default_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
766
+ update_slot_base(
767
+ default_slot,
768
+ default_slot_template,
769
+ ctx,
770
+ /*$$scope*/ ctx[23],
771
+ !current
772
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
773
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[23], dirty, null),
774
+ null
775
+ );
776
+ }
777
+ }
778
+
779
+ if (box_slot) {
780
+ if (box_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
781
+ update_slot_base(
782
+ box_slot,
783
+ box_slot_template,
784
+ ctx,
785
+ /*$$scope*/ ctx[23],
786
+ !current
787
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
788
+ : get_slot_changes(box_slot_template, /*$$scope*/ ctx[23], dirty, get_box_slot_changes),
789
+ get_box_slot_context
790
+ );
791
+ }
792
+ }
793
+
794
+ if (!/*$isOk*/ ctx[3]) {
795
+ if (if_block3) ; else {
796
+ if_block3 = create_if_block$9();
797
+ if_block3.c();
798
+ if_block3.m(div1, null);
799
+ }
800
+ } else if (if_block3) {
801
+ if_block3.d(1);
802
+ if_block3 = null;
803
+ }
804
+
805
+ if (!current || dirty[0] & /*$scale*/ 16 && div1_class_value !== (div1_class_value = "plot " + ('plot_' + /*$scale*/ ctx[4]))) {
806
+ attr(div1, "class", div1_class_value);
807
+ }
808
+
809
+ if (dirty[0] & /*$scale, $isOk*/ 24) {
810
+ toggle_class(div1, "plot_error", !/*$isOk*/ ctx[3]);
811
+ }
812
+ },
813
+ i(local) {
814
+ if (current) return;
815
+ transition_in(xaxis_slot, local);
816
+ transition_in(yaxis_slot, local);
817
+ transition_in(default_slot, local);
818
+ transition_in(box_slot, local);
819
+ current = true;
820
+ },
821
+ o(local) {
822
+ transition_out(xaxis_slot, local);
823
+ transition_out(yaxis_slot, local);
824
+ transition_out(default_slot, local);
825
+ transition_out(box_slot, local);
826
+ current = false;
827
+ },
828
+ d(detaching) {
829
+ if (detaching) detach(div1);
830
+ if (if_block0) if_block0.d();
831
+ if (if_block1) if_block1.d();
832
+ if (if_block2) if_block2.d();
833
+ if (xaxis_slot) xaxis_slot.d(detaching);
834
+ if (yaxis_slot) yaxis_slot.d(detaching);
835
+ if (default_slot) default_slot.d(detaching);
836
+ if (box_slot) box_slot.d(detaching);
837
+ /*div0_binding*/ ctx[25](null);
838
+ if (if_block3) if_block3.d();
839
+ }
840
+ };
841
+ }
842
+
843
+ function niceNum(localRange, round) {
844
+ const exponent = Math.floor(Math.log10(localRange));
845
+ const fraction = localRange / Math.pow(10, exponent);
846
+ let niceFraction;
847
+
848
+ if (round) {
849
+ if (fraction < 1.5) niceFraction = 1; else if (fraction < 3) niceFraction = 2; else if (fraction < 7) niceFraction = 5; else niceFraction = 10;
850
+ } else {
851
+ if (fraction <= 1) niceFraction = 1; else if (fraction <= 2) niceFraction = 2; else if (fraction <= 5) niceFraction = 5; else niceFraction = 10;
852
+ }
853
+
854
+ return niceFraction * Math.pow(10, exponent);
855
+ }
856
+
857
+ /** Computes a scale level
858
+ * @param {numeric} width - width of plotting area in pixels
859
+ * @param {numeric} height - height of plotting area in pixels
860
+ * @returns {text} the scale level ("small", "medium" or "large")
861
+ */
862
+ function getScale(width, height) {
863
+ if (height < 300.2 || width < 300.2) return "small";
864
+ if (height < 600.2 || width < 600.2) return "medium";
865
+ return "large";
866
+ }
867
+
868
+ function instance$b($$self, $$props, $$invalidate) {
869
+ let margins;
870
+ let cpx;
871
+ let cpy;
872
+ let $height;
873
+ let $yLim;
874
+ let $isOk;
875
+ let $width;
876
+ let $xLim;
877
+ let $scale;
878
+ let { $$slots: slots = {}, $$scope } = $$props;
879
+ let { limX = [undefined, undefined] } = $$props;
880
+ let { limY = [undefined, undefined] } = $$props;
881
+ let { title = "" } = $$props;
882
+ let { xLabel = "" } = $$props;
883
+ let { yLabel = "" } = $$props;
884
+ let { multiSeries = true } = $$props;
885
+
886
+ /* constants for internal use */
887
+ // how big are margins (number of pixels in unit margin value) between axis and plot area if axis are shown
888
+ const AXES_MARGIN_FACTORS = { "small": 30, "medium": 40, "large": 50 };
889
+
890
+ // number of ticks along each axis
891
+ const TICK_NUM = { "small": 5, "medium": 8, "large": 12 };
892
+
893
+ // margin between plot series elements and data labels
894
+ const LABELS_MARGIN = { "small": 10, "medium": 15, "large": 20 };
895
+
896
+ // line styles for different scales and types
897
+ const LINE_STYLES = {
898
+ small: ["0", "3,3", "1,1", "3,1"],
899
+ medium: ["0", "5,5", "2,2", "5,2"],
900
+ large: ["0", "7,7", "3,3", "7,3"]
901
+ };
902
+
903
+ // constant to make clip path ID unique
904
+ const clipPathID = "plottingArea" + Math.round(Math.random() * 10000);
905
+
906
+ /* parameters for internal use inside the component */
907
+ let axesWrapper; // pointer to axes wrapper DOM element
908
+
909
+ let axesMargins = [0.034, 0.034, 0.034, 0.034]; // initial margins (will be multiplied to FACTORS)
910
+
911
+ /* reactive parameters to be shared with children via context */
912
+ const width = writable(100); // actual width of plotting area in pixels
913
+
914
+ component_subscribe($$self, width, value => $$invalidate(21, $width = value));
915
+ const height = writable(100); // actual height of plotting area in pixels
916
+ component_subscribe($$self, height, value => $$invalidate(19, $height = value));
917
+ const xLim = writable([undefined, undefined]); // actual limits for x-axis in plot units
918
+ component_subscribe($$self, xLim, value => $$invalidate(22, $xLim = value));
919
+ const yLim = writable([undefined, undefined]); // actual limits for y-axis in plot units
920
+ component_subscribe($$self, yLim, value => $$invalidate(20, $yLim = value));
921
+ const scale = writable("medium"); // scale factor (how big the shown plot is)
922
+ component_subscribe($$self, scale, value => $$invalidate(4, $scale = value));
923
+ const isOk = writable(false); // are axes ready for drawing
924
+ component_subscribe($$self, isOk, value => $$invalidate(3, $isOk = value));
925
+
926
+ /** Adds margins for x-axis (e.g. when x-axis must be shown) */
927
+ const addXAxisMargins = function () {
928
+ $$invalidate(18, axesMargins[0] = 1, axesMargins);
929
+ $$invalidate(18, axesMargins[2] = 0.5, axesMargins);
930
+ $$invalidate(18, axesMargins[1] = axesMargins[1] > 0.5 ? axesMargins[1] : 0.5, axesMargins);
931
+ $$invalidate(18, axesMargins[3] = axesMargins[3] > 0.5 ? axesMargins[3] : 0.5, axesMargins);
932
+ };
933
+
934
+ /** Adds margins for y-axis (e.g. when y-axis must be shown) */
935
+ const addYAxisMargins = function () {
936
+ $$invalidate(18, axesMargins[1] = 1, axesMargins);
937
+ $$invalidate(18, axesMargins[3] = 0.5, axesMargins);
938
+ $$invalidate(18, axesMargins[0] = axesMargins[0] > 0.5 ? axesMargins[0] : 0.5, axesMargins);
939
+ $$invalidate(18, axesMargins[2] = axesMargins[2] > 0.5 ? axesMargins[2] : 0.5, axesMargins);
940
+ };
941
+
942
+ /** Adjusts limits for x-axis (e.g. when new series is added)
943
+ * @param {Array} newLim - vector with new limits (two values)
944
+ */
945
+ const adjustXAxisLimits = function (newLim) {
946
+ if (!limX.some(v => v === undefined)) return;
947
+ xLim.update(lim => adjustAxisLimits(lim, newLim));
948
+ };
949
+
950
+ /** Adjusts limits for y-axis (e.g. when new series is added)
951
+ * @param {Array} newLim - vector with new limits (two values)
952
+ */
953
+ const adjustYAxisLimits = function (newLim) {
954
+ if (!limY.some(v => v === undefined)) return;
955
+ yLim.update(lim => adjustAxisLimits(lim, newLim));
956
+ };
957
+
958
+ /** Adjusts x- or y- axis limits (e.g. when new elements are added)
959
+ * @param {Array} lim - vector with limits for current axis (two values)
960
+ * @param {Array} newLim - vector with new limits (two values)
961
+ * @returns {Array} vector with rescaled values
962
+ *
963
+ * The new limits are set separately for min and max. Either if current value is undefined or
964
+ * if new value is outside the current limits (smaller than min or larger than max).
965
+ */
966
+ const adjustAxisLimits = function (lim, newLim) {
967
+ let adjustedLim = [
968
+ lim[0] !== undefined && multiSeries === true && lim[0] < newLim[0]
969
+ ? lim[0]
970
+ : newLim[0],
971
+ lim[1] !== undefined && multiSeries === true && lim[1] > newLim[1]
972
+ ? lim[1]
973
+ : newLim[1]
974
+ ];
975
+
976
+ // special case when both limits are zero
977
+ if (adjustedLim[0] === 0 && adjustedLim[1] === 0) {
978
+ adjustedLim = [-0.1, 0.1];
979
+ }
980
+
981
+ // special case when limits are equal (add ±5%)
982
+ if (adjustedLim[0] === adjustedLim[1]) {
983
+ adjustedLim = [adjustedLim[0] * 0.95, adjustedLim[0] * 1.05];
984
+ }
985
+
986
+ return adjustedLim;
987
+ };
988
+
989
+ /** Rescales x-values from plot coordinates to screen (SVG) coordinates
990
+ * @param {Array} x - vector with coordinates (or objects size) in original plot coordinates
991
+ * @param {Array} xLim - vector with current limits for x-axis in original plot coordinates
992
+ * @param {number} width - width of coordinate system in pixels
993
+ * @param {boolean} doSizeScreen - scale size of objects (true) or coordinates
994
+ * @returns {Array} vector with rescaled values
995
+ */
996
+ const scaleX = function (x, xLim, width, doSizeScale = false) {
997
+ if (!$isOk || x === undefined || !Array.isArray(x)) return undefined;
998
+
999
+ if (doSizeScale) {
1000
+ // scale size of objects instead of coordinates
1001
+ return x.map(v => v / (xLim[1] - xLim[0]) * (width - margins[1] - margins[3]));
1002
+ }
1003
+
1004
+ return x.map(v => (v - xLim[0]) / (xLim[1] - xLim[0]) * (width - margins[1] - margins[3]) + margins[1]);
1005
+ };
1006
+
1007
+ /** Rescales x-values from plot coordinates to screen (SVG) coordinates
1008
+ * @param {Array} x - vector with coordinates (or objects size) in original plot coordinates
1009
+ * @param {Array} xLim - vector with current limits for x-axis in original plot coordinates
1010
+ * @param {number} width - width of coordinate system in pixels
1011
+ * @param {boolean} doSizeScreen - scale size of objects (true) or coordinates
1012
+ * @returns {Array} vector with rescaled values
1013
+ */
1014
+ const scaleY = function (y, yLim, height, doSizeScale = false) {
1015
+ if (!$isOk || y === undefined || !Array.isArray(y)) return undefined;
1016
+
1017
+ if (doSizeScale) {
1018
+ // scale size of objects instead of coordinates
1019
+ return y.map(v => v / (yLim[1] - yLim[0]) * (height - margins[0] - margins[2]));
1020
+ }
1021
+
1022
+ // for coordinates we also need to invert (flip) the y-axis
1023
+ return y.map(v => (yLim[1] - v) / (yLim[1] - yLim[0]) * (height - margins[0] - margins[2]) + margins[2]);
1024
+ };
1025
+
1026
+ /** Computes nice tick values for axis
1027
+ * @param {Array} ticks - vector with ticks if alredy available (if not, new will be computed)
1028
+ * @param {Array} lim - vector with axis limits tickets must be computed for
1029
+ * @param {number} maxTickNum - maximum number of ticks to compute
1030
+ * @param {boolean} round - round or not the fractions when computing nice numbers for the ticks
1031
+ * @returns {Array} a vector with computed tick positions
1032
+ */
1033
+ const getAxisTicks = function (ticks, lim, maxTickNum, round = true) {
1034
+ // if ticks are already provided do not recompute them
1035
+ if (ticks !== undefined) return ticks;
1036
+
1037
+ // check if limits are ok
1038
+ if (!Array.isArray(lim) || lim[0] === undefined || lim[1] === undefined) return undefined;
1039
+
1040
+ // get range as a nice number and compute min, max and steps for the tick sequence
1041
+ const range = niceNum(lim[1] - lim[0], round);
1042
+
1043
+ const tickSpacing = niceNum(range / (maxTickNum - 1), round);
1044
+ const tickMin = Math.ceil(lim[0] / tickSpacing) * tickSpacing;
1045
+ const tickMax = Math.floor(lim[1] / tickSpacing) * tickSpacing;
1046
+
1047
+ // recompute maxTickNum
1048
+ maxTickNum = Math.round((tickMax - tickMin + 1) / tickSpacing) + 1;
1049
+
1050
+ // create a sequence and return
1051
+ ticks = [...Array(maxTickNum)].map((x, i) => tickMin + i * tickSpacing);
1052
+
1053
+ // if step is smaller than 1 round values to remove small decimals accidentiall added by JS
1054
+ if (Math.abs(tickSpacing) < 1) {
1055
+ const r = Math.pow(10, 1 + Math.round(-Math.log10(tickSpacing)));
1056
+ ticks = ticks.map(v => Math.round((v + Number.EPSILON) * r) / r);
1057
+ }
1058
+
1059
+ // make sure the ticks are not aligned with axes limits
1060
+ return ticks.filter(x => x >= lim[0] & x <= lim[1]);
1061
+ };
1062
+
1063
+ /* context with Axes constants, properties and methods to share with children */
1064
+ let context = {
1065
+ // methods
1066
+ addXAxisMargins,
1067
+ addYAxisMargins,
1068
+ adjustXAxisLimits,
1069
+ adjustYAxisLimits,
1070
+ getAxisTicks,
1071
+ scaleX,
1072
+ scaleY,
1073
+ // variables
1074
+ isOk,
1075
+ scale,
1076
+ width,
1077
+ height,
1078
+ xLim,
1079
+ yLim,
1080
+ // constants
1081
+ LINE_STYLES,
1082
+ LABELS_MARGIN,
1083
+ TICK_NUM
1084
+ };
1085
+
1086
+ setContext('axes', context);
1087
+
1088
+ /* observer for the plotting area size */
1089
+ var ro = new ResizeObserver(entries => {
1090
+ for (let entry of entries) {
1091
+ const cr = entry.contentRect;
1092
+ width.update(x => cr.width);
1093
+ height.update(x => cr.height);
1094
+ scale.update(x => getScale(cr.width, cr.height));
1095
+ }
1096
+ });
1097
+
1098
+ onMount(() => {
1099
+ ro.observe(axesWrapper);
1100
+ });
1101
+
1102
+ function div0_binding($$value) {
1103
+ binding_callbacks[$$value ? 'unshift' : 'push'](() => {
1104
+ axesWrapper = $$value;
1105
+ $$invalidate(5, axesWrapper);
1106
+ });
1107
+ }
1108
+
1109
+ $$self.$$set = $$props => {
1110
+ if ('limX' in $$props) $$invalidate(15, limX = $$props.limX);
1111
+ if ('limY' in $$props) $$invalidate(16, limY = $$props.limY);
1112
+ if ('title' in $$props) $$invalidate(0, title = $$props.title);
1113
+ if ('xLabel' in $$props) $$invalidate(1, xLabel = $$props.xLabel);
1114
+ if ('yLabel' in $$props) $$invalidate(2, yLabel = $$props.yLabel);
1115
+ if ('multiSeries' in $$props) $$invalidate(17, multiSeries = $$props.multiSeries);
1116
+ if ('$$scope' in $$props) $$invalidate(23, $$scope = $$props.$$scope);
1117
+ };
1118
+
1119
+ $$self.$$.update = () => {
1120
+ if ($$self.$$.dirty[0] & /*limX*/ 32768) {
1121
+ // this is reactive in case if limX and limY are interactively changed by parent script
1122
+ if (!limX.some(v => v === undefined)) xLim.update(v => limX);
1123
+ }
1124
+
1125
+ if ($$self.$$.dirty[0] & /*limY*/ 65536) {
1126
+ if (!limY.some(v => v === undefined)) yLim.update(v => limY);
1127
+ }
1128
+
1129
+ if ($$self.$$.dirty[0] & /*axesMargins, $scale*/ 262160) {
1130
+ // computes real margins in pixels based on current scale
1131
+ margins = axesMargins.map(v => v * AXES_MARGIN_FACTORS[$scale]);
1132
+ }
1133
+
1134
+ if ($$self.$$.dirty[0] & /*$yLim, $xLim*/ 5242880) {
1135
+ // computes status which tells that axes limits look fine and it is safe to draw
1136
+ // the status is based on the axis limits validity
1137
+ isOk.update(v => Array.isArray($yLim) && Array.isArray($xLim) && $xLim.length === 2 && $yLim.length === 2 && !$yLim.some(v => v === undefined) && !$xLim.some(v => v === undefined) && !$yLim.some(v => isNaN(v)) && !$xLim.some(v => isNaN(v)) && $xLim[1] !== $xLim[0] && $yLim[1] !== $yLim[0]);
1138
+ }
1139
+
1140
+ if ($$self.$$.dirty[0] & /*$isOk, $xLim, $width*/ 6291464) {
1141
+ // computes coordinates for clip path box
1142
+ $$invalidate(7, cpx = $isOk ? scaleX($xLim, $xLim, $width) : [0, 1]);
1143
+ }
1144
+
1145
+ if ($$self.$$.dirty[0] & /*$isOk, $yLim, $height*/ 1572872) {
1146
+ $$invalidate(6, cpy = $isOk ? scaleY($yLim, $yLim, $height) : [1, 0]);
1147
+ }
1148
+ };
1149
+
1150
+ return [
1151
+ title,
1152
+ xLabel,
1153
+ yLabel,
1154
+ $isOk,
1155
+ $scale,
1156
+ axesWrapper,
1157
+ cpy,
1158
+ cpx,
1159
+ clipPathID,
1160
+ width,
1161
+ height,
1162
+ xLim,
1163
+ yLim,
1164
+ scale,
1165
+ isOk,
1166
+ limX,
1167
+ limY,
1168
+ multiSeries,
1169
+ axesMargins,
1170
+ $height,
1171
+ $yLim,
1172
+ $width,
1173
+ $xLim,
1174
+ $$scope,
1175
+ slots,
1176
+ div0_binding
1177
+ ];
1178
+ }
1179
+
1180
+ class Axes extends SvelteComponent {
1181
+ constructor(options) {
1182
+ super();
1183
+
1184
+ init(
1185
+ this,
1186
+ options,
1187
+ instance$b,
1188
+ create_fragment$b,
1189
+ safe_not_equal,
1190
+ {
1191
+ limX: 15,
1192
+ limY: 16,
1193
+ title: 0,
1194
+ xLabel: 1,
1195
+ yLabel: 2,
1196
+ multiSeries: 17
1197
+ },
1198
+ add_css$2,
1199
+ [-1, -1]
1200
+ );
1201
+ }
1202
+ }
1203
+
1204
+ const Colors = {
1205
+ "AXIS_LINE": "#303030",
1206
+ "AXIS_TICK": "#606060",
1207
+ "WHITE": "#fff",
1208
+ "BLACK": "#000",
1209
+ "GRAY": "#909090",
1210
+ "MIDDLEGRAY": "#dadada",
1211
+ "LIGHTGRAY": "#f0f0f0",
1212
+ "DARKGRAY": "#606060",
1213
+
1214
+ "PRIMARY": "#2266ff",
1215
+ "PRIMARY_TEXT": "#333",
1216
+ };
1217
+
1218
+ /* src/XAxis.svelte generated by Svelte v3.46.3 */
1219
+
1220
+ function get_each_context$5(ctx, list, i) {
1221
+ const child_ctx = ctx.slice();
1222
+ child_ctx[26] = list[i];
1223
+ child_ctx[28] = i;
1224
+ return child_ctx;
1225
+ }
1226
+
1227
+ // (57:0) {#if $isOk && x !== undefined && y !== undefined }
1228
+ function create_if_block$8(ctx) {
1229
+ let g;
1230
+ let line;
1231
+ let line_x__value;
1232
+ let line_x__value_1;
1233
+ let line_y__value;
1234
+ let line_y__value_1;
1235
+ let each_value = /*ticksX*/ ctx[4];
1236
+ let each_blocks = [];
1237
+
1238
+ for (let i = 0; i < each_value.length; i += 1) {
1239
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
1240
+ }
1241
+
1242
+ return {
1243
+ c() {
1244
+ g = svg_element("g");
1245
+
1246
+ for (let i = 0; i < each_blocks.length; i += 1) {
1247
+ each_blocks[i].c();
1248
+ }
1249
+
1250
+ line = svg_element("line");
1251
+ attr(line, "x1", line_x__value = /*x*/ ctx[5][0]);
1252
+ attr(line, "x2", line_x__value_1 = /*x*/ ctx[5][1]);
1253
+ attr(line, "y1", line_y__value = /*y*/ ctx[2][0]);
1254
+ attr(line, "y2", line_y__value_1 = /*y*/ ctx[2][0]);
1255
+ attr(line, "style", /*axisLineStyleStr*/ ctx[7]);
1256
+ attr(g, "class", "mdaplot__axis mdaplot__xaxis");
1257
+ },
1258
+ m(target, anchor) {
1259
+ insert(target, g, anchor);
1260
+
1261
+ for (let i = 0; i < each_blocks.length; i += 1) {
1262
+ each_blocks[i].m(g, null);
1263
+ }
1264
+
1265
+ append(g, line);
1266
+ },
1267
+ p(ctx, dirty) {
1268
+ if (dirty & /*ticksX, ticksY, dy, tickLabels, axisLineStyleStr, y, gridLineStyleStr*/ 415) {
1269
+ each_value = /*ticksX*/ ctx[4];
1270
+ let i;
1271
+
1272
+ for (i = 0; i < each_value.length; i += 1) {
1273
+ const child_ctx = get_each_context$5(ctx, each_value, i);
1274
+
1275
+ if (each_blocks[i]) {
1276
+ each_blocks[i].p(child_ctx, dirty);
1277
+ } else {
1278
+ each_blocks[i] = create_each_block$5(child_ctx);
1279
+ each_blocks[i].c();
1280
+ each_blocks[i].m(g, line);
1281
+ }
1282
+ }
1283
+
1284
+ for (; i < each_blocks.length; i += 1) {
1285
+ each_blocks[i].d(1);
1286
+ }
1287
+
1288
+ each_blocks.length = each_value.length;
1289
+ }
1290
+
1291
+ if (dirty & /*x*/ 32 && line_x__value !== (line_x__value = /*x*/ ctx[5][0])) {
1292
+ attr(line, "x1", line_x__value);
1293
+ }
1294
+
1295
+ if (dirty & /*x*/ 32 && line_x__value_1 !== (line_x__value_1 = /*x*/ ctx[5][1])) {
1296
+ attr(line, "x2", line_x__value_1);
1297
+ }
1298
+
1299
+ if (dirty & /*y*/ 4 && line_y__value !== (line_y__value = /*y*/ ctx[2][0])) {
1300
+ attr(line, "y1", line_y__value);
1301
+ }
1302
+
1303
+ if (dirty & /*y*/ 4 && line_y__value_1 !== (line_y__value_1 = /*y*/ ctx[2][0])) {
1304
+ attr(line, "y2", line_y__value_1);
1305
+ }
1306
+ },
1307
+ d(detaching) {
1308
+ if (detaching) detach(g);
1309
+ destroy_each(each_blocks, detaching);
1310
+ }
1311
+ };
1312
+ }
1313
+
1314
+ // (59:3) {#each ticksX as tx, i}
1315
+ function create_each_block$5(ctx) {
1316
+ let line0;
1317
+ let line0_x__value;
1318
+ let line0_x__value_1;
1319
+ let line0_y__value;
1320
+ let line0_y__value_1;
1321
+ let line1;
1322
+ let line1_x__value;
1323
+ let line1_x__value_1;
1324
+ let line1_y__value;
1325
+ let line1_y__value_1;
1326
+ let text_1;
1327
+ let t_value = /*tickLabels*/ ctx[0][/*i*/ ctx[28]] + "";
1328
+ let t;
1329
+ let text_1_x_value;
1330
+ let text_1_y_value;
1331
+
1332
+ return {
1333
+ c() {
1334
+ line0 = svg_element("line");
1335
+ line1 = svg_element("line");
1336
+ text_1 = svg_element("text");
1337
+ t = text(t_value);
1338
+ attr(line0, "x1", line0_x__value = /*tx*/ ctx[26]);
1339
+ attr(line0, "x2", line0_x__value_1 = /*tx*/ ctx[26]);
1340
+ attr(line0, "y1", line0_y__value = /*y*/ ctx[2][0]);
1341
+ attr(line0, "y2", line0_y__value_1 = /*y*/ ctx[2][1]);
1342
+ attr(line0, "style", /*gridLineStyleStr*/ ctx[8]);
1343
+ attr(line1, "x1", line1_x__value = /*tx*/ ctx[26]);
1344
+ attr(line1, "x2", line1_x__value_1 = /*tx*/ ctx[26]);
1345
+ attr(line1, "y1", line1_y__value = /*ticksY*/ ctx[3][0]);
1346
+ attr(line1, "y2", line1_y__value_1 = /*ticksY*/ ctx[3][1]);
1347
+ attr(line1, "style", /*axisLineStyleStr*/ ctx[7]);
1348
+ attr(text_1, "x", text_1_x_value = /*tx*/ ctx[26]);
1349
+ attr(text_1, "y", text_1_y_value = /*ticksY*/ ctx[3][1]);
1350
+ attr(text_1, "dx", "0");
1351
+ attr(text_1, "dy", /*dy*/ ctx[1]);
1352
+ attr(text_1, "class", "mdaplot__axis-labels");
1353
+ attr(text_1, "dominant-baseline", "middle");
1354
+ attr(text_1, "text-anchor", "middle");
1355
+ },
1356
+ m(target, anchor) {
1357
+ insert(target, line0, anchor);
1358
+ insert(target, line1, anchor);
1359
+ insert(target, text_1, anchor);
1360
+ append(text_1, t);
1361
+ },
1362
+ p(ctx, dirty) {
1363
+ if (dirty & /*ticksX*/ 16 && line0_x__value !== (line0_x__value = /*tx*/ ctx[26])) {
1364
+ attr(line0, "x1", line0_x__value);
1365
+ }
1366
+
1367
+ if (dirty & /*ticksX*/ 16 && line0_x__value_1 !== (line0_x__value_1 = /*tx*/ ctx[26])) {
1368
+ attr(line0, "x2", line0_x__value_1);
1369
+ }
1370
+
1371
+ if (dirty & /*y*/ 4 && line0_y__value !== (line0_y__value = /*y*/ ctx[2][0])) {
1372
+ attr(line0, "y1", line0_y__value);
1373
+ }
1374
+
1375
+ if (dirty & /*y*/ 4 && line0_y__value_1 !== (line0_y__value_1 = /*y*/ ctx[2][1])) {
1376
+ attr(line0, "y2", line0_y__value_1);
1377
+ }
1378
+
1379
+ if (dirty & /*ticksX*/ 16 && line1_x__value !== (line1_x__value = /*tx*/ ctx[26])) {
1380
+ attr(line1, "x1", line1_x__value);
1381
+ }
1382
+
1383
+ if (dirty & /*ticksX*/ 16 && line1_x__value_1 !== (line1_x__value_1 = /*tx*/ ctx[26])) {
1384
+ attr(line1, "x2", line1_x__value_1);
1385
+ }
1386
+
1387
+ if (dirty & /*ticksY*/ 8 && line1_y__value !== (line1_y__value = /*ticksY*/ ctx[3][0])) {
1388
+ attr(line1, "y1", line1_y__value);
1389
+ }
1390
+
1391
+ if (dirty & /*ticksY*/ 8 && line1_y__value_1 !== (line1_y__value_1 = /*ticksY*/ ctx[3][1])) {
1392
+ attr(line1, "y2", line1_y__value_1);
1393
+ }
1394
+
1395
+ if (dirty & /*tickLabels*/ 1 && t_value !== (t_value = /*tickLabels*/ ctx[0][/*i*/ ctx[28]] + "")) set_data(t, t_value);
1396
+
1397
+ if (dirty & /*ticksX*/ 16 && text_1_x_value !== (text_1_x_value = /*tx*/ ctx[26])) {
1398
+ attr(text_1, "x", text_1_x_value);
1399
+ }
1400
+
1401
+ if (dirty & /*ticksY*/ 8 && text_1_y_value !== (text_1_y_value = /*ticksY*/ ctx[3][1])) {
1402
+ attr(text_1, "y", text_1_y_value);
1403
+ }
1404
+
1405
+ if (dirty & /*dy*/ 2) {
1406
+ attr(text_1, "dy", /*dy*/ ctx[1]);
1407
+ }
1408
+ },
1409
+ d(detaching) {
1410
+ if (detaching) detach(line0);
1411
+ if (detaching) detach(line1);
1412
+ if (detaching) detach(text_1);
1413
+ }
1414
+ };
1415
+ }
1416
+
1417
+ function create_fragment$a(ctx) {
1418
+ let if_block_anchor;
1419
+ let if_block = /*$isOk*/ ctx[6] && /*x*/ ctx[5] !== undefined && /*y*/ ctx[2] !== undefined && create_if_block$8(ctx);
1420
+
1421
+ return {
1422
+ c() {
1423
+ if (if_block) if_block.c();
1424
+ if_block_anchor = empty();
1425
+ },
1426
+ m(target, anchor) {
1427
+ if (if_block) if_block.m(target, anchor);
1428
+ insert(target, if_block_anchor, anchor);
1429
+ },
1430
+ p(ctx, [dirty]) {
1431
+ if (/*$isOk*/ ctx[6] && /*x*/ ctx[5] !== undefined && /*y*/ ctx[2] !== undefined) {
1432
+ if (if_block) {
1433
+ if_block.p(ctx, dirty);
1434
+ } else {
1435
+ if_block = create_if_block$8(ctx);
1436
+ if_block.c();
1437
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
1438
+ }
1439
+ } else if (if_block) {
1440
+ if_block.d(1);
1441
+ if_block = null;
1442
+ }
1443
+ },
1444
+ i: noop,
1445
+ o: noop,
1446
+ d(detaching) {
1447
+ if (if_block) if_block.d(detaching);
1448
+ if (detaching) detach(if_block_anchor);
1449
+ }
1450
+ };
1451
+ }
1452
+
1453
+ function instance$a($$self, $$props, $$invalidate) {
1454
+ let x;
1455
+ let y;
1456
+ let dy;
1457
+ let tickNum;
1458
+ let ticksX;
1459
+ let ticksY;
1460
+ let $axesWidth;
1461
+ let $xLim;
1462
+ let $scale;
1463
+ let $axesHeight;
1464
+ let $yLim;
1465
+ let $isOk;
1466
+ let { slot = "xaxis" } = $$props;
1467
+ let { ticks = undefined } = $$props;
1468
+ let { tickLabels = ticks } = $$props;
1469
+ let { showGrid = false } = $$props;
1470
+
1471
+ // set up tick mode
1472
+ const tickMode = ticks === undefined ? "auto" : "manual";
1473
+
1474
+ /* sanity checks of input parameters */
1475
+ if (slot !== "xaxis") {
1476
+ throw "Component XAxis must have \"slot='xaxis'\" attribute.";
1477
+ }
1478
+
1479
+ if (ticks !== undefined && !Array.isArray(ticks)) {
1480
+ throw "XAxis: 'ticks' must be a vector of numbers.";
1481
+ }
1482
+
1483
+ if (ticks !== undefined && !(Array.isArray(tickLabels) && tickLabels.length == ticks.length)) {
1484
+ throw "XAxis: 'tickLabels' must be a vector of the same size as ticks.";
1485
+ }
1486
+
1487
+ /* styles for axis and grid lines */
1488
+ const axisLineStyleStr = `stroke:${Colors.DARKGRAY};line-width:1px;`;
1489
+
1490
+ const gridLineStyleStr = `stroke:${Colors.MIDDLEGRAY};stroke-opacity:${showGrid ? 1 : 0};stroke-dasharray:2px;`;
1491
+
1492
+ // get axes context and adjust x margins
1493
+ const axes = getContext('axes');
1494
+
1495
+ axes.addXAxisMargins();
1496
+
1497
+ // get reactive variables needed to compute coordinates
1498
+ const xLim = axes.xLim;
1499
+
1500
+ component_subscribe($$self, xLim, value => $$invalidate(20, $xLim = value));
1501
+ const yLim = axes.yLim;
1502
+ component_subscribe($$self, yLim, value => $$invalidate(23, $yLim = value));
1503
+ const axesWidth = axes.width;
1504
+ component_subscribe($$self, axesWidth, value => $$invalidate(19, $axesWidth = value));
1505
+ const axesHeight = axes.height;
1506
+ component_subscribe($$self, axesHeight, value => $$invalidate(22, $axesHeight = value));
1507
+ const scale = axes.scale;
1508
+ component_subscribe($$self, scale, value => $$invalidate(21, $scale = value));
1509
+ const isOk = axes.isOk;
1510
+ component_subscribe($$self, isOk, value => $$invalidate(6, $isOk = value));
1511
+
1512
+ $$self.$$set = $$props => {
1513
+ if ('slot' in $$props) $$invalidate(16, slot = $$props.slot);
1514
+ if ('ticks' in $$props) $$invalidate(15, ticks = $$props.ticks);
1515
+ if ('tickLabels' in $$props) $$invalidate(0, tickLabels = $$props.tickLabels);
1516
+ if ('showGrid' in $$props) $$invalidate(17, showGrid = $$props.showGrid);
1517
+ };
1518
+
1519
+ $$self.$$.update = () => {
1520
+ if ($$self.$$.dirty & /*$xLim, $axesWidth*/ 1572864) {
1521
+ // reactive variables for coordinates of axis lines
1522
+ $$invalidate(5, x = axes.scaleX($xLim, $xLim, $axesWidth));
1523
+ }
1524
+
1525
+ if ($$self.$$.dirty & /*$yLim, $axesHeight*/ 12582912) {
1526
+ $$invalidate(2, y = axes.scaleY($yLim, $yLim, $axesHeight));
1527
+ }
1528
+
1529
+ if ($$self.$$.dirty & /*$scale*/ 2097152) {
1530
+ // reactive variables for ticks and their coordinates
1531
+ $$invalidate(1, dy = $scale === "small" ? 7 : 10);
1532
+ }
1533
+
1534
+ if ($$self.$$.dirty & /*$scale*/ 2097152) {
1535
+ $$invalidate(18, tickNum = axes.TICK_NUM[$scale]);
1536
+ }
1537
+
1538
+ if ($$self.$$.dirty & /*$xLim, tickNum, ticks*/ 1343488) {
1539
+ $$invalidate(15, ticks = tickMode === "auto"
1540
+ ? axes.getAxisTicks(undefined, $xLim, tickNum, true)
1541
+ : ticks);
1542
+ }
1543
+
1544
+ if ($$self.$$.dirty & /*ticks, tickLabels*/ 32769) {
1545
+ $$invalidate(0, tickLabels = tickMode === "auto" ? ticks : tickLabels);
1546
+ }
1547
+
1548
+ if ($$self.$$.dirty & /*ticks, $xLim, $axesWidth*/ 1605632) {
1549
+ $$invalidate(4, ticksX = axes.scaleX(ticks, $xLim, $axesWidth));
1550
+ }
1551
+
1552
+ if ($$self.$$.dirty & /*y, dy*/ 6) {
1553
+ $$invalidate(3, ticksY = y === undefined ? undefined : [y[0], y[0] + dy]);
1554
+ }
1555
+ };
1556
+
1557
+ return [
1558
+ tickLabels,
1559
+ dy,
1560
+ y,
1561
+ ticksY,
1562
+ ticksX,
1563
+ x,
1564
+ $isOk,
1565
+ axisLineStyleStr,
1566
+ gridLineStyleStr,
1567
+ xLim,
1568
+ yLim,
1569
+ axesWidth,
1570
+ axesHeight,
1571
+ scale,
1572
+ isOk,
1573
+ ticks,
1574
+ slot,
1575
+ showGrid,
1576
+ tickNum,
1577
+ $axesWidth,
1578
+ $xLim,
1579
+ $scale,
1580
+ $axesHeight,
1581
+ $yLim
1582
+ ];
1583
+ }
1584
+
1585
+ class XAxis extends SvelteComponent {
1586
+ constructor(options) {
1587
+ super();
1588
+
1589
+ init(this, options, instance$a, create_fragment$a, safe_not_equal, {
1590
+ slot: 16,
1591
+ ticks: 15,
1592
+ tickLabels: 0,
1593
+ showGrid: 17
1594
+ });
1595
+ }
1596
+ }
1597
+
1598
+ /* src/YAxis.svelte generated by Svelte v3.46.3 */
1599
+
1600
+ function get_each_context$4(ctx, list, i) {
1601
+ const child_ctx = ctx.slice();
1602
+ child_ctx[26] = list[i];
1603
+ child_ctx[28] = i;
1604
+ return child_ctx;
1605
+ }
1606
+
1607
+ // (60:0) {#if x !== undefined && y !== undefined }
1608
+ function create_if_block$7(ctx) {
1609
+ let g;
1610
+ let line;
1611
+ let line_x__value;
1612
+ let line_x__value_1;
1613
+ let line_y__value;
1614
+ let line_y__value_1;
1615
+ let each_value = /*ticksY*/ ctx[4];
1616
+ let each_blocks = [];
1617
+
1618
+ for (let i = 0; i < each_value.length; i += 1) {
1619
+ each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
1620
+ }
1621
+
1622
+ return {
1623
+ c() {
1624
+ g = svg_element("g");
1625
+
1626
+ for (let i = 0; i < each_blocks.length; i += 1) {
1627
+ each_blocks[i].c();
1628
+ }
1629
+
1630
+ line = svg_element("line");
1631
+ attr(line, "x1", line_x__value = /*x*/ ctx[1][0]);
1632
+ attr(line, "x2", line_x__value_1 = /*x*/ ctx[1][0]);
1633
+ attr(line, "y1", line_y__value = /*y*/ ctx[5][0]);
1634
+ attr(line, "y2", line_y__value_1 = /*y*/ ctx[5][1]);
1635
+ attr(line, "style", /*axisLineStyleStr*/ ctx[7]);
1636
+ attr(g, "class", "mdaplot__axis mdaplot__yaxis");
1637
+ },
1638
+ m(target, anchor) {
1639
+ insert(target, g, anchor);
1640
+
1641
+ for (let i = 0; i < each_blocks.length; i += 1) {
1642
+ each_blocks[i].m(g, null);
1643
+ }
1644
+
1645
+ append(g, line);
1646
+ },
1647
+ p(ctx, dirty) {
1648
+ if (dirty & /*ticksX, ticksY, dx, transform, tickLabels, axisLineStyleStr, x, gridLineStyleStr*/ 479) {
1649
+ each_value = /*ticksY*/ ctx[4];
1650
+ let i;
1651
+
1652
+ for (i = 0; i < each_value.length; i += 1) {
1653
+ const child_ctx = get_each_context$4(ctx, each_value, i);
1654
+
1655
+ if (each_blocks[i]) {
1656
+ each_blocks[i].p(child_ctx, dirty);
1657
+ } else {
1658
+ each_blocks[i] = create_each_block$4(child_ctx);
1659
+ each_blocks[i].c();
1660
+ each_blocks[i].m(g, line);
1661
+ }
1662
+ }
1663
+
1664
+ for (; i < each_blocks.length; i += 1) {
1665
+ each_blocks[i].d(1);
1666
+ }
1667
+
1668
+ each_blocks.length = each_value.length;
1669
+ }
1670
+
1671
+ if (dirty & /*x*/ 2 && line_x__value !== (line_x__value = /*x*/ ctx[1][0])) {
1672
+ attr(line, "x1", line_x__value);
1673
+ }
1674
+
1675
+ if (dirty & /*x*/ 2 && line_x__value_1 !== (line_x__value_1 = /*x*/ ctx[1][0])) {
1676
+ attr(line, "x2", line_x__value_1);
1677
+ }
1678
+
1679
+ if (dirty & /*y*/ 32 && line_y__value !== (line_y__value = /*y*/ ctx[5][0])) {
1680
+ attr(line, "y1", line_y__value);
1681
+ }
1682
+
1683
+ if (dirty & /*y*/ 32 && line_y__value_1 !== (line_y__value_1 = /*y*/ ctx[5][1])) {
1684
+ attr(line, "y2", line_y__value_1);
1685
+ }
1686
+ },
1687
+ d(detaching) {
1688
+ if (detaching) detach(g);
1689
+ destroy_each(each_blocks, detaching);
1690
+ }
1691
+ };
1692
+ }
1693
+
1694
+ // (62:3) {#each ticksY as ty, i}
1695
+ function create_each_block$4(ctx) {
1696
+ let line0;
1697
+ let line0_x__value;
1698
+ let line0_x__value_1;
1699
+ let line0_y__value;
1700
+ let line0_y__value_1;
1701
+ let line1;
1702
+ let line1_x__value;
1703
+ let line1_x__value_1;
1704
+ let line1_y__value;
1705
+ let line1_y__value_1;
1706
+ let text_1;
1707
+ let t_value = /*tickLabels*/ ctx[0][/*i*/ ctx[28]] + "";
1708
+ let t;
1709
+ let text_1_x_value;
1710
+ let text_1_y_value;
1711
+ let text_1_dy_value;
1712
+
1713
+ return {
1714
+ c() {
1715
+ line0 = svg_element("line");
1716
+ line1 = svg_element("line");
1717
+ text_1 = svg_element("text");
1718
+ t = text(t_value);
1719
+ attr(line0, "x1", line0_x__value = /*x*/ ctx[1][0]);
1720
+ attr(line0, "x2", line0_x__value_1 = /*x*/ ctx[1][1]);
1721
+ attr(line0, "y1", line0_y__value = /*ty*/ ctx[26]);
1722
+ attr(line0, "y2", line0_y__value_1 = /*ty*/ ctx[26]);
1723
+ attr(line0, "style", /*gridLineStyleStr*/ ctx[8]);
1724
+ attr(line1, "x1", line1_x__value = /*ticksX*/ ctx[3][0]);
1725
+ attr(line1, "x2", line1_x__value_1 = /*ticksX*/ ctx[3][1]);
1726
+ attr(line1, "y1", line1_y__value = /*ty*/ ctx[26]);
1727
+ attr(line1, "y2", line1_y__value_1 = /*ty*/ ctx[26]);
1728
+ attr(line1, "style", /*axisLineStyleStr*/ ctx[7]);
1729
+ attr(text_1, "x", text_1_x_value = /*ticksX*/ ctx[3][0]);
1730
+ attr(text_1, "y", text_1_y_value = /*ty*/ ctx[26]);
1731
+ attr(text_1, "dx", /*dx*/ ctx[2]);
1732
+ attr(text_1, "dy", text_1_dy_value = 0);
1733
+ attr(text_1, "transform", /*transform*/ ctx[6]);
1734
+ set_style(text_1, "background", "red");
1735
+ attr(text_1, "class", "mdaplot__axis-labels");
1736
+ attr(text_1, "dominant-baseline", "middle");
1737
+ attr(text_1, "text-anchor", "end");
1738
+ },
1739
+ m(target, anchor) {
1740
+ insert(target, line0, anchor);
1741
+ insert(target, line1, anchor);
1742
+ insert(target, text_1, anchor);
1743
+ append(text_1, t);
1744
+ },
1745
+ p(ctx, dirty) {
1746
+ if (dirty & /*x*/ 2 && line0_x__value !== (line0_x__value = /*x*/ ctx[1][0])) {
1747
+ attr(line0, "x1", line0_x__value);
1748
+ }
1749
+
1750
+ if (dirty & /*x*/ 2 && line0_x__value_1 !== (line0_x__value_1 = /*x*/ ctx[1][1])) {
1751
+ attr(line0, "x2", line0_x__value_1);
1752
+ }
1753
+
1754
+ if (dirty & /*ticksY*/ 16 && line0_y__value !== (line0_y__value = /*ty*/ ctx[26])) {
1755
+ attr(line0, "y1", line0_y__value);
1756
+ }
1757
+
1758
+ if (dirty & /*ticksY*/ 16 && line0_y__value_1 !== (line0_y__value_1 = /*ty*/ ctx[26])) {
1759
+ attr(line0, "y2", line0_y__value_1);
1760
+ }
1761
+
1762
+ if (dirty & /*ticksX*/ 8 && line1_x__value !== (line1_x__value = /*ticksX*/ ctx[3][0])) {
1763
+ attr(line1, "x1", line1_x__value);
1764
+ }
1765
+
1766
+ if (dirty & /*ticksX*/ 8 && line1_x__value_1 !== (line1_x__value_1 = /*ticksX*/ ctx[3][1])) {
1767
+ attr(line1, "x2", line1_x__value_1);
1768
+ }
1769
+
1770
+ if (dirty & /*ticksY*/ 16 && line1_y__value !== (line1_y__value = /*ty*/ ctx[26])) {
1771
+ attr(line1, "y1", line1_y__value);
1772
+ }
1773
+
1774
+ if (dirty & /*ticksY*/ 16 && line1_y__value_1 !== (line1_y__value_1 = /*ty*/ ctx[26])) {
1775
+ attr(line1, "y2", line1_y__value_1);
1776
+ }
1777
+
1778
+ if (dirty & /*tickLabels*/ 1 && t_value !== (t_value = /*tickLabels*/ ctx[0][/*i*/ ctx[28]] + "")) set_data(t, t_value);
1779
+
1780
+ if (dirty & /*ticksX*/ 8 && text_1_x_value !== (text_1_x_value = /*ticksX*/ ctx[3][0])) {
1781
+ attr(text_1, "x", text_1_x_value);
1782
+ }
1783
+
1784
+ if (dirty & /*ticksY*/ 16 && text_1_y_value !== (text_1_y_value = /*ty*/ ctx[26])) {
1785
+ attr(text_1, "y", text_1_y_value);
1786
+ }
1787
+
1788
+ if (dirty & /*dx*/ 4) {
1789
+ attr(text_1, "dx", /*dx*/ ctx[2]);
1790
+ }
1791
+ },
1792
+ d(detaching) {
1793
+ if (detaching) detach(line0);
1794
+ if (detaching) detach(line1);
1795
+ if (detaching) detach(text_1);
1796
+ }
1797
+ };
1798
+ }
1799
+
1800
+ function create_fragment$9(ctx) {
1801
+ let if_block_anchor;
1802
+ let if_block = /*x*/ ctx[1] !== undefined && /*y*/ ctx[5] !== undefined && create_if_block$7(ctx);
1803
+
1804
+ return {
1805
+ c() {
1806
+ if (if_block) if_block.c();
1807
+ if_block_anchor = empty();
1808
+ },
1809
+ m(target, anchor) {
1810
+ if (if_block) if_block.m(target, anchor);
1811
+ insert(target, if_block_anchor, anchor);
1812
+ },
1813
+ p(ctx, [dirty]) {
1814
+ if (/*x*/ ctx[1] !== undefined && /*y*/ ctx[5] !== undefined) {
1815
+ if (if_block) {
1816
+ if_block.p(ctx, dirty);
1817
+ } else {
1818
+ if_block = create_if_block$7(ctx);
1819
+ if_block.c();
1820
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
1821
+ }
1822
+ } else if (if_block) {
1823
+ if_block.d(1);
1824
+ if_block = null;
1825
+ }
1826
+ },
1827
+ i: noop,
1828
+ o: noop,
1829
+ d(detaching) {
1830
+ if (if_block) if_block.d(detaching);
1831
+ if (detaching) detach(if_block_anchor);
1832
+ }
1833
+ };
1834
+ }
1835
+
1836
+ function instance$9($$self, $$props, $$invalidate) {
1837
+ let x;
1838
+ let y;
1839
+ let dx;
1840
+ let tickNum;
1841
+ let ticksY;
1842
+ let ticksX;
1843
+ let $axesHeight;
1844
+ let $yLim;
1845
+ let $scale;
1846
+ let $axesWidth;
1847
+ let $xLim;
1848
+ let { slot = "yaxis" } = $$props;
1849
+ let { ticks = undefined } = $$props;
1850
+ let { tickLabels = ticks } = $$props;
1851
+ let { showGrid = false } = $$props;
1852
+ let { las = 1 } = $$props;
1853
+
1854
+ // set up tick mode
1855
+ const tickMode = ticks === undefined ? "auto" : "manual";
1856
+
1857
+ // TODO: set up tick text translation
1858
+ const transform = las > 1 ? "" : "";
1859
+
1860
+ /* sanity checks of input parameters */
1861
+ if (slot !== "yaxis") {
1862
+ throw "Component YAxis must have \"slot='yaxis'\" attribute.";
1863
+ }
1864
+
1865
+ if (ticks !== undefined && !Array.isArray(ticks)) {
1866
+ throw "YAxis: 'ticks' must be a vector of numbers.";
1867
+ }
1868
+
1869
+ if (ticks !== undefined && !(Array.isArray(tickLabels) && tickLabels.length == ticks.length)) {
1870
+ throw "YAxis: 'tickLabels' must be a vector of the same size as ticks.";
1871
+ }
1872
+
1873
+ /* styles for axis and grid lines */
1874
+ const axisLineStyleStr = `stroke:${Colors.DARKGRAY};line-width:1px;`;
1875
+
1876
+ const gridLineStyleStr = `stroke:${Colors.MIDDLEGRAY};stroke-opacity:${showGrid ? 1 : 0};stroke-dasharray:2px;`;
1877
+
1878
+ // get axes context and adjust x margins
1879
+ const axes = getContext('axes');
1880
+
1881
+ axes.addYAxisMargins();
1882
+
1883
+ // get reactive variables needed to compute coordinates
1884
+ const xLim = axes.xLim;
1885
+
1886
+ component_subscribe($$self, xLim, value => $$invalidate(23, $xLim = value));
1887
+ const yLim = axes.yLim;
1888
+ component_subscribe($$self, yLim, value => $$invalidate(20, $yLim = value));
1889
+ const axesWidth = axes.width;
1890
+ component_subscribe($$self, axesWidth, value => $$invalidate(22, $axesWidth = value));
1891
+ const axesHeight = axes.height;
1892
+ component_subscribe($$self, axesHeight, value => $$invalidate(19, $axesHeight = value));
1893
+ const scale = axes.scale;
1894
+ component_subscribe($$self, scale, value => $$invalidate(21, $scale = value));
1895
+
1896
+ $$self.$$set = $$props => {
1897
+ if ('slot' in $$props) $$invalidate(15, slot = $$props.slot);
1898
+ if ('ticks' in $$props) $$invalidate(14, ticks = $$props.ticks);
1899
+ if ('tickLabels' in $$props) $$invalidate(0, tickLabels = $$props.tickLabels);
1900
+ if ('showGrid' in $$props) $$invalidate(16, showGrid = $$props.showGrid);
1901
+ if ('las' in $$props) $$invalidate(17, las = $$props.las);
1902
+ };
1903
+
1904
+ $$self.$$.update = () => {
1905
+ if ($$self.$$.dirty & /*$xLim, $axesWidth*/ 12582912) {
1906
+ // reactive variables for coordinates of axis lines
1907
+ $$invalidate(1, x = axes.scaleX($xLim, $xLim, $axesWidth));
1908
+ }
1909
+
1910
+ if ($$self.$$.dirty & /*$yLim, $axesHeight*/ 1572864) {
1911
+ $$invalidate(5, y = axes.scaleY($yLim, $yLim, $axesHeight));
1912
+ }
1913
+
1914
+ if ($$self.$$.dirty & /*$scale*/ 2097152) {
1915
+ // reactive variables for ticks and their coordinates
1916
+ $$invalidate(2, dx = $scale === "small" ? -4 : -6);
1917
+ }
1918
+
1919
+ if ($$self.$$.dirty & /*$scale*/ 2097152) {
1920
+ $$invalidate(18, tickNum = axes.TICK_NUM[$scale]);
1921
+ }
1922
+
1923
+ if ($$self.$$.dirty & /*$yLim, tickNum, ticks*/ 1327104) {
1924
+ $$invalidate(14, ticks = tickMode === "auto"
1925
+ ? axes.getAxisTicks(undefined, $yLim, tickNum, true)
1926
+ : ticks);
1927
+ }
1928
+
1929
+ if ($$self.$$.dirty & /*ticks, tickLabels*/ 16385) {
1930
+ $$invalidate(0, tickLabels = tickMode === "auto" ? ticks : tickLabels);
1931
+ }
1932
+
1933
+ if ($$self.$$.dirty & /*ticks, $yLim, $axesHeight*/ 1589248) {
1934
+ $$invalidate(4, ticksY = axes.scaleY(ticks, $yLim, $axesHeight));
1935
+ }
1936
+
1937
+ if ($$self.$$.dirty & /*x, dx*/ 6) {
1938
+ $$invalidate(3, ticksX = x === undefined ? undefined : [x[0] + dx, x[0]]);
1939
+ }
1940
+ };
1941
+
1942
+ return [
1943
+ tickLabels,
1944
+ x,
1945
+ dx,
1946
+ ticksX,
1947
+ ticksY,
1948
+ y,
1949
+ transform,
1950
+ axisLineStyleStr,
1951
+ gridLineStyleStr,
1952
+ xLim,
1953
+ yLim,
1954
+ axesWidth,
1955
+ axesHeight,
1956
+ scale,
1957
+ ticks,
1958
+ slot,
1959
+ showGrid,
1960
+ las,
1961
+ tickNum,
1962
+ $axesHeight,
1963
+ $yLim,
1964
+ $scale,
1965
+ $axesWidth,
1966
+ $xLim
1967
+ ];
1968
+ }
1969
+
1970
+ class YAxis extends SvelteComponent {
1971
+ constructor(options) {
1972
+ super();
1973
+
1974
+ init(this, options, instance$9, create_fragment$9, safe_not_equal, {
1975
+ slot: 15,
1976
+ ticks: 14,
1977
+ tickLabels: 0,
1978
+ showGrid: 16,
1979
+ las: 17
1980
+ });
1981
+ }
1982
+ }
1983
+
1984
+ /* src/Rectangles.svelte generated by Svelte v3.46.3 */
1985
+
1986
+ function get_each_context$3(ctx, list, i) {
1987
+ const child_ctx = ctx.slice();
1988
+ child_ctx[23] = list[i];
1989
+ child_ctx[25] = i;
1990
+ return child_ctx;
1991
+ }
1992
+
1993
+ // (51:0) {#if rx !== undefined && ry !== undefined}
1994
+ function create_if_block$6(ctx) {
1995
+ let each_1_anchor;
1996
+ let each_value = /*left*/ ctx[0];
1997
+ let each_blocks = [];
1998
+
1999
+ for (let i = 0; i < each_value.length; i += 1) {
2000
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
2001
+ }
2002
+
2003
+ return {
2004
+ c() {
2005
+ for (let i = 0; i < each_blocks.length; i += 1) {
2006
+ each_blocks[i].c();
2007
+ }
2008
+
2009
+ each_1_anchor = empty();
2010
+ },
2011
+ m(target, anchor) {
2012
+ for (let i = 0; i < each_blocks.length; i += 1) {
2013
+ each_blocks[i].m(target, anchor);
2014
+ }
2015
+
2016
+ insert(target, each_1_anchor, anchor);
2017
+ },
2018
+ p(ctx, dirty) {
2019
+ if (dirty & /*rx, ry, rw, rh, barsStyleStr, left*/ 63) {
2020
+ each_value = /*left*/ ctx[0];
2021
+ let i;
2022
+
2023
+ for (i = 0; i < each_value.length; i += 1) {
2024
+ const child_ctx = get_each_context$3(ctx, each_value, i);
2025
+
2026
+ if (each_blocks[i]) {
2027
+ each_blocks[i].p(child_ctx, dirty);
2028
+ } else {
2029
+ each_blocks[i] = create_each_block$3(child_ctx);
2030
+ each_blocks[i].c();
2031
+ each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2032
+ }
2033
+ }
2034
+
2035
+ for (; i < each_blocks.length; i += 1) {
2036
+ each_blocks[i].d(1);
2037
+ }
2038
+
2039
+ each_blocks.length = each_value.length;
2040
+ }
2041
+ },
2042
+ d(detaching) {
2043
+ destroy_each(each_blocks, detaching);
2044
+ if (detaching) detach(each_1_anchor);
2045
+ }
2046
+ };
2047
+ }
2048
+
2049
+ // (52:3) {#each left as v, i}
2050
+ function create_each_block$3(ctx) {
2051
+ let rect;
2052
+ let rect_x_value;
2053
+ let rect_y_value;
2054
+ let rect_width_value;
2055
+ let rect_height_value;
2056
+
2057
+ return {
2058
+ c() {
2059
+ rect = svg_element("rect");
2060
+ attr(rect, "x", rect_x_value = /*rx*/ ctx[4][/*i*/ ctx[25]]);
2061
+ attr(rect, "y", rect_y_value = /*ry*/ ctx[3][/*i*/ ctx[25]]);
2062
+ attr(rect, "width", rect_width_value = /*rw*/ ctx[2][/*i*/ ctx[25]]);
2063
+ attr(rect, "height", rect_height_value = /*rh*/ ctx[1][/*i*/ ctx[25]]);
2064
+ attr(rect, "style", /*barsStyleStr*/ ctx[5]);
2065
+ },
2066
+ m(target, anchor) {
2067
+ insert(target, rect, anchor);
2068
+ },
2069
+ p(ctx, dirty) {
2070
+ if (dirty & /*rx*/ 16 && rect_x_value !== (rect_x_value = /*rx*/ ctx[4][/*i*/ ctx[25]])) {
2071
+ attr(rect, "x", rect_x_value);
2072
+ }
2073
+
2074
+ if (dirty & /*ry*/ 8 && rect_y_value !== (rect_y_value = /*ry*/ ctx[3][/*i*/ ctx[25]])) {
2075
+ attr(rect, "y", rect_y_value);
2076
+ }
2077
+
2078
+ if (dirty & /*rw*/ 4 && rect_width_value !== (rect_width_value = /*rw*/ ctx[2][/*i*/ ctx[25]])) {
2079
+ attr(rect, "width", rect_width_value);
2080
+ }
2081
+
2082
+ if (dirty & /*rh*/ 2 && rect_height_value !== (rect_height_value = /*rh*/ ctx[1][/*i*/ ctx[25]])) {
2083
+ attr(rect, "height", rect_height_value);
2084
+ }
2085
+ },
2086
+ d(detaching) {
2087
+ if (detaching) detach(rect);
2088
+ }
2089
+ };
2090
+ }
2091
+
2092
+ function create_fragment$8(ctx) {
2093
+ let if_block_anchor;
2094
+ let if_block = /*rx*/ ctx[4] !== undefined && /*ry*/ ctx[3] !== undefined && create_if_block$6(ctx);
2095
+
2096
+ return {
2097
+ c() {
2098
+ if (if_block) if_block.c();
2099
+ if_block_anchor = empty();
2100
+ },
2101
+ m(target, anchor) {
2102
+ if (if_block) if_block.m(target, anchor);
2103
+ insert(target, if_block_anchor, anchor);
2104
+ },
2105
+ p(ctx, [dirty]) {
2106
+ if (/*rx*/ ctx[4] !== undefined && /*ry*/ ctx[3] !== undefined) {
2107
+ if (if_block) {
2108
+ if_block.p(ctx, dirty);
2109
+ } else {
2110
+ if_block = create_if_block$6(ctx);
2111
+ if_block.c();
2112
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2113
+ }
2114
+ } else if (if_block) {
2115
+ if_block.d(1);
2116
+ if_block = null;
2117
+ }
2118
+ },
2119
+ i: noop,
2120
+ o: noop,
2121
+ d(detaching) {
2122
+ if (if_block) if_block.d(detaching);
2123
+ if (detaching) detach(if_block_anchor);
2124
+ }
2125
+ };
2126
+ }
2127
+
2128
+ function instance$8($$self, $$props, $$invalidate) {
2129
+ let rx;
2130
+ let ry;
2131
+ let rw;
2132
+ let rh;
2133
+ let $axesHeight;
2134
+ let $yLim;
2135
+ let $axesWidth;
2136
+ let $xLim;
2137
+ let { left } = $$props;
2138
+ let { top } = $$props;
2139
+ let { width } = $$props;
2140
+ let { height } = $$props;
2141
+ let { labels = undefined } = $$props;
2142
+ let { faceColor = Colors.PRIMARY } = $$props;
2143
+ let { borderColor = faceColor } = $$props;
2144
+ let { lineWidth = 1 } = $$props;
2145
+
2146
+ // styles for bars and labels
2147
+ const barsStyleStr = `fill:${faceColor};stroke:${borderColor};stroke-width: ${lineWidth}px;`;
2148
+
2149
+ // multiply width and height values if needed
2150
+ if (!Array.isArray(left) || !Array.isArray(top) || left.length < 1 || left.length != top.length) {
2151
+ throw "Rectangles: parameters 'left' and 'top' must be vectors of the same size.";
2152
+ }
2153
+
2154
+ // we make this reactive in case if left and right has been changed but not width
2155
+ const n = left.length;
2156
+
2157
+ if (!Array.isArray(height)) height = Array(n).fill(height);
2158
+ if (!Array.isArray(width)) width = Array(n).fill(width);
2159
+
2160
+ /* sanity check for input parameters */
2161
+ if (top.length !== n || width.length !== n || height.length !== n) {
2162
+ throw "Rectangles: x, y, w and h should have the same length (w and h can be single values).";
2163
+ }
2164
+
2165
+ if (labels !== undefined && (!Array.isArray(labels) || labels.length !== n)) {
2166
+ throw "Rectangles: vector with labels should have the same length as vectors with x and y coordinates.";
2167
+ }
2168
+
2169
+ // get axes context and reactive variables needed to compute coordinates
2170
+ const axes = getContext('axes');
2171
+
2172
+ const xLim = axes.xLim;
2173
+ component_subscribe($$self, xLim, value => $$invalidate(20, $xLim = value));
2174
+ const yLim = axes.yLim;
2175
+ component_subscribe($$self, yLim, value => $$invalidate(18, $yLim = value));
2176
+ const axesWidth = axes.width;
2177
+ component_subscribe($$self, axesWidth, value => $$invalidate(19, $axesWidth = value));
2178
+ const axesHeight = axes.height;
2179
+ component_subscribe($$self, axesHeight, value => $$invalidate(17, $axesHeight = value));
2180
+
2181
+ $$self.$$set = $$props => {
2182
+ if ('left' in $$props) $$invalidate(0, left = $$props.left);
2183
+ if ('top' in $$props) $$invalidate(12, top = $$props.top);
2184
+ if ('width' in $$props) $$invalidate(10, width = $$props.width);
2185
+ if ('height' in $$props) $$invalidate(11, height = $$props.height);
2186
+ if ('labels' in $$props) $$invalidate(13, labels = $$props.labels);
2187
+ if ('faceColor' in $$props) $$invalidate(14, faceColor = $$props.faceColor);
2188
+ if ('borderColor' in $$props) $$invalidate(15, borderColor = $$props.borderColor);
2189
+ if ('lineWidth' in $$props) $$invalidate(16, lineWidth = $$props.lineWidth);
2190
+ };
2191
+
2192
+ $$self.$$.update = () => {
2193
+ if ($$self.$$.dirty & /*left, $xLim, $axesWidth*/ 1572865) {
2194
+ // reactive variables for coordinates of data points in pixels
2195
+ $$invalidate(4, rx = axes.scaleX(left, $xLim, $axesWidth));
2196
+ }
2197
+
2198
+ if ($$self.$$.dirty & /*top, $yLim, $axesHeight*/ 397312) {
2199
+ $$invalidate(3, ry = axes.scaleY(top, $yLim, $axesHeight));
2200
+ }
2201
+
2202
+ if ($$self.$$.dirty & /*width, $xLim, $axesWidth*/ 1573888) {
2203
+ $$invalidate(2, rw = axes.scaleX(width, $xLim, $axesWidth, true));
2204
+ }
2205
+
2206
+ if ($$self.$$.dirty & /*height, $yLim, $axesHeight*/ 395264) {
2207
+ $$invalidate(1, rh = axes.scaleY(height, $yLim, $axesHeight, true));
2208
+ }
2209
+ };
2210
+
2211
+ return [
2212
+ left,
2213
+ rh,
2214
+ rw,
2215
+ ry,
2216
+ rx,
2217
+ barsStyleStr,
2218
+ xLim,
2219
+ yLim,
2220
+ axesWidth,
2221
+ axesHeight,
2222
+ width,
2223
+ height,
2224
+ top,
2225
+ labels,
2226
+ faceColor,
2227
+ borderColor,
2228
+ lineWidth,
2229
+ $axesHeight,
2230
+ $yLim,
2231
+ $axesWidth,
2232
+ $xLim
2233
+ ];
2234
+ }
2235
+
2236
+ class Rectangles extends SvelteComponent {
2237
+ constructor(options) {
2238
+ super();
2239
+
2240
+ init(this, options, instance$8, create_fragment$8, safe_not_equal, {
2241
+ left: 0,
2242
+ top: 12,
2243
+ width: 10,
2244
+ height: 11,
2245
+ labels: 13,
2246
+ faceColor: 14,
2247
+ borderColor: 15,
2248
+ lineWidth: 16
2249
+ });
2250
+ }
2251
+ }
2252
+
2253
+ /* src/Box.svelte generated by Svelte v3.46.3 */
2254
+
2255
+ function create_if_block$5(ctx) {
2256
+ let g;
2257
+ let rectangles;
2258
+ let current;
2259
+
2260
+ rectangles = new Rectangles({
2261
+ props: {
2262
+ left: /*left*/ ctx[3],
2263
+ top: /*top*/ ctx[2],
2264
+ width: /*width*/ ctx[1],
2265
+ height: /*height*/ ctx[0],
2266
+ borderColor: Colors.DARKGRAY,
2267
+ faceColor: "transparent"
2268
+ }
2269
+ });
2270
+
2271
+ return {
2272
+ c() {
2273
+ g = svg_element("g");
2274
+ create_component(rectangles.$$.fragment);
2275
+ attr(g, "class", "mdaplot__axes-box");
2276
+ },
2277
+ m(target, anchor) {
2278
+ insert(target, g, anchor);
2279
+ mount_component(rectangles, g, null);
2280
+ current = true;
2281
+ },
2282
+ p(ctx, dirty) {
2283
+ const rectangles_changes = {};
2284
+ if (dirty & /*left*/ 8) rectangles_changes.left = /*left*/ ctx[3];
2285
+ if (dirty & /*top*/ 4) rectangles_changes.top = /*top*/ ctx[2];
2286
+ if (dirty & /*width*/ 2) rectangles_changes.width = /*width*/ ctx[1];
2287
+ if (dirty & /*height*/ 1) rectangles_changes.height = /*height*/ ctx[0];
2288
+ rectangles.$set(rectangles_changes);
2289
+ },
2290
+ i(local) {
2291
+ if (current) return;
2292
+ transition_in(rectangles.$$.fragment, local);
2293
+ current = true;
2294
+ },
2295
+ o(local) {
2296
+ transition_out(rectangles.$$.fragment, local);
2297
+ current = false;
2298
+ },
2299
+ d(detaching) {
2300
+ if (detaching) detach(g);
2301
+ destroy_component(rectangles);
2302
+ }
2303
+ };
2304
+ }
2305
+
2306
+ function create_fragment$7(ctx) {
2307
+ let if_block_anchor;
2308
+ let current;
2309
+ let if_block = /*$isOk*/ ctx[4] && create_if_block$5(ctx);
2310
+
2311
+ return {
2312
+ c() {
2313
+ if (if_block) if_block.c();
2314
+ if_block_anchor = empty();
2315
+ },
2316
+ m(target, anchor) {
2317
+ if (if_block) if_block.m(target, anchor);
2318
+ insert(target, if_block_anchor, anchor);
2319
+ current = true;
2320
+ },
2321
+ p(ctx, [dirty]) {
2322
+ if (/*$isOk*/ ctx[4]) {
2323
+ if (if_block) {
2324
+ if_block.p(ctx, dirty);
2325
+
2326
+ if (dirty & /*$isOk*/ 16) {
2327
+ transition_in(if_block, 1);
2328
+ }
2329
+ } else {
2330
+ if_block = create_if_block$5(ctx);
2331
+ if_block.c();
2332
+ transition_in(if_block, 1);
2333
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2334
+ }
2335
+ } else if (if_block) {
2336
+ group_outros();
2337
+
2338
+ transition_out(if_block, 1, 1, () => {
2339
+ if_block = null;
2340
+ });
2341
+
2342
+ check_outros();
2343
+ }
2344
+ },
2345
+ i(local) {
2346
+ if (current) return;
2347
+ transition_in(if_block);
2348
+ current = true;
2349
+ },
2350
+ o(local) {
2351
+ transition_out(if_block);
2352
+ current = false;
2353
+ },
2354
+ d(detaching) {
2355
+ if (if_block) if_block.d(detaching);
2356
+ if (detaching) detach(if_block_anchor);
2357
+ }
2358
+ };
2359
+ }
2360
+
2361
+ function instance$7($$self, $$props, $$invalidate) {
2362
+ let left;
2363
+ let top;
2364
+ let width;
2365
+ let height;
2366
+ let $yLim;
2367
+ let $xLim;
2368
+ let $isOk;
2369
+ let { slot } = $$props;
2370
+
2371
+ // check that the box is located in a correct slot
2372
+ if (slot !== "box") {
2373
+ throw "Component Box must have \"slot='box'\" attribute.";
2374
+ }
2375
+
2376
+ // get axes context and reactive variables needed to compute coordinates
2377
+ const axes = getContext('axes');
2378
+
2379
+ const xLim = axes.xLim;
2380
+ component_subscribe($$self, xLim, value => $$invalidate(10, $xLim = value));
2381
+ const yLim = axes.yLim;
2382
+ component_subscribe($$self, yLim, value => $$invalidate(9, $yLim = value));
2383
+ const isOk = axes.isOk;
2384
+ component_subscribe($$self, isOk, value => $$invalidate(4, $isOk = value));
2385
+
2386
+ $$self.$$set = $$props => {
2387
+ if ('slot' in $$props) $$invalidate(8, slot = $$props.slot);
2388
+ };
2389
+
2390
+ $$self.$$.update = () => {
2391
+ if ($$self.$$.dirty & /*$xLim*/ 1024) {
2392
+ // reactive variables for coordinates of box points in pixels
2393
+ $$invalidate(3, left = [$xLim[0]]);
2394
+ }
2395
+
2396
+ if ($$self.$$.dirty & /*$yLim*/ 512) {
2397
+ $$invalidate(2, top = [$yLim[1]]);
2398
+ }
2399
+
2400
+ if ($$self.$$.dirty & /*$xLim*/ 1024) {
2401
+ $$invalidate(1, width = [$xLim[1] - $xLim[0]]);
2402
+ }
2403
+
2404
+ if ($$self.$$.dirty & /*$yLim*/ 512) {
2405
+ $$invalidate(0, height = [$yLim[1] - $yLim[0]]);
2406
+ }
2407
+ };
2408
+
2409
+ return [height, width, top, left, $isOk, xLim, yLim, isOk, slot, $yLim, $xLim];
2410
+ }
2411
+
2412
+ class Box extends SvelteComponent {
2413
+ constructor(options) {
2414
+ super();
2415
+ init(this, options, instance$7, create_fragment$7, safe_not_equal, { slot: 8 });
2416
+ }
2417
+ }
2418
+
2419
+ /* src/Segments.svelte generated by Svelte v3.46.3 */
2420
+
2421
+ function get_each_context$2(ctx, list, i) {
2422
+ const child_ctx = ctx.slice();
2423
+ child_ctx[24] = list[i];
2424
+ child_ctx[26] = i;
2425
+ return child_ctx;
2426
+ }
2427
+
2428
+ // (41:0) {#if x1 !== undefined && y1 !== undefined}
2429
+ function create_if_block$4(ctx) {
2430
+ let each_1_anchor;
2431
+ let each_value = /*x1*/ ctx[4];
2432
+ let each_blocks = [];
2433
+
2434
+ for (let i = 0; i < each_value.length; i += 1) {
2435
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
2436
+ }
2437
+
2438
+ return {
2439
+ c() {
2440
+ for (let i = 0; i < each_blocks.length; i += 1) {
2441
+ each_blocks[i].c();
2442
+ }
2443
+
2444
+ each_1_anchor = empty();
2445
+ },
2446
+ m(target, anchor) {
2447
+ for (let i = 0; i < each_blocks.length; i += 1) {
2448
+ each_blocks[i].m(target, anchor);
2449
+ }
2450
+
2451
+ insert(target, each_1_anchor, anchor);
2452
+ },
2453
+ p(ctx, dirty) {
2454
+ if (dirty & /*x1, x2, y1, y2, lineStyleStr*/ 31) {
2455
+ each_value = /*x1*/ ctx[4];
2456
+ let i;
2457
+
2458
+ for (i = 0; i < each_value.length; i += 1) {
2459
+ const child_ctx = get_each_context$2(ctx, each_value, i);
2460
+
2461
+ if (each_blocks[i]) {
2462
+ each_blocks[i].p(child_ctx, dirty);
2463
+ } else {
2464
+ each_blocks[i] = create_each_block$2(child_ctx);
2465
+ each_blocks[i].c();
2466
+ each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2467
+ }
2468
+ }
2469
+
2470
+ for (; i < each_blocks.length; i += 1) {
2471
+ each_blocks[i].d(1);
2472
+ }
2473
+
2474
+ each_blocks.length = each_value.length;
2475
+ }
2476
+ },
2477
+ d(detaching) {
2478
+ destroy_each(each_blocks, detaching);
2479
+ if (detaching) detach(each_1_anchor);
2480
+ }
2481
+ };
2482
+ }
2483
+
2484
+ // (42:3) {#each x1 as v, i}
2485
+ function create_each_block$2(ctx) {
2486
+ let line;
2487
+ let line_x__value;
2488
+ let line_x__value_1;
2489
+ let line_y__value;
2490
+ let line_y__value_1;
2491
+
2492
+ return {
2493
+ c() {
2494
+ line = svg_element("line");
2495
+ attr(line, "x1", line_x__value = /*x1*/ ctx[4][/*i*/ ctx[26]]);
2496
+ attr(line, "x2", line_x__value_1 = /*x2*/ ctx[3][/*i*/ ctx[26]]);
2497
+ attr(line, "y1", line_y__value = /*y1*/ ctx[2][/*i*/ ctx[26]]);
2498
+ attr(line, "y2", line_y__value_1 = /*y2*/ ctx[1][/*i*/ ctx[26]]);
2499
+ attr(line, "style", /*lineStyleStr*/ ctx[0]);
2500
+ },
2501
+ m(target, anchor) {
2502
+ insert(target, line, anchor);
2503
+ },
2504
+ p(ctx, dirty) {
2505
+ if (dirty & /*x1*/ 16 && line_x__value !== (line_x__value = /*x1*/ ctx[4][/*i*/ ctx[26]])) {
2506
+ attr(line, "x1", line_x__value);
2507
+ }
2508
+
2509
+ if (dirty & /*x2*/ 8 && line_x__value_1 !== (line_x__value_1 = /*x2*/ ctx[3][/*i*/ ctx[26]])) {
2510
+ attr(line, "x2", line_x__value_1);
2511
+ }
2512
+
2513
+ if (dirty & /*y1*/ 4 && line_y__value !== (line_y__value = /*y1*/ ctx[2][/*i*/ ctx[26]])) {
2514
+ attr(line, "y1", line_y__value);
2515
+ }
2516
+
2517
+ if (dirty & /*y2*/ 2 && line_y__value_1 !== (line_y__value_1 = /*y2*/ ctx[1][/*i*/ ctx[26]])) {
2518
+ attr(line, "y2", line_y__value_1);
2519
+ }
2520
+
2521
+ if (dirty & /*lineStyleStr*/ 1) {
2522
+ attr(line, "style", /*lineStyleStr*/ ctx[0]);
2523
+ }
2524
+ },
2525
+ d(detaching) {
2526
+ if (detaching) detach(line);
2527
+ }
2528
+ };
2529
+ }
2530
+
2531
+ function create_fragment$6(ctx) {
2532
+ let if_block_anchor;
2533
+ let if_block = /*x1*/ ctx[4] !== undefined && /*y1*/ ctx[2] !== undefined && create_if_block$4(ctx);
2534
+
2535
+ return {
2536
+ c() {
2537
+ if (if_block) if_block.c();
2538
+ if_block_anchor = empty();
2539
+ },
2540
+ m(target, anchor) {
2541
+ if (if_block) if_block.m(target, anchor);
2542
+ insert(target, if_block_anchor, anchor);
2543
+ },
2544
+ p(ctx, [dirty]) {
2545
+ if (/*x1*/ ctx[4] !== undefined && /*y1*/ ctx[2] !== undefined) {
2546
+ if (if_block) {
2547
+ if_block.p(ctx, dirty);
2548
+ } else {
2549
+ if_block = create_if_block$4(ctx);
2550
+ if_block.c();
2551
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2552
+ }
2553
+ } else if (if_block) {
2554
+ if_block.d(1);
2555
+ if_block = null;
2556
+ }
2557
+ },
2558
+ i: noop,
2559
+ o: noop,
2560
+ d(detaching) {
2561
+ if (if_block) if_block.d(detaching);
2562
+ if (detaching) detach(if_block_anchor);
2563
+ }
2564
+ };
2565
+ }
2566
+
2567
+ function instance$6($$self, $$props, $$invalidate) {
2568
+ let x1;
2569
+ let x2;
2570
+ let y1;
2571
+ let y2;
2572
+ let lineStyleStr;
2573
+ let $scale;
2574
+ let $axesHeight;
2575
+ let $yLim;
2576
+ let $axesWidth;
2577
+ let $xLim;
2578
+ let { xStart } = $$props;
2579
+ let { xEnd } = $$props;
2580
+ let { yStart } = $$props;
2581
+ let { yEnd } = $$props;
2582
+ let { lineColor = Colors.PRIMARY } = $$props;
2583
+ let { lineType = 1 } = $$props;
2584
+ let { lineWidth = 1 } = $$props;
2585
+
2586
+ /* sanity check for input parameters */
2587
+ if (!Array.isArray(xStart) || !Array.isArray(xEnd) || !Array.isArray(yStart) || !Array.isArray(yEnd)) {
2588
+ throw "Segments: parameters 'xStart', 'yStart', 'xEnd' and 'yEnd' must be vectors.";
2589
+ }
2590
+
2591
+ const n = xStart.length;
2592
+
2593
+ if (xEnd.length !== n || yStart.length !== n || yEnd.length !== n) {
2594
+ throw "Segments: parameters 'xStart', 'yStart', 'xEnd' and 'yEnd' should have the same length.";
2595
+ }
2596
+
2597
+ // get axes context and reactive variables needed to compute coordinates
2598
+ const axes = getContext('axes');
2599
+
2600
+ const xLim = axes.xLim;
2601
+ component_subscribe($$self, xLim, value => $$invalidate(21, $xLim = value));
2602
+ const yLim = axes.yLim;
2603
+ component_subscribe($$self, yLim, value => $$invalidate(19, $yLim = value));
2604
+ const axesWidth = axes.width;
2605
+ component_subscribe($$self, axesWidth, value => $$invalidate(20, $axesWidth = value));
2606
+ const axesHeight = axes.height;
2607
+ component_subscribe($$self, axesHeight, value => $$invalidate(18, $axesHeight = value));
2608
+ const scale = axes.scale;
2609
+ component_subscribe($$self, scale, value => $$invalidate(17, $scale = value));
2610
+
2611
+ $$self.$$set = $$props => {
2612
+ if ('xStart' in $$props) $$invalidate(10, xStart = $$props.xStart);
2613
+ if ('xEnd' in $$props) $$invalidate(11, xEnd = $$props.xEnd);
2614
+ if ('yStart' in $$props) $$invalidate(12, yStart = $$props.yStart);
2615
+ if ('yEnd' in $$props) $$invalidate(13, yEnd = $$props.yEnd);
2616
+ if ('lineColor' in $$props) $$invalidate(14, lineColor = $$props.lineColor);
2617
+ if ('lineType' in $$props) $$invalidate(15, lineType = $$props.lineType);
2618
+ if ('lineWidth' in $$props) $$invalidate(16, lineWidth = $$props.lineWidth);
2619
+ };
2620
+
2621
+ $$self.$$.update = () => {
2622
+ if ($$self.$$.dirty & /*xStart, $xLim, $axesWidth*/ 3146752) {
2623
+ // reactive variables for coordinates of data points in pixels (and line style)
2624
+ $$invalidate(4, x1 = axes.scaleX(xStart, $xLim, $axesWidth));
2625
+ }
2626
+
2627
+ if ($$self.$$.dirty & /*xEnd, $xLim, $axesWidth*/ 3147776) {
2628
+ $$invalidate(3, x2 = axes.scaleX(xEnd, $xLim, $axesWidth));
2629
+ }
2630
+
2631
+ if ($$self.$$.dirty & /*yStart, $yLim, $axesHeight*/ 790528) {
2632
+ $$invalidate(2, y1 = axes.scaleY(yStart, $yLim, $axesHeight));
2633
+ }
2634
+
2635
+ if ($$self.$$.dirty & /*yEnd, $yLim, $axesHeight*/ 794624) {
2636
+ $$invalidate(1, y2 = axes.scaleY(yEnd, $yLim, $axesHeight));
2637
+ }
2638
+
2639
+ if ($$self.$$.dirty & /*lineColor, lineWidth, $scale, lineType*/ 245760) {
2640
+ $$invalidate(0, lineStyleStr = `stroke:${lineColor};stroke-width: ${lineWidth}px;stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
2641
+ }
2642
+ };
2643
+
2644
+ return [
2645
+ lineStyleStr,
2646
+ y2,
2647
+ y1,
2648
+ x2,
2649
+ x1,
2650
+ xLim,
2651
+ yLim,
2652
+ axesWidth,
2653
+ axesHeight,
2654
+ scale,
2655
+ xStart,
2656
+ xEnd,
2657
+ yStart,
2658
+ yEnd,
2659
+ lineColor,
2660
+ lineType,
2661
+ lineWidth,
2662
+ $scale,
2663
+ $axesHeight,
2664
+ $yLim,
2665
+ $axesWidth,
2666
+ $xLim
2667
+ ];
2668
+ }
2669
+
2670
+ class Segments extends SvelteComponent {
2671
+ constructor(options) {
2672
+ super();
2673
+
2674
+ init(this, options, instance$6, create_fragment$6, safe_not_equal, {
2675
+ xStart: 10,
2676
+ xEnd: 11,
2677
+ yStart: 12,
2678
+ yEnd: 13,
2679
+ lineColor: 14,
2680
+ lineType: 15,
2681
+ lineWidth: 16
2682
+ });
2683
+ }
2684
+ }
2685
+
2686
+ /* src/TextLabels.svelte generated by Svelte v3.46.3 */
2687
+
2688
+ function get_each_context$1(ctx, list, i) {
2689
+ const child_ctx = ctx.slice();
2690
+ child_ctx[25] = list[i];
2691
+ child_ctx[27] = i;
2692
+ return child_ctx;
2693
+ }
2694
+
2695
+ // (56:0) {#if x !== undefined && y !== undefined}
2696
+ function create_if_block$3(ctx) {
2697
+ let each_1_anchor;
2698
+ let each_value = /*x*/ ctx[6];
2699
+ let each_blocks = [];
2700
+
2701
+ for (let i = 0; i < each_value.length; i += 1) {
2702
+ each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
2703
+ }
2704
+
2705
+ return {
2706
+ c() {
2707
+ for (let i = 0; i < each_blocks.length; i += 1) {
2708
+ each_blocks[i].c();
2709
+ }
2710
+
2711
+ each_1_anchor = empty();
2712
+ },
2713
+ m(target, anchor) {
2714
+ for (let i = 0; i < each_blocks.length; i += 1) {
2715
+ each_blocks[i].m(target, anchor);
2716
+ }
2717
+
2718
+ insert(target, each_1_anchor, anchor);
2719
+ },
2720
+ p(ctx, dirty) {
2721
+ if (dirty & /*textStyleStr, x, y, dx, dy, textAnchors, pos, labels*/ 255) {
2722
+ each_value = /*x*/ ctx[6];
2723
+ let i;
2724
+
2725
+ for (i = 0; i < each_value.length; i += 1) {
2726
+ const child_ctx = get_each_context$1(ctx, each_value, i);
2727
+
2728
+ if (each_blocks[i]) {
2729
+ each_blocks[i].p(child_ctx, dirty);
2730
+ } else {
2731
+ each_blocks[i] = create_each_block$1(child_ctx);
2732
+ each_blocks[i].c();
2733
+ each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2734
+ }
2735
+ }
2736
+
2737
+ for (; i < each_blocks.length; i += 1) {
2738
+ each_blocks[i].d(1);
2739
+ }
2740
+
2741
+ each_blocks.length = each_value.length;
2742
+ }
2743
+ },
2744
+ d(detaching) {
2745
+ destroy_each(each_blocks, detaching);
2746
+ if (detaching) detach(each_1_anchor);
2747
+ }
2748
+ };
2749
+ }
2750
+
2751
+ // (57:3) {#each x as v, i}
2752
+ function create_each_block$1(ctx) {
2753
+ let text_1;
2754
+ let raw_value = /*labels*/ ctx[0][/*i*/ ctx[27]] + "";
2755
+ let text_1_x_value;
2756
+ let text_1_y_value;
2757
+ let text_1_text_anchor_value;
2758
+
2759
+ return {
2760
+ c() {
2761
+ text_1 = svg_element("text");
2762
+ attr(text_1, "style", /*textStyleStr*/ ctx[2]);
2763
+ attr(text_1, "x", text_1_x_value = /*x*/ ctx[6][/*i*/ ctx[27]]);
2764
+ attr(text_1, "y", text_1_y_value = /*y*/ ctx[5][/*i*/ ctx[27]]);
2765
+ attr(text_1, "dx", /*dx*/ ctx[4]);
2766
+ attr(text_1, "dy", /*dy*/ ctx[3]);
2767
+ attr(text_1, "dominant-baseline", "middle");
2768
+ attr(text_1, "text-anchor", text_1_text_anchor_value = /*textAnchors*/ ctx[7][/*pos*/ ctx[1]]);
2769
+ },
2770
+ m(target, anchor) {
2771
+ insert(target, text_1, anchor);
2772
+ text_1.innerHTML = raw_value;
2773
+ },
2774
+ p(ctx, dirty) {
2775
+ if (dirty & /*labels*/ 1 && raw_value !== (raw_value = /*labels*/ ctx[0][/*i*/ ctx[27]] + "")) text_1.innerHTML = raw_value;
2776
+ if (dirty & /*textStyleStr*/ 4) {
2777
+ attr(text_1, "style", /*textStyleStr*/ ctx[2]);
2778
+ }
2779
+
2780
+ if (dirty & /*x*/ 64 && text_1_x_value !== (text_1_x_value = /*x*/ ctx[6][/*i*/ ctx[27]])) {
2781
+ attr(text_1, "x", text_1_x_value);
2782
+ }
2783
+
2784
+ if (dirty & /*y*/ 32 && text_1_y_value !== (text_1_y_value = /*y*/ ctx[5][/*i*/ ctx[27]])) {
2785
+ attr(text_1, "y", text_1_y_value);
2786
+ }
2787
+
2788
+ if (dirty & /*dx*/ 16) {
2789
+ attr(text_1, "dx", /*dx*/ ctx[4]);
2790
+ }
2791
+
2792
+ if (dirty & /*dy*/ 8) {
2793
+ attr(text_1, "dy", /*dy*/ ctx[3]);
2794
+ }
2795
+
2796
+ if (dirty & /*pos*/ 2 && text_1_text_anchor_value !== (text_1_text_anchor_value = /*textAnchors*/ ctx[7][/*pos*/ ctx[1]])) {
2797
+ attr(text_1, "text-anchor", text_1_text_anchor_value);
2798
+ }
2799
+ },
2800
+ d(detaching) {
2801
+ if (detaching) detach(text_1);
2802
+ }
2803
+ };
2804
+ }
2805
+
2806
+ function create_fragment$5(ctx) {
2807
+ let if_block_anchor;
2808
+ let if_block = /*x*/ ctx[6] !== undefined && /*y*/ ctx[5] !== undefined && create_if_block$3(ctx);
2809
+
2810
+ return {
2811
+ c() {
2812
+ if (if_block) if_block.c();
2813
+ if_block_anchor = empty();
2814
+ },
2815
+ m(target, anchor) {
2816
+ if (if_block) if_block.m(target, anchor);
2817
+ insert(target, if_block_anchor, anchor);
2818
+ },
2819
+ p(ctx, [dirty]) {
2820
+ if (/*x*/ ctx[6] !== undefined && /*y*/ ctx[5] !== undefined) {
2821
+ if (if_block) {
2822
+ if_block.p(ctx, dirty);
2823
+ } else {
2824
+ if_block = create_if_block$3(ctx);
2825
+ if_block.c();
2826
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
2827
+ }
2828
+ } else if (if_block) {
2829
+ if_block.d(1);
2830
+ if_block = null;
2831
+ }
2832
+ },
2833
+ i: noop,
2834
+ o: noop,
2835
+ d(detaching) {
2836
+ if (if_block) if_block.d(detaching);
2837
+ if (detaching) detach(if_block_anchor);
2838
+ }
2839
+ };
2840
+ }
2841
+
2842
+ function instance$5($$self, $$props, $$invalidate) {
2843
+ let x;
2844
+ let y;
2845
+ let dx;
2846
+ let dy;
2847
+ let textStyleStr;
2848
+ let $scale;
2849
+ let $axesHeight;
2850
+ let $yLim;
2851
+ let $axesWidth;
2852
+ let $xLim;
2853
+ let { xValues } = $$props;
2854
+ let { yValues } = $$props;
2855
+ let { labels } = $$props;
2856
+ let { pos = 0 } = $$props;
2857
+ let { faceColor = Colors.PRIMARY_TEXT } = $$props;
2858
+ let { borderColor = "transparent" } = $$props;
2859
+ let { borderWidth = 0 } = $$props;
2860
+ let { textSize = 1 } = $$props;
2861
+
2862
+ // text-anchor values depending on position
2863
+ const textAnchors = ["middle", "middle", "start", "middle", "end"];
2864
+
2865
+ /* sanity check for input parameters */
2866
+ if (!Array.isArray(xValues) || !Array.isArray(yValues) || xValues.length !== yValues.length) {
2867
+ throw "TextLabels: parameters 'xValues' and 'yValues' must be vectors of the same length.";
2868
+ }
2869
+
2870
+ // get axes context and reactive variables needed to compute coordinates
2871
+ const axes = getContext('axes');
2872
+
2873
+ const xLim = axes.xLim;
2874
+ component_subscribe($$self, xLim, value => $$invalidate(23, $xLim = value));
2875
+ const yLim = axes.yLim;
2876
+ component_subscribe($$self, yLim, value => $$invalidate(21, $yLim = value));
2877
+ const axesWidth = axes.width;
2878
+ component_subscribe($$self, axesWidth, value => $$invalidate(22, $axesWidth = value));
2879
+ const axesHeight = axes.height;
2880
+ component_subscribe($$self, axesHeight, value => $$invalidate(20, $axesHeight = value));
2881
+ const scale = axes.scale;
2882
+ component_subscribe($$self, scale, value => $$invalidate(19, $scale = value));
2883
+
2884
+ $$self.$$set = $$props => {
2885
+ if ('xValues' in $$props) $$invalidate(13, xValues = $$props.xValues);
2886
+ if ('yValues' in $$props) $$invalidate(14, yValues = $$props.yValues);
2887
+ if ('labels' in $$props) $$invalidate(0, labels = $$props.labels);
2888
+ if ('pos' in $$props) $$invalidate(1, pos = $$props.pos);
2889
+ if ('faceColor' in $$props) $$invalidate(15, faceColor = $$props.faceColor);
2890
+ if ('borderColor' in $$props) $$invalidate(16, borderColor = $$props.borderColor);
2891
+ if ('borderWidth' in $$props) $$invalidate(17, borderWidth = $$props.borderWidth);
2892
+ if ('textSize' in $$props) $$invalidate(18, textSize = $$props.textSize);
2893
+ };
2894
+
2895
+ $$self.$$.update = () => {
2896
+ if ($$self.$$.dirty & /*xValues, labels*/ 8193) {
2897
+ // multiply labels values if needed
2898
+ {
2899
+ const n = xValues.length;
2900
+ if (!Array.isArray(labels)) $$invalidate(0, labels = Array(n).fill(labels));
2901
+
2902
+ // workaround for an issue when xValues and yValues are changed in parent app
2903
+ // but array of labels is still the same as in the
2904
+ if (labels.length != n) $$invalidate(0, labels = Array(n).fill(labels[0]));
2905
+
2906
+ // check that the length of labels vector is correct
2907
+ if (labels.length !== n) {
2908
+ throw "TextLabels: parameter 'labels' must be a single text value or a vector of the same size as 'x' and 'y'.";
2909
+ }
2910
+ }
2911
+ }
2912
+
2913
+ if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 12591104) {
2914
+ // reactive variables for coordinates of data points in pixels
2915
+ $$invalidate(6, x = axes.scaleX(xValues, $xLim, $axesWidth));
2916
+ }
2917
+
2918
+ if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 3162112) {
2919
+ $$invalidate(5, y = axes.scaleY(yValues, $yLim, $axesHeight));
2920
+ }
2921
+
2922
+ if ($$self.$$.dirty & /*pos, $scale*/ 524290) {
2923
+ $$invalidate(4, dx = [0, 0, 1, 0, -1][pos] * axes.LABELS_MARGIN[$scale]);
2924
+ }
2925
+
2926
+ if ($$self.$$.dirty & /*pos, $scale*/ 524290) {
2927
+ $$invalidate(3, dy = [0, 1, 0, -1, 0][pos] * axes.LABELS_MARGIN[$scale]);
2928
+ }
2929
+
2930
+ if ($$self.$$.dirty & /*faceColor, borderWidth, borderColor, textSize*/ 491520) {
2931
+ // styles for bars and labels
2932
+ $$invalidate(2, textStyleStr = `fill:${faceColor};stroke-width:${borderWidth}px;stroke:${borderColor};font-size:${textSize}em;`);
2933
+ }
2934
+ };
2935
+
2936
+ return [
2937
+ labels,
2938
+ pos,
2939
+ textStyleStr,
2940
+ dy,
2941
+ dx,
2942
+ y,
2943
+ x,
2944
+ textAnchors,
2945
+ xLim,
2946
+ yLim,
2947
+ axesWidth,
2948
+ axesHeight,
2949
+ scale,
2950
+ xValues,
2951
+ yValues,
2952
+ faceColor,
2953
+ borderColor,
2954
+ borderWidth,
2955
+ textSize,
2956
+ $scale,
2957
+ $axesHeight,
2958
+ $yLim,
2959
+ $axesWidth,
2960
+ $xLim
2961
+ ];
2962
+ }
2963
+
2964
+ class TextLabels extends SvelteComponent {
2965
+ constructor(options) {
2966
+ super();
2967
+
2968
+ init(this, options, instance$5, create_fragment$5, safe_not_equal, {
2969
+ xValues: 13,
2970
+ yValues: 14,
2971
+ labels: 0,
2972
+ pos: 1,
2973
+ faceColor: 15,
2974
+ borderColor: 16,
2975
+ borderWidth: 17,
2976
+ textSize: 18
2977
+ });
2978
+ }
2979
+ }
2980
+
2981
+ /* src/TextLegend.svelte generated by Svelte v3.46.3 */
2982
+
2983
+ function get_each_context(ctx, list, i) {
2984
+ const child_ctx = ctx.slice();
2985
+ child_ctx[22] = list[i];
2986
+ child_ctx[24] = i;
2987
+ return child_ctx;
2988
+ }
2989
+
2990
+ // (32:0) {#if x !== undefined && y !== undefined && elements.length > 0}
2991
+ function create_if_block$2(ctx) {
2992
+ let text_1;
2993
+ let each_value = /*elements*/ ctx[2];
2994
+ let each_blocks = [];
2995
+
2996
+ for (let i = 0; i < each_value.length; i += 1) {
2997
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
2998
+ }
2999
+
3000
+ return {
3001
+ c() {
3002
+ text_1 = svg_element("text");
3003
+
3004
+ for (let i = 0; i < each_blocks.length; i += 1) {
3005
+ each_blocks[i].c();
3006
+ }
3007
+
3008
+ attr(text_1, "style", /*textStyleStr*/ ctx[3]);
3009
+ attr(text_1, "x", /*x*/ ctx[5]);
3010
+ attr(text_1, "y", /*y*/ ctx[4]);
3011
+ attr(text_1, "dx", /*dx*/ ctx[0]);
3012
+ attr(text_1, "dy", /*dy*/ ctx[1]);
3013
+ attr(text_1, "dominant-baseline", "middle");
3014
+ attr(text_1, "text-anchor", "start");
3015
+ },
3016
+ m(target, anchor) {
3017
+ insert(target, text_1, anchor);
3018
+
3019
+ for (let i = 0; i < each_blocks.length; i += 1) {
3020
+ each_blocks[i].m(text_1, null);
3021
+ }
3022
+ },
3023
+ p(ctx, dirty) {
3024
+ if (dirty & /*x, dx, dy, elements*/ 39) {
3025
+ each_value = /*elements*/ ctx[2];
3026
+ let i;
3027
+
3028
+ for (i = 0; i < each_value.length; i += 1) {
3029
+ const child_ctx = get_each_context(ctx, each_value, i);
3030
+
3031
+ if (each_blocks[i]) {
3032
+ each_blocks[i].p(child_ctx, dirty);
3033
+ } else {
3034
+ each_blocks[i] = create_each_block(child_ctx);
3035
+ each_blocks[i].c();
3036
+ each_blocks[i].m(text_1, null);
3037
+ }
3038
+ }
3039
+
3040
+ for (; i < each_blocks.length; i += 1) {
3041
+ each_blocks[i].d(1);
3042
+ }
3043
+
3044
+ each_blocks.length = each_value.length;
3045
+ }
3046
+
3047
+ if (dirty & /*textStyleStr*/ 8) {
3048
+ attr(text_1, "style", /*textStyleStr*/ ctx[3]);
3049
+ }
3050
+
3051
+ if (dirty & /*x*/ 32) {
3052
+ attr(text_1, "x", /*x*/ ctx[5]);
3053
+ }
3054
+
3055
+ if (dirty & /*y*/ 16) {
3056
+ attr(text_1, "y", /*y*/ ctx[4]);
3057
+ }
3058
+
3059
+ if (dirty & /*dx*/ 1) {
3060
+ attr(text_1, "dx", /*dx*/ ctx[0]);
3061
+ }
3062
+
3063
+ if (dirty & /*dy*/ 2) {
3064
+ attr(text_1, "dy", /*dy*/ ctx[1]);
3065
+ }
3066
+ },
3067
+ d(detaching) {
3068
+ if (detaching) detach(text_1);
3069
+ destroy_each(each_blocks, detaching);
3070
+ }
3071
+ };
3072
+ }
3073
+
3074
+ // (34:6) {#each elements as el, i}
3075
+ function create_each_block(ctx) {
3076
+ let tspan;
3077
+ let raw_value = /*el*/ ctx[22] + "";
3078
+ let tspan_dy_value;
3079
+
3080
+ return {
3081
+ c() {
3082
+ tspan = svg_element("tspan");
3083
+ attr(tspan, "x", /*x*/ ctx[5]);
3084
+ attr(tspan, "dx", /*dx*/ ctx[0]);
3085
+ attr(tspan, "dy", tspan_dy_value = /*i*/ ctx[24] === 0 ? 0 : /*dy*/ ctx[1]);
3086
+ },
3087
+ m(target, anchor) {
3088
+ insert(target, tspan, anchor);
3089
+ tspan.innerHTML = raw_value;
3090
+ },
3091
+ p(ctx, dirty) {
3092
+ if (dirty & /*elements*/ 4 && raw_value !== (raw_value = /*el*/ ctx[22] + "")) tspan.innerHTML = raw_value;
3093
+ if (dirty & /*x*/ 32) {
3094
+ attr(tspan, "x", /*x*/ ctx[5]);
3095
+ }
3096
+
3097
+ if (dirty & /*dx*/ 1) {
3098
+ attr(tspan, "dx", /*dx*/ ctx[0]);
3099
+ }
3100
+
3101
+ if (dirty & /*dy*/ 2 && tspan_dy_value !== (tspan_dy_value = /*i*/ ctx[24] === 0 ? 0 : /*dy*/ ctx[1])) {
3102
+ attr(tspan, "dy", tspan_dy_value);
3103
+ }
3104
+ },
3105
+ d(detaching) {
3106
+ if (detaching) detach(tspan);
3107
+ }
3108
+ };
3109
+ }
3110
+
3111
+ function create_fragment$4(ctx) {
3112
+ let if_block_anchor;
3113
+ let if_block = /*x*/ ctx[5] !== undefined && /*y*/ ctx[4] !== undefined && /*elements*/ ctx[2].length > 0 && create_if_block$2(ctx);
3114
+
3115
+ return {
3116
+ c() {
3117
+ if (if_block) if_block.c();
3118
+ if_block_anchor = empty();
3119
+ },
3120
+ m(target, anchor) {
3121
+ if (if_block) if_block.m(target, anchor);
3122
+ insert(target, if_block_anchor, anchor);
3123
+ },
3124
+ p(ctx, [dirty]) {
3125
+ if (/*x*/ ctx[5] !== undefined && /*y*/ ctx[4] !== undefined && /*elements*/ ctx[2].length > 0) {
3126
+ if (if_block) {
3127
+ if_block.p(ctx, dirty);
3128
+ } else {
3129
+ if_block = create_if_block$2(ctx);
3130
+ if_block.c();
3131
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
3132
+ }
3133
+ } else if (if_block) {
3134
+ if_block.d(1);
3135
+ if_block = null;
3136
+ }
3137
+ },
3138
+ i: noop,
3139
+ o: noop,
3140
+ d(detaching) {
3141
+ if (if_block) if_block.d(detaching);
3142
+ if (detaching) detach(if_block_anchor);
3143
+ }
3144
+ };
3145
+ }
3146
+
3147
+ function instance$4($$self, $$props, $$invalidate) {
3148
+ let x;
3149
+ let y;
3150
+ let textStyleStr;
3151
+ let $axesHeight;
3152
+ let $yLim;
3153
+ let $axesWidth;
3154
+ let $xLim;
3155
+ let { left } = $$props;
3156
+ let { top } = $$props;
3157
+ let { dx = "0" } = $$props;
3158
+ let { dy = "1.25em" } = $$props;
3159
+ let { elements } = $$props;
3160
+ let { faceColor = Colors.PRIMARY_TEXT } = $$props;
3161
+ let { borderColor = "transparent" } = $$props;
3162
+ let { borderWidth = 0 } = $$props;
3163
+ let { textSize = 1 } = $$props;
3164
+
3165
+ // get axes context and reactive variables needed to compute coordinates
3166
+ const axes = getContext('axes');
3167
+
3168
+ const xLim = axes.xLim;
3169
+ component_subscribe($$self, xLim, value => $$invalidate(19, $xLim = value));
3170
+ const yLim = axes.yLim;
3171
+ component_subscribe($$self, yLim, value => $$invalidate(17, $yLim = value));
3172
+ const axesWidth = axes.width;
3173
+ component_subscribe($$self, axesWidth, value => $$invalidate(18, $axesWidth = value));
3174
+ const axesHeight = axes.height;
3175
+ component_subscribe($$self, axesHeight, value => $$invalidate(16, $axesHeight = value));
3176
+ axes.scale;
3177
+
3178
+ $$self.$$set = $$props => {
3179
+ if ('left' in $$props) $$invalidate(10, left = $$props.left);
3180
+ if ('top' in $$props) $$invalidate(11, top = $$props.top);
3181
+ if ('dx' in $$props) $$invalidate(0, dx = $$props.dx);
3182
+ if ('dy' in $$props) $$invalidate(1, dy = $$props.dy);
3183
+ if ('elements' in $$props) $$invalidate(2, elements = $$props.elements);
3184
+ if ('faceColor' in $$props) $$invalidate(12, faceColor = $$props.faceColor);
3185
+ if ('borderColor' in $$props) $$invalidate(13, borderColor = $$props.borderColor);
3186
+ if ('borderWidth' in $$props) $$invalidate(14, borderWidth = $$props.borderWidth);
3187
+ if ('textSize' in $$props) $$invalidate(15, textSize = $$props.textSize);
3188
+ };
3189
+
3190
+ $$self.$$.update = () => {
3191
+ if ($$self.$$.dirty & /*left, $xLim, $axesWidth*/ 787456) {
3192
+ // reactive variables for coordinates of data points in pixels
3193
+ $$invalidate(5, x = axes.scaleX([left], $xLim, $axesWidth));
3194
+ }
3195
+
3196
+ if ($$self.$$.dirty & /*top, $yLim, $axesHeight*/ 198656) {
3197
+ $$invalidate(4, y = axes.scaleY([top], $yLim, $axesHeight));
3198
+ }
3199
+
3200
+ if ($$self.$$.dirty & /*faceColor, borderWidth, borderColor, textSize*/ 61440) {
3201
+ // styles for bars and labels
3202
+ $$invalidate(3, textStyleStr = `fill:${faceColor};stroke-width:${borderWidth}px;stroke:${borderColor};font-size:${textSize}em;`);
3203
+ }
3204
+ };
3205
+
3206
+ return [
3207
+ dx,
3208
+ dy,
3209
+ elements,
3210
+ textStyleStr,
3211
+ y,
3212
+ x,
3213
+ xLim,
3214
+ yLim,
3215
+ axesWidth,
3216
+ axesHeight,
3217
+ left,
3218
+ top,
3219
+ faceColor,
3220
+ borderColor,
3221
+ borderWidth,
3222
+ textSize,
3223
+ $axesHeight,
3224
+ $yLim,
3225
+ $axesWidth,
3226
+ $xLim
3227
+ ];
3228
+ }
3229
+
3230
+ class TextLegend extends SvelteComponent {
3231
+ constructor(options) {
3232
+ super();
3233
+
3234
+ init(this, options, instance$4, create_fragment$4, safe_not_equal, {
3235
+ left: 10,
3236
+ top: 11,
3237
+ dx: 0,
3238
+ dy: 1,
3239
+ elements: 2,
3240
+ faceColor: 12,
3241
+ borderColor: 13,
3242
+ borderWidth: 14,
3243
+ textSize: 15
3244
+ });
3245
+ }
3246
+ }
3247
+
3248
+ /**********************************************
3249
+ * Functions for statistical tests *
3250
+ **********************************************/
3251
+
3252
+
3253
+ /**
3254
+ * Finds smallest value in a vector
3255
+ * @param {number[]} x - vector with values
3256
+ * @returns {number}
3257
+ */
3258
+ function min(x) {
3259
+ let n = x.length;
3260
+ let min = Number.POSITIVE_INFINITY;
3261
+
3262
+ while (n--) min = x[n] < min ? x[n] : min;
3263
+ return min;
3264
+ }
3265
+
3266
+
3267
+ /**
3268
+ * Finds largest value in a vector
3269
+ * @param {number[]} x - vector with values
3270
+ * @returns {number}
3271
+ */
3272
+ function max(x) {
3273
+ let n = x.length;
3274
+ let max = Number.NEGATIVE_INFINITY;
3275
+
3276
+ while (n--) max = x[n] > max ? x[n] : max;
3277
+ return max;
3278
+ }
3279
+
3280
+
3281
+ /**
3282
+ * Computes a range of values in a vector with a margin
3283
+ * @param {number[]} x - vector with values
3284
+ * @param {number} margin - margin in parts of one (e.g. 0.1 for 10% or 2 for 200%)
3285
+ * @returns{number[]} array with marginal range boundaries
3286
+ */
3287
+ function mrange(x, margin = 0.05) {
3288
+ const mn = min(x);
3289
+ const mx = max(x);
3290
+ const d = mx - mn;
3291
+
3292
+ return [mn - d * margin, max(x) + d * margin];
3293
+ }
3294
+
3295
+
3296
+ /**
3297
+ * Computes difference between all adjacent values in a vector
3298
+ * @param {number[]} x - vector with values
3299
+ * @returns {number[]} vector with the differences
3300
+ */
3301
+ function diff(x) {
3302
+ return x.slice(1).map( (y, i) => (y - x[i]));
3303
+ }
3304
+
3305
+ /* src/BarSeries.svelte generated by Svelte v3.46.3 */
3306
+
3307
+ function add_css$1(target) {
3308
+ append_styles(target, "svelte-kw726w", ".series_bar > rect{stroke-width:1px}.series_bar > rect:hover{opacity:90%}");
3309
+ }
3310
+
3311
+ function create_fragment$3(ctx) {
3312
+ let g;
3313
+ let rectangles;
3314
+ let current;
3315
+
3316
+ rectangles = new Rectangles({
3317
+ props: {
3318
+ left: /*left*/ ctx[4],
3319
+ top: /*top*/ ctx[5],
3320
+ width: /*width*/ ctx[3],
3321
+ height: /*height*/ ctx[6],
3322
+ borderColor: /*borderColor*/ ctx[2],
3323
+ faceColor: /*faceColor*/ ctx[1]
3324
+ }
3325
+ });
3326
+
3327
+ return {
3328
+ c() {
3329
+ g = svg_element("g");
3330
+ create_component(rectangles.$$.fragment);
3331
+ attr(g, "class", "series series_bar");
3332
+ attr(g, "title", /*title*/ ctx[0]);
3333
+ },
3334
+ m(target, anchor) {
3335
+ insert(target, g, anchor);
3336
+ mount_component(rectangles, g, null);
3337
+ current = true;
3338
+ },
3339
+ p(ctx, [dirty]) {
3340
+ const rectangles_changes = {};
3341
+ if (dirty & /*left*/ 16) rectangles_changes.left = /*left*/ ctx[4];
3342
+ if (dirty & /*top*/ 32) rectangles_changes.top = /*top*/ ctx[5];
3343
+ if (dirty & /*width*/ 8) rectangles_changes.width = /*width*/ ctx[3];
3344
+ if (dirty & /*height*/ 64) rectangles_changes.height = /*height*/ ctx[6];
3345
+ if (dirty & /*borderColor*/ 4) rectangles_changes.borderColor = /*borderColor*/ ctx[2];
3346
+ if (dirty & /*faceColor*/ 2) rectangles_changes.faceColor = /*faceColor*/ ctx[1];
3347
+ rectangles.$set(rectangles_changes);
3348
+
3349
+ if (!current || dirty & /*title*/ 1) {
3350
+ attr(g, "title", /*title*/ ctx[0]);
3351
+ }
3352
+ },
3353
+ i(local) {
3354
+ if (current) return;
3355
+ transition_in(rectangles.$$.fragment, local);
3356
+ current = true;
3357
+ },
3358
+ o(local) {
3359
+ transition_out(rectangles.$$.fragment, local);
3360
+ current = false;
3361
+ },
3362
+ d(detaching) {
3363
+ if (detaching) detach(g);
3364
+ destroy_component(rectangles);
3365
+ }
3366
+ };
3367
+ }
3368
+
3369
+ function instance$3($$self, $$props, $$invalidate) {
3370
+ let { xValues } = $$props;
3371
+ let { yValues } = $$props;
3372
+ let { barWidth = 0.8 } = $$props;
3373
+ let { title = "" } = $$props;
3374
+ let { faceColor = Colors.PRIMARY } = $$props;
3375
+ let { borderColor = Colors.PRIMARY } = $$props;
3376
+ let { showLabels = "no" } = $$props;
3377
+
3378
+ // TODO: implemented later
3379
+ //export let labels = yValues;
3380
+ /* internal parameters */
3381
+ let width;
3382
+
3383
+ let left;
3384
+ let top;
3385
+ let height;
3386
+
3387
+ // to access shared parameters and methods from Axes
3388
+ const axes = getContext('axes');
3389
+
3390
+ $$self.$$set = $$props => {
3391
+ if ('xValues' in $$props) $$invalidate(7, xValues = $$props.xValues);
3392
+ if ('yValues' in $$props) $$invalidate(8, yValues = $$props.yValues);
3393
+ if ('barWidth' in $$props) $$invalidate(9, barWidth = $$props.barWidth);
3394
+ if ('title' in $$props) $$invalidate(0, title = $$props.title);
3395
+ if ('faceColor' in $$props) $$invalidate(1, faceColor = $$props.faceColor);
3396
+ if ('borderColor' in $$props) $$invalidate(2, borderColor = $$props.borderColor);
3397
+ if ('showLabels' in $$props) $$invalidate(10, showLabels = $$props.showLabels);
3398
+ };
3399
+
3400
+ $$self.$$.update = () => {
3401
+ if ($$self.$$.dirty & /*xValues, barWidth, width*/ 648) {
3402
+ /* reactive actions related to x-values, fires when there are changes in:
3403
+ * - xValues
3404
+ * - barWidth
3405
+ */
3406
+ {
3407
+ if (!Array.isArray(xValues)) {
3408
+ throw "BarSeries: parameter 'xValues' must be a numeric vector.";
3409
+ }
3410
+
3411
+ if (barWidth <= 0 || barWidth > 1) {
3412
+ throw "BarSeries: parameters 'barWidth' should be between 0 and 1.";
3413
+ }
3414
+
3415
+ const xValuesRange = mrange(xValues, 0.1);
3416
+ xValuesRange[0] = xValuesRange[0] - barWidth * diff(xValuesRange) / xValues.length * 0.5;
3417
+ xValuesRange[1] = xValuesRange[1] + barWidth * diff(xValuesRange) / xValues.length * 0.5;
3418
+ axes.adjustXAxisLimits(xValuesRange);
3419
+ $$invalidate(3, width = Array(xValues.length).fill(max(diff(xValues)) * barWidth));
3420
+ $$invalidate(4, left = xValues.map((v, i) => v - width[i] / 2));
3421
+ }
3422
+ }
3423
+
3424
+ if ($$self.$$.dirty & /*yValues, xValues, showLabels*/ 1408) {
3425
+ /* reactive actions related to y-values, fires when there are changes in:
3426
+ * - yValues
3427
+ */
3428
+ {
3429
+ if (!Array.isArray(yValues) || xValues.length != yValues.length) {
3430
+ throw "BarSeries: parameter 'yValues' must be a numeric vector of the same length as 'xValues'.";
3431
+ }
3432
+
3433
+ const yValuesRange = mrange(yValues, showLabels === "no" ? 0.05 : 0.20);
3434
+ axes.adjustYAxisLimits(yValuesRange);
3435
+ $$invalidate(5, top = yValues.map(v => v > 0 ? v : 0));
3436
+ $$invalidate(6, height = yValues.map(v => Math.abs(v)));
3437
+ }
3438
+ }
3439
+ };
3440
+
3441
+ return [
3442
+ title,
3443
+ faceColor,
3444
+ borderColor,
3445
+ width,
3446
+ left,
3447
+ top,
3448
+ height,
3449
+ xValues,
3450
+ yValues,
3451
+ barWidth,
3452
+ showLabels
3453
+ ];
3454
+ }
3455
+
3456
+ class BarSeries extends SvelteComponent {
3457
+ constructor(options) {
3458
+ super();
3459
+
3460
+ init(
3461
+ this,
3462
+ options,
3463
+ instance$3,
3464
+ create_fragment$3,
3465
+ safe_not_equal,
3466
+ {
3467
+ xValues: 7,
3468
+ yValues: 8,
3469
+ barWidth: 9,
3470
+ title: 0,
3471
+ faceColor: 1,
3472
+ borderColor: 2,
3473
+ showLabels: 10
3474
+ },
3475
+ add_css$1
3476
+ );
3477
+ }
3478
+ }
3479
+
3480
+ /* src/ScatterSeries.svelte generated by Svelte v3.46.3 */
3481
+
3482
+ function add_css(target) {
3483
+ append_styles(target, "svelte-11a4d2d", ".marker{font-size:1em;cursor:default}.marker:hover{opacity:90%}.series_scatter > *:hover + .labels_hover{visibility:visible;opacity:1}");
3484
+ }
3485
+
3486
+ function create_fragment$2(ctx) {
3487
+ let g;
3488
+ let textlabels;
3489
+ let current;
3490
+
3491
+ textlabels = new TextLabels({
3492
+ props: {
3493
+ xValues: /*xValues*/ ctx[0],
3494
+ yValues: /*yValues*/ ctx[1],
3495
+ labels: /*markerSymbol*/ ctx[7],
3496
+ textSize: /*markerSize*/ ctx[6],
3497
+ faceColor: /*faceColor*/ ctx[3],
3498
+ borderColor: /*borderColor*/ ctx[4],
3499
+ borderWidth: /*borderWidth*/ ctx[5]
3500
+ }
3501
+ });
3502
+
3503
+ return {
3504
+ c() {
3505
+ g = svg_element("g");
3506
+ create_component(textlabels.$$.fragment);
3507
+ attr(g, "class", "series series_scatter");
3508
+ attr(g, "title", /*title*/ ctx[2]);
3509
+ },
3510
+ m(target, anchor) {
3511
+ insert(target, g, anchor);
3512
+ mount_component(textlabels, g, null);
3513
+ current = true;
3514
+ },
3515
+ p(ctx, [dirty]) {
3516
+ const textlabels_changes = {};
3517
+ if (dirty & /*xValues*/ 1) textlabels_changes.xValues = /*xValues*/ ctx[0];
3518
+ if (dirty & /*yValues*/ 2) textlabels_changes.yValues = /*yValues*/ ctx[1];
3519
+ if (dirty & /*markerSymbol*/ 128) textlabels_changes.labels = /*markerSymbol*/ ctx[7];
3520
+ if (dirty & /*markerSize*/ 64) textlabels_changes.textSize = /*markerSize*/ ctx[6];
3521
+ if (dirty & /*faceColor*/ 8) textlabels_changes.faceColor = /*faceColor*/ ctx[3];
3522
+ if (dirty & /*borderColor*/ 16) textlabels_changes.borderColor = /*borderColor*/ ctx[4];
3523
+ if (dirty & /*borderWidth*/ 32) textlabels_changes.borderWidth = /*borderWidth*/ ctx[5];
3524
+ textlabels.$set(textlabels_changes);
3525
+
3526
+ if (!current || dirty & /*title*/ 4) {
3527
+ attr(g, "title", /*title*/ ctx[2]);
3528
+ }
3529
+ },
3530
+ i(local) {
3531
+ if (current) return;
3532
+ transition_in(textlabels.$$.fragment, local);
3533
+ current = true;
3534
+ },
3535
+ o(local) {
3536
+ transition_out(textlabels.$$.fragment, local);
3537
+ current = false;
3538
+ },
3539
+ d(detaching) {
3540
+ if (detaching) detach(g);
3541
+ destroy_component(textlabels);
3542
+ }
3543
+ };
3544
+ }
3545
+
3546
+ function instance$2($$self, $$props, $$invalidate) {
3547
+ let { xValues } = $$props;
3548
+ let { yValues } = $$props;
3549
+ let { marker = 1 } = $$props;
3550
+ let { title = "" } = $$props;
3551
+ let { faceColor = "transparent" } = $$props;
3552
+ let { borderColor = Colors.PRIMARY } = $$props;
3553
+ let { borderWidth = 1 } = $$props;
3554
+ let { markerSize = 1 } = $$props;
3555
+
3556
+ // TODO: implement later
3557
+ //export let labels = yValues;
3558
+ //export let showLabels = "no"; // can be "no", "hover", "always"
3559
+ const markers = ["●", "◼", "▲", "▼", "⬥", "+", "*", "⨯"];
3560
+
3561
+ let markerSymbol;
3562
+
3563
+ /* sanity check of input parameters */
3564
+ if (typeof marker !== "number" || marker < 1 || marker > markers.length) {
3565
+ throw `ScatterSeries: parameter 'marker' must be a number from 1 to ${markers.length}."`;
3566
+ }
3567
+
3568
+ // to access shared parameters and methods from Axes
3569
+ const axes = getContext('axes');
3570
+
3571
+ $$self.$$set = $$props => {
3572
+ if ('xValues' in $$props) $$invalidate(0, xValues = $$props.xValues);
3573
+ if ('yValues' in $$props) $$invalidate(1, yValues = $$props.yValues);
3574
+ if ('marker' in $$props) $$invalidate(8, marker = $$props.marker);
3575
+ if ('title' in $$props) $$invalidate(2, title = $$props.title);
3576
+ if ('faceColor' in $$props) $$invalidate(3, faceColor = $$props.faceColor);
3577
+ if ('borderColor' in $$props) $$invalidate(4, borderColor = $$props.borderColor);
3578
+ if ('borderWidth' in $$props) $$invalidate(5, borderWidth = $$props.borderWidth);
3579
+ if ('markerSize' in $$props) $$invalidate(6, markerSize = $$props.markerSize);
3580
+ };
3581
+
3582
+ $$self.$$.update = () => {
3583
+ if ($$self.$$.dirty & /*xValues, marker*/ 257) {
3584
+ /* reactive actions related to x-values, fires when there are changes in:
3585
+ * - xValues
3586
+ * - marker
3587
+ */
3588
+ {
3589
+ if (!Array.isArray(xValues)) {
3590
+ throw "ScatterSeries: parameter 'xValues' must be a numeric vector.";
3591
+ }
3592
+
3593
+ const xValuesRange = mrange(xValues, 0.05);
3594
+ axes.adjustXAxisLimits(xValuesRange);
3595
+ $$invalidate(7, markerSymbol = "");
3596
+ $$invalidate(7, markerSymbol = markers[marker - 1]);
3597
+ }
3598
+ }
3599
+
3600
+ if ($$self.$$.dirty & /*yValues, xValues*/ 3) {
3601
+ /* reactive actions related to y-values, fires when there are changes in:
3602
+ * - yValues
3603
+ */
3604
+ {
3605
+ if (!Array.isArray(yValues) || xValues.length != yValues.length) {
3606
+ throw "BarSeries: parameter 'yValues' must be a numeric vector of the same length as 'xValues'.";
3607
+ }
3608
+
3609
+ const yValuesRange = mrange(yValues, 0.05);
3610
+ axes.adjustYAxisLimits(yValuesRange);
3611
+ }
3612
+ }
3613
+ };
3614
+
3615
+ return [
3616
+ xValues,
3617
+ yValues,
3618
+ title,
3619
+ faceColor,
3620
+ borderColor,
3621
+ borderWidth,
3622
+ markerSize,
3623
+ markerSymbol,
3624
+ marker
3625
+ ];
3626
+ }
3627
+
3628
+ class ScatterSeries extends SvelteComponent {
3629
+ constructor(options) {
3630
+ super();
3631
+
3632
+ init(
3633
+ this,
3634
+ options,
3635
+ instance$2,
3636
+ create_fragment$2,
3637
+ safe_not_equal,
3638
+ {
3639
+ xValues: 0,
3640
+ yValues: 1,
3641
+ marker: 8,
3642
+ title: 2,
3643
+ faceColor: 3,
3644
+ borderColor: 4,
3645
+ borderWidth: 5,
3646
+ markerSize: 6
3647
+ },
3648
+ add_css
3649
+ );
3650
+ }
3651
+ }
3652
+
3653
+ /* src/LineSeries.svelte generated by Svelte v3.46.3 */
3654
+
3655
+ function create_if_block$1(ctx) {
3656
+ let g;
3657
+ let polyline;
3658
+
3659
+ return {
3660
+ c() {
3661
+ g = svg_element("g");
3662
+ polyline = svg_element("polyline");
3663
+ attr(polyline, "class", "line");
3664
+ attr(polyline, "points", /*p*/ ctx[2]);
3665
+ attr(g, "class", "series lineseries");
3666
+ attr(g, "style", /*lineStyleStr*/ ctx[1]);
3667
+ attr(g, "title", /*title*/ ctx[0]);
3668
+ },
3669
+ m(target, anchor) {
3670
+ insert(target, g, anchor);
3671
+ append(g, polyline);
3672
+ },
3673
+ p(ctx, dirty) {
3674
+ if (dirty & /*p*/ 4) {
3675
+ attr(polyline, "points", /*p*/ ctx[2]);
3676
+ }
3677
+
3678
+ if (dirty & /*lineStyleStr*/ 2) {
3679
+ attr(g, "style", /*lineStyleStr*/ ctx[1]);
3680
+ }
3681
+
3682
+ if (dirty & /*title*/ 1) {
3683
+ attr(g, "title", /*title*/ ctx[0]);
3684
+ }
3685
+ },
3686
+ d(detaching) {
3687
+ if (detaching) detach(g);
3688
+ }
3689
+ };
3690
+ }
3691
+
3692
+ function create_fragment$1(ctx) {
3693
+ let if_block_anchor;
3694
+ let if_block = /*p*/ ctx[2] !== undefined && create_if_block$1(ctx);
3695
+
3696
+ return {
3697
+ c() {
3698
+ if (if_block) if_block.c();
3699
+ if_block_anchor = empty();
3700
+ },
3701
+ m(target, anchor) {
3702
+ if (if_block) if_block.m(target, anchor);
3703
+ insert(target, if_block_anchor, anchor);
3704
+ },
3705
+ p(ctx, [dirty]) {
3706
+ if (/*p*/ ctx[2] !== undefined) {
3707
+ if (if_block) {
3708
+ if_block.p(ctx, dirty);
3709
+ } else {
3710
+ if_block = create_if_block$1(ctx);
3711
+ if_block.c();
3712
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
3713
+ }
3714
+ } else if (if_block) {
3715
+ if_block.d(1);
3716
+ if_block = null;
3717
+ }
3718
+ },
3719
+ i: noop,
3720
+ o: noop,
3721
+ d(detaching) {
3722
+ if (if_block) if_block.d(detaching);
3723
+ if (detaching) detach(if_block_anchor);
3724
+ }
3725
+ };
3726
+ }
3727
+
3728
+ function instance$1($$self, $$props, $$invalidate) {
3729
+ let x;
3730
+ let y;
3731
+ let p;
3732
+ let lineStyleStr;
3733
+ let $scale;
3734
+ let $axesHeight;
3735
+ let $yLim;
3736
+ let $axesWidth;
3737
+ let $xLim;
3738
+ let { xValues } = $$props;
3739
+ let { yValues } = $$props;
3740
+ let { title = "" } = $$props;
3741
+ let { lineWidth = 1 } = $$props;
3742
+ let { lineColor = Colors.PRIMARY } = $$props;
3743
+ let { lineType = 1 } = $$props;
3744
+
3745
+ /* sanity check of input parameters */
3746
+ if (!Array.isArray(xValues) || !Array.isArray(yValues) || xValues.length != yValues.length) {
3747
+ throw "LineSeries: parameters 'xValues' and 'yValues' must be numeric vectors of the same length.";
3748
+ }
3749
+
3750
+ // compute ranges for x and y values
3751
+ const xValuesRange = mrange(xValues, 0.05);
3752
+
3753
+ const yValuesRange = mrange(yValues, 0.05);
3754
+
3755
+ // get axes context and adjust axes limits
3756
+ const axes = getContext('axes');
3757
+
3758
+ axes.adjustXAxisLimits(xValuesRange);
3759
+ axes.adjustYAxisLimits(yValuesRange);
3760
+
3761
+ // get reactive variables needed to compute coordinates
3762
+ const xLim = axes.xLim;
3763
+
3764
+ component_subscribe($$self, xLim, value => $$invalidate(19, $xLim = value));
3765
+ const yLim = axes.yLim;
3766
+ component_subscribe($$self, yLim, value => $$invalidate(17, $yLim = value));
3767
+ const axesWidth = axes.width;
3768
+ component_subscribe($$self, axesWidth, value => $$invalidate(18, $axesWidth = value));
3769
+ const axesHeight = axes.height;
3770
+ component_subscribe($$self, axesHeight, value => $$invalidate(16, $axesHeight = value));
3771
+ const scale = axes.scale;
3772
+ component_subscribe($$self, scale, value => $$invalidate(15, $scale = value));
3773
+
3774
+ $$self.$$set = $$props => {
3775
+ if ('xValues' in $$props) $$invalidate(8, xValues = $$props.xValues);
3776
+ if ('yValues' in $$props) $$invalidate(9, yValues = $$props.yValues);
3777
+ if ('title' in $$props) $$invalidate(0, title = $$props.title);
3778
+ if ('lineWidth' in $$props) $$invalidate(10, lineWidth = $$props.lineWidth);
3779
+ if ('lineColor' in $$props) $$invalidate(11, lineColor = $$props.lineColor);
3780
+ if ('lineType' in $$props) $$invalidate(12, lineType = $$props.lineType);
3781
+ };
3782
+
3783
+ $$self.$$.update = () => {
3784
+ if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 786688) {
3785
+ // reactive variables for coordinates of data points in pixels
3786
+ $$invalidate(14, x = axes.scaleX(xValues, $xLim, $axesWidth));
3787
+ }
3788
+
3789
+ if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 197120) {
3790
+ $$invalidate(13, y = axes.scaleY(yValues, $yLim, $axesHeight));
3791
+ }
3792
+
3793
+ if ($$self.$$.dirty & /*x, y*/ 24576) {
3794
+ $$invalidate(2, p = x !== undefined && y !== undefined
3795
+ ? x.map((v, i) => `${v},${y[i]}`).join(' ')
3796
+ : undefined);
3797
+ }
3798
+
3799
+ if ($$self.$$.dirty & /*lineColor, lineWidth, $scale, lineType*/ 39936) {
3800
+ $$invalidate(1, lineStyleStr = `fill:transparent;stroke:${lineColor};stroke-width: ${lineWidth}px;stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
3801
+ }
3802
+ };
3803
+
3804
+ return [
3805
+ title,
3806
+ lineStyleStr,
3807
+ p,
3808
+ xLim,
3809
+ yLim,
3810
+ axesWidth,
3811
+ axesHeight,
3812
+ scale,
3813
+ xValues,
3814
+ yValues,
3815
+ lineWidth,
3816
+ lineColor,
3817
+ lineType,
3818
+ y,
3819
+ x,
3820
+ $scale,
3821
+ $axesHeight,
3822
+ $yLim,
3823
+ $axesWidth,
3824
+ $xLim
3825
+ ];
3826
+ }
3827
+
3828
+ class LineSeries extends SvelteComponent {
3829
+ constructor(options) {
3830
+ super();
3831
+
3832
+ init(this, options, instance$1, create_fragment$1, safe_not_equal, {
3833
+ xValues: 8,
3834
+ yValues: 9,
3835
+ title: 0,
3836
+ lineWidth: 10,
3837
+ lineColor: 11,
3838
+ lineType: 12
3839
+ });
3840
+ }
3841
+ }
3842
+
3843
+ /* src/AreaSeries.svelte generated by Svelte v3.46.3 */
3844
+
3845
+ function create_if_block(ctx) {
3846
+ let g;
3847
+ let polygon;
3848
+ let polygon_points_value;
3849
+
3850
+ return {
3851
+ c() {
3852
+ g = svg_element("g");
3853
+ polygon = svg_element("polygon");
3854
+ attr(polygon, "points", polygon_points_value = /*x*/ ctx[1][0] + "," + /*y0*/ ctx[4] + " " + /*p*/ ctx[3] + " " + /*x*/ ctx[1][/*x*/ ctx[1].length - 1] + "," + /*y0*/ ctx[4][0]);
3855
+ attr(g, "class", "series lineseries");
3856
+ attr(g, "style", /*areaStyleStr*/ ctx[2]);
3857
+ attr(g, "title", /*title*/ ctx[0]);
3858
+ },
3859
+ m(target, anchor) {
3860
+ insert(target, g, anchor);
3861
+ append(g, polygon);
3862
+ },
3863
+ p(ctx, dirty) {
3864
+ if (dirty & /*x, y0, p*/ 26 && polygon_points_value !== (polygon_points_value = /*x*/ ctx[1][0] + "," + /*y0*/ ctx[4] + " " + /*p*/ ctx[3] + " " + /*x*/ ctx[1][/*x*/ ctx[1].length - 1] + "," + /*y0*/ ctx[4][0])) {
3865
+ attr(polygon, "points", polygon_points_value);
3866
+ }
3867
+
3868
+ if (dirty & /*areaStyleStr*/ 4) {
3869
+ attr(g, "style", /*areaStyleStr*/ ctx[2]);
3870
+ }
3871
+
3872
+ if (dirty & /*title*/ 1) {
3873
+ attr(g, "title", /*title*/ ctx[0]);
3874
+ }
3875
+ },
3876
+ d(detaching) {
3877
+ if (detaching) detach(g);
3878
+ }
3879
+ };
3880
+ }
3881
+
3882
+ function create_fragment(ctx) {
3883
+ let if_block_anchor;
3884
+ let if_block = /*p*/ ctx[3] !== undefined && create_if_block(ctx);
3885
+
3886
+ return {
3887
+ c() {
3888
+ if (if_block) if_block.c();
3889
+ if_block_anchor = empty();
3890
+ },
3891
+ m(target, anchor) {
3892
+ if (if_block) if_block.m(target, anchor);
3893
+ insert(target, if_block_anchor, anchor);
3894
+ },
3895
+ p(ctx, [dirty]) {
3896
+ if (/*p*/ ctx[3] !== undefined) {
3897
+ if (if_block) {
3898
+ if_block.p(ctx, dirty);
3899
+ } else {
3900
+ if_block = create_if_block(ctx);
3901
+ if_block.c();
3902
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
3903
+ }
3904
+ } else if (if_block) {
3905
+ if_block.d(1);
3906
+ if_block = null;
3907
+ }
3908
+ },
3909
+ i: noop,
3910
+ o: noop,
3911
+ d(detaching) {
3912
+ if (if_block) if_block.d(detaching);
3913
+ if (detaching) detach(if_block_anchor);
3914
+ }
3915
+ };
3916
+ }
3917
+
3918
+ function instance($$self, $$props, $$invalidate) {
3919
+ let y0;
3920
+ let x;
3921
+ let y;
3922
+ let p;
3923
+ let areaStyleStr;
3924
+ let $scale;
3925
+ let $axesHeight;
3926
+ let $yLim;
3927
+ let $axesWidth;
3928
+ let $xLim;
3929
+ let { xValues } = $$props;
3930
+ let { yValues } = $$props;
3931
+ let { title = "" } = $$props;
3932
+ let { lineWidth = 1 } = $$props;
3933
+ let { lineColor = Colors.PRIMARY } = $$props;
3934
+ let { fillColor = Colors.PRIMARY } = $$props;
3935
+ let { opacity = 1 } = $$props;
3936
+ let { lineType = 1 } = $$props;
3937
+
3938
+ /* sanity check of input parameters */
3939
+ if (!Array.isArray(xValues) || !Array.isArray(yValues) || xValues.length != yValues.length) {
3940
+ throw "AreaSeries: parameters 'xValues' and 'yValues' must be numeric vectors of the same length.";
3941
+ }
3942
+
3943
+ // compute ranges for x and y values
3944
+ const xValuesRange = mrange(xValues, 0.05);
3945
+
3946
+ const yValuesRange = mrange(yValues, 0.05);
3947
+
3948
+ // get axes context and adjust axes limits
3949
+ const axes = getContext('axes');
3950
+
3951
+ axes.adjustXAxisLimits(xValuesRange);
3952
+ axes.adjustYAxisLimits(yValuesRange);
3953
+
3954
+ // get reactive variables needed to compute coordinates
3955
+ const xLim = axes.xLim;
3956
+
3957
+ component_subscribe($$self, xLim, value => $$invalidate(22, $xLim = value));
3958
+ const yLim = axes.yLim;
3959
+ component_subscribe($$self, yLim, value => $$invalidate(20, $yLim = value));
3960
+ const axesWidth = axes.width;
3961
+ component_subscribe($$self, axesWidth, value => $$invalidate(21, $axesWidth = value));
3962
+ const axesHeight = axes.height;
3963
+ component_subscribe($$self, axesHeight, value => $$invalidate(19, $axesHeight = value));
3964
+ const scale = axes.scale;
3965
+ component_subscribe($$self, scale, value => $$invalidate(18, $scale = value));
3966
+
3967
+ $$self.$$set = $$props => {
3968
+ if ('xValues' in $$props) $$invalidate(10, xValues = $$props.xValues);
3969
+ if ('yValues' in $$props) $$invalidate(11, yValues = $$props.yValues);
3970
+ if ('title' in $$props) $$invalidate(0, title = $$props.title);
3971
+ if ('lineWidth' in $$props) $$invalidate(12, lineWidth = $$props.lineWidth);
3972
+ if ('lineColor' in $$props) $$invalidate(13, lineColor = $$props.lineColor);
3973
+ if ('fillColor' in $$props) $$invalidate(14, fillColor = $$props.fillColor);
3974
+ if ('opacity' in $$props) $$invalidate(15, opacity = $$props.opacity);
3975
+ if ('lineType' in $$props) $$invalidate(16, lineType = $$props.lineType);
3976
+ };
3977
+
3978
+ $$self.$$.update = () => {
3979
+ if ($$self.$$.dirty & /*$yLim, $axesHeight*/ 1572864) {
3980
+ // reactive variables for coordinates of data points in pixels
3981
+ $$invalidate(4, y0 = axes.scaleY([0], $yLim, $axesHeight));
3982
+ }
3983
+
3984
+ if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 6292480) {
3985
+ $$invalidate(1, x = axes.scaleX(xValues, $xLim, $axesWidth));
3986
+ }
3987
+
3988
+ if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 1574912) {
3989
+ $$invalidate(17, y = axes.scaleY(yValues, $yLim, $axesHeight));
3990
+ }
3991
+
3992
+ if ($$self.$$.dirty & /*x, y*/ 131074) {
3993
+ $$invalidate(3, p = x !== undefined && y !== undefined
3994
+ ? x.map((v, i) => `${v},${y[i]}`).join(' ')
3995
+ : undefined);
3996
+ }
3997
+
3998
+ if ($$self.$$.dirty & /*opacity, fillColor, lineColor, lineWidth, $scale, lineType*/ 389120) {
3999
+ $$invalidate(2, areaStyleStr = `opacity:${opacity};fill:${fillColor};stroke:${lineColor};stroke-width: ${lineWidth}px;stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
4000
+ }
4001
+ };
4002
+
4003
+ return [
4004
+ title,
4005
+ x,
4006
+ areaStyleStr,
4007
+ p,
4008
+ y0,
4009
+ xLim,
4010
+ yLim,
4011
+ axesWidth,
4012
+ axesHeight,
4013
+ scale,
4014
+ xValues,
4015
+ yValues,
4016
+ lineWidth,
4017
+ lineColor,
4018
+ fillColor,
4019
+ opacity,
4020
+ lineType,
4021
+ y,
4022
+ $scale,
4023
+ $axesHeight,
4024
+ $yLim,
4025
+ $axesWidth,
4026
+ $xLim
4027
+ ];
4028
+ }
4029
+
4030
+ class AreaSeries extends SvelteComponent {
4031
+ constructor(options) {
4032
+ super();
4033
+
4034
+ init(this, options, instance, create_fragment, safe_not_equal, {
4035
+ xValues: 10,
4036
+ yValues: 11,
4037
+ title: 0,
4038
+ lineWidth: 12,
4039
+ lineColor: 13,
4040
+ fillColor: 14,
4041
+ opacity: 15,
4042
+ lineType: 16
4043
+ });
4044
+ }
4045
+ }
4046
+
4047
+ export { AreaSeries, Axes, BarSeries, Box, Colors, LineSeries, Rectangles, ScatterSeries, Segments, TextLabels, TextLegend, XAxis, YAxis };