mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Core: classify spec data blocks by Vega-Lite fidelity (spec-data) for dataset refs
This commit is contained in:
@@ -203,6 +203,26 @@ describe('prepareSpecForRender — dataset resolution (spec §04 Rendering Contr
|
||||
expect(out.data).toEqual({ name: 'local' });
|
||||
});
|
||||
|
||||
test('native Vega-Lite data with a name label is left untouched (not resolved, never throws)', () => {
|
||||
// A name on inline/url data, or a generator, is native Vega-Lite — even when
|
||||
// the name is absent from the library. Resolution must not touch or reject it.
|
||||
const inline = { data: { name: 'pts', values: [{ a: 1 }] }, mark: 'point' };
|
||||
expect(prepareSpecForRender(inline, { datasets }).data).toEqual({
|
||||
name: 'pts',
|
||||
values: [{ a: 1 }],
|
||||
});
|
||||
const url = { data: { name: 'remote', url: 'https://x/y.csv' } };
|
||||
expect(prepareSpecForRender(url, { datasets }).data).toEqual({
|
||||
name: 'remote',
|
||||
url: 'https://x/y.csv',
|
||||
});
|
||||
const gen = { data: { name: 'seq', sequence: { start: 0, stop: 5 } } };
|
||||
expect(prepareSpecForRender(gen, { datasets }).data).toEqual({
|
||||
name: 'seq',
|
||||
sequence: { start: 0, stop: 5 },
|
||||
});
|
||||
});
|
||||
|
||||
test('resolution runs before fit-mode: a ref + fit mode produce both transforms', () => {
|
||||
const spec = { data: { name: 'JsonDs' }, mark: 'bar' };
|
||||
const out = prepareSpecForRender(spec, { datasets, fitMode: 'full' }) as unknown as {
|
||||
|
||||
Reference in New Issue
Block a user