<commit_before>import {Model} from './Model';
import {Channel} from '../channel';
import {isArray} from '../util';

export interface StackProperties {
  groupbyChannel: Channel;
  fieldChannel: Channel;
  stackChannels: Channel[]; // COLOR or DETAIL
  config: any;
}

// TODO: put all vega interface in one place
interface StackTransform {
  type: string;
  offset?: any;
  groupby: any;
  field: any;
  sortby: any;
  output: any;
}

// impute data for stacked area
export function imputeTransform(model: Model) {
  const stack = model.stack();
  return {
    type: 'impute',
    field: model.field(stack.fieldChannel),
    groupby: [stack.stackChannels.map(function(c) { return model.field(c); })],
    orderby: [model.field(stack.groupbyChannel)],
    method: 'value',
    value: 0<commit_msg>fix typo bug<commit_after>import {Model} from './Model';
import {Channel} from '../channel';
import {isArray} from '../util';

export interface StackProperties {
  groupbyChannel: Channel;
  fieldChannel: Channel;
  stackChannels: Channel[]; // COLOR or DETAIL
  config: any;
}

// TODO: put all vega interface in one place
interface StackTransform {
  type: string;
  offset?: any;
  groupby: any;
  field: any;
  sortby: any;
  output: any;
}

// impute data for stacked area
export function imputeTransform(model: Model) {
  const stack = model.stack();
  return {
    type: 'impute',
    field: model.field(stack.fieldChannel),
    groupby: stack.stackChannels.map(function(c) { return model.field(c); }),
    orderby: [model.field(stack.groupbyChannel)],
    method: 'value',
    value: 0
{'fraction_non_alphanumeric': 0.13593455003146634, 'fraction_numerical': 0.0012586532410320957, 'mean_word_length': 3.953271028037383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5485790', 'n_tokens_mistral': 504, 'n_tokens_neox': 500, 'n_words': 151}