<commit_before>import React from 'react';
import { connect } from 'react-redux';
import * as EditorActions from '../../../actions/editor';

const toggleStyle = {
  cursor:'pointer',
  position: 'absolute',
  bottom: 0,
};

const svgStyle = {
  position:'absolute',
  right:'50%',
  height: 25,
  width: 35
}

class CompiledSpecDisplayHeader extends React.Component {
  editVegaSpec () {
    this.props.updateVegaSpec(JSON.stringify(this.props.value, null, 2));
  }

  render () {
    if (this.props.compiledVegaSpec) {
      const toggleStyleUp = Object.assign({}, toggleStyle, {
        position: 'static'
      });
      return (
        <div  className="editor-header"
             style={toggleStyleUp}
             onClick={this.props.showCompiledVegaSpec}>
            <span style={{marginLeft: 10}}>
              Compiled Vega
            </span>
          <svg
              style={svgStyle}>
              <polygon points="5,5 30,5 17.5,20" />
          </svg>
          <button
              onClick={this.editVegaSpec.bind(this)}
              style={{position:'absolute', right:'3%', cursor:'pointer'}}>
              Edit Vega spec
          </button>
        </div>
      );
    } else {
      return (
        <div className={'full-height-wrapper'}
            onClick={this.props.showCompiledVegaSpec}>
          <div className="editor-header" style={toggleStyle}>
            <span style={{marginLeft: 10}}>
              Compiled Vega
            </span>
            <svg
              style={svgStyle}>
              <polygon points="5,20 30,20 17.5,5" />
            </svg>
            <span style={{marginRight: 10, position: 'absolute', right: 0}}>
              Read Only
            </span>
          </div>
        </div>
      );
    }
  }
};<commit_msg>Fix resizing issue in split mode. Alsop, remove annotation that the spec is read only, although it is invisible. <commit_after>import React from 'react';
import { connect } from 'react-redux';
import * as EditorActions from '../../../actions/editor';

const toggleStyle = {
  cursor:'pointer',
  position: 'absolute',
  bottom: 0,
};

const svgStyle = {
  position:'absolute',
  right:'50%',
  height: 25,
  width: 35
}

class CompiledSpecDisplayHeader extends React.Component {
  editVegaSpec () {
    this.props.updateVegaSpec(JSON.stringify(this.props.value, null, 2));
  }

  render () {
    if (this.props.compiledVegaSpec) {
      const toggleStyleUp = Object.assign({}, toggleStyle, {
        position: 'static'
      });
      return (
        <div className="editor-header"
             style={toggleStyleUp}
             onClick={this.props.showCompiledVegaSpec}>
            <span style={{marginLeft: 10}}>
              Compiled Vega
            </span>
          <svg
              style={svgStyle}>
              <polygon points="5,5 30,5 17.5,20" />
          </svg>
          <button
              onClick={this.editVegaSpec.bind(this)}
              style={{position:'absolute', right:'3%', cursor:'pointer'}}>
              Edit Vega spec
          </button>
        </div>
      );
    } else {
      return (
        <div onClick={this.props.showCompiledVegaSpec}>
          <div className="editor-header" style={toggleStyle}>
            <span style={{marginLeft: 10}}>
              Compiled Vega
            </span>
            <svg
              style={svgStyle}>
              <polygon points="5,20 30,20 17.5,5" />
            </svg>
          </div>
        </div>
      );
    }
  }
};
{'fraction_non_alphanumeric': 0.14138523182598742, 'fraction_numerical': 0.020320549513451632, 'mean_word_length': 1.867104183757178, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '6033927', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1019, 'n_words': 220}