BarData
It looks like BarData is defined to be allowed to take either number or string array for x. However, bar plot needs to take a categorical variable only for x axis and numeric variable for y (of course, the flipped bar plot is the other way around):
https://github.com/xability/maidr-ts/blob/c0c42b2177192679b4d7d07ed86d84c4478651ba/src/plot/grammar.ts#L14-L22
Shouldn't we restrict the type of x to be string array only for bar plot?
LineData
Although numeric variable is possible for x variable, date variable is a typical use case for x axis in line plot. Shouldn't we allow date variable for x axis in line plot? I know, date is a subtype of number, but it would be more intuitive to allow date variable for x axis in line plot for better manipulation.
https://github.com/xability/maidr-ts/blob/c0c42b2177192679b4d7d07ed86d84c4478651ba/src/plot/grammar.ts#L24-L30
BarData
It looks like BarData is defined to be allowed to take either number or string array for x. However, bar plot needs to take a categorical variable only for x axis and numeric variable for y (of course, the flipped bar plot is the other way around):
https://github.com/xability/maidr-ts/blob/c0c42b2177192679b4d7d07ed86d84c4478651ba/src/plot/grammar.ts#L14-L22
Shouldn't we restrict the type of x to be string array only for bar plot?
LineData
Although numeric variable is possible for x variable, date variable is a typical use case for x axis in line plot. Shouldn't we allow date variable for x axis in line plot? I know, date is a subtype of number, but it would be more intuitive to allow date variable for x axis in line plot for better manipulation.
https://github.com/xability/maidr-ts/blob/c0c42b2177192679b4d7d07ed86d84c4478651ba/src/plot/grammar.ts#L24-L30