@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.
- package/bundle/openbridge-webcomponents.bundle.js +55 -11
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +33 -3
- package/dist/building-blocks/chart-line/chart-line-base.d.ts +10 -2
- package/dist/building-blocks/chart-line/chart-line-base.d.ts.map +1 -1
- package/dist/building-blocks/chart-line/chart-line-base.js +27 -8
- package/dist/building-blocks/chart-line/chart-line-base.js.map +1 -1
- package/dist/charthelpers/chart-common.css.js +28 -3
- package/dist/charthelpers/chart-common.css.js.map +1 -1
- package/package.json +1 -1
|
@@ -42,11 +42,36 @@ canvas {
|
|
|
42
42
|
display: block;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/* Fixed aspect ratio scaling mode: canvas
|
|
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
|
-
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|