<commit_before>import * as async from '@polymer/polymer/lib/utils/async.js'
import 'highcharts/highstock.js'
import 'highcharts/highcharts-more.js'
import 'highcharts/modules/exporting'
import 'highcharts/modules/drilldown'
import 'highcharts/modules/annotations'

// Global options and settings added
Highcharts.setOptions({global: {useUTC: false}})
const _extends = (...a) => Object.assign({}, ...a)

export const HighchartsPolymer = {
    Highcharts,
    /* @polymerMixin */
    BaseBehavior: superClass => {
        const newObj = _ => ({}), newArr = _ => []
        return class extends superClass {
            constructor() {
                super()
                this.__lateBindCallbacks = _extends({}, this.__lateBindCallbacks, {_updateType:1,_loadingUpdate:1})
            }
            static get properties() {return {
                type: {type: String, observer: "_updateType"},
                title: {type: String, value: "", observer: "_titleUpdate"},
                subtitle: {type: String, observer: "_subtitleUpdate"},
                colorByPoint: {type: Boolean, value: false, reflectToAttribute:true, observer: "_cbpUpdate"},
                credits: {type: Boolean, value: false, reflectToAttribute:true, observer: "_creditsUpdate"},
                legend: {type: Boolean, value: false, reflectToAttribute:true, observer: "_legendUpdate"},
                chartOptions: {type: Object, value: newObj, observer: "_chartUpdate"},
                plotOptions: {type: Object, value: newObj, observer: "_plotUpdate"},
                xAxis: {type: Object, value: newObj, observer: "_xAxisUpdate"},
                yAxis: {type: Object, value: newObj, observer: "_yAxisUpdate"},
                xLabel: {type: String, value: "", observer: "_xAxisTitleUpdate"},
                yLabel: {type: String, value: "", observer: "_yAxisTitleUpdate"},
                label: {type: String, value: "", observer: "_labelUpdate"},
                data: {type: Array, value: newArr, observer:"_dataUpdate"},
                export: {type: Boolean, value: false, reflectToAttribute: true, observer: "_exportingUpdate"},
                xZoom: {type: Boolean, value: false, reflectToAttribute: true, observer: "_zoomUpdate"},
                yZoom: {type: Boolean, value: false, reflectToAttribute: true, observer: "_zoomUpdate"},
                loading: {type: Boolean, value: false, observer: "_loadingUpdate", reflectToAttribute:true},
                loadingMessage: {type: String, value: ""},
                renderer: {type: Object, computed: "_getRenderer(_chart.renderer)"},
                //Custom Chart Declarations
                legendOptions: {type: Object, value: newObj, observer: "_legendOptionsUpdate"},
                tooltipOptions: {type: Object, value: newObj, observer: "_tooltipOptionsUpdate"},
                annotations: {type: Object, value: newArr, observer: "_annotationsUpdate"},
                highchartOptions: {type: Object, value: newObj, observer: "_hcUpdate"},
                _chart: {type: Object, readOnly: true},
                __microTaskDelaySetData: {type: Number, value: 25},
            }}
            __createChart(namespace) {
                var xAxis = _extends(this.vsTime?{type: 'datetime',tickPixelInterval: 150}:{},this.xAxis, {title: {text: this._getAxisLabel('X')}});
                var yAxis = _extends(this.yAxis, {title: {text: this._getAxisLabel('Y')}});
                var Series = this.data.length && this.data[0].data instanceof Array?this.data:[{name: (this.label||this.yLabel||this.xLabel),colorByPoint: this.colorByPoint, data: this.data}];
                var __app = this;
                this._set_chart(new Highcharts[namespace||"Chart"](_extends(true,{},{
                    chart: _extends({
                        renderTo: __app.$.Chart,
                        defaultSeriesType: this.type,
                        animation: Highcharts.svg, // don't animate in old IE
                        marginRight: 10,
                        events: {
                            click: function(e){__app._fire("chart-click",{e: e,chart: this,component:__app})},
                            load: function(e){__app._fire("chart-load",{e: e,chart: this,component:__app})},
                            beforePrint: function(e){__app._fire("before-print",{e: e,chart: this,component:__app})},
                            afterPrint: function(e){__app._fire("after-print",{e: e,chart: this,component:__app})},
                            addSeries: function(e){__app._fire("series-added",{e: e,chart: this,component:__app})},
                            drilldown: function(e){__app._fire("drill-down",{e: e,chart: this,component:__app})},
                            drillup: function(e){__app._fire("drill-up",{e: e,chart: this,component:__app})},
                            drillupall: function(e){__app._fire("drill-up-all",{e: e,chart: this,component:__app})},
                            selection: function(e){__app._fire("selection",{e: e,chart: this,component:__app})},
                            redraw: function(e){__app._fire("redraw",{e: e,chart: this,component:__app})},
                            render: function(e){__app._fire("render",{e: e,chart: this,component:__app})},
                        }
                    },this.xZoom||this.yZoom?{zoomType: (this.xZoom&&"x")+(this.yZoom&&"y")}:{},this.chartOptions),
                    //Properties
                    title: {text: this.title},
                    subtitle: {text: this.subtitle},
                    xAxis: xAxis,
                    yAxis: yAxis,
                    credits: {enabled: this.credits},
                    plotOptions: _extends({
                        pie: {
                            allowPointSelect: true,
                            cursor: 'pointer',
                            dataLabels: {
                                enabled: true,
                                format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                                style: {color: (Highcharts.theme||[]).contrastTextColor||'black'},
                            }
                        }
                    }, this.plotOptions),
                    annotations: this.annotations,
                    tooltip: _extends(this.vsTime?{formatter: function(_) {
                        return [
                            `<b>${this.points ? this.points[0].series.name : this.series.name}</b>`,
                            Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x),
                            Highcharts.numberFormat(this.y, 2),
                        ].join('<br>')<commit_msg>Fixed support for multiple Axises configs, as usual, help only applies to axis[0]<commit_after>import * as async from '@polymer/polymer/lib/utils/async.js'
import 'highcharts/highstock.js'
import 'highcharts/highcharts-more.js'
import 'highcharts/modules/exporting'
import 'highcharts/modules/drilldown'
import 'highcharts/modules/annotations'

// Global options and settings added
Highcharts.setOptions({global: {useUTC: false}})
const _extends = (...a) => Object.assign({}, ...a)

export const HighchartsPolymer = {
    Highcharts,
    /* @polymerMixin */
    BaseBehavior: superClass => {
        const newObj = _ => ({}), newArr = _ => []
        return class extends superClass {
            constructor() {
                super()
                this.__lateBindCallbacks = _extends({}, this.__lateBindCallbacks, {_updateType:1,_loadingUpdate:1})
            }
            static get properties() {return {
                type: {type: String, observer: "_updateType"},
                title: {type: String, value: "", observer: "_titleUpdate"},
                subtitle: {type: String, observer: "_subtitleUpdate"},
                colorByPoint: {type: Boolean, value: false, reflectToAttribute:true, observer: "_cbpUpdate"},
                credits: {type: Boolean, value: false, reflectToAttribute:true, observer: "_creditsUpdate"},
                legend: {type: Boolean, value: false, reflectToAttribute:true, observer: "_legendUpdate"},
                chartOptions: {type: Object, value: newObj, observer: "_chartUpdate"},
                plotOptions: {type: Object, value: newObj, observer: "_plotUpdate"},
                xAxis: {type: Object, value: newObj, observer: "_xAxisUpdate"},
                yAxis: {type: Object, value: newObj, observer: "_yAxisUpdate"},
                xLabel: {type: String, value: "", observer: "_xAxisTitleUpdate"},
                yLabel: {type: String, value: "", observer: "_yAxisTitleUpdate"},
                label: {type: String, value: "", observer: "_labelUpdate"},
                data: {type: Array, value: newArr, observer:"_dataUpdate"},
                export: {type: Boolean, value: false, reflectToAttribute: true, observer: "_exportingUpdate"},
                xZoom: {type: Boolean, value: false, reflectToAttribute: true, observer: "_zoomUpdate"},
                yZoom: {type: Boolean, value: false, reflectToAttribute: true, observer: "_zoomUpdate"},
                loading: {type: Boolean, value: false, observer: "_loadingUpdate", reflectToAttribute:true},
                loadingMessage: {type: String, value: ""},
                renderer: {type: Object, computed: "_getRenderer(_chart.renderer)"},
                //Custom Chart Declarations
                legendOptions: {type: Object, value: newObj, observer: "_legendOptionsUpdate"},
                tooltipOptions: {type: Object, value: newObj, observer: "_tooltipOptionsUpdate"},
                annotations: {type: Object, value: newArr, observer: "_annotationsUpdate"},
                highchartOptions: {type: Object, value: newObj, observer: "_hcUpdate"},
                _chart: {type: Object, readOnly: true},
                __microTaskDelaySetData: {type: Number, value: 25},
            }}
            __createChart(namespace) {
                const getFirstOrAxisConfig = axis => axis instanceof Array
                    ? axis[0] || (axis.push({}), axis[0])
                    : axis
                let tempX_Axis = _extends(this.vsTime ? {type: 'datetime', tickPixelInterval: 150} : {}, getFirstOrAxisConfig(this.xAxis), {title: {text: this._getAxisLabel('X')}});
                if (this.xAxis instanceof Array) {
                    this.xAxis[0] = tempX_Axis
                } else {
                    this.xAxis = tempX_Axis
                }
                Object.assign(getFirstOrAxisConfig(this.yAxis), {title: {text: this._getAxisLabel('Y')}});
                var Series = this.data.length && this.data[0].data instanceof Array?this.data:[{name: (this.label||this.yLabel||this.xLabel),colorByPoint: this.colorByPoint, data: this.data}];
                var __app = this;
                this._set_chart(new Highcharts[namespace||"Chart"](_extends(true,{},{
                    chart: _extends({
                        renderTo: __app.$.Chart,
                        defaultSeriesType: this.type,
                        animation: Highcharts.svg, // don't animate in old IE
                        marginRight: 10,
                        events: {
                            click: function(e){__app._fire("chart-click",{e: e,chart: this,component:__app})},
                            load: function(e){__app._fire("chart-load",{e: e,chart: this,component:__app})},
                            beforePrint: function(e){__app._fire("before-print",{e: e,chart: this,component:__app})},
                            afterPrint: function(e){__app._fire("after-print",{e: e,chart: this,component:__app})},
                            addSeries: function(e){__app._fire("series-added",{e: e,chart: this,component:__app})},
                            drilldown: function(e){__app._fire("drill-down",{e: e,chart: this,component:__app})},
                            drillup: function(e){__app._fire("drill-up",{e: e,chart: this,component:__app})},
                            drillupall: function(e){__app._fire("drill-up-all",{e: e,chart: this,component:__app})},
                            selection: function(e){__app._fire("selection",{e: e,chart: this,component:__app})},
                            redraw: function(e){__app._fire("redraw",{e: e,chart: this,component:__app})},
                            render: function(e){__app._fire("render",{e: e,chart: this,component:__app})},
                        }
                    },this.xZoom||this.yZoom?{zoomType: (this.xZoom&&"x")+(this.yZoom&&"y")}:{},this.chartOptions),
                    //Properties
                    title: {text: this.title},
                    subtitle: {text: this.subtitle},
                    xAxis: this.xAxis,
                    yAxis: this.yAxis,
                    credits: {enabled: this.credits},
                    plotOptions: _extends({
                        pie: {
                            allowPointSelect: true,
                            cursor: 'pointer',
                            dataLabels: {
                                enabled: true,
                                format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                                style: {color: (Highcharts.theme||[]).contrastTextColor||'black'},
                            }
                        }
                    }, this.plotOptions),
                    annotations: this.annotations,
                    tooltip: _extends(this.vsTime?{formatter: function(_) {
                        return [
                            `<b>${this.points ? this.points[0].series.name : this.series.name}</b>`,
                            Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x),
                            Highcharts.numberFormat(this.y, 2),
                        ].join('<br>')
{'fraction_non_alphanumeric': 0.1376365873073305, 'fraction_numerical': 0.0021709240900209857, 'mean_word_length': 1.9599485971300064, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 22, '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': '6681213', 'n_tokens_mistral': 3787, 'n_tokens_neox': 3590, 'n_words': 765}