<commit_before>import React, { Component } from 'react';
import {connect} from 'react-redux';

import { map } from 'lodash'

import { Icon } from '../index'
import { clearSelection, highlightNodes, deleteNodes} from '../../modules/graph/index'
import { tableColumnAdd, tableColumnRemove } from '../../modules/data/index'
import { fieldLocator } from '../../helpers/index'

class Nodes extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            editNode: null
        }
    }

    handleClearSelection() {
        const { dispatch } = this.props;
        dispatch(clearSelection());
    }

    handleCancelEditNode(node) {
        const { dispatch } = this.props;
        this.setState({editNode: null});
    }

    handleEditNode(node) {
        this.setState({editNode: node});
    }

    handleDeleteNode(node) {
        const { dispatch } = this.props;
        dispatch(deleteNodes([node.id]));
    }

    renderSelected() {
        const { node } = this.props;
        const { editNode } = this.state;

        return (
            node ?
                map(node, (i_node) => {
                    if (editNode == i_node) {
                        return (
                            <li key={i_node.id}><input type="text" value={i_node.id}/>
                                <button onClick={(n) => this.handleCancelEditNode(n) }>cancel</button>
                            </li>
                        )
                    } else {
                        return (
                            <li key={i_node.id}>{i_node.id}
                                <Icon onClick={(n) => this.handleDeleteNode(i_node)} name="ion-ios-remove-circle-outline"/>
                            </li>
                        )
                    }
                })
                : null
        )
    }


    render() {
        return (
            <div className="form-group">
                <span style={{cursor: 'pointer'}} onClick={() => this.handleClearSelection()}>
                    <Icon name="ion-ios-hand-outline"/> Clear selection
                </span>
                <br/><br/>
                <ul>
                    {this.renderSelected()}
                </ul>
            </div>
        )
    }
}
<commit_msg>add icon to selected nodes<commit_after>import React, { Component } from 'react';
import {connect} from 'react-redux';

import { map } from 'lodash'

import { Icon } from '../index'
import { clearSelection, highlightNodes, deleteNodes} from '../../modules/graph/index'
import { tableColumnAdd, tableColumnRemove } from '../../modules/data/index'
import { fieldLocator } from '../../helpers/index'

class Nodes extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            editNode: null
        }
    }

    handleClearSelection() {
        const { dispatch } = this.props;
        dispatch(clearSelection());
    }

    handleCancelEditNode(node) {
        const { dispatch } = this.props;
        this.setState({editNode: null});
    }

    handleEditNode(node) {
        this.setState({editNode: node});
    }

    handleDeleteNode(node) {
        const { dispatch } = this.props;
        dispatch(deleteNodes([node.id]));
    }

    renderSelected() {
        const { node } = this.props;
        const { editNode } = this.state;

        return (
            node ?
                map(node, (i_node) => {
                    if (editNode == i_node) {
                        return (
                            <li key={i_node.id}>
                                <i className="glyphicon">{ i_node.icon }</i>
                                <input type="text" value={i_node.id}/>
                                <button onClick={(n) => this.handleCancelEditNode(n) }>cancel</button>
                            </li>
                        )
                    } else {
                        return (
                            <li key={i_node.id}>
                                <i className="glyphicon">{ i_node.icon }</i>
                                {i_node.id}
                                <Icon onClick={(n) => this.handleDeleteNode(i_node)} name="ion-ios-remove-circle-outline"/>
                            </li>
                        )
                    }
                })
                : null
        )
    }


    render() {
        return (
            <div className="form-group">
                <span style={{cursor: 'pointer'}} onClick={() => this.handleClearSelection()}>
                    <Icon name="ion-ios-hand-outline"/> Clear selection
                </span>
                <br/><br/>
                <ul>
                    {this.renderSelected()}
                </ul>
            </div>
        )
    }
}

{'fraction_non_alphanumeric': 0.13202423229580112, 'fraction_numerical': 0.0, 'mean_word_length': 1.2574257425742574, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1191066', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1238, 'n_words': 240}