<commit_before>import {RecipeActions, RecipeState} from 'app/home/body/process/mosaic/mosaicRecipe'
import {google, googleMap, MapLayer, MapObject, sepalMap} from 'app/home/map/map'
import backend from 'backend'
import _ from 'lodash'
import PropTypes from 'prop-types'
import React from 'react'
import {of} from 'rxjs'
import {map} from 'rxjs/operators'
import {connect} from 'store'
import {msg} from 'translate'
import MapStatus from 'widget/mapStatus'
import {SceneSelectionType} from './mosaicRecipe'
import styles from './sceneAreas.module.css'


const mapStateToProps = (state, ownProps) => {
    const recipe = RecipeState(ownProps.recipeId)
    return {
        initialized: recipe('ui.initialized'),
        sceneAreasShown: recipe('ui.sceneAreasShown'),
        aoi: recipe('aoi'),
        source: Object.keys(recipe('sources'))[0],
        sceneSelectionOptions: recipe('sceneSelectionOptions')
    }
}

class SceneAreas extends React.Component {
    state = {
        show: true
    }

    constructor(props) {
        super(props)
        this.recipe = RecipeActions(props.recipeId)
    }

    selectScenes(sceneAreaId) {
        this.recipe.setSceneSelection(sceneAreaId).dispatch()
    }

    render() {
        const {sceneAreasShown, action} = this.props
        if (this.renderable() && sceneAreasShown && this.state.show)
            return (
                <div>
                    {action('LOAD_SCENE_AREAS').dispatched
                        ? null
                        : <MapStatus message={msg('process.mosaic.sceneAreas.loading')}/>}
                    {this.renderSceneAreas()}
                </div>
            )
        else
            return null
    }

    renderSceneAreas() {
        const sceneAreas = this.state.sceneAreas
        if (sceneAreas)
            return (
                <MapLayer className={styles.sceneAreas}>
                    {sceneAreas.map(sceneArea => this.renderSceneArea(sceneArea))}
                </MapLayer>
            )
        else
            return null
    }
<commit_msg>Removed scene areas when loading new.<commit_after>import {RecipeActions, RecipeState} from 'app/home/body/process/mosaic/mosaicRecipe'
import {google, googleMap, MapLayer, MapObject, sepalMap} from 'app/home/map/map'
import backend from 'backend'
import _ from 'lodash'
import PropTypes from 'prop-types'
import React from 'react'
import {of} from 'rxjs'
import {map} from 'rxjs/operators'
import {connect} from 'store'
import {msg} from 'translate'
import MapStatus from 'widget/mapStatus'
import {SceneSelectionType} from './mosaicRecipe'
import styles from './sceneAreas.module.css'


const mapStateToProps = (state, ownProps) => {
    const recipe = RecipeState(ownProps.recipeId)
    return {
        initialized: recipe('ui.initialized'),
        sceneAreasShown: recipe('ui.sceneAreasShown'),
        aoi: recipe('aoi'),
        source: Object.keys(recipe('sources'))[0],
        sceneSelectionOptions: recipe('sceneSelectionOptions')
    }
}

class SceneAreas extends React.Component {
    state = {
        show: true
    }

    constructor(props) {
        super(props)
        this.recipe = RecipeActions(props.recipeId)
    }

    selectScenes(sceneAreaId) {
        this.recipe.setSceneSelection(sceneAreaId).dispatch()
    }

    render() {
        const {sceneAreasShown, action} = this.props
        if (this.renderable() && sceneAreasShown && this.state.show)
            return (
                <div>
                    {action('LOAD_SCENE_AREAS').dispatched
                        ? this.renderSceneAreas()
                        : <MapStatus message={msg('process.mosaic.sceneAreas.loading')}/>}
                </div>
            )
        else
            return null
    }

    renderSceneAreas() {
        const sceneAreas = this.state.sceneAreas
        if (sceneAreas)
            return (
                <MapLayer className={styles.sceneAreas}>
                    {sceneAreas.map(sceneArea => this.renderSceneArea(sceneArea))}
                </MapLayer>
            )
        else
            return null
    }

{'fraction_non_alphanumeric': 0.11062271062271062, 'fraction_numerical': 0.0004884004884004884, 'mean_word_length': 2.3355048859934855, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '5565242', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1173, 'n_words': 248}