Type definitions: Data.Table1NF type definition doesn't match documentation

This issue has been tracked since 2021-10-18.

The doc says that data can be specified by records, which I believe is referred to as Table1NF in the type definitions (at least based on the keys in that type)

let data = {
  series: [
    { name: 'Genres', type: 'dimension' },
    { name: 'Types', type: 'dimension' },
    { name: 'Popularity', type: 'measure' }
  records: [
    ['Pop', 'Hard', 114],
    ['Rock', 'Hard', 96],
    ['Jazz', 'Hard', 78],
    ['Metal', 'Hard', 52],
    ['Pop', 'Smooth', 56],
    ['Rock', 'Smooth', 36],
    ['Jazz', 'Smooth', 174],
    ['Metal', 'Smooth', 121],
    ['Pop', 'Experimental', 127],
    ['Rock', 'Experimental', 83],
    ['Jazz', 'Experimental', 94],
    ['Metal', 'Experimental', 58],

The type definition however requires that values must be set on the items of the series object. I believe type has been solved in #12 but that still means that values are required where they shouldn't be, according to the docs.

// comments stripped
interface SeriesMetaInfo
	name: string;
	type?: 'dimension'|'measure'; 

// [...]

interface Series extends SeriesMetaInfo {
  values: Values;

// [...]

interface Table1NF extends Filter {
  series?: Series[];
  records?: string[][];

I find the Table1NF naming confusing here, but I assume this is supposed to be a union type of the 'by series' and 'by records' specification of data. I don't think there is an elegant way around registering a separate interface for each of those.

I'll submit a PR soon.

simzer wrote this answer on 2021-10-18

Merged, thanks!

More Details About Repo
Owner Name vizzuhq
Repo Name vizzu-lib
Full Name vizzuhq/vizzu-lib
Language JavaScript
Created Date 2021-06-07
Updated Date 2022-11-22
Star Count 1630
Watcher Count 19
Fork Count 65
Issue Count 17


Issue Title Created Date Updated Date