<commit_before>/* global vg */
import React from 'react';

const Wp10Graph = React.createClass({
  displayName: 'Wp10Graph',

  propTypes: {
    article: React.PropTypes.object
  },

  getInitialState() {
    return { showGraph: false };
  },

  showGraph() {
    this.setState({ showGraph: true });
  },

  hideGraph() {
    this.setState({ showGraph: false });
  },

  graphId() {
    return `vega-graph-${this.props.article.id}`;
  },

  renderGraph() {
    this.showGraph();
    const articleId = this.props.article.id;
    const vlSpec = {
      // TODO: get data from json endpoint
      data: { url: `http://localhost:3000/articles/${articleId}.json` },
      mark: 'circle',
      encoding: {
        x: {
          field: 'date',
          timeUnite: 'day',
          type: 'temporal'
        },
        y: {
          field: 'wp10',
          type: 'quantitative'<commit_msg>Fix data url in vega graph<commit_after>/* global vg */
import React from 'react';

const Wp10Graph = React.createClass({
  displayName: 'Wp10Graph',

  propTypes: {
    article: React.PropTypes.object
  },

  getInitialState() {
    return { showGraph: false };
  },

  showGraph() {
    this.setState({ showGraph: true });
  },

  hideGraph() {
    this.setState({ showGraph: false });
  },

  graphId() {
    return `vega-graph-${this.props.article.id}`;
  },

  renderGraph() {
    this.showGraph();
    const articleId = this.props.article.id;
    const vlSpec = {
      // TODO: get data from json endpoint
      data: { url: `/articles/${articleId}.json` },
      mark: 'circle',
      encoding: {
        x: {
          field: 'date',
          timeUnite: 'day',
          type: 'temporal'
        },
        y: {
          field: 'wp10',
          type: 'quantitative'
{'fraction_non_alphanumeric': 0.1543700340522134, 'fraction_numerical': 0.009080590238365494, 'mean_word_length': 2.228937728937729, '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': '4226953', 'n_tokens_mistral': 589, 'n_tokens_neox': 571, 'n_words': 126}