<commit_before>import React from 'react';

import { Config } from 'vega-lite';

import FooterChart from './FooterChart';

export interface Props {
  data: any[],
  config?: Config,
  x?: string,
  y?: string,
  duration?: number,
  height?: number,
}

export default function FlushLineChart(props: Props) {
  if (props.data.length === 0) {
    return null;
  }

  const x = props.x || 'time';
  const y = props.y || 'val';
  const spec = {
    mark: {
      type: 'area' as const,
      line: {
        color: '#fab700',
        strokeWidth: 1,
      },
      color: 'rgba(250, 183, 0, 0.15)',
    },
    transform: [
      {
        calculate: `max(datum.${y}, 0)`,
        as: y,
      },
      {
        impute: y,
        key: x,
        keyvals: {
          start: 0,
          stop: props.duration || Math.max.apply(null, props.data.map((obj: any) => obj[x])),
        },
        method: 'value' as const,
        value: 0,<commit_msg>flush line chart now uses integer keys for impute<commit_after>import React from 'react';

import { Config } from 'vega-lite';

import FooterChart from './FooterChart';

export interface Props {
  data: any[],
  config?: Config,
  x?: string,
  y?: string,
  duration?: number,
  height?: number,
}

export default function FlushLineChart(props: Props) {
  if (props.data.length === 0) {
    return null;
  }

  const x = props.x || 'time';
  const y = props.y || 'val';

  const spec = {
    mark: {
      type: 'area' as const,
      line: {
        color: '#fab700',
        strokeWidth: 1,
      },
      color: 'rgba(250, 183, 0, 0.15)',
    },
    transform: [
      {
        calculate: `max(datum.${y}, 0)`,
        as: y,
      },
      {
        impute: y,
        key: x,
        keyvals: {
          start: 0,
          stop: props.duration ? Math.ceil(props.duration) : Math.max.apply(null, props.data.map((obj: any) => obj[x])),
        },
        method: 'value' as const,
        value: 0,
{'fraction_non_alphanumeric': 0.1593011305241521, 'fraction_numerical': 0.018499486125385406, 'mean_word_length': 2.061320754716981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6946474', 'n_tokens_mistral': 698, 'n_tokens_neox': 666, 'n_words': 182}