<commit_before>/*!
 * VIZABI GAPMINDER PREFERENCES (included only in Gapminder build)
 */

import globals from 'base/globals';
import * as utils from 'base/utils';
import Promise from 'base/promise';
import Tool from 'base/tool';
import Vzb from 'vizabi';

//import tools
import BubbleChart from 'tools/bubblechart';
import BarRankChart from 'tools/barrankchart';
import MountainChart from 'tools/mountainchart';
import MCComponent from 'tools/mountainchart-component';
import BarChart from 'tools/barchart';
import BubbleMap from 'tools/bubblemap';
import BMComponent from 'tools/bubblemap-component';
import LineChart from 'tools/linechart';
import PopByAge from 'tools/popbyage';

//waffle reader
import {
  waffle as WaffleReader
}
from 'readers/_index';

var language = {
  id: "en",
  strings: {}
};

var locationArray = window.location.href.split("/");
var localUrl = locationArray.splice(0, locationArray.indexOf("preview")).join("/");
localUrl += "/preview/";
var onlineUrl = "http://static.gapminderdev.org/vizabi/develop/preview/";

//TODO: remove hardcoded path from source code
globals.gapminder_paths = {
  baseUrl: localUrl
};

//OVERWRITE OPTIONS

BarChart.define('default_model', {
  state: {
    time: {
      start: "1800",
      end: "2012",
      value: "2000",
      step: 1,
      formatInput: "%Y"
    },
    entities: {
      dim: "geo",
      show: {
        _defs_: {
          "geo": ["usa", "swe", "nor"],
          "geo.cat": ["country", "unstate"]
        }
      }
    },
    marker: {
      space: ["entities", "time"],
      label: {
        use: "property",
        which: "geo.name"
      },
      axis_y: {
        use: "indicator",
        which: "population",
        scaleType: "log",
        allow: {
          scales: ["linear", "log"]
        }
      },
      axis_x: {
        use: "property",
        which: "geo.name",
        allow: {
          scales: ["ordinal"],
          names: ["!geo", "!_default"]
        }
      },
      color: {
        use: "property",
        which: "geo.region",
        scaleType: "ordinal"
      }
    }
  },
  data: {
    reader: "waffle",
    path: "http://waffle-server-dev.gapminderdev.org/api/graphs/stats/vizabi-tools"
    //reader: "csv",
    //path: globals.gapminder_paths.baseUrl + "data/waffles/dont-panic-poverty.csv"
  },
  language: language,
  ui: {
    presentation: false
  }
});

BarRankChart.define('default_model', {
  state: {
    time: {
      start: "1800",
      end: "2015",
      value: "2000",
      step: 1,
      formatInput: "%Y"
    },
    entities: {
      dim: "geo",
      show: {
        _defs_: {
          "geo.cat": ["country", "unstate"]
        }
      },
      opacitySelectDim: .3,
      opacityRegular: 1
    },
    entities_allpossible: {
      dim: "geo",
      show: {
        _defs_: {
          "geo": ["*"],
          "geo.cat": ["country", "unstate"]
        }
      }
    },
    marker_allpossible: {
      space: ["entities_allpossible"],
      label: {
        use: "property",
        which: "geo.name"
      }    
    },      
    marker: {
      space: ["entities", "time"],
      label: {
        use: "property",
        which: "geo.name"
      },
      axis_x: {
        use: "indicator",
        which: "population",
        scaleType: "log",
        allow: {
          scales: [
            "linear",
            "log"
          ]
        }
      },
      // should not be here because axis-y is not geo.name but order of population
      axis_y: {
        use: "property",
        which: "geo.name",
        scaleType: "log",
        allow: {
          scales: [
            "ordinal"
          ]
        }
      },
      color: {
        use: "property",
        which: "geo.region"
      }
    }
  },
  language: language,
  data: {
    //reader: "waffle",
    reader: "csv",
    path: globals.gapminder_paths.baseUrl + "data/waffles/basic-indicators.csv"
  },
  ui: {
    presentation: false
  }
});

BubbleMap.define('datawarning_content', {
  title: "",
  body: "Comparing the size of economy across countries and time is not trivial. The methods vary and the prices change. Gapminder has adjusted the picture for many such differences, but still we recommend you take these numbers with a large grain of salt.<br/><br/> Countries on a lower income levels have lower data quality in general, as less resources are available for compiling statistics. Historic estimates of GDP before 1950 are generally also more rough. <br/><br/> Data for child mortality is more reliable than GDP per capita, as the unit of comparison, dead children, is universally comparable across time and place. This is one of the reasons this indicator has become so useful to measure social progress. But the historic estimates of child mortality are still suffering from large uncertainties.<br/><br/> Learn more about the datasets and methods in this <a href='http://www.gapminder.org/news/data-sources-dont-panic-end-poverty' target='_blank'>blog post</a>",
  doubtDomain: [1800, 1950, 2015],
  doubtRange: [1.0, .3, .2]
});

BubbleMap.define('default_model', {<commit_msg>Hide the bug when loading data from CSV. Worth re-investigating when we are done with loading procedure and racing conditions<commit_after>/*!
 * VIZABI GAPMINDER PREFERENCES (included only in Gapminder build)
 */

import globals from 'base/globals';
import * as utils from 'base/utils';
import Promise from 'base/promise';
import Tool from 'base/tool';
import Vzb from 'vizabi';

//import tools
import BubbleChart from 'tools/bubblechart';
import BarRankChart from 'tools/barrankchart';
import MountainChart from 'tools/mountainchart';
import MCComponent from 'tools/mountainchart-component';
import BarChart from 'tools/barchart';
import BubbleMap from 'tools/bubblemap';
import BMComponent from 'tools/bubblemap-component';
import LineChart from 'tools/linechart';
import PopByAge from 'tools/popbyage';

//waffle reader
import {
  waffle as WaffleReader
}
from 'readers/_index';

var language = {
  id: "en",
  strings: {}
};

var locationArray = window.location.href.split("/");
var localUrl = locationArray.splice(0, locationArray.indexOf("preview")).join("/");
localUrl += "/preview/";
var onlineUrl = "http://static.gapminderdev.org/vizabi/develop/preview/";

//TODO: remove hardcoded path from source code
globals.gapminder_paths = {
  baseUrl: localUrl
};

//OVERWRITE OPTIONS

BarChart.define('default_model', {
  state: {
    time: {
      start: "1800",
      end: "2012",
      value: "2000",
      step: 1,
      formatInput: "%Y"
    },
    entities: {
      dim: "geo",
      show: {
        _defs_: {
          "geo": ["usa", "swe", "nor"],
          "geo.cat": ["country", "unstate"]
        }
      }
    },
    marker: {
      space: ["entities", "time"],
      label: {
        use: "property",
        which: "geo.name"
      },
      axis_y: {
        use: "indicator",
        which: "population",
        scaleType: "log",
        allow: {
          scales: ["linear", "log"]
        }
      },
      axis_x: {
        use: "property",
        which: "geo.name",
        allow: {
          scales: ["ordinal"],
          names: ["!geo", "!_default"]
        }
      },
      color: {
        use: "property",
        which: "geo.region",
        scaleType: "ordinal"
      }
    }
  },
  data: {
    reader: "waffle",
    path: "http://waffle-server-dev.gapminderdev.org/api/graphs/stats/vizabi-tools"
    //reader: "csv",
    //path: globals.gapminder_paths.baseUrl + "data/waffles/dont-panic-poverty.csv"
  },
  language: language,
  ui: {
    presentation: false
  }
});

BarRankChart.define('default_model', {
  state: {
    time: {
      start: "1950",
      end: "2015",
      value: "2000",
      step: 1,
      formatInput: "%Y"
    },
    entities: {
      dim: "geo",
      show: {
        _defs_: {
          "geo.cat": ["country", "unstate"]
        }
      },
      opacitySelectDim: .3,
      opacityRegular: 1
    },
    entities_allpossible: {
      dim: "geo",
      show: {
        _defs_: {
          "geo": ["*"],
          "geo.cat": ["country", "unstate"]
        }
      }
    },
    marker_allpossible: {
      space: ["entities_allpossible"],
      label: {
        use: "property",
        which: "geo.name"
      }    
    },      
    marker: {
      space: ["entities", "time"],
      label: {
        use: "property",
        which: "geo.name"
      },
      axis_x: {
        use: "indicator",
        which: "population",
        scaleType: "log",
        allow: {
          scales: [
            "linear",
            "log"
          ]
        }
      },
      // should not be here because axis-y is not geo.name but order of population
      axis_y: {
        use: "property",
        which: "geo.name",
        scaleType: "log",
        allow: {
          scales: [
            "ordinal"
          ]
        }
      },
      color: {
        use: "property",
        which: "geo.region"
      }
    }
  },
  language: language,
  data: {
    reader: "waffle",
    path: "http://waffle-server-dev.gapminderdev.org/api/graphs/stats/vizabi-tools",
    //reader: "csv",
    //path: globals.gapminder_paths.baseUrl + "data/waffles/basic-indicators.csv"
    splash: true
  },
  ui: {
    presentation: false
  }
});

BubbleMap.define('datawarning_content', {
  title: "",
  body: "Comparing the size of economy across countries and time is not trivial. The methods vary and the prices change. Gapminder has adjusted the picture for many such differences, but still we recommend you take these numbers with a large grain of salt.<br/><br/> Countries on a lower income levels have lower data quality in general, as less resources are available for compiling statistics. Historic estimates of GDP before 1950 are generally also more rough. <br/><br/> Data for child mortality is more reliable than GDP per capita, as the unit of comparison, dead children, is universally comparable across time and place. This is one of the reasons this indicator has become so useful to measure social progress. But the historic estimates of child mortality are still suffering from large uncertainties.<br/><br/> Learn more about the datasets and methods in this <a href='http://www.gapminder.org/news/data-sources-dont-panic-end-poverty' target='_blank'>blog post</a>",
  doubtDomain: [1800, 1950, 2015],
  doubtRange: [1.0, .3, .2]
});

BubbleMap.define('default_model', {
{'fraction_non_alphanumeric': 0.13652959262106074, 'fraction_numerical': 0.009415833973866257, 'mean_word_length': 2.354495649371576, 'pattern_counts': {'":': 10, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4405079', 'n_tokens_mistral': 3355, 'n_tokens_neox': 3230, 'n_words': 901}