@oicl/openbridge-webcomponents 2.0.0-next.127 → 2.0.0-next.128

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.
@@ -42,11 +42,36 @@ canvas {
42
42
  display: block;
43
43
  }
44
44
 
45
- /* Fixed aspect ratio scaling mode: canvas fills wrapper */
45
+ /* Fixed aspect ratio scaling mode: the canvas container must be a definite
46
+ box, not shrink-to-fit. The wrapper is a column flex with align-items:
47
+ center, so the container would otherwise size to the canvas' max-content
48
+ width — and a canvas with an auto width and a definite height resolves
49
+ against its intrinsic 2:1 ratio, capping the chart at height * 2. */
46
50
 
47
- :host([fixedaspectratioscaling]) canvas {
51
+ :host([fixedaspectratioscaling]) .canvas-and-slots-container {
48
52
  width: 100%;
49
- height: var(--chart-height, auto);
53
+ }
54
+
55
+ /* Fixed aspect ratio scaling mode: canvas fills wrapper.
56
+
57
+ \`!important\` is load-bearing, not a shortcut. Chart.js measures the
58
+ container with getBoundingClientRect() — which is scaled by any ancestor
59
+ CSS \`zoom\` — and writes that number straight back as an inline
60
+ \`style="width/height: Npx"\`. The browser then scales that CSS-pixel value
61
+ by the same zoom a second time, so the canvas lands at zoom² of its cell
62
+ (64% at zoom 0.8, 156% at zoom 1.25). Overriding the inline style pins the
63
+ canvas to the box the layout actually gave it at every zoom level; Chart.js
64
+ keeps using its own measurement for the drawing buffer, which only affects
65
+ raster resolution, not geometry.
66
+
67
+ No auto margins here either: Chart.js subtracts the canvas' resolved
68
+ margins from the container width, so centring it with \`margin: 0 auto\`
69
+ makes the leftover space permanently unavailable to it. */
70
+
71
+ :host([fixedaspectratioscaling]) canvas {
72
+ width: 100% !important;
73
+ height: var(--chart-height, auto) !important;
74
+ margin: 0;
50
75
  }
51
76
  `;
52
77
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"chart-common.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"chart-common.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oicl/openbridge-webcomponents",
3
- "version": "2.0.0-next.127",
3
+ "version": "2.0.0-next.128",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",