<commit_before>;(function() {
	"use strict";
	owid.namespace("App.Models.ChartModel");

	App.Models.ChartModel = Backbone.Model.extend( {
        url: function(id) {
            id = id || this.id;
            if( $("#form-view").length ) {
                if( id ) {
                    //editing existing
                    return Global.rootUrl + "/charts/" + id;
                } else {
                    //saving new
                    return Global.rootUrl + "/charts";
                }

            } else {
                // Pass any query parameters on to config
                return Global.rootUrl + "/data/config/" + id + window.location.search;
            }
        },

		defaults: {
			"title": "",
			"subtitle": "",
			"slug": "",
			"note": "",
			"internalNotes": "",
			"chart-type": App.ChartType.LineChart,
			"published": false,
			// A range of form e.g. [0, 2015] with null meaning "all of it"
			"chart-time": null,
			"cache": true,
			"selected-countries": [], // e.g. [{id: "1", name: "United Kingdom"}]
			"tabs": [ "chart", "data", "sources" ],
			"default-tab": "chart",
			"line-type": 0,
			"line-tolerance": 1,
			"chart-description": "",
			"sourceDesc": "",
			"chart-dimensions": [],
			"logos": ['OWD'],
			"y-axis": {"axis-label-distance":"-10"},
			"x-axis": {},
			"margins": { top: 10, left: 60, bottom: 10, right: 10 },
			"units": "",
			"hide-legend": false,
			"hide-toggle": false,
			"entity-type": "country",
			"group-by-variables": false,
			"add-country-mode": "add-country",
			"x-axis-scale-selector": false,
			"y-axis-scale-selector": false,
			"activeLegendKeys": null,
			"currentStackMode": null,
            "timeline": null
		},

		// Get defaults appropriate for this kind of chart
		getDefaults: function(chartType) {
			chartType = chartType || App.ChartModel.get("chart-type");
			var defaults = _.clone(this.defaults);

			if (chartType == App.ChartType.ScatterPlot) {
				_.extend(defaults, {
					"hide-legend": true,
				});
			} else if (chartType == App.ChartType.StackedArea) {
				_.extend(defaults, {<commit_msg>Axis-min defaults to 0 (unless removed)<commit_after>;(function() {
	"use strict";
	owid.namespace("App.Models.ChartModel");

	App.Models.ChartModel = Backbone.Model.extend( {
        url: function(id) {
            id = id || this.id;
            if( $("#form-view").length ) {
                if( id ) {
                    //editing existing
                    return Global.rootUrl + "/charts/" + id;
                } else {
                    //saving new
                    return Global.rootUrl + "/charts";
                }

            } else {
                // Pass any query parameters on to config
                return Global.rootUrl + "/data/config/" + id + window.location.search;
            }
        },

		defaults: {
			"title": "",
			"subtitle": "",
			"slug": "",
			"note": "",
			"internalNotes": "",
			"chart-type": App.ChartType.LineChart,
			"published": false,
			// A range of form e.g. [0, 2015] with null meaning "all of it"
			"chart-time": null,
			"cache": true,
			"selected-countries": [], // e.g. [{id: "1", name: "United Kingdom"}]
			"tabs": [ "chart", "data", "sources" ],
			"default-tab": "chart",
			"line-type": 0,
			"line-tolerance": 1,
			"chart-description": "",
			"sourceDesc": "",
			"chart-dimensions": [],
			"logos": ['OWD'],
			"y-axis": {"axis-label-distance": "-10", "axis-min": "0"},
			"x-axis": {},
			"margins": { top: 10, left: 60, bottom: 10, right: 10 },
			"units": "",
			"hide-legend": false,
			"hide-toggle": false,
			"entity-type": "country",
			"group-by-variables": false,
			"add-country-mode": "add-country",
			"x-axis-scale-selector": false,
			"y-axis-scale-selector": false,
			"activeLegendKeys": null,
			"currentStackMode": null,
            "timeline": null
		},

		// Get defaults appropriate for this kind of chart
		getDefaults: function(chartType) {
			chartType = chartType || App.ChartModel.get("chart-type");
			var defaults = _.clone(this.defaults);

			if (chartType == App.ChartType.ScatterPlot) {
				_.extend(defaults, {
					"hide-legend": true,
				});
			} else if (chartType == App.ChartType.StackedArea) {
				_.extend(defaults, {
{'fraction_non_alphanumeric': 0.18422295701464336, 'fraction_numerical': 0.008974964572508267, 'mean_word_length': 2.18660647103085, 'pattern_counts': {'":': 69, '<': 3, '<?xml version=': 0, '>': 3, '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': '3001397', 'n_tokens_mistral': 1592, 'n_tokens_neox': 1336, 'n_words': 306}