svelte-plots-basic 1.0.3 → 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.mjs CHANGED
@@ -130,6 +130,10 @@ function space() {
130
130
  function empty() {
131
131
  return text('');
132
132
  }
133
+ function listen(node, event, handler, options) {
134
+ node.addEventListener(event, handler, options);
135
+ return () => node.removeEventListener(event, handler, options);
136
+ }
133
137
  function attr(node, attribute, value) {
134
138
  if (value == null)
135
139
  node.removeAttribute(attribute);
@@ -155,6 +159,11 @@ function set_style(node, key, value, important) {
155
159
  function toggle_class(element, name, toggle) {
156
160
  element.classList[toggle ? 'add' : 'remove'](name);
157
161
  }
162
+ function custom_event(type, detail, bubbles = false) {
163
+ const e = document.createEvent('CustomEvent');
164
+ e.initCustomEvent(type, bubbles, false, detail);
165
+ return e;
166
+ }
158
167
 
159
168
  let current_component;
160
169
  function set_current_component(component) {
@@ -168,6 +177,20 @@ function get_current_component() {
168
177
  function onMount(fn) {
169
178
  get_current_component().$$.on_mount.push(fn);
170
179
  }
180
+ function createEventDispatcher() {
181
+ const component = get_current_component();
182
+ return (type, detail) => {
183
+ const callbacks = component.$$.callbacks[type];
184
+ if (callbacks) {
185
+ // TODO are there situations where events could be dispatched
186
+ // in a server (non-DOM) environment?
187
+ const event = custom_event(type, detail);
188
+ callbacks.slice().forEach(fn => {
189
+ fn.call(component, event);
190
+ });
191
+ }
192
+ };
193
+ }
171
194
  function setContext(key, context) {
172
195
  get_current_component().$$.context.set(key, context);
173
196
  }
@@ -472,7 +495,7 @@ function writable(value, start = noop) {
472
495
 
473
496
  /* src/Axes.svelte generated by Svelte v3.46.3 */
474
497
 
475
- function add_css$2(target) {
498
+ function add_css$3(target) {
476
499
  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}");
477
500
  }
478
501
 
@@ -483,7 +506,7 @@ const get_yaxis_slot_context = ctx => ({});
483
506
  const get_xaxis_slot_changes = dirty => ({});
484
507
  const get_xaxis_slot_context = ctx => ({});
485
508
 
486
- // (313:3) {#if title !== ""}
509
+ // (330:3) {#if title !== ""}
487
510
  function create_if_block_3(ctx) {
488
511
  let div;
489
512
 
@@ -504,7 +527,7 @@ function create_if_block_3(ctx) {
504
527
  };
505
528
  }
506
529
 
507
- // (314:3) {#if yLabel !== ""}
530
+ // (331:3) {#if yLabel !== ""}
508
531
  function create_if_block_2(ctx) {
509
532
  let div;
510
533
  let span;
@@ -528,7 +551,7 @@ function create_if_block_2(ctx) {
528
551
  };
529
552
  }
530
553
 
531
- // (315:3) {#if xLabel !== ""}
554
+ // (332:3) {#if xLabel !== ""}
532
555
  function create_if_block_1(ctx) {
533
556
  let div;
534
557
  let span;
@@ -552,7 +575,7 @@ function create_if_block_1(ctx) {
552
575
  };
553
576
  }
554
577
 
555
- // (343:3) {#if !$isOk}
578
+ // (360:3) {#if !$isOk}
556
579
  function create_if_block$9(ctx) {
557
580
  let p;
558
581
 
@@ -592,17 +615,19 @@ function create_fragment$b(ctx) {
592
615
  let t3;
593
616
  let div1_class_value;
594
617
  let current;
618
+ let mounted;
619
+ let dispose;
595
620
  let if_block0 = /*title*/ ctx[0] !== "" && create_if_block_3(ctx);
596
621
  let if_block1 = /*yLabel*/ ctx[2] !== "" && create_if_block_2(ctx);
597
622
  let if_block2 = /*xLabel*/ ctx[1] !== "" && create_if_block_1(ctx);
598
- const xaxis_slot_template = /*#slots*/ ctx[25].xaxis;
599
- const xaxis_slot = create_slot(xaxis_slot_template, ctx, /*$$scope*/ ctx[24], get_xaxis_slot_context);
600
- const yaxis_slot_template = /*#slots*/ ctx[25].yaxis;
601
- const yaxis_slot = create_slot(yaxis_slot_template, ctx, /*$$scope*/ ctx[24], get_yaxis_slot_context);
602
- const default_slot_template = /*#slots*/ ctx[25].default;
603
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[24], null);
604
- const box_slot_template = /*#slots*/ ctx[25].box;
605
- const box_slot = create_slot(box_slot_template, ctx, /*$$scope*/ ctx[24], get_box_slot_context);
623
+ const xaxis_slot_template = /*#slots*/ ctx[26].xaxis;
624
+ const xaxis_slot = create_slot(xaxis_slot_template, ctx, /*$$scope*/ ctx[25], get_xaxis_slot_context);
625
+ const yaxis_slot_template = /*#slots*/ ctx[26].yaxis;
626
+ const yaxis_slot = create_slot(yaxis_slot_template, ctx, /*$$scope*/ ctx[25], get_yaxis_slot_context);
627
+ const default_slot_template = /*#slots*/ ctx[26].default;
628
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[25], null);
629
+ const box_slot_template = /*#slots*/ ctx[26].box;
630
+ const box_slot = create_slot(box_slot_template, ctx, /*$$scope*/ ctx[25], get_box_slot_context);
606
631
  let if_block3 = !/*$isOk*/ ctx[3] && create_if_block$9();
607
632
 
608
633
  return {
@@ -626,6 +651,7 @@ function create_fragment$b(ctx) {
626
651
  if (box_slot) box_slot.c();
627
652
  t3 = space();
628
653
  if (if_block3) if_block3.c();
654
+ set_style(rect, "pointer-events", "none");
629
655
  attr(rect, "x", rect_x_value = /*cpx*/ ctx[7][0]);
630
656
  attr(rect, "y", rect_y_value = /*cpy*/ ctx[6][1]);
631
657
  attr(rect, "width", rect_width_value = /*cpx*/ ctx[7][1] - /*cpx*/ ctx[7][0]);
@@ -670,10 +696,15 @@ function create_fragment$b(ctx) {
670
696
  box_slot.m(svg, null);
671
697
  }
672
698
 
673
- /*div0_binding*/ ctx[26](div0);
699
+ /*div0_binding*/ ctx[27](div0);
674
700
  append(div1, t3);
675
701
  if (if_block3) if_block3.m(div1, null);
676
702
  current = true;
703
+
704
+ if (!mounted) {
705
+ dispose = listen(svg, "click", /*handleClick*/ ctx[15]);
706
+ mounted = true;
707
+ }
677
708
  },
678
709
  p(ctx, dirty) {
679
710
  if (/*title*/ ctx[0] !== "") {
@@ -732,60 +763,60 @@ function create_fragment$b(ctx) {
732
763
  }
733
764
 
734
765
  if (xaxis_slot) {
735
- if (xaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 16777216)) {
766
+ if (xaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
736
767
  update_slot_base(
737
768
  xaxis_slot,
738
769
  xaxis_slot_template,
739
770
  ctx,
740
- /*$$scope*/ ctx[24],
771
+ /*$$scope*/ ctx[25],
741
772
  !current
742
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[24])
743
- : get_slot_changes(xaxis_slot_template, /*$$scope*/ ctx[24], dirty, get_xaxis_slot_changes),
773
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
774
+ : get_slot_changes(xaxis_slot_template, /*$$scope*/ ctx[25], dirty, get_xaxis_slot_changes),
744
775
  get_xaxis_slot_context
745
776
  );
746
777
  }
747
778
  }
748
779
 
749
780
  if (yaxis_slot) {
750
- if (yaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 16777216)) {
781
+ if (yaxis_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
751
782
  update_slot_base(
752
783
  yaxis_slot,
753
784
  yaxis_slot_template,
754
785
  ctx,
755
- /*$$scope*/ ctx[24],
786
+ /*$$scope*/ ctx[25],
756
787
  !current
757
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[24])
758
- : get_slot_changes(yaxis_slot_template, /*$$scope*/ ctx[24], dirty, get_yaxis_slot_changes),
788
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
789
+ : get_slot_changes(yaxis_slot_template, /*$$scope*/ ctx[25], dirty, get_yaxis_slot_changes),
759
790
  get_yaxis_slot_context
760
791
  );
761
792
  }
762
793
  }
763
794
 
764
795
  if (default_slot) {
765
- if (default_slot.p && (!current || dirty[0] & /*$$scope*/ 16777216)) {
796
+ if (default_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
766
797
  update_slot_base(
767
798
  default_slot,
768
799
  default_slot_template,
769
800
  ctx,
770
- /*$$scope*/ ctx[24],
801
+ /*$$scope*/ ctx[25],
771
802
  !current
772
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[24])
773
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[24], dirty, null),
803
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
804
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[25], dirty, null),
774
805
  null
775
806
  );
776
807
  }
777
808
  }
778
809
 
779
810
  if (box_slot) {
780
- if (box_slot.p && (!current || dirty[0] & /*$$scope*/ 16777216)) {
811
+ if (box_slot.p && (!current || dirty[0] & /*$$scope*/ 33554432)) {
781
812
  update_slot_base(
782
813
  box_slot,
783
814
  box_slot_template,
784
815
  ctx,
785
- /*$$scope*/ ctx[24],
816
+ /*$$scope*/ ctx[25],
786
817
  !current
787
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[24])
788
- : get_slot_changes(box_slot_template, /*$$scope*/ ctx[24], dirty, get_box_slot_changes),
818
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[25])
819
+ : get_slot_changes(box_slot_template, /*$$scope*/ ctx[25], dirty, get_box_slot_changes),
789
820
  get_box_slot_context
790
821
  );
791
822
  }
@@ -834,8 +865,10 @@ function create_fragment$b(ctx) {
834
865
  if (yaxis_slot) yaxis_slot.d(detaching);
835
866
  if (default_slot) default_slot.d(detaching);
836
867
  if (box_slot) box_slot.d(detaching);
837
- /*div0_binding*/ ctx[26](null);
868
+ /*div0_binding*/ ctx[27](null);
838
869
  if (if_block3) if_block3.d();
870
+ mounted = false;
871
+ dispose();
839
872
  }
840
873
  };
841
874
  }
@@ -883,7 +916,9 @@ function instance$b($$self, $$props, $$invalidate) {
883
916
  let { yLabel = "" } = $$props;
884
917
  let { multiSeries = true } = $$props;
885
918
 
886
- /* constants for internal use */
919
+ // event dispatcher
920
+ const dispatch = createEventDispatcher();
921
+
887
922
  // how big are margins (number of pixels in unit margin value) between axis and plot area if axis are shown
888
923
  const AXES_MARGIN_FACTORS = { "small": 30, "medium": 40, "large": 50 };
889
924
 
@@ -911,13 +946,13 @@ function instance$b($$self, $$props, $$invalidate) {
911
946
  /* reactive parameters to be shared with children via context */
912
947
  const width = writable(100); // actual width of plotting area in pixels
913
948
 
914
- component_subscribe($$self, width, value => $$invalidate(22, $width = value));
949
+ component_subscribe($$self, width, value => $$invalidate(23, $width = value));
915
950
  const height = writable(100); // actual height of plotting area in pixels
916
- component_subscribe($$self, height, value => $$invalidate(20, $height = value));
951
+ component_subscribe($$self, height, value => $$invalidate(21, $height = value));
917
952
  const xLim = writable([undefined, undefined]); // actual limits for x-axis in plot units
918
- component_subscribe($$self, xLim, value => $$invalidate(23, $xLim = value));
953
+ component_subscribe($$self, xLim, value => $$invalidate(24, $xLim = value));
919
954
  const yLim = writable([undefined, undefined]); // actual limits for y-axis in plot units
920
- component_subscribe($$self, yLim, value => $$invalidate(21, $yLim = value));
955
+ component_subscribe($$self, yLim, value => $$invalidate(22, $yLim = value));
921
956
  const scale = writable("medium"); // scale factor (how big the shown plot is)
922
957
  component_subscribe($$self, scale, value => $$invalidate(4, $scale = value));
923
958
  const isOk = writable(false); // are axes ready for drawing
@@ -925,18 +960,18 @@ function instance$b($$self, $$props, $$invalidate) {
925
960
 
926
961
  /** Adds margins for x-axis (e.g. when x-axis must be shown) */
927
962
  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);
963
+ $$invalidate(19, axesMargins[0] = 1, axesMargins);
964
+ $$invalidate(19, axesMargins[2] = 0.5, axesMargins);
965
+ $$invalidate(19, axesMargins[1] = axesMargins[1] > 0.5 ? axesMargins[1] : 0.5, axesMargins);
966
+ $$invalidate(19, axesMargins[3] = axesMargins[3] > 0.5 ? axesMargins[3] : 0.5, axesMargins);
932
967
  };
933
968
 
934
969
  /** Adds margins for y-axis (e.g. when y-axis must be shown) */
935
970
  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);
971
+ $$invalidate(19, axesMargins[1] = 1, axesMargins);
972
+ $$invalidate(19, axesMargins[3] = 0.5, axesMargins);
973
+ $$invalidate(19, axesMargins[0] = axesMargins[0] > 0.5 ? axesMargins[0] : 0.5, axesMargins);
974
+ $$invalidate(19, axesMargins[2] = axesMargins[2] > 0.5 ? axesMargins[2] : 0.5, axesMargins);
940
975
  };
941
976
 
942
977
  /** Adjusts limits for x-axis (e.g. when new series is added)
@@ -1099,6 +1134,21 @@ function instance$b($$self, $$props, $$invalidate) {
1099
1134
  ro.observe(axesWrapper);
1100
1135
  });
1101
1136
 
1137
+ // handle click on plot elements and dispatch manual events
1138
+ function handleClick(e) {
1139
+ if (e.target.tagName === "text" && e.target.parentNode.classList.contains("series_scatter")) {
1140
+ dispatch("markerclick", { markerid: e.target.dataset.id });
1141
+ return;
1142
+ }
1143
+
1144
+ if (e.target.tagName === "rect" && e.target.parentNode.classList.contains("series_bar")) {
1145
+ dispatch("barclick", { markerid: e.target.dataset.id });
1146
+ return;
1147
+ }
1148
+
1149
+ dispatch("axesclick");
1150
+ }
1151
+
1102
1152
  function div0_binding($$value) {
1103
1153
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
1104
1154
  axesWrapper = $$value;
@@ -1107,42 +1157,42 @@ function instance$b($$self, $$props, $$invalidate) {
1107
1157
  }
1108
1158
 
1109
1159
  $$self.$$set = $$props => {
1110
- if ('limX' in $$props) $$invalidate(15, limX = $$props.limX);
1111
- if ('limY' in $$props) $$invalidate(16, limY = $$props.limY);
1160
+ if ('limX' in $$props) $$invalidate(16, limX = $$props.limX);
1161
+ if ('limY' in $$props) $$invalidate(17, limY = $$props.limY);
1112
1162
  if ('title' in $$props) $$invalidate(0, title = $$props.title);
1113
1163
  if ('xLabel' in $$props) $$invalidate(1, xLabel = $$props.xLabel);
1114
1164
  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(24, $$scope = $$props.$$scope);
1165
+ if ('multiSeries' in $$props) $$invalidate(18, multiSeries = $$props.multiSeries);
1166
+ if ('$$scope' in $$props) $$invalidate(25, $$scope = $$props.$$scope);
1117
1167
  };
1118
1168
 
1119
1169
  $$self.$$.update = () => {
1120
- if ($$self.$$.dirty[0] & /*limX*/ 32768) {
1170
+ if ($$self.$$.dirty[0] & /*limX*/ 65536) {
1121
1171
  // this is reactive in case if limX and limY are interactively changed by parent script
1122
1172
  if (!limX.some(v => v === undefined)) xLim.update(v => limX);
1123
1173
  }
1124
1174
 
1125
- if ($$self.$$.dirty[0] & /*limY*/ 65536) {
1175
+ if ($$self.$$.dirty[0] & /*limY*/ 131072) {
1126
1176
  if (!limY.some(v => v === undefined)) yLim.update(v => limY);
1127
1177
  }
1128
1178
 
1129
- if ($$self.$$.dirty[0] & /*axesMargins, $scale*/ 262160) {
1179
+ if ($$self.$$.dirty[0] & /*axesMargins, $scale*/ 524304) {
1130
1180
  // computes real margins in pixels based on current scale
1131
- $$invalidate(19, margins = axesMargins.map(v => v * AXES_MARGIN_FACTORS[$scale]));
1181
+ $$invalidate(20, margins = axesMargins.map(v => v * AXES_MARGIN_FACTORS[$scale]));
1132
1182
  }
1133
1183
 
1134
- if ($$self.$$.dirty[0] & /*$yLim, $xLim, $width, margins, $height*/ 16252928) {
1184
+ if ($$self.$$.dirty[0] & /*$yLim, $xLim, $width, margins, $height*/ 32505856) {
1135
1185
  // computes status which tells that axes limits look fine and it is safe to draw
1136
1186
  // the status is based on the axis limits validity
1137
1187
  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]);
1138
1188
  }
1139
1189
 
1140
- if ($$self.$$.dirty[0] & /*$isOk, $xLim, $width*/ 12582920) {
1190
+ if ($$self.$$.dirty[0] & /*$isOk, $xLim, $width*/ 25165832) {
1141
1191
  // computes coordinates for clip path box
1142
1192
  $$invalidate(7, cpx = $isOk ? scaleX($xLim, $xLim, $width) : [0, 1]);
1143
1193
  }
1144
1194
 
1145
- if ($$self.$$.dirty[0] & /*$isOk, $yLim, $height*/ 3145736) {
1195
+ if ($$self.$$.dirty[0] & /*$isOk, $yLim, $height*/ 6291464) {
1146
1196
  $$invalidate(6, cpy = $isOk ? scaleY($yLim, $yLim, $height) : [1, 0]);
1147
1197
  }
1148
1198
  };
@@ -1163,6 +1213,7 @@ function instance$b($$self, $$props, $$invalidate) {
1163
1213
  yLim,
1164
1214
  scale,
1165
1215
  isOk,
1216
+ handleClick,
1166
1217
  limX,
1167
1218
  limY,
1168
1219
  multiSeries,
@@ -1189,14 +1240,14 @@ class Axes extends SvelteComponent {
1189
1240
  create_fragment$b,
1190
1241
  safe_not_equal,
1191
1242
  {
1192
- limX: 15,
1193
- limY: 16,
1243
+ limX: 16,
1244
+ limY: 17,
1194
1245
  title: 0,
1195
1246
  xLabel: 1,
1196
1247
  yLabel: 2,
1197
- multiSeries: 17
1248
+ multiSeries: 18
1198
1249
  },
1199
- add_css$2,
1250
+ add_css$3,
1200
1251
  [-1, -1]
1201
1252
  );
1202
1253
  }
@@ -1986,14 +2037,15 @@ class YAxis extends SvelteComponent {
1986
2037
 
1987
2038
  function get_each_context$3(ctx, list, i) {
1988
2039
  const child_ctx = ctx.slice();
1989
- child_ctx[23] = list[i];
1990
- child_ctx[25] = i;
2040
+ child_ctx[25] = list[i];
2041
+ child_ctx[27] = i;
1991
2042
  return child_ctx;
1992
2043
  }
1993
2044
 
1994
- // (51:0) {#if rx !== undefined && ry !== undefined}
2045
+ // (53:0) {#if rx !== undefined && ry !== undefined}
1995
2046
  function create_if_block$6(ctx) {
1996
- let each_1_anchor;
2047
+ let g;
2048
+ let g_class_value;
1997
2049
  let each_value = /*left*/ ctx[0];
1998
2050
  let each_blocks = [];
1999
2051
 
@@ -2003,21 +2055,25 @@ function create_if_block$6(ctx) {
2003
2055
 
2004
2056
  return {
2005
2057
  c() {
2058
+ g = svg_element("g");
2059
+
2006
2060
  for (let i = 0; i < each_blocks.length; i += 1) {
2007
2061
  each_blocks[i].c();
2008
2062
  }
2009
2063
 
2010
- each_1_anchor = empty();
2064
+ attr(g, "class", g_class_value = "series " + /*style*/ ctx[2]);
2065
+ attr(g, "title", /*title*/ ctx[1]);
2066
+ attr(g, "style", /*barsStyleStr*/ ctx[7]);
2011
2067
  },
2012
2068
  m(target, anchor) {
2069
+ insert(target, g, anchor);
2070
+
2013
2071
  for (let i = 0; i < each_blocks.length; i += 1) {
2014
- each_blocks[i].m(target, anchor);
2072
+ each_blocks[i].m(g, null);
2015
2073
  }
2016
-
2017
- insert(target, each_1_anchor, anchor);
2018
2074
  },
2019
2075
  p(ctx, dirty) {
2020
- if (dirty & /*rx, ry, rw, rh, barsStyleStr, left*/ 63) {
2076
+ if (dirty & /*rx, ry, rw, rh, left*/ 121) {
2021
2077
  each_value = /*left*/ ctx[0];
2022
2078
  let i;
2023
2079
 
@@ -2029,7 +2085,7 @@ function create_if_block$6(ctx) {
2029
2085
  } else {
2030
2086
  each_blocks[i] = create_each_block$3(child_ctx);
2031
2087
  each_blocks[i].c();
2032
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2088
+ each_blocks[i].m(g, null);
2033
2089
  }
2034
2090
  }
2035
2091
 
@@ -2039,15 +2095,23 @@ function create_if_block$6(ctx) {
2039
2095
 
2040
2096
  each_blocks.length = each_value.length;
2041
2097
  }
2098
+
2099
+ if (dirty & /*style*/ 4 && g_class_value !== (g_class_value = "series " + /*style*/ ctx[2])) {
2100
+ attr(g, "class", g_class_value);
2101
+ }
2102
+
2103
+ if (dirty & /*title*/ 2) {
2104
+ attr(g, "title", /*title*/ ctx[1]);
2105
+ }
2042
2106
  },
2043
2107
  d(detaching) {
2108
+ if (detaching) detach(g);
2044
2109
  destroy_each(each_blocks, detaching);
2045
- if (detaching) detach(each_1_anchor);
2046
2110
  }
2047
2111
  };
2048
2112
  }
2049
2113
 
2050
- // (52:3) {#each left as v, i}
2114
+ // (55:3) {#each left as v, i}
2051
2115
  function create_each_block$3(ctx) {
2052
2116
  let rect;
2053
2117
  let rect_x_value;
@@ -2058,29 +2122,28 @@ function create_each_block$3(ctx) {
2058
2122
  return {
2059
2123
  c() {
2060
2124
  rect = svg_element("rect");
2061
- attr(rect, "x", rect_x_value = /*rx*/ ctx[4][/*i*/ ctx[25]]);
2062
- attr(rect, "y", rect_y_value = /*ry*/ ctx[3][/*i*/ ctx[25]]);
2063
- attr(rect, "width", rect_width_value = /*rw*/ ctx[2][/*i*/ ctx[25]]);
2064
- attr(rect, "height", rect_height_value = /*rh*/ ctx[1][/*i*/ ctx[25]]);
2065
- attr(rect, "style", /*barsStyleStr*/ ctx[5]);
2125
+ attr(rect, "x", rect_x_value = /*rx*/ ctx[6][/*i*/ ctx[27]]);
2126
+ attr(rect, "y", rect_y_value = /*ry*/ ctx[5][/*i*/ ctx[27]]);
2127
+ attr(rect, "width", rect_width_value = /*rw*/ ctx[4][/*i*/ ctx[27]]);
2128
+ attr(rect, "height", rect_height_value = /*rh*/ ctx[3][/*i*/ ctx[27]]);
2066
2129
  },
2067
2130
  m(target, anchor) {
2068
2131
  insert(target, rect, anchor);
2069
2132
  },
2070
2133
  p(ctx, dirty) {
2071
- if (dirty & /*rx*/ 16 && rect_x_value !== (rect_x_value = /*rx*/ ctx[4][/*i*/ ctx[25]])) {
2134
+ if (dirty & /*rx*/ 64 && rect_x_value !== (rect_x_value = /*rx*/ ctx[6][/*i*/ ctx[27]])) {
2072
2135
  attr(rect, "x", rect_x_value);
2073
2136
  }
2074
2137
 
2075
- if (dirty & /*ry*/ 8 && rect_y_value !== (rect_y_value = /*ry*/ ctx[3][/*i*/ ctx[25]])) {
2138
+ if (dirty & /*ry*/ 32 && rect_y_value !== (rect_y_value = /*ry*/ ctx[5][/*i*/ ctx[27]])) {
2076
2139
  attr(rect, "y", rect_y_value);
2077
2140
  }
2078
2141
 
2079
- if (dirty & /*rw*/ 4 && rect_width_value !== (rect_width_value = /*rw*/ ctx[2][/*i*/ ctx[25]])) {
2142
+ if (dirty & /*rw*/ 16 && rect_width_value !== (rect_width_value = /*rw*/ ctx[4][/*i*/ ctx[27]])) {
2080
2143
  attr(rect, "width", rect_width_value);
2081
2144
  }
2082
2145
 
2083
- if (dirty & /*rh*/ 2 && rect_height_value !== (rect_height_value = /*rh*/ ctx[1][/*i*/ ctx[25]])) {
2146
+ if (dirty & /*rh*/ 8 && rect_height_value !== (rect_height_value = /*rh*/ ctx[3][/*i*/ ctx[27]])) {
2084
2147
  attr(rect, "height", rect_height_value);
2085
2148
  }
2086
2149
  },
@@ -2092,7 +2155,7 @@ function create_each_block$3(ctx) {
2092
2155
 
2093
2156
  function create_fragment$8(ctx) {
2094
2157
  let if_block_anchor;
2095
- let if_block = /*rx*/ ctx[4] !== undefined && /*ry*/ ctx[3] !== undefined && create_if_block$6(ctx);
2158
+ let if_block = /*rx*/ ctx[6] !== undefined && /*ry*/ ctx[5] !== undefined && create_if_block$6(ctx);
2096
2159
 
2097
2160
  return {
2098
2161
  c() {
@@ -2104,7 +2167,7 @@ function create_fragment$8(ctx) {
2104
2167
  insert(target, if_block_anchor, anchor);
2105
2168
  },
2106
2169
  p(ctx, [dirty]) {
2107
- if (/*rx*/ ctx[4] !== undefined && /*ry*/ ctx[3] !== undefined) {
2170
+ if (/*rx*/ ctx[6] !== undefined && /*ry*/ ctx[5] !== undefined) {
2108
2171
  if (if_block) {
2109
2172
  if_block.p(ctx, dirty);
2110
2173
  } else {
@@ -2143,6 +2206,8 @@ function instance$8($$self, $$props, $$invalidate) {
2143
2206
  let { faceColor = Colors.PRIMARY } = $$props;
2144
2207
  let { borderColor = faceColor } = $$props;
2145
2208
  let { lineWidth = 1 } = $$props;
2209
+ let { title = "" } = $$props;
2210
+ let { style = "series_rect" } = $$props;
2146
2211
 
2147
2212
  // styles for bars and labels
2148
2213
  const barsStyleStr = `fill:${faceColor};stroke:${borderColor};stroke-width: ${lineWidth}px;`;
@@ -2171,46 +2236,50 @@ function instance$8($$self, $$props, $$invalidate) {
2171
2236
  const axes = getContext('axes');
2172
2237
 
2173
2238
  const xLim = axes.xLim;
2174
- component_subscribe($$self, xLim, value => $$invalidate(20, $xLim = value));
2239
+ component_subscribe($$self, xLim, value => $$invalidate(22, $xLim = value));
2175
2240
  const yLim = axes.yLim;
2176
- component_subscribe($$self, yLim, value => $$invalidate(18, $yLim = value));
2241
+ component_subscribe($$self, yLim, value => $$invalidate(20, $yLim = value));
2177
2242
  const axesWidth = axes.width;
2178
- component_subscribe($$self, axesWidth, value => $$invalidate(19, $axesWidth = value));
2243
+ component_subscribe($$self, axesWidth, value => $$invalidate(21, $axesWidth = value));
2179
2244
  const axesHeight = axes.height;
2180
- component_subscribe($$self, axesHeight, value => $$invalidate(17, $axesHeight = value));
2245
+ component_subscribe($$self, axesHeight, value => $$invalidate(19, $axesHeight = value));
2181
2246
 
2182
2247
  $$self.$$set = $$props => {
2183
2248
  if ('left' in $$props) $$invalidate(0, left = $$props.left);
2184
- if ('top' in $$props) $$invalidate(12, top = $$props.top);
2185
- if ('width' in $$props) $$invalidate(10, width = $$props.width);
2186
- if ('height' in $$props) $$invalidate(11, height = $$props.height);
2187
- if ('labels' in $$props) $$invalidate(13, labels = $$props.labels);
2188
- if ('faceColor' in $$props) $$invalidate(14, faceColor = $$props.faceColor);
2189
- if ('borderColor' in $$props) $$invalidate(15, borderColor = $$props.borderColor);
2190
- if ('lineWidth' in $$props) $$invalidate(16, lineWidth = $$props.lineWidth);
2249
+ if ('top' in $$props) $$invalidate(14, top = $$props.top);
2250
+ if ('width' in $$props) $$invalidate(12, width = $$props.width);
2251
+ if ('height' in $$props) $$invalidate(13, height = $$props.height);
2252
+ if ('labels' in $$props) $$invalidate(15, labels = $$props.labels);
2253
+ if ('faceColor' in $$props) $$invalidate(16, faceColor = $$props.faceColor);
2254
+ if ('borderColor' in $$props) $$invalidate(17, borderColor = $$props.borderColor);
2255
+ if ('lineWidth' in $$props) $$invalidate(18, lineWidth = $$props.lineWidth);
2256
+ if ('title' in $$props) $$invalidate(1, title = $$props.title);
2257
+ if ('style' in $$props) $$invalidate(2, style = $$props.style);
2191
2258
  };
2192
2259
 
2193
2260
  $$self.$$.update = () => {
2194
- if ($$self.$$.dirty & /*left, $xLim, $axesWidth*/ 1572865) {
2261
+ if ($$self.$$.dirty & /*left, $xLim, $axesWidth*/ 6291457) {
2195
2262
  // reactive variables for coordinates of data points in pixels
2196
- $$invalidate(4, rx = axes.scaleX(left, $xLim, $axesWidth));
2263
+ $$invalidate(6, rx = axes.scaleX(left, $xLim, $axesWidth));
2197
2264
  }
2198
2265
 
2199
- if ($$self.$$.dirty & /*top, $yLim, $axesHeight*/ 397312) {
2200
- $$invalidate(3, ry = axes.scaleY(top, $yLim, $axesHeight));
2266
+ if ($$self.$$.dirty & /*top, $yLim, $axesHeight*/ 1589248) {
2267
+ $$invalidate(5, ry = axes.scaleY(top, $yLim, $axesHeight));
2201
2268
  }
2202
2269
 
2203
- if ($$self.$$.dirty & /*width, $xLim, $axesWidth*/ 1573888) {
2204
- $$invalidate(2, rw = axes.scaleX(width, $xLim, $axesWidth, true));
2270
+ if ($$self.$$.dirty & /*width, $xLim, $axesWidth*/ 6295552) {
2271
+ $$invalidate(4, rw = axes.scaleX(width, $xLim, $axesWidth, true));
2205
2272
  }
2206
2273
 
2207
- if ($$self.$$.dirty & /*height, $yLim, $axesHeight*/ 395264) {
2208
- $$invalidate(1, rh = axes.scaleY(height, $yLim, $axesHeight, true));
2274
+ if ($$self.$$.dirty & /*height, $yLim, $axesHeight*/ 1581056) {
2275
+ $$invalidate(3, rh = axes.scaleY(height, $yLim, $axesHeight, true));
2209
2276
  }
2210
2277
  };
2211
2278
 
2212
2279
  return [
2213
2280
  left,
2281
+ title,
2282
+ style,
2214
2283
  rh,
2215
2284
  rw,
2216
2285
  ry,
@@ -2240,13 +2309,15 @@ class Rectangles extends SvelteComponent {
2240
2309
 
2241
2310
  init(this, options, instance$8, create_fragment$8, safe_not_equal, {
2242
2311
  left: 0,
2243
- top: 12,
2244
- width: 10,
2245
- height: 11,
2246
- labels: 13,
2247
- faceColor: 14,
2248
- borderColor: 15,
2249
- lineWidth: 16
2312
+ top: 14,
2313
+ width: 12,
2314
+ height: 13,
2315
+ labels: 15,
2316
+ faceColor: 16,
2317
+ borderColor: 17,
2318
+ lineWidth: 18,
2319
+ title: 1,
2320
+ style: 2
2250
2321
  });
2251
2322
  }
2252
2323
  }
@@ -2273,6 +2344,7 @@ function create_if_block$5(ctx) {
2273
2344
  c() {
2274
2345
  g = svg_element("g");
2275
2346
  create_component(rectangles.$$.fragment);
2347
+ set_style(g, "pointer-events", "none");
2276
2348
  attr(g, "class", "mdaplot__axes-box");
2277
2349
  },
2278
2350
  m(target, anchor) {
@@ -2686,17 +2758,22 @@ class Segments extends SvelteComponent {
2686
2758
 
2687
2759
  /* src/TextLabels.svelte generated by Svelte v3.46.3 */
2688
2760
 
2761
+ function add_css$2(target) {
2762
+ append_styles(target, "svelte-1szep8i", "text.svelte-1szep8i{dominant-baseline:middle}");
2763
+ }
2764
+
2689
2765
  function get_each_context$1(ctx, list, i) {
2690
2766
  const child_ctx = ctx.slice();
2691
- child_ctx[25] = list[i];
2692
- child_ctx[27] = i;
2767
+ child_ctx[27] = list[i];
2768
+ child_ctx[29] = i;
2693
2769
  return child_ctx;
2694
2770
  }
2695
2771
 
2696
- // (56:0) {#if x !== undefined && y !== undefined}
2772
+ // (66:0) {#if x !== undefined && y !== undefined}
2697
2773
  function create_if_block$3(ctx) {
2698
- let each_1_anchor;
2699
- let each_value = /*x*/ ctx[6];
2774
+ let g;
2775
+ let g_class_value;
2776
+ let each_value = /*x*/ ctx[7];
2700
2777
  let each_blocks = [];
2701
2778
 
2702
2779
  for (let i = 0; i < each_value.length; i += 1) {
@@ -2705,22 +2782,26 @@ function create_if_block$3(ctx) {
2705
2782
 
2706
2783
  return {
2707
2784
  c() {
2785
+ g = svg_element("g");
2786
+
2708
2787
  for (let i = 0; i < each_blocks.length; i += 1) {
2709
2788
  each_blocks[i].c();
2710
2789
  }
2711
2790
 
2712
- each_1_anchor = empty();
2791
+ attr(g, "class", g_class_value = "series " + /*style*/ ctx[1]);
2792
+ attr(g, "title", /*title*/ ctx[2]);
2793
+ attr(g, "style", /*textStyleStr*/ ctx[3]);
2713
2794
  },
2714
2795
  m(target, anchor) {
2796
+ insert(target, g, anchor);
2797
+
2715
2798
  for (let i = 0; i < each_blocks.length; i += 1) {
2716
- each_blocks[i].m(target, anchor);
2799
+ each_blocks[i].m(g, null);
2717
2800
  }
2718
-
2719
- insert(target, each_1_anchor, anchor);
2720
2801
  },
2721
2802
  p(ctx, dirty) {
2722
- if (dirty & /*textStyleStr, x, y, dx, dy, textAnchors, pos, labels*/ 255) {
2723
- each_value = /*x*/ ctx[6];
2803
+ if (dirty & /*x, y, dx, dy, labels*/ 241) {
2804
+ each_value = /*x*/ ctx[7];
2724
2805
  let i;
2725
2806
 
2726
2807
  for (i = 0; i < each_value.length; i += 1) {
@@ -2731,7 +2812,7 @@ function create_if_block$3(ctx) {
2731
2812
  } else {
2732
2813
  each_blocks[i] = create_each_block$1(child_ctx);
2733
2814
  each_blocks[i].c();
2734
- each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
2815
+ each_blocks[i].m(g, null);
2735
2816
  }
2736
2817
  }
2737
2818
 
@@ -2741,61 +2822,64 @@ function create_if_block$3(ctx) {
2741
2822
 
2742
2823
  each_blocks.length = each_value.length;
2743
2824
  }
2825
+
2826
+ if (dirty & /*style*/ 2 && g_class_value !== (g_class_value = "series " + /*style*/ ctx[1])) {
2827
+ attr(g, "class", g_class_value);
2828
+ }
2829
+
2830
+ if (dirty & /*title*/ 4) {
2831
+ attr(g, "title", /*title*/ ctx[2]);
2832
+ }
2833
+
2834
+ if (dirty & /*textStyleStr*/ 8) {
2835
+ attr(g, "style", /*textStyleStr*/ ctx[3]);
2836
+ }
2744
2837
  },
2745
2838
  d(detaching) {
2839
+ if (detaching) detach(g);
2746
2840
  destroy_each(each_blocks, detaching);
2747
- if (detaching) detach(each_1_anchor);
2748
2841
  }
2749
2842
  };
2750
2843
  }
2751
2844
 
2752
- // (57:3) {#each x as v, i}
2845
+ // (68:3) {#each x as v, i}
2753
2846
  function create_each_block$1(ctx) {
2754
2847
  let text_1;
2755
- let raw_value = /*labels*/ ctx[0][/*i*/ ctx[27]] + "";
2848
+ let raw_value = /*labels*/ ctx[0][/*i*/ ctx[29]] + "";
2849
+ let text_1_data_id_value;
2756
2850
  let text_1_x_value;
2757
2851
  let text_1_y_value;
2758
- let text_1_text_anchor_value;
2759
2852
 
2760
2853
  return {
2761
2854
  c() {
2762
2855
  text_1 = svg_element("text");
2763
- attr(text_1, "style", /*textStyleStr*/ ctx[2]);
2764
- attr(text_1, "x", text_1_x_value = /*x*/ ctx[6][/*i*/ ctx[27]]);
2765
- attr(text_1, "y", text_1_y_value = /*y*/ ctx[5][/*i*/ ctx[27]]);
2766
- attr(text_1, "dx", /*dx*/ ctx[4]);
2767
- attr(text_1, "dy", /*dy*/ ctx[3]);
2768
- attr(text_1, "dominant-baseline", "middle");
2769
- attr(text_1, "text-anchor", text_1_text_anchor_value = /*textAnchors*/ ctx[7][/*pos*/ ctx[1]]);
2856
+ attr(text_1, "data-id", text_1_data_id_value = /*i*/ ctx[29]);
2857
+ attr(text_1, "x", text_1_x_value = /*x*/ ctx[7][/*i*/ ctx[29]]);
2858
+ attr(text_1, "y", text_1_y_value = /*y*/ ctx[6][/*i*/ ctx[29]]);
2859
+ attr(text_1, "dx", /*dx*/ ctx[5]);
2860
+ attr(text_1, "dy", /*dy*/ ctx[4]);
2861
+ attr(text_1, "class", "svelte-1szep8i");
2770
2862
  },
2771
2863
  m(target, anchor) {
2772
2864
  insert(target, text_1, anchor);
2773
2865
  text_1.innerHTML = raw_value;
2774
2866
  },
2775
2867
  p(ctx, dirty) {
2776
- if (dirty & /*labels*/ 1 && raw_value !== (raw_value = /*labels*/ ctx[0][/*i*/ ctx[27]] + "")) text_1.innerHTML = raw_value;
2777
- if (dirty & /*textStyleStr*/ 4) {
2778
- attr(text_1, "style", /*textStyleStr*/ ctx[2]);
2779
- }
2780
-
2781
- if (dirty & /*x*/ 64 && text_1_x_value !== (text_1_x_value = /*x*/ ctx[6][/*i*/ ctx[27]])) {
2868
+ if (dirty & /*labels*/ 1 && raw_value !== (raw_value = /*labels*/ ctx[0][/*i*/ ctx[29]] + "")) text_1.innerHTML = raw_value;
2869
+ if (dirty & /*x*/ 128 && text_1_x_value !== (text_1_x_value = /*x*/ ctx[7][/*i*/ ctx[29]])) {
2782
2870
  attr(text_1, "x", text_1_x_value);
2783
2871
  }
2784
2872
 
2785
- if (dirty & /*y*/ 32 && text_1_y_value !== (text_1_y_value = /*y*/ ctx[5][/*i*/ ctx[27]])) {
2873
+ if (dirty & /*y*/ 64 && text_1_y_value !== (text_1_y_value = /*y*/ ctx[6][/*i*/ ctx[29]])) {
2786
2874
  attr(text_1, "y", text_1_y_value);
2787
2875
  }
2788
2876
 
2789
- if (dirty & /*dx*/ 16) {
2790
- attr(text_1, "dx", /*dx*/ ctx[4]);
2791
- }
2792
-
2793
- if (dirty & /*dy*/ 8) {
2794
- attr(text_1, "dy", /*dy*/ ctx[3]);
2877
+ if (dirty & /*dx*/ 32) {
2878
+ attr(text_1, "dx", /*dx*/ ctx[5]);
2795
2879
  }
2796
2880
 
2797
- if (dirty & /*pos*/ 2 && text_1_text_anchor_value !== (text_1_text_anchor_value = /*textAnchors*/ ctx[7][/*pos*/ ctx[1]])) {
2798
- attr(text_1, "text-anchor", text_1_text_anchor_value);
2881
+ if (dirty & /*dy*/ 16) {
2882
+ attr(text_1, "dy", /*dy*/ ctx[4]);
2799
2883
  }
2800
2884
  },
2801
2885
  d(detaching) {
@@ -2806,7 +2890,7 @@ function create_each_block$1(ctx) {
2806
2890
 
2807
2891
  function create_fragment$5(ctx) {
2808
2892
  let if_block_anchor;
2809
- let if_block = /*x*/ ctx[6] !== undefined && /*y*/ ctx[5] !== undefined && create_if_block$3(ctx);
2893
+ let if_block = /*x*/ ctx[7] !== undefined && /*y*/ ctx[6] !== undefined && create_if_block$3(ctx);
2810
2894
 
2811
2895
  return {
2812
2896
  c() {
@@ -2818,7 +2902,7 @@ function create_fragment$5(ctx) {
2818
2902
  insert(target, if_block_anchor, anchor);
2819
2903
  },
2820
2904
  p(ctx, [dirty]) {
2821
- if (/*x*/ ctx[6] !== undefined && /*y*/ ctx[5] !== undefined) {
2905
+ if (/*x*/ ctx[7] !== undefined && /*y*/ ctx[6] !== undefined) {
2822
2906
  if (if_block) {
2823
2907
  if_block.p(ctx, dirty);
2824
2908
  } else {
@@ -2859,11 +2943,13 @@ function instance$5($$self, $$props, $$invalidate) {
2859
2943
  let { borderColor = "transparent" } = $$props;
2860
2944
  let { borderWidth = 0 } = $$props;
2861
2945
  let { textSize = 1 } = $$props;
2946
+ let { style = "" } = $$props;
2947
+ let { title = "series_text" } = $$props;
2862
2948
 
2863
2949
  // text-anchor values depending on position
2864
2950
  const textAnchors = ["middle", "middle", "start", "middle", "end"];
2865
2951
 
2866
- /* sanity check for input parameters */
2952
+ // sanity check for input parameters
2867
2953
  if (!Array.isArray(xValues) || !Array.isArray(yValues) || xValues.length !== yValues.length) {
2868
2954
  throw "TextLabels: parameters 'xValues' and 'yValues' must be vectors of the same length.";
2869
2955
  }
@@ -2872,30 +2958,32 @@ function instance$5($$self, $$props, $$invalidate) {
2872
2958
  const axes = getContext('axes');
2873
2959
 
2874
2960
  const xLim = axes.xLim;
2875
- component_subscribe($$self, xLim, value => $$invalidate(23, $xLim = value));
2961
+ component_subscribe($$self, xLim, value => $$invalidate(24, $xLim = value));
2876
2962
  const yLim = axes.yLim;
2877
- component_subscribe($$self, yLim, value => $$invalidate(21, $yLim = value));
2963
+ component_subscribe($$self, yLim, value => $$invalidate(22, $yLim = value));
2878
2964
  const axesWidth = axes.width;
2879
- component_subscribe($$self, axesWidth, value => $$invalidate(22, $axesWidth = value));
2965
+ component_subscribe($$self, axesWidth, value => $$invalidate(23, $axesWidth = value));
2880
2966
  const axesHeight = axes.height;
2881
- component_subscribe($$self, axesHeight, value => $$invalidate(20, $axesHeight = value));
2967
+ component_subscribe($$self, axesHeight, value => $$invalidate(21, $axesHeight = value));
2882
2968
  const scale = axes.scale;
2883
- component_subscribe($$self, scale, value => $$invalidate(19, $scale = value));
2969
+ component_subscribe($$self, scale, value => $$invalidate(20, $scale = value));
2884
2970
 
2885
2971
  $$self.$$set = $$props => {
2886
2972
  if ('xValues' in $$props) $$invalidate(13, xValues = $$props.xValues);
2887
2973
  if ('yValues' in $$props) $$invalidate(14, yValues = $$props.yValues);
2888
2974
  if ('labels' in $$props) $$invalidate(0, labels = $$props.labels);
2889
- if ('pos' in $$props) $$invalidate(1, pos = $$props.pos);
2890
- if ('faceColor' in $$props) $$invalidate(15, faceColor = $$props.faceColor);
2891
- if ('borderColor' in $$props) $$invalidate(16, borderColor = $$props.borderColor);
2892
- if ('borderWidth' in $$props) $$invalidate(17, borderWidth = $$props.borderWidth);
2893
- if ('textSize' in $$props) $$invalidate(18, textSize = $$props.textSize);
2975
+ if ('pos' in $$props) $$invalidate(15, pos = $$props.pos);
2976
+ if ('faceColor' in $$props) $$invalidate(16, faceColor = $$props.faceColor);
2977
+ if ('borderColor' in $$props) $$invalidate(17, borderColor = $$props.borderColor);
2978
+ if ('borderWidth' in $$props) $$invalidate(18, borderWidth = $$props.borderWidth);
2979
+ if ('textSize' in $$props) $$invalidate(19, textSize = $$props.textSize);
2980
+ if ('style' in $$props) $$invalidate(1, style = $$props.style);
2981
+ if ('title' in $$props) $$invalidate(2, title = $$props.title);
2894
2982
  };
2895
2983
 
2896
2984
  $$self.$$.update = () => {
2897
2985
  if ($$self.$$.dirty & /*xValues, labels*/ 8193) {
2898
- // multiply labels values if needed
2986
+ // multiply label values if needed
2899
2987
  {
2900
2988
  const n = xValues.length;
2901
2989
  if (!Array.isArray(labels)) $$invalidate(0, labels = Array(n).fill(labels));
@@ -2911,38 +2999,39 @@ function instance$5($$self, $$props, $$invalidate) {
2911
2999
  }
2912
3000
  }
2913
3001
 
2914
- if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 12591104) {
3002
+ if ($$self.$$.dirty & /*xValues, $xLim, $axesWidth*/ 25174016) {
2915
3003
  // reactive variables for coordinates of data points in pixels
2916
- $$invalidate(6, x = axes.scaleX(xValues, $xLim, $axesWidth));
3004
+ $$invalidate(7, x = axes.scaleX(xValues, $xLim, $axesWidth));
2917
3005
  }
2918
3006
 
2919
- if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 3162112) {
2920
- $$invalidate(5, y = axes.scaleY(yValues, $yLim, $axesHeight));
3007
+ if ($$self.$$.dirty & /*yValues, $yLim, $axesHeight*/ 6307840) {
3008
+ $$invalidate(6, y = axes.scaleY(yValues, $yLim, $axesHeight));
2921
3009
  }
2922
3010
 
2923
- if ($$self.$$.dirty & /*pos, $scale*/ 524290) {
2924
- $$invalidate(4, dx = [0, 0, 1, 0, -1][pos] * axes.LABELS_MARGIN[$scale]);
3011
+ if ($$self.$$.dirty & /*pos, $scale*/ 1081344) {
3012
+ $$invalidate(5, dx = [0, 0, 1, 0, -1][pos] * axes.LABELS_MARGIN[$scale]);
2925
3013
  }
2926
3014
 
2927
- if ($$self.$$.dirty & /*pos, $scale*/ 524290) {
2928
- $$invalidate(3, dy = [0, 1, 0, -1, 0][pos] * axes.LABELS_MARGIN[$scale]);
3015
+ if ($$self.$$.dirty & /*pos, $scale*/ 1081344) {
3016
+ $$invalidate(4, dy = [0, 1, 0, -1, 0][pos] * axes.LABELS_MARGIN[$scale]);
2929
3017
  }
2930
3018
 
2931
- if ($$self.$$.dirty & /*faceColor, borderWidth, borderColor, textSize*/ 491520) {
2932
- // styles for bars and labels
2933
- $$invalidate(2, textStyleStr = `fill:${faceColor};stroke-width:${borderWidth}px;stroke:${borderColor};font-size:${textSize}em;`);
3019
+ if ($$self.$$.dirty & /*faceColor, borderWidth, borderColor, textSize, pos*/ 1015808) {
3020
+ // styles for the elements
3021
+ $$invalidate(3, textStyleStr = `fill:${faceColor};stroke-width:${borderWidth}px;stroke:${borderColor};
3022
+ font-size:${textSize}em; text-anchor:${textAnchors[pos]};`);
2934
3023
  }
2935
3024
  };
2936
3025
 
2937
3026
  return [
2938
3027
  labels,
2939
- pos,
3028
+ style,
3029
+ title,
2940
3030
  textStyleStr,
2941
3031
  dy,
2942
3032
  dx,
2943
3033
  y,
2944
3034
  x,
2945
- textAnchors,
2946
3035
  xLim,
2947
3036
  yLim,
2948
3037
  axesWidth,
@@ -2950,6 +3039,7 @@ function instance$5($$self, $$props, $$invalidate) {
2950
3039
  scale,
2951
3040
  xValues,
2952
3041
  yValues,
3042
+ pos,
2953
3043
  faceColor,
2954
3044
  borderColor,
2955
3045
  borderWidth,
@@ -2966,16 +3056,26 @@ class TextLabels extends SvelteComponent {
2966
3056
  constructor(options) {
2967
3057
  super();
2968
3058
 
2969
- init(this, options, instance$5, create_fragment$5, safe_not_equal, {
2970
- xValues: 13,
2971
- yValues: 14,
2972
- labels: 0,
2973
- pos: 1,
2974
- faceColor: 15,
2975
- borderColor: 16,
2976
- borderWidth: 17,
2977
- textSize: 18
2978
- });
3059
+ init(
3060
+ this,
3061
+ options,
3062
+ instance$5,
3063
+ create_fragment$5,
3064
+ safe_not_equal,
3065
+ {
3066
+ xValues: 13,
3067
+ yValues: 14,
3068
+ labels: 0,
3069
+ pos: 15,
3070
+ faceColor: 16,
3071
+ borderColor: 17,
3072
+ borderWidth: 18,
3073
+ textSize: 19,
3074
+ style: 1,
3075
+ title: 2
3076
+ },
3077
+ add_css$2
3078
+ );
2979
3079
  }
2980
3080
  }
2981
3081
 
@@ -3310,31 +3410,28 @@ function add_css$1(target) {
3310
3410
  }
3311
3411
 
3312
3412
  function create_fragment$3(ctx) {
3313
- let g;
3314
3413
  let rectangles;
3315
3414
  let current;
3316
3415
 
3317
3416
  rectangles = new Rectangles({
3318
3417
  props: {
3418
+ style: "series_bar",
3319
3419
  left: /*left*/ ctx[4],
3320
3420
  top: /*top*/ ctx[5],
3321
3421
  width: /*width*/ ctx[3],
3322
3422
  height: /*height*/ ctx[6],
3323
3423
  borderColor: /*borderColor*/ ctx[2],
3324
- faceColor: /*faceColor*/ ctx[1]
3424
+ faceColor: /*faceColor*/ ctx[1],
3425
+ title: /*title*/ ctx[0]
3325
3426
  }
3326
3427
  });
3327
3428
 
3328
3429
  return {
3329
3430
  c() {
3330
- g = svg_element("g");
3331
3431
  create_component(rectangles.$$.fragment);
3332
- attr(g, "class", "series series_bar");
3333
- attr(g, "title", /*title*/ ctx[0]);
3334
3432
  },
3335
3433
  m(target, anchor) {
3336
- insert(target, g, anchor);
3337
- mount_component(rectangles, g, null);
3434
+ mount_component(rectangles, target, anchor);
3338
3435
  current = true;
3339
3436
  },
3340
3437
  p(ctx, [dirty]) {
@@ -3345,11 +3442,8 @@ function create_fragment$3(ctx) {
3345
3442
  if (dirty & /*height*/ 64) rectangles_changes.height = /*height*/ ctx[6];
3346
3443
  if (dirty & /*borderColor*/ 4) rectangles_changes.borderColor = /*borderColor*/ ctx[2];
3347
3444
  if (dirty & /*faceColor*/ 2) rectangles_changes.faceColor = /*faceColor*/ ctx[1];
3445
+ if (dirty & /*title*/ 1) rectangles_changes.title = /*title*/ ctx[0];
3348
3446
  rectangles.$set(rectangles_changes);
3349
-
3350
- if (!current || dirty & /*title*/ 1) {
3351
- attr(g, "title", /*title*/ ctx[0]);
3352
- }
3353
3447
  },
3354
3448
  i(local) {
3355
3449
  if (current) return;
@@ -3361,8 +3455,7 @@ function create_fragment$3(ctx) {
3361
3455
  current = false;
3362
3456
  },
3363
3457
  d(detaching) {
3364
- if (detaching) detach(g);
3365
- destroy_component(rectangles);
3458
+ destroy_component(rectangles, detaching);
3366
3459
  }
3367
3460
  };
3368
3461
  }
@@ -3481,11 +3574,10 @@ class BarSeries extends SvelteComponent {
3481
3574
  /* src/ScatterSeries.svelte generated by Svelte v3.46.3 */
3482
3575
 
3483
3576
  function add_css(target) {
3484
- append_styles(target, "svelte-11a4d2d", ".marker{font-size:1em;cursor:default}.marker:hover{opacity:90%}.series_scatter > *:hover + .labels_hover{visibility:visible;opacity:1}");
3577
+ 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}");
3485
3578
  }
3486
3579
 
3487
3580
  function create_fragment$2(ctx) {
3488
- let g;
3489
3581
  let textlabels;
3490
3582
  let current;
3491
3583
 
@@ -3493,40 +3585,35 @@ function create_fragment$2(ctx) {
3493
3585
  props: {
3494
3586
  xValues: /*xValues*/ ctx[0],
3495
3587
  yValues: /*yValues*/ ctx[1],
3496
- labels: /*markerSymbol*/ ctx[7],
3497
- textSize: /*markerSize*/ ctx[6],
3498
3588
  faceColor: /*faceColor*/ ctx[3],
3499
3589
  borderColor: /*borderColor*/ ctx[4],
3500
- borderWidth: /*borderWidth*/ ctx[5]
3590
+ borderWidth: /*borderWidth*/ ctx[5],
3591
+ title: /*title*/ ctx[2],
3592
+ style: "series_scatter",
3593
+ labels: /*markerSymbol*/ ctx[7],
3594
+ textSize: /*markerSize*/ ctx[6]
3501
3595
  }
3502
3596
  });
3503
3597
 
3504
3598
  return {
3505
3599
  c() {
3506
- g = svg_element("g");
3507
3600
  create_component(textlabels.$$.fragment);
3508
- attr(g, "class", "series series_scatter");
3509
- attr(g, "title", /*title*/ ctx[2]);
3510
3601
  },
3511
3602
  m(target, anchor) {
3512
- insert(target, g, anchor);
3513
- mount_component(textlabels, g, null);
3603
+ mount_component(textlabels, target, anchor);
3514
3604
  current = true;
3515
3605
  },
3516
3606
  p(ctx, [dirty]) {
3517
3607
  const textlabels_changes = {};
3518
3608
  if (dirty & /*xValues*/ 1) textlabels_changes.xValues = /*xValues*/ ctx[0];
3519
3609
  if (dirty & /*yValues*/ 2) textlabels_changes.yValues = /*yValues*/ ctx[1];
3520
- if (dirty & /*markerSymbol*/ 128) textlabels_changes.labels = /*markerSymbol*/ ctx[7];
3521
- if (dirty & /*markerSize*/ 64) textlabels_changes.textSize = /*markerSize*/ ctx[6];
3522
3610
  if (dirty & /*faceColor*/ 8) textlabels_changes.faceColor = /*faceColor*/ ctx[3];
3523
3611
  if (dirty & /*borderColor*/ 16) textlabels_changes.borderColor = /*borderColor*/ ctx[4];
3524
3612
  if (dirty & /*borderWidth*/ 32) textlabels_changes.borderWidth = /*borderWidth*/ ctx[5];
3613
+ if (dirty & /*title*/ 4) textlabels_changes.title = /*title*/ ctx[2];
3614
+ if (dirty & /*markerSymbol*/ 128) textlabels_changes.labels = /*markerSymbol*/ ctx[7];
3615
+ if (dirty & /*markerSize*/ 64) textlabels_changes.textSize = /*markerSize*/ ctx[6];
3525
3616
  textlabels.$set(textlabels_changes);
3526
-
3527
- if (!current || dirty & /*title*/ 4) {
3528
- attr(g, "title", /*title*/ ctx[2]);
3529
- }
3530
3617
  },
3531
3618
  i(local) {
3532
3619
  if (current) return;
@@ -3538,8 +3625,7 @@ function create_fragment$2(ctx) {
3538
3625
  current = false;
3539
3626
  },
3540
3627
  d(detaching) {
3541
- if (detaching) detach(g);
3542
- destroy_component(textlabels);
3628
+ destroy_component(textlabels, detaching);
3543
3629
  }
3544
3630
  };
3545
3631
  }
@@ -3557,6 +3643,7 @@ function instance$2($$self, $$props, $$invalidate) {
3557
3643
  // TODO: implement later
3558
3644
  //export let labels = yValues;
3559
3645
  //export let showLabels = "no"; // can be "no", "hover", "always"
3646
+ /* constants for internal use */
3560
3647
  const markers = ["●", "◼", "▲", "▼", "⬥", "+", "*", "⨯"];
3561
3648
 
3562
3649
  let markerSymbol;
@@ -3663,7 +3750,7 @@ function create_if_block$1(ctx) {
3663
3750
  polyline = svg_element("polyline");
3664
3751
  attr(polyline, "class", "line");
3665
3752
  attr(polyline, "points", /*p*/ ctx[2]);
3666
- attr(g, "class", "series lineseries");
3753
+ attr(g, "class", "series series_line");
3667
3754
  attr(g, "style", /*lineStyleStr*/ ctx[1]);
3668
3755
  attr(g, "title", /*title*/ ctx[0]);
3669
3756
  },
@@ -3798,7 +3885,8 @@ function instance$1($$self, $$props, $$invalidate) {
3798
3885
  }
3799
3886
 
3800
3887
  if ($$self.$$.dirty & /*lineColor, lineWidth, $scale, lineType*/ 39936) {
3801
- $$invalidate(1, lineStyleStr = `fill:transparent;stroke:${lineColor};stroke-width: ${lineWidth}px;stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
3888
+ $$invalidate(1, lineStyleStr = `fill:transparent;stroke:${lineColor};stroke-width: ${lineWidth}px;
3889
+ stroke-dasharray:${axes.LINE_STYLES[$scale][lineType - 1]}`);
3802
3890
  }
3803
3891
  };
3804
3892