@yuneta/gobj-ui 7.23.85 → 7.23.86

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/README.md CHANGED
@@ -850,6 +850,16 @@ both keys, either — a G6 `trigger` is a CHORD, not a list of alternatives:
850
850
  `Shortcut.match()` compares the keys held to the keys bound as a SET, so
851
851
  `['Control', 'Meta']` would mean both at once.
852
852
 
853
+ **One glyph size for the whole row** (`7.23.86`): `YUI_GRAPH_ICON_SIZE` in
854
+ `yui_graph_camera.js`, with a `yui_graph_icon()` that builds the `<i>`. It is
855
+ in **`rem` and not `em`** for a reason worth keeping: in `em` the same
856
+ `1.5em` drew 24px inside a plain button, 18px inside an `is-small` chip of
857
+ the legend, and a labelled button left its icon at the inherited 16px — three
858
+ sizes in two strips that are read as one thing. The legend under the toolbar
859
+ follows it: topic name at `1rem`, count at `.875rem` (the one deliberate step
860
+ down), glyphs at the shared size, and `align-items: stretch` so a chip's star
861
+ and crosshair are as tall as its body.
862
+
853
863
  `C_G6_NODES_TREE` floats a vertical toolbar over the canvas:
854
864
 
855
865
  | control | what it does |
@@ -10560,6 +10560,30 @@ function getPointPosition(count, index, margin = .2) {
10560
10560
  * All Rights Reserved.
10561
10561
  ***********************************************************************/
10562
10562
  /************************************************************
10563
+ * ONE size for every glyph of a graph's toolbar ROW, in
10564
+ * `rem` and not `em`.
10565
+ *
10566
+ * In `em` the same declaration draws three different icons:
10567
+ * `1.5em` is 24px inside a plain button, 18px inside an
10568
+ * `is-small` one, and a labelled button left its icon at the
10569
+ * inherited 16px -- so one row held 16px, 18px and 24px
10570
+ * glyphs and looked like three toolbars pushed together.
10571
+ * `rem` is measured against the page, so a chip that is
10572
+ * deliberately shorter than a button still carries the same
10573
+ * glyph.
10574
+ *
10575
+ * 20px against the row's 16px text: an icon-only button is
10576
+ * legible at half its 40px height, and beside a label the
10577
+ * glyph reads as a marker rather than as a second word.
10578
+ ************************************************************/
10579
+ var YUI_GRAPH_ICON_SIZE = "1.25rem";
10580
+ function yui_graph_icon(icon_class, extra_style) {
10581
+ return ["i", {
10582
+ class: icon_class,
10583
+ style: `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;` + (extra_style || "")
10584
+ }];
10585
+ }
10586
+ /************************************************************
10563
10587
  * One icon button that fires `event_name`.
10564
10588
  ************************************************************/
10565
10589
  function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
@@ -10577,10 +10601,7 @@ function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
10577
10601
  "aria-label": (0, i18next.t)(label_key),
10578
10602
  "data-i18n-aria-label": label_key
10579
10603
  },
10580
- ["i", {
10581
- style: "font-size:1.5em; color:inherit;" + (extra_style || ""),
10582
- class: icon
10583
- }],
10604
+ yui_graph_icon(icon, extra_style),
10584
10605
  { click: (evt) => {
10585
10606
  evt.stopPropagation();
10586
10607
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, event_name, { evt }, gobj);
@@ -11673,7 +11694,7 @@ function make_toolbar$5(gobj) {
11673
11694
  [$find_input, [
11674
11695
  "span",
11675
11696
  { class: "icon is-left" },
11676
- [["i", { class: "yi-magnifying-glass" }]]
11697
+ [yui_graph_icon("yi-magnifying-glass")]
11677
11698
  ]]
11678
11699
  ]);
11679
11700
  attach_clear($find_control, $find_input);
@@ -18115,7 +18136,7 @@ function make_find_items(gobj) {
18115
18136
  [$find_input, [
18116
18137
  "span",
18117
18138
  { class: "icon is-left" },
18118
- [["i", { class: "yi-magnifying-glass" }]]
18139
+ [yui_graph_icon("yi-magnifying-glass")]
18119
18140
  ]]
18120
18141
  ]);
18121
18142
  attach_clear($find_control, $find_input);
@@ -62082,10 +62103,7 @@ function node_shape_items(gobj, wide) {
62082
62103
  "data-i18n-aria-label": key,
62083
62104
  "aria-pressed": "false"
62084
62105
  },
62085
- ["i", {
62086
- style: "font-size:1.5em; color:inherit;",
62087
- class: NODE_MODE_ICONS[mode]
62088
- }],
62106
+ yui_graph_icon(NODE_MODE_ICONS[mode]),
62089
62107
  { click: (evt) => {
62090
62108
  evt.stopPropagation();
62091
62109
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_SET_NODE_MODE", { node_mode: mode }, gobj);
@@ -62107,10 +62125,7 @@ function node_shape_items(gobj, wide) {
62107
62125
  "data-i18n-aria-label": "node labels",
62108
62126
  "aria-pressed": "false"
62109
62127
  },
62110
- ["i", {
62111
- style: "font-size:1.5em; color:inherit;",
62112
- class: "yi-font"
62113
- }],
62128
+ yui_graph_icon("yi-font"),
62114
62129
  { click: (evt) => {
62115
62130
  evt.stopPropagation();
62116
62131
  (0, _yuneta_gobj_js.gobj_send_event)(gobj, "EV_TOGGLE_NODE_LABELS", {}, gobj);
@@ -62204,7 +62219,7 @@ function make_toolbar(gobj) {
62204
62219
  [
62205
62220
  "button",
62206
62221
  { class: "GRAPH_REFRESH button" },
62207
- [["i", { class: "yi-arrows-rotate" }], [
62222
+ [yui_graph_icon("yi-arrows-rotate"), [
62208
62223
  "span",
62209
62224
  {
62210
62225
  class: "is-hidden-mobile",
@@ -62229,7 +62244,7 @@ function make_toolbar(gobj) {
62229
62244
  "data-i18n-title": "raw json",
62230
62245
  "data-i18n-aria-label": "raw json"
62231
62246
  },
62232
- [["i", { class: "yi-eye" }], [
62247
+ [yui_graph_icon("yi-eye"), [
62233
62248
  "span",
62234
62249
  {
62235
62250
  class: "is-hidden-mobile",
@@ -62274,7 +62289,7 @@ function make_toolbar(gobj) {
62274
62289
  [$find_input, [
62275
62290
  "span",
62276
62291
  { class: "icon is-left" },
62277
- [["i", { class: "yi-magnifying-glass" }]]
62292
+ [yui_graph_icon("yi-magnifying-glass")]
62278
62293
  ]]
62279
62294
  ]);
62280
62295
  attach_clear($find_control, $find_input);
@@ -63243,9 +63258,9 @@ function ac_set_operation_mode(gobj, event, kw, src) {
63243
63258
  * card's graph icon travels — as EV_TOPIC_SELECTED, which the host turns
63244
63259
  * into the URL, so what you are looking at stays linkable.
63245
63260
  ************************************************************/
63246
- var LEGEND_GLYPH_STYLE = "font-size:1.5em; line-height:1; color:inherit;";
63247
- var LEGEND_NAME_STYLE = "font-size:1.2em; line-height:1.2;";
63248
- var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:1em;";
63261
+ var LEGEND_GLYPH_STYLE = `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;`;
63262
+ var LEGEND_NAME_STYLE = "font-size:1rem; line-height:1.2;";
63263
+ var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem;";
63249
63264
  function refresh_legend(gobj) {
63250
63265
  let priv = gobj.priv;
63251
63266
  let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
@@ -63418,7 +63433,7 @@ function refresh_legend(gobj) {
63418
63433
  "div",
63419
63434
  {
63420
63435
  class: "GRAPH_LEGEND_CHIP buttons has-addons",
63421
- style: "margin:0; flex:0 0 auto; flex-wrap:nowrap;"
63436
+ style: "margin:0; flex:0 0 auto; flex-wrap:nowrap; align-items:stretch;"
63422
63437
  },
63423
63438
  [$body].concat(extras.map((spec) => (0, _yuneta_gobj_js.createElement2)(spec)))
63424
63439
  ]);
@@ -10555,6 +10555,30 @@ function getPointPosition(count, index, margin = .2) {
10555
10555
  * All Rights Reserved.
10556
10556
  ***********************************************************************/
10557
10557
  /************************************************************
10558
+ * ONE size for every glyph of a graph's toolbar ROW, in
10559
+ * `rem` and not `em`.
10560
+ *
10561
+ * In `em` the same declaration draws three different icons:
10562
+ * `1.5em` is 24px inside a plain button, 18px inside an
10563
+ * `is-small` one, and a labelled button left its icon at the
10564
+ * inherited 16px -- so one row held 16px, 18px and 24px
10565
+ * glyphs and looked like three toolbars pushed together.
10566
+ * `rem` is measured against the page, so a chip that is
10567
+ * deliberately shorter than a button still carries the same
10568
+ * glyph.
10569
+ *
10570
+ * 20px against the row's 16px text: an icon-only button is
10571
+ * legible at half its 40px height, and beside a label the
10572
+ * glyph reads as a marker rather than as a second word.
10573
+ ************************************************************/
10574
+ var YUI_GRAPH_ICON_SIZE = "1.25rem";
10575
+ function yui_graph_icon(icon_class, extra_style) {
10576
+ return ["i", {
10577
+ class: icon_class,
10578
+ style: `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;` + (extra_style || "")
10579
+ }];
10580
+ }
10581
+ /************************************************************
10558
10582
  * One icon button that fires `event_name`.
10559
10583
  ************************************************************/
10560
10584
  function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
@@ -10572,10 +10596,7 @@ function camera_button(gobj, icon, event_name, label_key, wide, extra_style) {
10572
10596
  "aria-label": t(label_key),
10573
10597
  "data-i18n-aria-label": label_key
10574
10598
  },
10575
- ["i", {
10576
- style: "font-size:1.5em; color:inherit;" + (extra_style || ""),
10577
- class: icon
10578
- }],
10599
+ yui_graph_icon(icon, extra_style),
10579
10600
  { click: (evt) => {
10580
10601
  evt.stopPropagation();
10581
10602
  gobj_send_event(gobj, event_name, { evt }, gobj);
@@ -11668,7 +11689,7 @@ function make_toolbar$5(gobj) {
11668
11689
  [$find_input, [
11669
11690
  "span",
11670
11691
  { class: "icon is-left" },
11671
- [["i", { class: "yi-magnifying-glass" }]]
11692
+ [yui_graph_icon("yi-magnifying-glass")]
11672
11693
  ]]
11673
11694
  ]);
11674
11695
  attach_clear($find_control, $find_input);
@@ -18110,7 +18131,7 @@ function make_find_items(gobj) {
18110
18131
  [$find_input, [
18111
18132
  "span",
18112
18133
  { class: "icon is-left" },
18113
- [["i", { class: "yi-magnifying-glass" }]]
18134
+ [yui_graph_icon("yi-magnifying-glass")]
18114
18135
  ]]
18115
18136
  ]);
18116
18137
  attach_clear($find_control, $find_input);
@@ -62077,10 +62098,7 @@ function node_shape_items(gobj, wide) {
62077
62098
  "data-i18n-aria-label": key,
62078
62099
  "aria-pressed": "false"
62079
62100
  },
62080
- ["i", {
62081
- style: "font-size:1.5em; color:inherit;",
62082
- class: NODE_MODE_ICONS[mode]
62083
- }],
62101
+ yui_graph_icon(NODE_MODE_ICONS[mode]),
62084
62102
  { click: (evt) => {
62085
62103
  evt.stopPropagation();
62086
62104
  gobj_send_event(gobj, "EV_SET_NODE_MODE", { node_mode: mode }, gobj);
@@ -62102,10 +62120,7 @@ function node_shape_items(gobj, wide) {
62102
62120
  "data-i18n-aria-label": "node labels",
62103
62121
  "aria-pressed": "false"
62104
62122
  },
62105
- ["i", {
62106
- style: "font-size:1.5em; color:inherit;",
62107
- class: "yi-font"
62108
- }],
62123
+ yui_graph_icon("yi-font"),
62109
62124
  { click: (evt) => {
62110
62125
  evt.stopPropagation();
62111
62126
  gobj_send_event(gobj, "EV_TOGGLE_NODE_LABELS", {}, gobj);
@@ -62199,7 +62214,7 @@ function make_toolbar(gobj) {
62199
62214
  [
62200
62215
  "button",
62201
62216
  { class: "GRAPH_REFRESH button" },
62202
- [["i", { class: "yi-arrows-rotate" }], [
62217
+ [yui_graph_icon("yi-arrows-rotate"), [
62203
62218
  "span",
62204
62219
  {
62205
62220
  class: "is-hidden-mobile",
@@ -62224,7 +62239,7 @@ function make_toolbar(gobj) {
62224
62239
  "data-i18n-title": "raw json",
62225
62240
  "data-i18n-aria-label": "raw json"
62226
62241
  },
62227
- [["i", { class: "yi-eye" }], [
62242
+ [yui_graph_icon("yi-eye"), [
62228
62243
  "span",
62229
62244
  {
62230
62245
  class: "is-hidden-mobile",
@@ -62269,7 +62284,7 @@ function make_toolbar(gobj) {
62269
62284
  [$find_input, [
62270
62285
  "span",
62271
62286
  { class: "icon is-left" },
62272
- [["i", { class: "yi-magnifying-glass" }]]
62287
+ [yui_graph_icon("yi-magnifying-glass")]
62273
62288
  ]]
62274
62289
  ]);
62275
62290
  attach_clear($find_control, $find_input);
@@ -63238,9 +63253,9 @@ function ac_set_operation_mode(gobj, event, kw, src) {
63238
63253
  * card's graph icon travels — as EV_TOPIC_SELECTED, which the host turns
63239
63254
  * into the URL, so what you are looking at stays linkable.
63240
63255
  ************************************************************/
63241
- var LEGEND_GLYPH_STYLE = "font-size:1.5em; line-height:1; color:inherit;";
63242
- var LEGEND_NAME_STYLE = "font-size:1.2em; line-height:1.2;";
63243
- var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:1em;";
63256
+ var LEGEND_GLYPH_STYLE = `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;`;
63257
+ var LEGEND_NAME_STYLE = "font-size:1rem; line-height:1.2;";
63258
+ var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem;";
63244
63259
  function refresh_legend(gobj) {
63245
63260
  let priv = gobj.priv;
63246
63261
  let $container = gobj_read_attr(gobj, "$container");
@@ -63413,7 +63428,7 @@ function refresh_legend(gobj) {
63413
63428
  "div",
63414
63429
  {
63415
63430
  class: "GRAPH_LEGEND_CHIP buttons has-addons",
63416
- style: "margin:0; flex:0 0 auto; flex-wrap:nowrap;"
63431
+ style: "margin:0; flex:0 0 auto; flex-wrap:nowrap; align-items:stretch;"
63417
63432
  },
63418
63433
  [$body].concat(extras.map((spec) => createElement2(spec)))
63419
63434
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.85",
3
+ "version": "7.23.86",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -62,6 +62,7 @@ import {
62
62
  yui_graph_update_anchor,
63
63
  yui_graph_center_on,
64
64
  yui_graph_fold_items,
65
+ yui_graph_icon,
65
66
  yui_graph_refresh_item,
66
67
  yui_graph_update_zoom,
67
68
  } from "./yui_graph_camera.js";
@@ -906,7 +907,7 @@ function make_find_items(gobj)
906
907
  style: 'margin-left:.5rem; margin-right:.5rem; ' +
907
908
  'max-width:12rem; min-width:7rem;'}, [
908
909
  $find_input,
909
- ['span', {class: 'icon is-left'}, [['i', {class: 'yi-magnifying-glass'}]]]
910
+ ['span', {class: 'icon is-left'}, [yui_graph_icon('yi-magnifying-glass')]]
910
911
  ]]);
911
912
  attach_clear($find_control, $find_input);
912
913
 
@@ -57,6 +57,7 @@ import {
57
57
  yui_graph_place_at,
58
58
  yui_graph_viewport_of,
59
59
  yui_graph_fold_items,
60
+ yui_graph_icon,
60
61
  yui_graph_refresh_item,
61
62
  yui_graph_update_zoom,
62
63
  } from "./yui_graph_camera.js";
@@ -585,7 +586,7 @@ function make_toolbar(gobj)
585
586
  ['div', {class: 'JSON_GRAPH_FIND control has-icons-left',
586
587
  style: 'margin-right:.5rem; max-width:12rem; min-width:7rem;'}, [
587
588
  $find_input,
588
- ['span', {class: 'icon is-left'}, [['i', {class: 'yi-magnifying-glass'}]]]
589
+ ['span', {class: 'icon is-left'}, [yui_graph_icon('yi-magnifying-glass')]]
589
590
  ]]);
590
591
  attach_clear($find_control, $find_input);
591
592
 
@@ -82,7 +82,11 @@ import {
82
82
  import {yui_toolbar} from "./yui_toolbar.js";
83
83
  import {attach_clear} from "./yui_inputs.js";
84
84
  import {register_c_g6_nodes_tree} from "./c_g6_nodes_tree.js";
85
- import {yui_graph_fold_items} from "./yui_graph_camera.js";
85
+ import {
86
+ yui_graph_fold_items,
87
+ yui_graph_icon,
88
+ YUI_GRAPH_ICON_SIZE,
89
+ } from "./yui_graph_camera.js";
86
90
  import {
87
91
  removeChildElements,
88
92
  disableElements,
@@ -574,7 +578,7 @@ function node_shape_items(gobj, wide)
574
578
  title: t(key), 'data-i18n-title': key,
575
579
  'aria-label': t(key), 'data-i18n-aria-label': key,
576
580
  'aria-pressed': 'false'},
577
- ['i', {style: 'font-size:1.5em; color:inherit;', class: NODE_MODE_ICONS[mode]}],
581
+ yui_graph_icon(NODE_MODE_ICONS[mode]),
578
582
  {
579
583
  click: (evt) => {
580
584
  evt.stopPropagation();
@@ -591,7 +595,7 @@ function node_shape_items(gobj, wide)
591
595
  title: t('node labels'), 'data-i18n-title': 'node labels',
592
596
  'aria-label': t('node labels'), 'data-i18n-aria-label': 'node labels',
593
597
  'aria-pressed': 'false'},
594
- ['i', {style: 'font-size:1.5em; color:inherit;', class: 'yi-font'}],
598
+ yui_graph_icon('yi-font'),
595
599
  {
596
600
  click: (evt) => {
597
601
  evt.stopPropagation();
@@ -693,7 +697,7 @@ function make_toolbar(gobj)
693
697
  }],
694
698
 
695
699
  ['button', {class: 'GRAPH_REFRESH button'}, [
696
- ['i', {class: 'yi-arrows-rotate'}],
700
+ yui_graph_icon('yi-arrows-rotate'),
697
701
  ['span', {class: 'is-hidden-mobile', style: 'padding-left:5px;', i18n: 'refresh'}, 'refresh']
698
702
  ], {
699
703
  click: (evt) => {
@@ -718,7 +722,7 @@ function make_toolbar(gobj)
718
722
  ['button', {class: 'button ml-2 TREEDB_JSON_BTN',
719
723
  title: t('raw json'), 'aria-label': t('raw json'),
720
724
  'data-i18n-title': 'raw json', 'data-i18n-aria-label': 'raw json'}, [
721
- ['i', {class: 'yi-eye'}],
725
+ yui_graph_icon('yi-eye'),
722
726
  ['span', {class: 'is-hidden-mobile', style: 'padding-left:5px;', i18n: 'raw json'}, 'raw json']
723
727
  ], {
724
728
  click: (evt) => {
@@ -775,7 +779,7 @@ function make_toolbar(gobj)
775
779
  ['div', {class: 'GRAPH_FIND control has-icons-left',
776
780
  style: 'margin-right:.5rem; max-width:12rem; min-width:7rem;'}, [
777
781
  $find_input,
778
- ['span', {class: 'icon is-left'}, [['i', {class: 'yi-magnifying-glass'}]]]
782
+ ['span', {class: 'icon is-left'}, [yui_graph_icon('yi-magnifying-glass')]]
779
783
  ]]);
780
784
  attach_clear($find_control, $find_input);
781
785
 
@@ -2453,19 +2457,20 @@ function ac_set_operation_mode(gobj, event, kw, src)
2453
2457
  * card's graph icon travels — as EV_TOPIC_SELECTED, which the host turns
2454
2458
  * into the URL, so what you are looking at stays linkable.
2455
2459
  ************************************************************/
2456
- /* The glyphs of a chip's small buttons: `is-small` sets a 0.75rem
2457
- * font and a star or a crosshair at that size is a speck. The BUTTON
2458
- * stays small so the strip keeps its height; the glyph inside grows. */
2459
- const LEGEND_GLYPH_STYLE = 'font-size:1.5em; line-height:1; color:inherit;';
2460
-
2461
- /* And the same for what a chip SAYS. The legend is a layer control --
2462
- * a gadget somebody uses, not a footnote somebody glances at -- and a
2463
- * topic name is the thing it is read for, so 0.75rem is the wrong
2464
- * size for it. The button stays `is-small` because the strip has to
2465
- * hold a chip per topic on one row; the name and the count come back
2466
- * up inside it, exactly as the glyphs did. */
2467
- const LEGEND_NAME_STYLE = 'font-size:1.2em; line-height:1.2;';
2468
- const LEGEND_COUNT_STYLE = 'margin-left:.4rem; font-size:1em;';
2460
+ /* The legend is the strip UNDER the toolbar, and the two are read as
2461
+ * one thing: what they say has to be the same size, or the lower one
2462
+ * reads as a footnote to the upper. `is-small` earns its place in the
2463
+ * PADDING -- a chip per topic has to fit on one row -- and nowhere
2464
+ * else, so the text and the glyphs are given back in `rem`, which is
2465
+ * measured against the page instead of against the 0.75rem the class
2466
+ * sets. In `em` they were 18px and 14.4px against the toolbar's 24px
2467
+ * and 16px: three sizes in two strips.
2468
+ *
2469
+ * The count is the one deliberate step down: it is the number beside
2470
+ * the name, not the name. */
2471
+ const LEGEND_GLYPH_STYLE = `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;`;
2472
+ const LEGEND_NAME_STYLE = 'font-size:1rem; line-height:1.2;';
2473
+ const LEGEND_COUNT_STYLE = 'margin-left:.4rem; font-size:.875rem;';
2469
2474
 
2470
2475
  /* The focused chip is HIGHLIGHTED, not pressed. The body of a chip is
2471
2476
  * the show/hide toggle, and that is what its `aria-pressed` says;
@@ -2653,8 +2658,15 @@ function refresh_legend(gobj)
2653
2658
  }
2654
2659
 
2655
2660
  let $chip = createElement2(
2661
+ /* `align-items: stretch`: Bulma's `.buttons` centres its
2662
+ * children, so the star and the crosshair -- a glyph and
2663
+ * nothing else -- stood 20px tall beside a 30px chip body
2664
+ * that carries a swatch, a name and a count. In a
2665
+ * `has-addons` group that reads as three buttons of three
2666
+ * heights welded together. */
2656
2667
  ['div', {class: 'GRAPH_LEGEND_CHIP buttons has-addons',
2657
- style: 'margin:0; flex:0 0 auto; flex-wrap:nowrap;'},
2668
+ style: 'margin:0; flex:0 0 auto; flex-wrap:nowrap; ' +
2669
+ 'align-items:stretch;'},
2658
2670
  [$body].concat(extras.map((spec) => createElement2(spec)))]
2659
2671
  );
2660
2672
  $legend.appendChild($chip);
@@ -42,6 +42,35 @@ import {t} from "i18next";
42
42
  import {set_pressed_state} from "./lib_graph.js";
43
43
 
44
44
 
45
+ /************************************************************
46
+ * ONE size for every glyph of a graph's toolbar ROW, in
47
+ * `rem` and not `em`.
48
+ *
49
+ * In `em` the same declaration draws three different icons:
50
+ * `1.5em` is 24px inside a plain button, 18px inside an
51
+ * `is-small` one, and a labelled button left its icon at the
52
+ * inherited 16px -- so one row held 16px, 18px and 24px
53
+ * glyphs and looked like three toolbars pushed together.
54
+ * `rem` is measured against the page, so a chip that is
55
+ * deliberately shorter than a button still carries the same
56
+ * glyph.
57
+ *
58
+ * 20px against the row's 16px text: an icon-only button is
59
+ * legible at half its 40px height, and beside a label the
60
+ * glyph reads as a marker rather than as a second word.
61
+ ************************************************************/
62
+ export const YUI_GRAPH_ICON_SIZE = "1.25rem";
63
+
64
+ /* The `<i>` spec of a toolbar glyph, at that one size. */
65
+ export function yui_graph_icon(icon_class, extra_style)
66
+ {
67
+ return ['i', {
68
+ class: icon_class,
69
+ style: `font-size:${YUI_GRAPH_ICON_SIZE}; line-height:1; color:inherit;` +
70
+ (extra_style || ''),
71
+ }];
72
+ }
73
+
45
74
  /************************************************************
46
75
  * One icon button that fires `event_name`.
47
76
  ************************************************************/
@@ -51,8 +80,7 @@ function camera_button(gobj, icon, event_name, label_key, wide, extra_style)
51
80
  style: {height: wide, width: '2.5em'},
52
81
  title: t(label_key), 'data-i18n-title': label_key,
53
82
  'aria-label': t(label_key), 'data-i18n-aria-label': label_key},
54
- ['i', {style: 'font-size:1.5em; color:inherit;' + (extra_style || ''),
55
- class: icon}],
83
+ yui_graph_icon(icon, extra_style),
56
84
  {
57
85
  click: (evt) => {
58
86
  evt.stopPropagation();