blob: 74203911e3eaab157e7ce18b5010e9b426aa5aaf [file] [log] [blame]
import { createEncoderFactory, Encoder, DeriveEncoding } from 'encodable';
export type BoxPlotEncodingConfig = {
x: ['XBand', number];
y: ['YBand', number];
color: ['Color', string];
};
export const boxPlotEncoderFactory = createEncoderFactory<BoxPlotEncodingConfig>({
channelTypes: {
x: 'XBand',
y: 'YBand',
color: 'Color',
},
defaultEncoding: {
x: { field: 'x', type: 'nominal' },
y: { field: 'y', type: 'quantitative' },
color: { value: '#222' },
},
});
export type BoxPlotEncoding = DeriveEncoding<BoxPlotEncodingConfig>;
export type BoxPlotEncoder = Encoder<BoxPlotEncodingConfig>;