mol_plot_all 1.2.534 → 1.2.536

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/node.test.js CHANGED
@@ -5202,143 +5202,6 @@ var $;
5202
5202
  ;
5203
5203
  "use strict";
5204
5204
  var $;
5205
- (function ($) {
5206
- class $mol_svg_text_box extends $mol_svg_group {
5207
- font_size() {
5208
- return 16;
5209
- }
5210
- width() {
5211
- return 0;
5212
- }
5213
- sub() {
5214
- return [
5215
- this.Back(),
5216
- this.Text()
5217
- ];
5218
- }
5219
- box_width() {
5220
- return "0.5rem";
5221
- }
5222
- box_height() {
5223
- return "1rem";
5224
- }
5225
- box_pos_x() {
5226
- return this.pos_x();
5227
- }
5228
- box_pos_y() {
5229
- return "0";
5230
- }
5231
- Back() {
5232
- const obj = new this.$.$mol_svg_rect();
5233
- obj.width = () => this.box_width();
5234
- obj.height = () => this.box_height();
5235
- obj.pos = () => [
5236
- this.box_pos_x(),
5237
- this.box_pos_y()
5238
- ];
5239
- return obj;
5240
- }
5241
- pos_x() {
5242
- return "0";
5243
- }
5244
- pos_y() {
5245
- return "100%";
5246
- }
5247
- align() {
5248
- return "start";
5249
- }
5250
- text() {
5251
- return "";
5252
- }
5253
- Text() {
5254
- const obj = new this.$.$mol_svg_text();
5255
- obj.pos = () => [
5256
- this.pos_x(),
5257
- this.pos_y()
5258
- ];
5259
- obj.align = () => this.align();
5260
- obj.sub = () => [
5261
- this.text()
5262
- ];
5263
- return obj;
5264
- }
5265
- }
5266
- __decorate([
5267
- $mol_mem
5268
- ], $mol_svg_text_box.prototype, "Back", null);
5269
- __decorate([
5270
- $mol_mem
5271
- ], $mol_svg_text_box.prototype, "Text", null);
5272
- $.$mol_svg_text_box = $mol_svg_text_box;
5273
- })($ || ($ = {}));
5274
- //mol/svg/text/box/-view.tree/box.view.tree.ts
5275
- ;
5276
- "use strict";
5277
- var $;
5278
- (function ($) {
5279
- let canvas;
5280
- function $mol_font_canvas(next = canvas) {
5281
- if (!next)
5282
- next = $mol_dom_context.document.createElement('canvas').getContext('2d');
5283
- return canvas = next;
5284
- }
5285
- $.$mol_font_canvas = $mol_font_canvas;
5286
- })($ || ($ = {}));
5287
- //mol/font/canvas/canvas.ts
5288
- ;
5289
- "use strict";
5290
- var $;
5291
- (function ($) {
5292
- function $mol_font_measure(font, text) {
5293
- const canvas = $mol_font_canvas();
5294
- canvas.font = font;
5295
- return canvas.measureText(text).width;
5296
- }
5297
- $.$mol_font_measure = $mol_font_measure;
5298
- })($ || ($ = {}));
5299
- //mol/font/measure/measure.ts
5300
- ;
5301
- "use strict";
5302
- var $;
5303
- (function ($) {
5304
- var $$;
5305
- (function ($$) {
5306
- class $mol_svg_text_box extends $.$mol_svg_text_box {
5307
- box_width() {
5308
- return `${this.width()}px`;
5309
- }
5310
- width() {
5311
- return $mol_font_measure(this.font_size() + 'px ' + this.font_family(), this.text());
5312
- }
5313
- box_pos_x() {
5314
- const align = this.align();
5315
- if (align === 'end')
5316
- return `calc(${this.pos_x()} - ${this.width()})`;
5317
- if (align === 'middle')
5318
- return `calc(${this.pos_x()} - ${Math.round(this.width() / 2)})`;
5319
- return this.pos_x();
5320
- }
5321
- box_pos_y() {
5322
- return `calc(${this.pos_y()} - ${this.font_size() - 2})`;
5323
- }
5324
- }
5325
- __decorate([
5326
- $mol_mem
5327
- ], $mol_svg_text_box.prototype, "width", null);
5328
- $$.$mol_svg_text_box = $mol_svg_text_box;
5329
- })($$ = $.$$ || ($.$$ = {}));
5330
- })($ || ($ = {}));
5331
- //mol/svg/text/box/box.view.ts
5332
- ;
5333
- "use strict";
5334
- var $;
5335
- (function ($) {
5336
- $mol_style_attach("mol/svg/text/box/box.view.css", "[mol_svg_text_box_back] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n}\n");
5337
- })($ || ($ = {}));
5338
- //mol/svg/text/box/-css/box.view.css.ts
5339
- ;
5340
- "use strict";
5341
- var $;
5342
5205
  (function ($) {
5343
5206
  class $mol_plot_ruler extends $mol_plot_graph {
5344
5207
  step() {
@@ -5428,7 +5291,7 @@ var $;
5428
5291
  return "start";
5429
5292
  }
5430
5293
  Title() {
5431
- const obj = new this.$.$mol_svg_text_box();
5294
+ const obj = new this.$.$mol_svg_text();
5432
5295
  obj.pos_x = () => this.title_pos_x();
5433
5296
  obj.pos_y = () => this.title_pos_y();
5434
5297
  obj.align = () => this.title_align();
@@ -5563,7 +5426,10 @@ var $;
5563
5426
  return [this.Curve()];
5564
5427
  }
5565
5428
  front() {
5566
- return [this.Background(), ...this.labels_formatted(), this.Title()];
5429
+ return [
5430
+ ...this.labels_formatted(),
5431
+ this.Title()
5432
+ ];
5567
5433
  }
5568
5434
  }
5569
5435
  __decorate([
@@ -5583,7 +5449,7 @@ var $;
5583
5449
  "use strict";
5584
5450
  var $;
5585
5451
  (function ($) {
5586
- $mol_style_attach("mol/plot/ruler/ruler.view.css", "[mol_plot_ruler_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n}\n\n[mol_plot_ruler_label] {\n\tcolor: var(--mol_theme_text);\n}\n\n[mol_plot_ruler_title] {\n\tcolor: var(--mol_theme_shade);\n\tbackground-color: var(--mol_theme_back);\n}\n\n[mol_plot_ruler_background] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n\topacity: 0.8;\n}\n");
5452
+ $mol_style_attach("mol/plot/ruler/ruler.view.css", "[mol_plot_ruler_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n}\n\n[mol_plot_ruler_label] {\n\tcolor: var(--mol_theme_text);\n\ttext-shadow: 0 -1px var(--mol_theme_back), 0px 1px var(--mol_theme_back);\n}\n\n[mol_plot_ruler_title] {\n\tcolor: var(--mol_theme_shade);\n\tbackground-color: var(--mol_theme_back);\n\ttext-shadow: 0 -1px var(--mol_theme_back), 0px 1px var(--mol_theme_back);\n}\n\n[mol_plot_ruler_background] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n\topacity: 0.8;\n}\n");
5587
5453
  })($ || ($ = {}));
5588
5454
  //mol/plot/ruler/-css/ruler.view.css.ts
5589
5455
  ;
@@ -5747,6 +5613,143 @@ var $;
5747
5613
  ;
5748
5614
  "use strict";
5749
5615
  var $;
5616
+ (function ($) {
5617
+ class $mol_svg_text_box extends $mol_svg_group {
5618
+ font_size() {
5619
+ return 16;
5620
+ }
5621
+ width() {
5622
+ return 0;
5623
+ }
5624
+ sub() {
5625
+ return [
5626
+ this.Back(),
5627
+ this.Text()
5628
+ ];
5629
+ }
5630
+ box_width() {
5631
+ return "0.5rem";
5632
+ }
5633
+ box_height() {
5634
+ return "1rem";
5635
+ }
5636
+ box_pos_x() {
5637
+ return this.pos_x();
5638
+ }
5639
+ box_pos_y() {
5640
+ return "0";
5641
+ }
5642
+ Back() {
5643
+ const obj = new this.$.$mol_svg_rect();
5644
+ obj.width = () => this.box_width();
5645
+ obj.height = () => this.box_height();
5646
+ obj.pos = () => [
5647
+ this.box_pos_x(),
5648
+ this.box_pos_y()
5649
+ ];
5650
+ return obj;
5651
+ }
5652
+ pos_x() {
5653
+ return "0";
5654
+ }
5655
+ pos_y() {
5656
+ return "100%";
5657
+ }
5658
+ align() {
5659
+ return "start";
5660
+ }
5661
+ text() {
5662
+ return "";
5663
+ }
5664
+ Text() {
5665
+ const obj = new this.$.$mol_svg_text();
5666
+ obj.pos = () => [
5667
+ this.pos_x(),
5668
+ this.pos_y()
5669
+ ];
5670
+ obj.align = () => this.align();
5671
+ obj.sub = () => [
5672
+ this.text()
5673
+ ];
5674
+ return obj;
5675
+ }
5676
+ }
5677
+ __decorate([
5678
+ $mol_mem
5679
+ ], $mol_svg_text_box.prototype, "Back", null);
5680
+ __decorate([
5681
+ $mol_mem
5682
+ ], $mol_svg_text_box.prototype, "Text", null);
5683
+ $.$mol_svg_text_box = $mol_svg_text_box;
5684
+ })($ || ($ = {}));
5685
+ //mol/svg/text/box/-view.tree/box.view.tree.ts
5686
+ ;
5687
+ "use strict";
5688
+ var $;
5689
+ (function ($) {
5690
+ let canvas;
5691
+ function $mol_font_canvas(next = canvas) {
5692
+ if (!next)
5693
+ next = $mol_dom_context.document.createElement('canvas').getContext('2d');
5694
+ return canvas = next;
5695
+ }
5696
+ $.$mol_font_canvas = $mol_font_canvas;
5697
+ })($ || ($ = {}));
5698
+ //mol/font/canvas/canvas.ts
5699
+ ;
5700
+ "use strict";
5701
+ var $;
5702
+ (function ($) {
5703
+ function $mol_font_measure(font, text) {
5704
+ const canvas = $mol_font_canvas();
5705
+ canvas.font = font;
5706
+ return canvas.measureText(text).width;
5707
+ }
5708
+ $.$mol_font_measure = $mol_font_measure;
5709
+ })($ || ($ = {}));
5710
+ //mol/font/measure/measure.ts
5711
+ ;
5712
+ "use strict";
5713
+ var $;
5714
+ (function ($) {
5715
+ var $$;
5716
+ (function ($$) {
5717
+ class $mol_svg_text_box extends $.$mol_svg_text_box {
5718
+ box_width() {
5719
+ return `${this.width()}px`;
5720
+ }
5721
+ width() {
5722
+ return $mol_font_measure(this.font_size() + 'px ' + this.font_family(), this.text());
5723
+ }
5724
+ box_pos_x() {
5725
+ const align = this.align();
5726
+ if (align === 'end')
5727
+ return `calc(${this.pos_x()} - ${this.width()})`;
5728
+ if (align === 'middle')
5729
+ return `calc(${this.pos_x()} - ${Math.round(this.width() / 2)})`;
5730
+ return this.pos_x();
5731
+ }
5732
+ box_pos_y() {
5733
+ return `calc(${this.pos_y()} - ${this.font_size() - 2})`;
5734
+ }
5735
+ }
5736
+ __decorate([
5737
+ $mol_mem
5738
+ ], $mol_svg_text_box.prototype, "width", null);
5739
+ $$.$mol_svg_text_box = $mol_svg_text_box;
5740
+ })($$ = $.$$ || ($.$$ = {}));
5741
+ })($ || ($ = {}));
5742
+ //mol/svg/text/box/box.view.ts
5743
+ ;
5744
+ "use strict";
5745
+ var $;
5746
+ (function ($) {
5747
+ $mol_style_attach("mol/svg/text/box/box.view.css", "[mol_svg_text_box_back] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n}\n");
5748
+ })($ || ($ = {}));
5749
+ //mol/svg/text/box/-css/box.view.css.ts
5750
+ ;
5751
+ "use strict";
5752
+ var $;
5750
5753
  (function ($) {
5751
5754
  class $mol_plot_mark_cross extends $mol_plot_graph {
5752
5755
  labels() {