@micha.bigler/ui-core-micha 2.42.3 → 3.0.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/WORK_ORDERS.md +1 -0
- package/dev/entries.jsx +6 -0
- package/dist/components/charts/BarChart.js +24 -12
- package/dist/components/charts/ChartFrame.js +23 -5
- package/dist/components/charts/LineChart.js +24 -12
- package/dist/components/charts/ScatterChart.js +30 -22
- package/dist/components/charts/TimeSeriesChart.js +6 -1
- package/dist/components/charts/chartDefaults.js +263 -127
- package/docs/CHART-LAYOUT.md +140 -0
- package/package.json +1 -1
- package/src/components/charts/BarChart.jsx +31 -28
- package/src/components/charts/ChartFrame.jsx +24 -5
- package/src/components/charts/LineChart.jsx +32 -29
- package/src/components/charts/ScatterChart.jsx +38 -29
- package/src/components/charts/TimeSeriesChart.jsx +6 -1
- package/src/components/charts/chartDefaults.js +292 -133
- package/tests/BarChart.test.jsx +27 -39
- package/tests/LineChart.test.jsx +21 -24
- package/tests/ScatterChart.test.jsx +21 -24
- package/tests/chartDefaults.test.js +460 -265
- package/work-orders/UCM-CHART-12.md +348 -0
|
@@ -233,39 +233,36 @@ describe('ScatterReferenceCurve / ScatterReferenceLine (THEME-10)', () => {
|
|
|
233
233
|
});
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
-
// CHART-
|
|
237
|
-
|
|
236
|
+
// UCM-CHART-12: `size`/`height` resolution, wired through the actual component. Replaces the
|
|
237
|
+
// deleted `minHeight`/`aspect` CHART-8 trio.
|
|
238
|
+
describe('ScatterChart size/height resolution (UCM-CHART-12)', () => {
|
|
238
239
|
afterEach(() => { cleanup(); vi.clearAllMocks(); });
|
|
239
240
|
|
|
240
|
-
it(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
it.each([
|
|
242
|
+
['compact', 240],
|
|
243
|
+
['standard', 320],
|
|
244
|
+
['tall', 400],
|
|
245
|
+
])('resolves size="%s" to %ipx, on both the chart height and the wrapper', (size, px) => {
|
|
246
|
+
renderScatter({ size });
|
|
247
|
+
expect(scatterSpy.mock.calls.at(-1)[0].height).toBe(px);
|
|
248
|
+
expect(window.getComputedStyle(screen.getByTestId('scatter-chart-container')).height).toBe(`${px}px`);
|
|
244
249
|
});
|
|
245
250
|
|
|
246
|
-
it('
|
|
247
|
-
renderScatter({
|
|
248
|
-
expect(scatterSpy.mock.calls.at(-1)[0].height).
|
|
249
|
-
|
|
250
|
-
expect(style.minHeight).toBe('320px');
|
|
251
|
-
expect(style.aspectRatio).toBe('1.8 / 1');
|
|
251
|
+
it('lets height override size entirely, as the documented escape', () => {
|
|
252
|
+
renderScatter({ size: 'tall', height: 280 });
|
|
253
|
+
expect(scatterSpy.mock.calls.at(-1)[0].height).toBe(280);
|
|
254
|
+
expect(window.getComputedStyle(screen.getByTestId('scatter-chart-container')).height).toBe('280px');
|
|
252
255
|
});
|
|
253
256
|
|
|
254
|
-
it('
|
|
255
|
-
renderScatter({ minHeight:
|
|
256
|
-
expect(scatterSpy.mock.calls.at(-1)[0].height).toBe(380);
|
|
257
|
-
expect(window.getComputedStyle(screen.getByTestId('scatter-chart-container')).minHeight).toBe('380px');
|
|
257
|
+
it('throws in dev when a caller still passes minHeight, naming the replacement', () => {
|
|
258
|
+
expect(() => renderScatter({ minHeight: 300 })).toThrow(/size=.*standard.*tall/);
|
|
258
259
|
});
|
|
259
260
|
|
|
260
|
-
it('
|
|
261
|
-
renderScatter({
|
|
262
|
-
expect(scatterSpy.mock.calls.at(-1)[0].height).toBe(320);
|
|
263
|
-
expect(window.getComputedStyle(screen.getByTestId('scatter-chart-container')).minHeight).toBe('320px');
|
|
261
|
+
it('throws in dev when a caller still passes aspect, naming the removal', () => {
|
|
262
|
+
expect(() => renderScatter({ aspect: 1.8 })).toThrow(/aspect/);
|
|
264
263
|
});
|
|
265
264
|
|
|
266
|
-
it('
|
|
267
|
-
renderScatter({
|
|
268
|
-
expect(scatterSpy.mock.calls.at(-1)[0].height).toBe(280);
|
|
269
|
-
expect(window.getComputedStyle(screen.getByTestId('scatter-chart-container')).minHeight).toBe('auto');
|
|
265
|
+
it('throws in dev when a caller still passes margin, naming the removal', () => {
|
|
266
|
+
expect(() => renderScatter({ margin: { top: 1 } })).toThrow(/margin/);
|
|
270
267
|
});
|
|
271
268
|
});
|