<commit_before>import { getNetChange } from 'services/analysis-cached';

import { getYearsRangeFromData } from 'components/widgets/utils/data';

import {
  POLITICAL_BOUNDARIES_DATASET,
  NET_CHANGE_DATASET,
} from 'data/datasets';
import {
  DISPUTED_POLITICAL_BOUNDARIES,
  POLITICAL_BOUNDARIES,
  NET_CHANGE,
} from 'data/layers';

import getWidgetProps from './selectors';

const getGlobalLocation = (params) => ({
  adm0: params.type === 'global' ? null : params.adm0,
  adm1: params.type === 'global' ? null : params.adm1,
  adm2: params.type === 'global' ? null : params.adm2,
});

export default {
  widget: 'netChange',
  title: {
    default: 'Components of net change in tree cover in {location}',
    global: 'Components of net change in tree cover globally',
  },
  categories: ['summary', 'forest-change'],
  subCategory: 'net-change',
  types: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'],
  admins: ['global', 'adm0', 'adm1', 'adm2'],
  caution: {
    text:
      'Would you like to help us understand how to present this data in more helpful ways? {Click here to fill out a survey}',
    visible: ['country', 'geostore', 'aoi', 'wdpa', 'use', 'dashboard', 'global'],
    linkText: 'Click here to fill out a survey',
    link:
      'https://survey.alchemer.com/s3/7062032/Provide-feedback-for-Global-Forest-Watch-s-Net-Change-in-Tree-Cover-data-layer',
  },
  large: true,
  visible: ['dashboard', 'analysis'],
  chartType: 'pieChart',
  colors: 'netChange',
  dataType: 'netChange',
  metaKey: 'umd_adm0_net_tree_cover_change',
  datasets: [
    {
      dataset: POLITICAL_BOUNDARIES_DATASET,
      layers: [DISPUTED_POLITICAL_BOUNDARIES, POLITICAL_BOUNDARIES],
      boundary: true,
    },
    {
      dataset: NET_CHANGE_DATASET,
      layers: [NET_CHANGE],
    },
  ],
  sortOrder: {
    summary: 9999,
    forestChange: 9999,
  },
  sentence: {
    globalInitial:
      'From 2000 to 2020, the world experienced a net change of {netChange} ({netChangePerc}) change in tree cover.',
    initial:
      'From 2000 to 2020, {location} experienced a net change of {netChange} ({netChangePerc}) change in tree cover.',
    // noLoss:<commit_msg>Change Net Change position in Summary<commit_after>import { getNetChange } from 'services/analysis-cached';

import { getYearsRangeFromData } from 'components/widgets/utils/data';

import {
  POLITICAL_BOUNDARIES_DATASET,
  NET_CHANGE_DATASET,
} from 'data/datasets';
import {
  DISPUTED_POLITICAL_BOUNDARIES,
  POLITICAL_BOUNDARIES,
  NET_CHANGE,
} from 'data/layers';

import getWidgetProps from './selectors';

const getGlobalLocation = (params) => ({
  adm0: params.type === 'global' ? null : params.adm0,
  adm1: params.type === 'global' ? null : params.adm1,
  adm2: params.type === 'global' ? null : params.adm2,
});

export default {
  widget: 'netChange',
  title: {
    default: 'Components of net change in tree cover in {location}',
    global: 'Components of net change in tree cover globally',
  },
  categories: ['summary', 'forest-change'],
  subCategory: 'net-change',
  types: ['global', 'country', 'geostore', 'aoi', 'wdpa', 'use'],
  admins: ['global', 'adm0', 'adm1', 'adm2'],
  caution: {
    text:
      'Would you like to help us understand how to present this data in more helpful ways? {Click here to fill out a survey}',
    visible: ['country', 'geostore', 'aoi', 'wdpa', 'use', 'dashboard', 'global'],
    linkText: 'Click here to fill out a survey',
    link:
      'https://survey.alchemer.com/s3/7062032/Provide-feedback-for-Global-Forest-Watch-s-Net-Change-in-Tree-Cover-data-layer',
  },
  large: true,
  visible: ['dashboard', 'analysis'],
  chartType: 'pieChart',
  colors: 'netChange',
  dataType: 'netChange',
  metaKey: 'umd_adm0_net_tree_cover_change',
  datasets: [
    {
      dataset: POLITICAL_BOUNDARIES_DATASET,
      layers: [DISPUTED_POLITICAL_BOUNDARIES, POLITICAL_BOUNDARIES],
      boundary: true,
    },
    {
      dataset: NET_CHANGE_DATASET,
      layers: [NET_CHANGE],
    },
  ],
  sortOrder: {
    summary: -2,
    forestChange: 1,
  },
  sentence: {
    globalInitial:
      'From 2000 to 2020, the world experienced a net change of {netChange} ({netChangePerc}) change in tree cover.',
    initial:
      'From 2000 to 2020, {location} experienced a net change of {netChange} ({netChangePerc}) change in tree cover.',
    // noLoss:
{'fraction_non_alphanumeric': 0.1413516609392898, 'fraction_numerical': 0.017869415807560136, 'mean_word_length': 3.889137737961926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '8208', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1474, 'n_words': 388}