@elyra/canvas 12.23.0 → 12.23.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyra/canvas",
3
- "version": "12.23.0",
3
+ "version": "12.23.1",
4
4
  "description": "Elyra common-canvas",
5
5
  "main": "dist/common-canvas.js",
6
6
  "module": "dist/common-canvas.es.js",
@@ -333,6 +333,16 @@ $link-highlight-color: $support-04;
333
333
  }
334
334
  }
335
335
 
336
+ .d3-label-multi-line-entry {
337
+ white-space: pre-wrap;
338
+ word-wrap: normal;
339
+ word-break: break-word;
340
+
341
+ & .d3-label-full {
342
+ display: inline-block;
343
+ }
344
+ }
345
+
336
346
  .d3-label-center {
337
347
  text-align: center;
338
348
  }
@@ -743,8 +743,17 @@ export default class SVGCanvasRenderer {
743
743
  // Returns the current mouse position based on the D3 SVG selection object
744
744
  // passed in.
745
745
  getMousePos(d3Event, svgSel) {
746
- const mousePos = d3.pointer(d3Event, svgSel.node());
747
- return { x: mousePos[0], y: mousePos[1] };
746
+ // The d3Event must have either a sourceEvent or be an actual event, which
747
+ // can be indicated by the existence of a pageX attribute. This test is only
748
+ // necessary on Firefox and then only when the action (such as zoom)
749
+ // calling this function is itself called programmatically - for example,
750
+ // when the user clicks one of the zoom buttons on the toolbar. It's not
751
+ // clear why d3.pointer cannot handle all events like it can on Chrome.
752
+ if (d3Event.sourceEvent || d3Event.pageX) {
753
+ const mousePos = d3.pointer(d3Event, svgSel.node());
754
+ return { x: mousePos[0], y: mousePos[1] };
755
+ }
756
+ return { x: 0, y: 0 };
748
757
  }
749
758
 
750
759
  // Convert coordinates from the page (based on the page top left corner) to
@@ -37,7 +37,7 @@ export default class SvgCanvasDecs {
37
37
  }
38
38
 
39
39
  getDecLabelTextAreaClass(dec) {
40
- const lineTypeClass = dec.label_single_line ? " d3-label-single-line" : " d3-label-multi-line";
40
+ const lineTypeClass = dec.label_single_line ? " d3-label-single-line" : " d3-label-multi-line-entry";
41
41
  const justificationClass = dec.label_align === "center" ? " d3-label-center" : "";
42
42
  return "d3-dec-label-entry" + lineTypeClass + justificationClass;
43
43
  }
@@ -82,7 +82,7 @@ const portsHorizontalDefaultLayout = {
82
82
 
83
83
  // Width and height for label decorators
84
84
  decoratorLabelWidth: 80,
85
- decoratorLabelHeight: 15,
85
+ decoratorLabelHeight: 30,
86
86
 
87
87
  // Display drop shadow under and round the nodes
88
88
  dropShadow: true,
@@ -294,7 +294,7 @@ const portsHorizontalDefaultLayout = {
294
294
 
295
295
  // Width and height for label decorators
296
296
  linkDecoratorLabelWidth: 80,
297
- linkDecoratorLabelHeight: 15,
297
+ linkDecoratorLabelHeight: 30,
298
298
 
299
299
  // Values for drawing connectors. wrapAroundSpacing and
300
300
  // wrapAroundNodePadding are used when curved connectors are drawn all the
@@ -473,7 +473,7 @@ const portsVerticalDefaultLayout = {
473
473
 
474
474
  // Width and height for label decorators
475
475
  decoratorLabelWidth: 80,
476
- decoratorLabelHeight: 15,
476
+ decoratorLabelHeight: 30,
477
477
 
478
478
  // Display drop shadow under and round the nodes
479
479
  dropShadow: false,
@@ -685,7 +685,7 @@ const portsVerticalDefaultLayout = {
685
685
 
686
686
  // Width and height for label decorators
687
687
  linkDecoratorLabelWidth: 80,
688
- linkDecoratorLabelHeight: 15,
688
+ linkDecoratorLabelHeight: 30,
689
689
 
690
690
  // Values for drawing connectors. wrapAroundSpacing and
691
691
  // wrapAroundNodePadding are used when curved connectors are drawn all the