svelte-plots-basic 1.0.1 → 1.0.4

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.js CHANGED
@@ -136,6 +136,10 @@
136
136
  function empty() {
137
137
  return text('');
138
138
  }
139
+ function listen(node, event, handler, options) {
140
+ node.addEventListener(event, handler, options);
141
+ return () => node.removeEventListener(event, handler, options);
142
+ }
139
143
  function attr(node, attribute, value) {
140
144
  if (value == null)
141
145
  node.removeAttribute(attribute);
@@ -161,6 +165,11 @@
161
165
  function toggle_class(element, name, toggle) {
162
166
  element.classList[toggle ? 'add' : 'remove'](name);
163
167
  }
168
+ function custom_event(type, detail, bubbles = false) {
169
+ const e = document.createEvent('CustomEvent');
170
+ e.initCustomEvent(type, bubbles, false, detail);
171
+ return e;
172
+ }
164
173
 
165
174
  let current_component;
166
175
  function set_current_component(component) {
@@ -174,6 +183,20 @@
174
183
  function onMount(fn) {
175
184
  get_current_component().$$.on_mount.push(fn);
176
185
  }
186
+ function createEventDispatcher() {
187
+ const component = get_current_component();
188
+ return (type, detail) => {
189
+ const callbacks = component.$$.callbacks[type];
190
+ if (callbacks) {
191
+ // TODO are there situations where events could be dispatched
192
+ // in a server (non-DOM) environment?
193
+ const event = custom_event(type, detail);
194
+ callbacks.slice().forEach(fn => {
195
+ fn.call(component, event);
196
+ });
197
+ }
198
+ };
199
+ }
177
200
  function setContext(key, context) {
178
201
  get_current_component().$$.context.set(key, context);
179
202
  }
@@ -478,8 +501,8 @@
478
501
 
479
502
  /* src/Axes.svelte generated by Svelte v3.46.3 */
480
503
 
481
- function add_css$2(target) {
482
- 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}");
504
+ function add_css$3(target) {
505
+ append_styles(target, "svelte-n80kcc", ".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.svelte-n80kcc{grid-area:axes;position:relative;box-sizing:border-box;display:flex;width:100%;height:100%;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}");
483
506
  }
484
507
 
485
508
  const get_box_slot_changes = dirty => ({});
@@ -489,7 +512,7 @@
489
512
  const get_xaxis_slot_changes = dirty => ({});
490
513
  const get_xaxis_slot_context = ctx => ({});
491
514
 
492
- // (313:3) {#if title !== ""}
515
+ // (330:3) {#if title !== ""}
493
516
  function create_if_block_3(ctx) {
494
517
  let div;
495
518
 
@@ -510,7 +533,7 @@
510
533
  };
511
534
  }
512
535
 
513
- // (314:3) {#if yLabel !== ""}
536
+ // (331:3) {#if yLabel !== ""}
514
537
  function create_if_block_2(ctx) {
515
538
  let div;
516
539
  let span;
@@ -534,7 +557,7 @@
534
557
  };
535
558
  }
536
559
 
537
- // (315:3) {#if xLabel !== ""}
560
+ // (332:3) {#if xLabel !== ""}
538
561
  function create_if_block_1(ctx) {
539
562
  let div;
540
563
  let span;
@@ -558,7 +581,7 @@
558
581
  };
559
582
  }
560
583
 
561
- // (343:3) {#if !$isOk}
584
+ // (360:3) {#if !$isOk}
562
585
  function create_if_block$9(ctx) {
563
586
  let p;
564
587
 
@@ -598,18 +621,20 @@
598
621
  let t3;
599
622
  let div1_class_value;
600
623
  let current;
624
+ let mounted;
625
+ let dispose;
601
626
  let if_block0 = /*title*/ ctx[0] !== "" && create_if_block_3(ctx);
602
627
  let if_block1 = /*yLabel*/ ctx[2] !== "" && create_if_block_2(ctx);
603
628
  let if_block2 = /*xLabel*/ ctx[1] !== "" && create_if_block_1(ctx);
604
- const xaxis_slot_template = /*#slots*/ ctx[24].xaxis;
605
- const xaxis_slot = create_slot(xaxis_slot_template, ctx, /*$$scope*/ ctx[23], get_xaxis_slot_context);
606
- const yaxis_slot_template = /*#slots*/ ctx[24].yaxis;
607
- const yaxis_slot = create_slot(yaxis_slot_template, ctx, /*$$scope*/ ctx[23], get_yaxis_slot_context);
608
- const default_slot_template = /*#slots*/ ctx[24].default;
609
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[23], null);
610
- const box_slot_template = /*#slots*/ ctx[24].box;
611
- const box_slot = create_slot(box_slot_template, ctx, /*$$scope*/ ctx[23], get_box_slot_context);
612
- let if_block3 = !/*$isOk*/ ctx[5] && create_if_block$9();
629
+ const xaxis_slot_template = /*#slots*/ ctx[26].xaxis;
630
+ const xaxis_slot = create_slot(xaxis_slot_template, ctx, /*$$scope*/ ctx[25], get_xaxis_slot_context);
631
+ const yaxis_slot_template = /*#slots*/ ctx[26].yaxis;
632
+ const yaxis_slot = create_slot(yaxis_slot_template, ctx, /*$$scope*/ ctx[25], get_yaxis_slot_context);
633
+ const default_slot_template = /*#slots*/ ctx[26].default;
634
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[25], null);
635
+ const box_slot_template = /*#slots*/ ctx[26].box;
636
+ const box_slot = create_slot(box_slot_template, ctx, /*$$scope*/ ctx[25], get_box_slot_context);
637
+ let if_block3 = !/*$isOk*/ ctx[3] && create_if_block$9();
613
638
 
614
639
  return {
615
640
  c() {
@@ -632,17 +657,18 @@
632
657
  if (box_slot) box_slot.c();
633
658
  t3 = space();
634
659
  if (if_block3) if_block3.c();
635
- attr(rect, "x", rect_x_value = /*cpx*/ ctx[4][0]);
636
- attr(rect, "y", rect_y_value = /*cpy*/ ctx[3][1]);
637
- attr(rect, "width", rect_width_value = /*cpx*/ ctx[4][1] - /*cpx*/ ctx[4][0]);
638
- attr(rect, "height", rect_height_value = /*cpy*/ ctx[3][0] - /*cpy*/ ctx[3][1]);
660
+ set_style(rect, "pointer-events", "none");
661
+ attr(rect, "x", rect_x_value = /*cpx*/ ctx[7][0]);
662
+ attr(rect, "y", rect_y_value = /*cpy*/ ctx[6][1]);
663
+ attr(rect, "width", rect_width_value = /*cpx*/ ctx[7][1] - /*cpx*/ ctx[7][0]);
664
+ attr(rect, "height", rect_height_value = /*cpy*/ ctx[6][0] - /*cpy*/ ctx[6][1]);
639
665
  attr(clipPath, "id", /*clipPathID*/ ctx[8]);
640
666
  attr(g, "clip-path", "url(#" + /*clipPathID*/ ctx[8] + ")");
641
667
  attr(svg, "preserveAspectRatio", "none");
642
668
  attr(svg, "class", "axes");
643
- attr(div0, "class", "axes-wrapper");
644
- attr(div1, "class", div1_class_value = "plot " + ('plot_' + /*$scale*/ ctx[6]));
645
- toggle_class(div1, "plot_error", !/*$isOk*/ ctx[5]);
669
+ attr(div0, "class", "axes-wrapper svelte-n80kcc");
670
+ attr(div1, "class", div1_class_value = "plot " + ('plot_' + /*$scale*/ ctx[4]) + " svelte-n80kcc");
671
+ toggle_class(div1, "plot_error", !/*$isOk*/ ctx[3]);
646
672
  },
647
673
  m(target, anchor) {
648
674
  insert(target, div1, anchor);
@@ -676,10 +702,15 @@
676
702
  box_slot.m(svg, null);
677
703
  }
678
704
 
679
- /*div0_binding*/ ctx[25](div0);
705
+ /*div0_binding*/ ctx[27](div0);
680
706
  append(div1, t3);
681
707
  if (if_block3) if_block3.m(div1, null);
682
708
  current = true;
709
+
710
+ if (!mounted) {
711
+ dispose = listen(svg, "click", /*handleClick*/ ctx[15]);
712
+ mounted = true;
713
+ }
683
714
  },
684
715
  p(ctx, dirty) {
685
716
  if (/*title*/ ctx[0] !== "") {
@@ -721,83 +752,83 @@
721
752
  if_block2 = null;
722
753
  }
723
754
 
724
- if (!current || dirty[0] & /*cpx*/ 16 && rect_x_value !== (rect_x_value = /*cpx*/ ctx[4][0])) {
755
+ if (!current || dirty[0] & /*cpx*/ 128 && rect_x_value !== (rect_x_value = /*cpx*/ ctx[7][0])) {
725
756
  attr(rect, "x", rect_x_value);
726
757
  }
727
758
 
728
- if (!current || dirty[0] & /*cpy*/ 8 && rect_y_value !== (rect_y_value = /*cpy*/ ctx[3][1])) {
759
+ if (!current || dirty[0] & /*cpy*/ 64 && rect_y_value !== (rect_y_value = /*cpy*/ ctx[6][1])) {
729
760
  attr(rect, "y", rect_y_value);
730
761
  }
731
762
 
732
- if (!current || dirty[0] & /*cpx*/ 16 && rect_width_value !== (rect_width_value = /*cpx*/ ctx[4][1] - /*cpx*/ ctx[4][0])) {
763
+ if (!current || dirty[0] & /*cpx*/ 128 && rect_width_value !== (rect_width_value = /*cpx*/ ctx[7][1] - /*cpx*/ ctx[7][0])) {
733
764
  attr(rect, "width", rect_width_value);
734
765
  }
735
766
 
736
- if (!current || dirty[0] & /*cpy*/ 8 && rect_height_value !== (rect_height_value = /*cpy*/ ctx[3][0] - /*cpy*/ ctx[3][1])) {
767
+ if (!current || dirty[0] & /*cpy*/ 64 && rect_height_value !== (rect_height_value = /*cpy*/ ctx[6][0] - /*cpy*/ ctx[6][1])) {
737
768
  attr(rect, "height", rect_height_value);
738
769
  }
739
770
 
740
771
  if (xaxis_slot) {
741
- if (xaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
772
+ if (xaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
742
773
  update_slot_base(
743
774
  xaxis_slot,
744
775
  xaxis_slot_template,
745
776
  ctx,
746
- /*$$scope*/ ctx[23],
777
+ /*$$scope*/ ctx[25],
747
778
  !current
748
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
749
- : get_slot_changes(xaxis_slot_template, /*$$scope*/ ctx[23], dirty, get_xaxis_slot_changes),
779
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
780
+ : get_slot_changes(xaxis_slot_template, /*$$scope*/ ctx[25], dirty, get_xaxis_slot_changes),
750
781
  get_xaxis_slot_context
751
782
  );
752
783
  }
753
784
  }
754
785
 
755
786
  if (yaxis_slot) {
756
- if (yaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
787
+ if (yaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
757
788
  update_slot_base(
758
789
  yaxis_slot,
759
790
  yaxis_slot_template,
760
791
  ctx,
761
- /*$$scope*/ ctx[23],
792
+ /*$$scope*/ ctx[25],
762
793
  !current
763
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
764
- : get_slot_changes(yaxis_slot_template, /*$$scope*/ ctx[23], dirty, get_yaxis_slot_changes),
794
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
795
+ : get_slot_changes(yaxis_slot_template, /*$$scope*/ ctx[25], dirty, get_yaxis_slot_changes),
765
796
  get_yaxis_slot_context
766
797
  );
767
798
  }
768
799
  }
769
800
 
770
801
  if (default_slot) {
771
- if (default_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
802
+ if (default_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
772
803
  update_slot_base(
773
804
  default_slot,
774
805
  default_slot_template,
775
806
  ctx,
776
- /*$$scope*/ ctx[23],
807
+ /*$$scope*/ ctx[25],
777
808
  !current
778
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
779
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[23], dirty, null),
809
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
810
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[25], dirty, null),
780
811
  null
781
812
  );
782
813
  }
783
814
  }
784
815
 
785
816
  if (box_slot) {
786
- if (box_slot.p && (!current || dirty[0] & /*$$scope*/ 8388608)) {
817
+ if (box_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
787
818
  update_slot_base(
788
819
  box_slot,
789
820
  box_slot_template,
790
821
  ctx,
791
- /*$$scope*/ ctx[23],
822
+ /*$$scope*/ ctx[25],
792
823
  !current
793
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
794
- : get_slot_changes(box_slot_template, /*$$scope*/ ctx[23], dirty, get_box_slot_changes),
824
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
825
+ : get_slot_changes(box_slot_template, /*$$scope*/ ctx[25], dirty, get_box_slot_changes),
795
826
  get_box_slot_context
796
827
  );
797
828
  }
798
829
  }
799
830
 
800
- if (!/*$isOk*/ ctx[5]) {
831
+ if (!/*$isOk*/ ctx[3]) {
801
832
  if (if_block3) ; else {
802
833
  if_block3 = create_if_block$9();
803
834
  if_block3.c();
@@ -808,12 +839,12 @@
808
839
  if_block3 = null;
809
840
  }
810
841
 
811
- if (!current || dirty[0] & /*$scale*/ 64 && div1_class_value !== (div1_class_value = "plot " + ('plot_' + /*$scale*/ ctx[6]))) {
842
+ if (!current || dirty[0] & /*$scale*/ 16 && div1_class_value !== (div1_class_value = "plot " + ('plot_' + /*$scale*/ ctx[4]) + " svelte-n80kcc")) {
812
843
  attr(div1, "class", div1_class_value);
813
844
  }
814
845
 
815
- if (dirty[0] & /*$scale, $isOk*/ 96) {
816
- toggle_class(div1, "plot_error", !/*$isOk*/ ctx[5]);
846
+ if (dirty[0] & /*$scale, $isOk*/ 24) {
847
+ toggle_class(div1, "plot_error", !/*$isOk*/ ctx[3]);
817
848
  }
818
849
  },
819
850
  i(local) {
@@ -840,8 +871,10 @@
840
871
  if (yaxis_slot) yaxis_slot.d(detaching);
841
872
  if (default_slot) default_slot.d(detaching);
842
873
  if (box_slot) box_slot.d(detaching);
843
- /*div0_binding*/ ctx[25](null);
874
+ /*div0_binding*/ ctx[27](null);
844
875
  if (if_block3) if_block3.d();
876
+ mounted = false;
877
+ dispose();
845
878
  }
846
879
  };
847
880
  }
@@ -889,7 +922,9 @@
889
922
  let { yLabel = "" } = $$props;
890
923
  let { multiSeries = true } = $$props;
891
924
 
892
- /* constants for internal use */
925
+ // event dispatcher
926
+ const dispatch = createEventDispatcher();
927
+
893
928
  // how big are margins (number of pixels in unit margin value) between axis and plot area if axis are shown
894
929
  const AXES_MARGIN_FACTORS = { "small": 30, "medium": 40, "large": 50 };
895
930
 
@@ -917,32 +952,32 @@
917
952
  /* reactive parameters to be shared with children via context */
918
953
  const width = writable(100); // actual width of plotting area in pixels
919
954
 
920
- component_subscribe($$self, width, value => $$invalidate(21, $width = value));
955
+ component_subscribe($$self, width, value => $$invalidate(23, $width = value));
921
956
  const height = writable(100); // actual height of plotting area in pixels
922
- component_subscribe($$self, height, value => $$invalidate(19, $height = value));
957
+ component_subscribe($$self, height, value => $$invalidate(21, $height = value));
923
958
  const xLim = writable([undefined, undefined]); // actual limits for x-axis in plot units
924
- component_subscribe($$self, xLim, value => $$invalidate(22, $xLim = value));
959
+ component_subscribe($$self, xLim, value => $$invalidate(24, $xLim = value));
925
960
  const yLim = writable([undefined, undefined]); // actual limits for y-axis in plot units
926
- component_subscribe($$self, yLim, value => $$invalidate(20, $yLim = value));
961
+ component_subscribe($$self, yLim, value => $$invalidate(22, $yLim = value));
927
962
  const scale = writable("medium"); // scale factor (how big the shown plot is)
928
- component_subscribe($$self, scale, value => $$invalidate(6, $scale = value));
963
+ component_subscribe($$self, scale, value => $$invalidate(4, $scale = value));
929
964
  const isOk = writable(false); // are axes ready for drawing
930
- component_subscribe($$self, isOk, value => $$invalidate(5, $isOk = value));
965
+ component_subscribe($$self, isOk, value => $$invalidate(3, $isOk = value));
931
966
 
932
967
  /** Adds margins for x-axis (e.g. when x-axis must be shown) */
933
968
  const addXAxisMargins = function () {
934
- $$invalidate(18, axesMargins[0] = 1, axesMargins);
935
- $$invalidate(18, axesMargins[2] = 0.5, axesMargins);
936
- $$invalidate(18, axesMargins[1] = axesMargins[1] > 0.5 ? axesMargins[1] : 0.5, axesMargins);
937
- $$invalidate(18, axesMargins[3] = axesMargins[3] > 0.5 ? axesMargins[3] : 0.5, axesMargins);
969
+ $$invalidate(19, axesMargins[0] = 1, axesMargins);
970
+ $$invalidate(19, axesMargins[2] = 0.5, axesMargins);
971
+ $$invalidate(19, axesMargins[1] = axesMargins[1] > 0.5 ? axesMargins[1] : 0.5, axesMargins);
972
+ $$invalidate(19, axesMargins[3] = axesMargins[3] > 0.5 ? axesMargins[3] : 0.5, axesMargins);
938
973
  };
939
974
 
940
975
  /** Adds margins for y-axis (e.g. when y-axis must be shown) */
941
976
  const addYAxisMargins = function () {
942
- $$invalidate(18, axesMargins[1] = 1, axesMargins);
943
- $$invalidate(18, axesMargins[3] = 0.5, axesMargins);
944
- $$invalidate(18, axesMargins[0] = axesMargins[0] > 0.5 ? axesMargins[0] : 0.5, axesMargins);
945
- $$invalidate(18, axesMargins[2] = axesMargins[2] > 0.5 ? axesMargins[2] : 0.5, axesMargins);
977
+ $$invalidate(19, axesMargins[1] = 1, axesMargins);
978
+ $$invalidate(19, axesMargins[3] = 0.5, axesMargins);
979
+ $$invalidate(19, axesMargins[0] = axesMargins[0] > 0.5 ? axesMargins[0] : 0.5, axesMargins);
980
+ $$invalidate(19, axesMargins[2] = axesMargins[2] > 0.5 ? axesMargins[2] : 0.5, axesMargins);
946
981
  };
947
982
 
948
983
  /** Adjusts limits for x-axis (e.g. when new series is added)
@@ -1105,51 +1140,66 @@
1105
1140
  ro.observe(axesWrapper);
1106
1141
  });
1107
1142
 
1143
+ // handle click on plot elements and dispatch manual events
1144
+ function handleClick(e) {
1145
+ if (e.target.tagName === "text" && e.target.parentNode.classList.contains("series_scatter")) {
1146
+ dispatch("markerclick", { markerid: e.target.dataset.id });
1147
+ return;
1148
+ }
1149
+
1150
+ if (e.target.tagName === "rect" && e.target.parentNode.classList.contains("series_bar")) {
1151
+ dispatch("barclick", { markerid: e.target.dataset.id });
1152
+ return;
1153
+ }
1154
+
1155
+ dispatch("axesclick");
1156
+ }
1157
+
1108
1158
  function div0_binding($$value) {
1109
1159
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
1110
1160
  axesWrapper = $$value;
1111
- $$invalidate(7, axesWrapper);
1161
+ $$invalidate(5, axesWrapper);
1112
1162
  });
1113
1163
  }
1114
1164
 
1115
1165
  $$self.$$set = $$props => {
1116
- if ('limX' in $$props) $$invalidate(15, limX = $$props.limX);
1117
- if ('limY' in $$props) $$invalidate(16, limY = $$props.limY);
1166
+ if ('limX' in $$props) $$invalidate(16, limX = $$props.limX);
1167
+ if ('limY' in $$props) $$invalidate(17, limY = $$props.limY);
1118
1168
  if ('title' in $$props) $$invalidate(0, title = $$props.title);
1119
1169
  if ('xLabel' in $$props) $$invalidate(1, xLabel = $$props.xLabel);
1120
1170
  if ('yLabel' in $$props) $$invalidate(2, yLabel = $$props.yLabel);
1121
- if ('multiSeries' in $$props) $$invalidate(17, multiSeries = $$props.multiSeries);
1122
- if ('$$scope' in $$props) $$invalidate(23, $$scope = $$props.$$scope);
1171
+ if ('multiSeries' in $$props) $$invalidate(18, multiSeries = $$props.multiSeries);
1172
+ if ('$$scope' in $$props) $$invalidate(25, $$scope = $$props.$$scope);
1123
1173
  };
1124
1174
 
1125
1175
  $$self.$$.update = () => {
1126
- if ($$self.$$.dirty[0] & /*limX*/ 32768) {
1176
+ if ($$self.$$.dirty[0] & /*limX*/ 65536) {
1127
1177
  // this is reactive in case if limX and limY are interactively changed by parent script
1128
1178
  if (!limX.some(v => v === undefined)) xLim.update(v => limX);
1129
1179
  }
1130
1180
 
1131
- if ($$self.$$.dirty[0] & /*limY*/ 65536) {
1181
+ if ($$self.$$.dirty[0] & /*limY*/ 131072) {
1132
1182
  if (!limY.some(v => v === undefined)) yLim.update(v => limY);
1133
1183
  }
1134
1184
 
1135
- if ($$self.$$.dirty[0] & /*axesMargins, $scale*/ 262208) {
1185
+ if ($$self.$$.dirty[0] & /*axesMargins, $scale*/ 524304) {
1136
1186
  // computes real margins in pixels based on current scale
1137
- margins = axesMargins.map(v => v * AXES_MARGIN_FACTORS[$scale]);
1187
+ $$invalidate(20, margins = axesMargins.map(v => v * AXES_MARGIN_FACTORS[$scale]));
1138
1188
  }
1139
1189
 
1140
- if ($$self.$$.dirty[0] & /*$isOk, $yLim, $height*/ 1572896) {
1141
- $$invalidate(3, cpy = $isOk ? scaleY($yLim, $yLim, $height) : [1, 0]);
1190
+ if ($$self.$$.dirty[0] & /*$yLim, $xLim, $width, margins, $height*/ 32505856) {
1191
+ // computes status which tells that axes limits look fine and it is safe to draw
1192
+ // the status is based on the axis limits validity
1193
+ 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] && $width > margins[1] + margins[3] && $height > margins[0] + margins[2]);
1142
1194
  }
1143
1195
 
1144
- if ($$self.$$.dirty[0] & /*$isOk, $xLim, $width*/ 6291488) {
1196
+ if ($$self.$$.dirty[0] & /*$isOk, $xLim, $width*/ 25165832) {
1145
1197
  // computes coordinates for clip path box
1146
- $$invalidate(4, cpx = $isOk ? scaleX($xLim, $xLim, $width) : [0, 1]);
1198
+ $$invalidate(7, cpx = $isOk ? scaleX($xLim, $xLim, $width) : [0, 1]);
1147
1199
  }
1148
1200
 
1149
- if ($$self.$$.dirty[0] & /*$yLim, $xLim, cpy, cpx*/ 5242904) {
1150
- // computes status which tells that axes limits look fine and it is safe to draw
1151
- // the status is based on the axis limits validity
1152
- 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] && cpy[0] > cpy[1] && cpx[1] > cpx[0]);
1201
+ if ($$self.$$.dirty[0] & /*$isOk, $yLim, $height*/ 6291464) {
1202
+ $$invalidate(6, cpy = $isOk ? scaleY($yLim, $yLim, $height) : [1, 0]);
1153
1203
  }
1154
1204
  };
1155
1205
 
@@ -1157,11 +1207,11 @@
1157
1207
  title,
1158
1208
  xLabel,
1159
1209
  yLabel,
1160
- cpy,
1161
- cpx,
1162
1210
  $isOk,
1163
1211
  $scale,
1164
1212
  axesWrapper,
1213
+ cpy,
1214
+ cpx,
1165
1215
  clipPathID,
1166
1216
  width,
1167
1217
  height,
@@ -1169,10 +1219,12 @@
1169
1219
  yLim,
1170
1220
  scale,
1171
1221
  isOk,
1222
+ handleClick,
1172
1223
  limX,
1173
1224
  limY,
1174
1225
  multiSeries,
1175
1226
  axesMargins,
1227
+ margins,
1176
1228
  $height,
1177
1229
  $yLim,
1178
1230
  $width,
@@ -1194,14 +1246,14 @@
1194
1246
  create_fragment$b,
1195
1247
  safe_not_equal,
1196
1248
  {
1197
- limX: 15,
1198
- limY: 16,
1249
+ limX: 16,
1250
+ limY: 17,
1199
1251
  title: 0,
1200
1252
  xLabel: 1,
1201
1253
  yLabel: 2,
1202
- multiSeries: 17
1254
+ multiSeries: 18
1203
1255
  },
1204
- add_css$2,
1256
+ add_css$3,
1205
1257
  [-1, -1]
1206
1258
  );
1207
1259
  }
@@ -1991,14 +2043,15 @@
1991
2043
 
1992
2044
  function get_each_context$3(ctx, list, i) {
1993
2045
  const child_ctx = ctx.slice();
1994
- child_ctx[23] = list[i];
1995
- child_ctx[25] = i;
2046
+ child_ctx[25] = list[i];
2047
+ child_ctx[27] = i;
1996
2048
  return child_ctx;
1997
2049
  }
1998
2050
 
1999
- // (51:0) {#if rx !== undefined && ry !== undefined}
2051
+ // (53:0) {#if rx !== undefined && ry !== undefined}
2000
2052
  function create_if_block$6(ctx) {
2001
- let each_1_anchor;
2053
+ let g;
2054
+ let g_class_value;
2002
2055
  let each_value = /*left*/ ctx[0];
2003
2056
  let each_blocks = [];
2004
2057
 
@@ -2008,21 +2061,25 @@
2008
2061
 
2009
2062
  return {
2010
2063
  c() {
2064
+ g = svg_element("g");
2065
+
2011
2066
  for (let i = 0; i < each_blocks.length; i += 1) {
2012
2067
  each_blocks[i].c();
2013
2068
  }
2014
2069
 
2015
- each_1_anchor = empty();
2070
+ attr(g, "class", g_class_value = "series " + /*style*/ ctx[2]);
2071
+ attr(g, "title", /*title*/ ctx[1]);
2072
+ attr(g, "style", /*barsStyleStr*/ ctx[7]);
2016
2073
  },
2017
2074
  m(target, anchor) {
2075
+ insert(target, g, anchor);
2076
+
2018
2077
  for (let i = 0; i < each_blocks.length; i += 1) {
2019
- each_blocks[i].m(target, anchor);
2078
+ each_blocks[i].m(g, null);
2020
2079
  }
2021
-
2022
- insert(target, each_1_anchor, anchor);
2023
2080
  },
2024
2081
  p(ctx, dirty) {
2025
- if (dirty & /*rx, ry, rw, rh, barsStyleStr, left*/ 63) {
2082
+ if (dirty & /*rx, ry, rw, rh, left*/ 121) {
2026
2083
  each_value = /*left*/ ctx[0];
2027
2084
  let i;
2028
2085
 
@@ -2034,7 +2091,7 @@
2034
2091
  } else {
2035
2092
  each_blocks[i] = create_each_block$3(child_ctx);
2036
2093
  each_blocks[i].c();
2037
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2094
+ each_blocks[i].m(g, null);
2038
2095
  }
2039
2096
  }
2040
2097
 
@@ -2044,15 +2101,23 @@
2044
2101
 
2045
2102
  each_blocks.length = each_value.length;
2046
2103
  }
2104
+
2105
+ if (dirty & /*style*/ 4 && g_class_value !== (g_class_value = "series " + /*style*/ ctx[2])) {
2106
+ attr(g, "class", g_class_value);
2107
+ }
2108
+
2109
+ if (dirty & /*title*/ 2) {
2110
+ attr(g, "title", /*title*/ ctx[1]);
2111
+ }
2047
2112
  },
2048
2113
  d(detaching) {
2114
+ if (detaching) detach(g);
2049
2115
  destroy_each(each_blocks, detaching);
2050
- if (detaching) detach(each_1_anchor);
2051
2116
  }
2052
2117
  };
2053
2118
  }
2054
2119
 
2055
- // (52:3) {#each left as v, i}
2120
+ // (55:3) {#each left as v, i}
2056
2121
  function create_each_block$3(ctx) {
2057
2122
  let rect;
2058
2123
  let rect_x_value;
@@ -2063,29 +2128,28 @@
2063
2128
  return {
2064
2129
  c() {
2065
2130
  rect = svg_element("rect");
2066
- attr(rect, "x", rect_x_value = /*rx*/ ctx[4][/*i*/ ctx[25]]);
2067
- attr(rect, "y", rect_y_value = /*ry*/ ctx[3][/*i*/ ctx[25]]);
2068
- attr(rect, "width", rect_width_value = /*rw*/ ctx[2][/*i*/ ctx[25]]);
2069
- attr(rect, "height", rect_height_value = /*rh*/ ctx[1][/*i*/ ctx[25]]);
2070
- attr(rect, "style", /*barsStyleStr*/ ctx[5]);
2131
+ attr(rect, "x", rect_x_value = /*rx*/ ctx[6][/*i*/ ctx[27]]);
2132
+ attr(rect, "y", rect_y_value = /*ry*/ ctx[5][/*i*/ ctx[27]]);
2133
+ attr(rect, "width", rect_width_value = /*rw*/ ctx[4][/*i*/ ctx[27]]);
2134
+ attr(rect, "height", rect_height_value = /*rh*/ ctx[3][/*i*/ ctx[27]]);
2071
2135
  },
2072
2136
  m(target, anchor) {
2073
2137
  insert(target, rect, anchor);
2074
2138
  },
2075
2139
  p(ctx, dirty) {
2076
- if (dirty & /*rx*/ 16 && rect_x_value !== (rect_x_value = /*rx*/ ctx[4][/*i*/ ctx[25]])) {
2140
+ if (dirty & /*rx*/ 64 && rect_x_value !== (rect_x_value = /*rx*/ ctx[6][/*i*/ ctx[27]])) {
2077
2141
  attr(rect, "x", rect_x_value);
2078
2142
  }
2079
2143
 
2080
- if (dirty & /*ry*/ 8 && rect_y_value !== (rect_y_value = /*ry*/ ctx[3][/*i*/ ctx[25]])) {
2144
+ if (dirty & /*ry*/ 32 && rect_y_value !== (rect_y_value = /*ry*/ ctx[5][/*i*/ ctx[27]])) {
2081
2145
  attr(rect, "y", rect_y_value);
2082
2146
  }
2083
2147
 
2084
- if (dirty & /*rw*/ 4 && rect_width_value !== (rect_width_value = /*rw*/ ctx[2][/*i*/ ctx[25]])) {
2148
+ if (dirty & /*rw*/ 16 && rect_width_value !== (rect_width_value = /*rw*/ ctx[4][/*i*/ ctx[27]])) {
2085
2149
  attr(rect, "width", rect_width_value);
2086
2150
  }
2087
2151
 
2088
- if (dirty & /*rh*/ 2 && rect_height_value !== (rect_height_value = /*rh*/ ctx[1][/*i*/ ctx[25]])) {
2152
+ if (dirty & /*rh*/ 8 && rect_height_value !== (rect_height_value = /*rh*/ ctx[3][/*i*/ ctx[27]])) {
2089
2153
  attr(rect, "height", rect_height_value);
2090
2154
  }
2091
2155
  },
@@ -2097,7 +2161,7 @@
2097
2161
 
2098
2162
  function create_fragment$8(ctx) {
2099
2163
  let if_block_anchor;
2100
- let if_block = /*rx*/ ctx[4] !== undefined && /*ry*/ ctx[3] !== undefined && create_if_block$6(ctx);
2164
+ let if_block = /*rx*/ ctx[6] !== undefined && /*ry*/ ctx[5] !== undefined && create_if_block$6(ctx);
2101
2165
 
2102
2166
  return {
2103
2167
  c() {
@@ -2109,7 +2173,7 @@
2109
2173
  insert(target, if_block_anchor, anchor);
2110
2174
  },
2111
2175
  p(ctx, [dirty]) {
2112
- if (/*rx*/ ctx[4] !== undefined && /*ry*/ ctx[3] !== undefined) {
2176
+ if (/*rx*/ ctx[6] !== undefined && /*ry*/ ctx[5] !== undefined) {
2113
2177
  if (if_block) {
2114
2178
  if_block.p(ctx, dirty);
2115
2179
  } else {
@@ -2148,6 +2212,8 @@
2148
2212
  let { faceColor = Colors.PRIMARY } = $$props;
2149
2213
  let { borderColor = faceColor } = $$props;
2150
2214
  let { lineWidth = 1 } = $$props;
2215
+ let { title = "" } = $$props;
2216
+ let { style = "series_rect" } = $$props;
2151
2217
 
2152
2218
  // styles for bars and labels
2153
2219
  const barsStyleStr = `fill:${faceColor};stroke:${borderColor};stroke-width: ${lineWidth}px;`;
@@ -2176,46 +2242,50 @@
2176
2242
  const axes = getContext('axes');
2177
2243
 
2178
2244
  const xLim = axes.xLim;
2179
- component_subscribe($$self, xLim, value => $$invalidate(20, $xLim = value));
2245
+ component_subscribe($$self, xLim, value => $$invalidate(22, $xLim = value));
2180
2246
  const yLim = axes.yLim;
2181
- component_subscribe($$self, yLim, value => $$invalidate(18, $yLim = value));
2247
+ component_subscribe($$self, yLim, value => $$invalidate(20, $yLim = value));
2182
2248
  const axesWidth = axes.width;
2183
- component_subscribe($$self, axesWidth, value => $$invalidate(19, $axesWidth = value));
2249
+ component_subscribe($$self, axesWidth, value => $$invalidate(21, $axesWidth = value));
2184
2250
  const axesHeight = axes.height;
2185
- component_subscribe($$self, axesHeight, value => $$invalidate(17, $axesHeight = value));
2251
+ component_subscribe($$self, axesHeight, value => $$invalidate(19, $axesHeight = value));
2186
2252
 
2187
2253
  $$self.$$set = $$props => {
2188
2254
  if ('left' in $$props) $$invalidate(0, left = $$props.left);
2189
- if ('top' in $$props) $$invalidate(12, top = $$props.top);
2190
- if ('width' in $$props) $$invalidate(10, width = $$props.width);
2191
- if ('height' in $$props) $$invalidate(11, height = $$props.height);
2192
- if ('labels' in $$props) $$invalidate(13, labels = $$props.labels);
2193
- if ('faceColor' in $$props) $$invalidate(14, faceColor = $$props.faceColor);
2194
- if ('borderColor' in $$props) $$invalidate(15, borderColor = $$props.borderColor);
2195
- if ('lineWidth' in $$props) $$invalidate(16, lineWidth = $$props.lineWidth);
2255
+ if ('top' in $$props) $$invalidate(14, top = $$props.top);
2256
+ if ('width' in $$props) $$invalidate(12, width = $$props.width);
2257
+ if ('height' in $$props) $$invalidate(13, height = $$props.height);
2258
+ if ('labels' in $$props) $$invalidate(15, labels = $$props.labels);
2259
+ if ('faceColor' in $$props) $$invalidate(16, faceColor = $$props.faceColor);
2260
+ if ('borderColor' in $$props) $$invalidate(17, borderColor = $$props.borderColor);
2261
+ if ('lineWidth' in $$props) $$invalidate(18, lineWidth = $$props.lineWidth);
2262
+ if ('title' in $$props) $$invalidate(1, title = $$props.title);
2263
+ if ('style' in $$props) $$invalidate(2, style = $$props.style);
2196
2264
  };
2197
2265
 
2198
2266
  $$self.$$.update = () => {
2199
- if ($$self.$$.dirty & /*left, $xLim, $axesWidth*/ 1572865) {
2267
+ if ($$self.$$.dirty & /*left, $xLim, $axesWidth*/ 6291457) {
2200
2268
  // reactive variables for coordinates of data points in pixels
2201
- $$invalidate(4, rx = axes.scaleX(left, $xLim, $axesWidth));
2269
+ $$invalidate(6, rx = axes.scaleX(left, $xLim, $axesWidth));
2202
2270
  }
2203
2271
 
2204
- if ($$self.$$.dirty & /*top, $yLim, $axesHeight*/ 397312) {
2205
- $$invalidate(3, ry = axes.scaleY(top, $yLim, $axesHeight));
2272
+ if ($$self.$$.dirty & /*top, $yLim, $axesHeight*/ 1589248) {
2273
+ $$invalidate(5, ry = axes.scaleY(top, $yLim, $axesHeight));
2206
2274
  }
2207
2275
 
2208
- if ($$self.$$.dirty & /*width, $xLim, $axesWidth*/ 1573888) {
2209
- $$invalidate(2, rw = axes.scaleX(width, $xLim, $axesWidth, true));
2276
+ if ($$self.$$.dirty & /*width, $xLim, $axesWidth*/ 6295552) {
2277
+ $$invalidate(4, rw = axes.scaleX(width, $xLim, $axesWidth, true));
2210
2278
  }
2211
2279
 
2212
- if ($$self.$$.dirty & /*height, $yLim, $axesHeight*/ 395264) {
2213
- $$invalidate(1, rh = axes.scaleY(height, $yLim, $axesHeight, true));
2280
+ if ($$self.$$.dirty & /*height, $yLim, $axesHeight*/ 1581056) {
2281
+ $$invalidate(3, rh = axes.scaleY(height, $yLim, $axesHeight, true));
2214
2282
  }
2215
2283
  };
2216
2284
 
2217
2285
  return [
2218
2286
  left,
2287
+ title,
2288
+ style,
2219
2289
  rh,
2220
2290
  rw,
2221
2291
  ry,
@@ -2245,13 +2315,15 @@
2245
2315
 
2246
2316
  init(this, options, instance$8, create_fragment$8, safe_not_equal, {
2247
2317
  left: 0,
2248
- top: 12,
2249
- width: 10,
2250
- height: 11,
2251
- labels: 13,
2252
- faceColor: 14,
2253
- borderColor: 15,
2254
- lineWidth: 16
2318
+ top: 14,
2319
+ width: 12,
2320
+ height: 13,
2321
+ labels: 15,
2322
+ faceColor: 16,
2323
+ borderColor: 17,
2324
+ lineWidth: 18,
2325
+ title: 1,
2326
+ style: 2
2255
2327
  });
2256
2328
  }
2257
2329
  }
@@ -2278,6 +2350,7 @@
2278
2350
  c() {
2279
2351
  g = svg_element("g");
2280
2352
  create_component(rectangles.$$.fragment);
2353
+ set_style(g, "pointer-events", "none");
2281
2354
  attr(g, "class", "mdaplot__axes-box");
2282
2355
  },
2283
2356
  m(target, anchor) {
@@ -2691,17 +2764,22 @@
2691
2764
 
2692
2765
  /* src/TextLabels.svelte generated by Svelte v3.46.3 */
2693
2766
 
2767
+ function add_css$2(target) {
2768
+ append_styles(target, "svelte-1szep8i", "text.svelte-1szep8i{dominant-baseline:middle}");
2769
+ }
2770
+
2694
2771
  function get_each_context$1(ctx, list, i) {
2695
2772
  const child_ctx = ctx.slice();
2696
- child_ctx[25] = list[i];
2697
- child_ctx[27] = i;
2773
+ child_ctx[27] = list[i];
2774
+ child_ctx[29] = i;
2698
2775
  return child_ctx;
2699
2776
  }
2700
2777
 
2701
- // (56:0) {#if x !== undefined && y !== undefined}
2778
+ // (66:0) {#if x !== undefined && y !== undefined}
2702
2779
  function create_if_block$3(ctx) {
2703
- let each_1_anchor;
2704
- let each_value = /*x*/ ctx[6];
2780
+ let g;
2781
+ let g_class_value;
2782
+ let each_value = /*x*/ ctx[7];
2705
2783
  let each_blocks = [];
2706
2784
 
2707
2785
  for (let i = 0; i < each_value.length; i += 1) {
@@ -2710,22 +2788,26 @@
2710
2788
 
2711
2789
  return {
2712
2790
  c() {
2791
+ g = svg_element("g");
2792
+
2713
2793
  for (let i = 0; i < each_blocks.length; i += 1) {
2714
2794
  each_blocks[i].c();
2715
2795
  }
2716
2796
 
2717
- each_1_anchor = empty();
2797
+ attr(g, "class", g_class_value = "series " + /*style*/ ctx[1]);
2798
+ attr(g, "title", /*title*/ ctx[2]);
2799
+ attr(g, "style", /*textStyleStr*/ ctx[3]);
2718
2800
  },
2719
2801
  m(target, anchor) {
2802
+ insert(target, g, anchor);
2803
+
2720
2804
  for (let i = 0; i < each_blocks.length; i += 1) {
2721
- each_blocks[i].m(target, anchor);
2805
+ each_blocks[i].m(g, null);
2722
2806
  }
2723
-
2724
- insert(target, each_1_anchor, anchor);
2725
2807
  },
2726
2808
  p(ctx, dirty) {
2727
- if (dirty & /*textStyleStr, x, y, dx, dy, textAnchors, pos, labels*/ 255) {
2728
- each_value = /*x*/ ctx[6];
2809
+ if (dirty & /*x, y, dx, dy, labels*/ 241) {
2810
+ each_value = /*x*/ ctx[7];
2729
2811
  let i;
2730
2812
 
2731
2813
  for (i = 0; i < each_value.length; i += 1) {
@@ -2736,7 +2818,7 @@
2736
2818
  } else {
2737
2819
  each_blocks[i] = create_each_block$1(child_ctx);
2738
2820
  each_blocks[i].c();
2739
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2821
+ each_blocks[i].m(g, null);
2740
2822
  }
2741
2823
  }
2742
2824
 
@@ -2746,61 +2828,64 @@
2746
2828
 
2747
2829
  each_blocks.length = each_value.length;
2748
2830
  }
2831
+
2832
+ if (dirty & /*style*/ 2 && g_class_value !== (g_class_value = "series " + /*style*/ ctx[1])) {
2833
+ attr(g, "class", g_class_value);
2834
+ }
2835
+
2836
+ if (dirty & /*title*/ 4) {
2837
+ attr(g, "title", /*title*/ ctx[2]);
2838
+ }
2839
+
2840
+ if (dirty & /*textStyleStr*/ 8) {
2841
+ attr(g, "style", /*textStyleStr*/ ctx[3]);
2842
+ }
2749
2843
  },
2750
2844
  d(detaching) {
2845
+ if (detaching) detach(g);
2751
2846
  destroy_each(each_blocks, detaching);
2752
- if (detaching) detach(each_1_anchor);
2753
2847
  }
2754
2848
  };
2755
2849
  }
2756
2850
 
2757
- // (57:3) {#each x as v, i}
2851
+ // (68:3) {#each x as v, i}
2758
2852
  function create_each_block$1(ctx) {
2759
2853
  let text_1;
2760
- let raw_value = /*labels*/ ctx[0][/*i*/ ctx[27]] + "";
2854
+ let raw_value = /*labels*/ ctx[0][/*i*/ ctx[29]] + "";
2855
+ let text_1_data_id_value;
2761
2856
  let text_1_x_value;
2762
2857
  let text_1_y_value;
2763
- let text_1_text_anchor_value;
2764
2858
 
2765
2859
  return {
2766
2860
  c() {
2767
2861
  text_1 = svg_element("text");
2768
- attr(text_1, "style", /*textStyleStr*/ ctx[2]);
2769
- attr(text_1, "x", text_1_x_value = /*x*/ ctx[6][/*i*/ ctx[27]]);
2770
- attr(text_1, "y", text_1_y_value = /*y*/ ctx[5][/*i*/ ctx[27]]);
2771
- attr(text_1, "dx", /*dx*/ ctx[4]);
2772
- attr(text_1, "dy", /*dy*/ ctx[3]);
2773
- attr(text_1, "dominant-baseline", "middle");
2774
- attr(text_1, "text-anchor", text_1_text_anchor_value = /*textAnchors*/ ctx[7][/*pos*/ ctx[1]]);
2862
+ attr(text_1, "data-id", text_1_data_id_value = /*i*/ ctx[29]);
2863
+ attr(text_1, "x", text_1_x_value = /*x*/ ctx[7][/*i*/ ctx[29]]);
2864
+ attr(text_1, "y", text_1_y_value = /*y*/ ctx[6][/*i*/ ctx[29]]);
2865
+ attr(text_1, "dx", /*dx*/ ctx[5]);
2866
+ attr(text_1, "dy", /*dy*/ ctx[4]);
2867
+ attr(text_1, "class", "svelte-1szep8i");
2775
2868
  },
2776
2869
  m(target, anchor) {
2777
2870
  insert(target, text_1, anchor);
2778
2871
  text_1.innerHTML = raw_value;
2779
2872
  },
2780
2873
  p(ctx, dirty) {
2781
- if (dirty & /*labels*/ 1 && raw_value !== (raw_value = /*labels*/ ctx[0][/*i*/ ctx[27]] + "")) text_1.innerHTML = raw_value;
2782
- if (dirty & /*textStyleStr*/ 4) {
2783
- attr(text_1, "style", /*textStyleStr*/ ctx[2]);
2784
- }
2785
-
2786
- if (dirty & /*x*/ 64 && text_1_x_value !== (text_1_x_value = /*x*/ ctx[6][/*i*/ ctx[27]])) {
2874
+ if (dirty & /*labels*/ 1 && raw_value !== (raw_value = /*labels*/ ctx[0][/*i*/ ctx[29]] + "")) text_1.innerHTML = raw_value;
2875
+ if (dirty & /*x*/ 128 && text_1_x_value !== (text_1_x_value = /*x*/ ctx[7][/*i*/ ctx[29]])) {
2787
2876
  attr(text_1, "x", text_1_x_value);
2788
2877
  }
2789
2878
 
2790
- if (dirty & /*y*/ 32 && text_1_y_value !== (text_1_y_value = /*y*/ ctx[5][/*i*/ ctx[27]])) {
2879
+ if (dirty & /*y*/ 64 && text_1_y_value !== (text_1_y_value = /*y*/ ctx[6][/*i*/ ctx[29]])) {
2791
2880
  attr(text_1, "y", text_1_y_value);
2792
2881
  }
2793
2882
 
2794
- if (dirty & /*dx*/ 16) {
2795
- attr(text_1, "dx", /*dx*/ ctx[4]);
2883
+ if (dirty & /*dx*/ 32) {
2884
+ attr(text_1, "dx", /*dx*/ ctx[5]);
2796
2885
  }
2797
2886
 
2798
- if (dirty & /*dy*/ 8) {
2799
- attr(text_1, "dy", /*dy*/ ctx[3]);
2800
- }
2801
-
2802
- if (dirty & /*pos*/ 2 && text_1_text_anchor_value !== (text_1_text_anchor_value = /*textAnchors*/ ctx[7][/*pos*/ ctx[1]])) {
2803
- attr(text_1, "text-anchor", text_1_text_anchor_value);
2887
+ if (dirty & /*dy*/ 16) {
2888
+ attr(text_1, "dy", /*dy*/ ctx[4]);
2804
2889
  }
2805
2890
  },
2806
2891
  d(detaching) {
@@ -2811,7 +2896,7 @@
2811
2896
 
2812
2897
  function create_fragment$5(ctx) {
2813
2898
  let if_block_anchor;
2814
- let if_block = /*x*/ ctx[6] !== undefined && /*y*/ ctx[5] !== undefined && create_if_block$3(ctx);
2899
+ let if_block = /*x*/ ctx[7] !== undefined && /*y*/ ctx[6] !== undefined && create_if_block$3(ctx);
2815
2900
 
2816
2901
  return {
2817
2902
  c() {
@@ -2823,7 +2908,7 @@
2823
2908
  insert(target, if_block_anchor, anchor);
2824
2909
  },
2825
2910
  p(ctx, [dirty]) {
2826
- if (/*x*/ ctx[6] !== undefined && /*y*/ ctx[5] !== undefined) {
2911
+ if (/*x*/ ctx[7] !== undefined && /*y*/ ctx[6] !== undefined) {
2827
2912
  if (if_block) {
2828
2913
  if_block.p(ctx, dirty);
2829
2914
  } else {
@@ -2864,11 +2949,13 @@
2864
2949
  let { borderColor = "transparent" } = $$props;
2865
2950
  let { borderWidth = 0 } = $$props;
2866
2951
  let { textSize = 1 } = $$props;
2952
+ let { style = "" } = $$props;
2953
+ let { title = "series_text" } = $$props;
2867
2954
 
2868
2955
  // text-anchor values depending on position
2869
2956
  const textAnchors = ["middle", "middle", "start", "middle", "end"];
2870
2957
 
2871
- /* sanity check for input parameters */
2958
+ // sanity check for input parameters
2872
2959
  if (!Array.isArray(xValues) || !Array.isArray(yValues) || xValues.length !== yValues.length) {
2873
2960
  throw "TextLabels: parameters 'xValues' and 'yValues' must be vectors of the same length.";
2874
2961
  }
@@ -2877,30 +2964,32 @@
2877
2964
  const axes = getContext('axes');
2878
2965
 
2879
2966
  const xLim = axes.xLim;
2880
- component_subscribe($$self, xLim, value => $$invalidate(23, $xLim = value));
2967
+ component_subscribe($$self, xLim, value => $$invalidate(24, $xLim = value));
2881
2968
  const yLim = axes.yLim;
2882
- component_subscribe($$self, yLim, value => $$invalidate(21, $yLim = value));
2969
+ component_subscribe($$self, yLim, value => $$invalidate(22, $yLim = value));
2883
2970
  const axesWidth = axes.width;
2884
- component_subscribe($$self, axesWidth, value => $$invalidate(22, $axesWidth = value));
2971
+ component_subscribe($$self, axesWidth, value => $$invalidate(23, $axesWidth = value));
2885
2972
  const axesHeight = axes.height;
2886
- component_subscribe($$self, axesHeight, value => $$invalidate(20, $axesHeight = value));
2973
+ component_subscribe($$self, axesHeight, value => $$invalidate(21, $axesHeight = value));
2887
2974
  const scale = axes.scale;
2888
- component_subscribe($$self, scale, value => $$invalidate(19, $scale = value));
2975
+ component_subscribe($$self, scale, value => $$invalidate(20, $scale = value));
2889
2976
 
2890
2977
  $$self.$$set = $$props => {
2891
2978
  if ('xValues' in $$props) $$invalidate(13, xValues = $$props.xValues);
2892
2979
  if ('yValues' in $$props) $$invalidate(14, yValues = $$props.yValues);
2893
2980
  if ('labels' in $$props) $$invalidate(0, labels = $$props.labels);
2894
- if ('pos' in $$props) $$invalidate(1, pos = $$props.pos);
2895
- if ('faceColor' in $$props) $$invalidate(15, faceColor = $$props.faceColor);
2896
- if ('borderColor' in $$props) $$invalidate(16, borderColor = $$props.borderColor);
2897
- if ('borderWidth' in $$props) $$invalidate(17, borderWidth = $$props.borderWidth);
2898
- if ('textSize' in $$props) $$invalidate(18, textSize = $$props.textSize);
2981
+ if ('pos' in $$props) $$invalidate(15, pos = $$props.pos);
2982
+ if ('faceColor' in $$props) $$invalidate(16, faceColor = $$props.faceColor);
2983
+ if ('borderColor' in $$props) $$invalidate(17, borderColor = $$props.borderColor);
2984
+ if ('borderWidth' in $$props) $$invalidate(18, borderWidth = $$props.borderWidth);
2985
+ if ('textSize' in $$props) $$invalidate(19, textSize = $$props.textSize);
2986
+ if ('style' in $$props) $$invalidate(1, style = $$props.style);
2987
+ if ('title' in $$props) $$invalidate(2, title = $$props.title);
2899
2988
  };
2900
2989
 
2901
2990
  $$self.$$.update = () => {
2902
2991
  if ($$self.$$.dirty & /*xValues, labels*/ 8193) {
2903
- // multiply labels values if needed
2992
+ // multiply label values if needed
2904
2993
  {
2905
2994
  const n = xValues.length;
2906
2995
  if (!Array.isArray(labels)) $$invalidate(0, labels = Array(n).fill(labels));
@@ -2916,38 +3005,39 @@
2916
3005
  }
2917
3006
  }
2918
3007
 
2919
- if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 12591104) {
3008
+ if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 25174016) {
2920
3009
  // reactive variables for coordinates of data points in pixels
2921
- $$invalidate(6, x = axes.scaleX(xValues, $xLim, $axesWidth));
3010
+ $$invalidate(7, x = axes.scaleX(xValues, $xLim, $axesWidth));
2922
3011
  }
2923
3012
 
2924
- if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 3162112) {
2925
- $$invalidate(5, y = axes.scaleY(yValues, $yLim, $axesHeight));
3013
+ if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 6307840) {
3014
+ $$invalidate(6, y = axes.scaleY(yValues, $yLim, $axesHeight));
2926
3015
  }
2927
3016
 
2928
- if ($$self.$$.dirty & /*pos, $scale*/ 524290) {
2929
- $$invalidate(4, dx = [0, 0, 1, 0, -1][pos] * axes.LABELS_MARGIN[$scale]);
3017
+ if ($$self.$$.dirty & /*pos, $scale*/ 1081344) {
3018
+ $$invalidate(5, dx = [0, 0, 1, 0, -1][pos] * axes.LABELS_MARGIN[$scale]);
2930
3019
  }
2931
3020
 
2932
- if ($$self.$$.dirty & /*pos, $scale*/ 524290) {
2933
- $$invalidate(3, dy = [0, 1, 0, -1, 0][pos] * axes.LABELS_MARGIN[$scale]);
3021
+ if ($$self.$$.dirty & /*pos, $scale*/ 1081344) {
3022
+ $$invalidate(4, dy = [0, 1, 0, -1, 0][pos] * axes.LABELS_MARGIN[$scale]);
2934
3023
  }
2935
3024
 
2936
- if ($$self.$$.dirty & /*faceColor, borderWidth, borderColor, textSize*/ 491520) {
2937
- // styles for bars and labels
2938
- $$invalidate(2, textStyleStr = `fill:${faceColor};stroke-width:${borderWidth}px;stroke:${borderColor};font-size:${textSize}em;`);
3025
+ if ($$self.$$.dirty & /*faceColor, borderWidth, borderColor, textSize, pos*/ 1015808) {
3026
+ // styles for the elements
3027
+ $$invalidate(3, textStyleStr = `fill:${faceColor};stroke-width:${borderWidth}px;stroke:${borderColor};
3028
+ font-size:${textSize}em; text-anchor:${textAnchors[pos]};`);
2939
3029
  }
2940
3030
  };
2941
3031
 
2942
3032
  return [
2943
3033
  labels,
2944
- pos,
3034
+ style,
3035
+ title,
2945
3036
  textStyleStr,
2946
3037
  dy,
2947
3038
  dx,
2948
3039
  y,
2949
3040
  x,
2950
- textAnchors,
2951
3041
  xLim,
2952
3042
  yLim,
2953
3043
  axesWidth,
@@ -2955,6 +3045,7 @@
2955
3045
  scale,
2956
3046
  xValues,
2957
3047
  yValues,
3048
+ pos,
2958
3049
  faceColor,
2959
3050
  borderColor,
2960
3051
  borderWidth,
@@ -2971,16 +3062,26 @@
2971
3062
  constructor(options) {
2972
3063
  super();
2973
3064
 
2974
- init(this, options, instance$5, create_fragment$5, safe_not_equal, {
2975
- xValues: 13,
2976
- yValues: 14,
2977
- labels: 0,
2978
- pos: 1,
2979
- faceColor: 15,
2980
- borderColor: 16,
2981
- borderWidth: 17,
2982
- textSize: 18
2983
- });
3065
+ init(
3066
+ this,
3067
+ options,
3068
+ instance$5,
3069
+ create_fragment$5,
3070
+ safe_not_equal,
3071
+ {
3072
+ xValues: 13,
3073
+ yValues: 14,
3074
+ labels: 0,
3075
+ pos: 15,
3076
+ faceColor: 16,
3077
+ borderColor: 17,
3078
+ borderWidth: 18,
3079
+ textSize: 19,
3080
+ style: 1,
3081
+ title: 2
3082
+ },
3083
+ add_css$2
3084
+ );
2984
3085
  }
2985
3086
  }
2986
3087
 
@@ -3315,31 +3416,28 @@
3315
3416
  }
3316
3417
 
3317
3418
  function create_fragment$3(ctx) {
3318
- let g;
3319
3419
  let rectangles;
3320
3420
  let current;
3321
3421
 
3322
3422
  rectangles = new Rectangles({
3323
3423
  props: {
3424
+ style: "series_bar",
3324
3425
  left: /*left*/ ctx[4],
3325
3426
  top: /*top*/ ctx[5],
3326
3427
  width: /*width*/ ctx[3],
3327
3428
  height: /*height*/ ctx[6],
3328
3429
  borderColor: /*borderColor*/ ctx[2],
3329
- faceColor: /*faceColor*/ ctx[1]
3430
+ faceColor: /*faceColor*/ ctx[1],
3431
+ title: /*title*/ ctx[0]
3330
3432
  }
3331
3433
  });
3332
3434
 
3333
3435
  return {
3334
3436
  c() {
3335
- g = svg_element("g");
3336
3437
  create_component(rectangles.$$.fragment);
3337
- attr(g, "class", "series series_bar");
3338
- attr(g, "title", /*title*/ ctx[0]);
3339
3438
  },
3340
3439
  m(target, anchor) {
3341
- insert(target, g, anchor);
3342
- mount_component(rectangles, g, null);
3440
+ mount_component(rectangles, target, anchor);
3343
3441
  current = true;
3344
3442
  },
3345
3443
  p(ctx, [dirty]) {
@@ -3350,11 +3448,8 @@
3350
3448
  if (dirty & /*height*/ 64) rectangles_changes.height = /*height*/ ctx[6];
3351
3449
  if (dirty & /*borderColor*/ 4) rectangles_changes.borderColor = /*borderColor*/ ctx[2];
3352
3450
  if (dirty & /*faceColor*/ 2) rectangles_changes.faceColor = /*faceColor*/ ctx[1];
3451
+ if (dirty & /*title*/ 1) rectangles_changes.title = /*title*/ ctx[0];
3353
3452
  rectangles.$set(rectangles_changes);
3354
-
3355
- if (!current || dirty & /*title*/ 1) {
3356
- attr(g, "title", /*title*/ ctx[0]);
3357
- }
3358
3453
  },
3359
3454
  i(local) {
3360
3455
  if (current) return;
@@ -3366,8 +3461,7 @@
3366
3461
  current = false;
3367
3462
  },
3368
3463
  d(detaching) {
3369
- if (detaching) detach(g);
3370
- destroy_component(rectangles);
3464
+ destroy_component(rectangles, detaching);
3371
3465
  }
3372
3466
  };
3373
3467
  }
@@ -3486,11 +3580,10 @@
3486
3580
  /* src/ScatterSeries.svelte generated by Svelte v3.46.3 */
3487
3581
 
3488
3582
  function add_css(target) {
3489
- append_styles(target, "svelte-11a4d2d", ".marker{font-size:1em;cursor:default}.marker:hover{opacity:90%}.series_scatter > *:hover + .labels_hover{visibility:visible;opacity:1}");
3583
+ append_styles(target, "svelte-byxua3", ".series_scatter > text{font-size:1em;cursor:default}.series_scatter > text:hover{opacity:90%}.series_scatter > *:hover + .labels_hover{visibility:visible;opacity:1}");
3490
3584
  }
3491
3585
 
3492
3586
  function create_fragment$2(ctx) {
3493
- let g;
3494
3587
  let textlabels;
3495
3588
  let current;
3496
3589
 
@@ -3498,40 +3591,35 @@
3498
3591
  props: {
3499
3592
  xValues: /*xValues*/ ctx[0],
3500
3593
  yValues: /*yValues*/ ctx[1],
3501
- labels: /*markerSymbol*/ ctx[7],
3502
- textSize: /*markerSize*/ ctx[6],
3503
3594
  faceColor: /*faceColor*/ ctx[3],
3504
3595
  borderColor: /*borderColor*/ ctx[4],
3505
- borderWidth: /*borderWidth*/ ctx[5]
3596
+ borderWidth: /*borderWidth*/ ctx[5],
3597
+ title: /*title*/ ctx[2],
3598
+ style: "series_scatter",
3599
+ labels: /*markerSymbol*/ ctx[7],
3600
+ textSize: /*markerSize*/ ctx[6]
3506
3601
  }
3507
3602
  });
3508
3603
 
3509
3604
  return {
3510
3605
  c() {
3511
- g = svg_element("g");
3512
3606
  create_component(textlabels.$$.fragment);
3513
- attr(g, "class", "series series_scatter");
3514
- attr(g, "title", /*title*/ ctx[2]);
3515
3607
  },
3516
3608
  m(target, anchor) {
3517
- insert(target, g, anchor);
3518
- mount_component(textlabels, g, null);
3609
+ mount_component(textlabels, target, anchor);
3519
3610
  current = true;
3520
3611
  },
3521
3612
  p(ctx, [dirty]) {
3522
3613
  const textlabels_changes = {};
3523
3614
  if (dirty & /*xValues*/ 1) textlabels_changes.xValues = /*xValues*/ ctx[0];
3524
3615
  if (dirty & /*yValues*/ 2) textlabels_changes.yValues = /*yValues*/ ctx[1];
3525
- if (dirty & /*markerSymbol*/ 128) textlabels_changes.labels = /*markerSymbol*/ ctx[7];
3526
- if (dirty & /*markerSize*/ 64) textlabels_changes.textSize = /*markerSize*/ ctx[6];
3527
3616
  if (dirty & /*faceColor*/ 8) textlabels_changes.faceColor = /*faceColor*/ ctx[3];
3528
3617
  if (dirty & /*borderColor*/ 16) textlabels_changes.borderColor = /*borderColor*/ ctx[4];
3529
3618
  if (dirty & /*borderWidth*/ 32) textlabels_changes.borderWidth = /*borderWidth*/ ctx[5];
3619
+ if (dirty & /*title*/ 4) textlabels_changes.title = /*title*/ ctx[2];
3620
+ if (dirty & /*markerSymbol*/ 128) textlabels_changes.labels = /*markerSymbol*/ ctx[7];
3621
+ if (dirty & /*markerSize*/ 64) textlabels_changes.textSize = /*markerSize*/ ctx[6];
3530
3622
  textlabels.$set(textlabels_changes);
3531
-
3532
- if (!current || dirty & /*title*/ 4) {
3533
- attr(g, "title", /*title*/ ctx[2]);
3534
- }
3535
3623
  },
3536
3624
  i(local) {
3537
3625
  if (current) return;
@@ -3543,8 +3631,7 @@
3543
3631
  current = false;
3544
3632
  },
3545
3633
  d(detaching) {
3546
- if (detaching) detach(g);
3547
- destroy_component(textlabels);
3634
+ destroy_component(textlabels, detaching);
3548
3635
  }
3549
3636
  };
3550
3637
  }
@@ -3562,6 +3649,7 @@
3562
3649
  // TODO: implement later
3563
3650
  //export let labels = yValues;
3564
3651
  //export let showLabels = "no"; // can be "no", "hover", "always"
3652
+ /* constants for internal use */
3565
3653
  const markers = ["●", "◼", "▲", "▼", "⬥", "+", "*", "⨯"];
3566
3654
 
3567
3655
  let markerSymbol;
@@ -3668,7 +3756,7 @@
3668
3756
  polyline = svg_element("polyline");
3669
3757
  attr(polyline, "class", "line");
3670
3758
  attr(polyline, "points", /*p*/ ctx[2]);
3671
- attr(g, "class", "series lineseries");
3759
+ attr(g, "class", "series series_line");
3672
3760
  attr(g, "style", /*lineStyleStr*/ ctx[1]);
3673
3761
  attr(g, "title", /*title*/ ctx[0]);
3674
3762
  },
@@ -3803,7 +3891,8 @@
3803
3891
  }
3804
3892
 
3805
3893
  if ($$self.$$.dirty & /*lineColor, lineWidth, $scale, lineType*/ 39936) {
3806
- $$invalidate(1, lineStyleStr = `fill:transparent;stroke:${lineColor};stroke-width: ${lineWidth}px;stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
3894
+ $$invalidate(1, lineStyleStr = `fill:transparent;stroke:${lineColor};stroke-width: ${lineWidth}px;
3895
+ stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
3807
3896
  }
3808
3897
  };
3809
3898