<commit_before>/*
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      This file is part of the Smart Developer Hub Project:
        http://www.smartdeveloperhub.org/
      Center for Open Middleware
            http://www.centeropenmiddleware.com/
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      Copyright (C) 2015 Center for Open Middleware.
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
                http://www.apache.org/licenses/LICENSE-2.0
      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
*/

(function() {

    var __loader = (function() {


        var defaultConfig = {
            height: {
                type: ['number'],
                default: 150
            },
            minValue: {
                type: ['number'],
                default: 100
            },
            circleThickness: {
                type: ['number'],
                default: 0.05
            },
            circleFillGap: {
                type: ['number'],
                default: 0.05
            },
            circleColor: {
                type: ['string', Array],
                default: "#178BCA"
            },
            waveHeight: {
                type: ['number'],
                default: 0.05
            },
            waveCount: {
                type: ['number'],
                default: 1
            },
            waveRiseTime: {
                type: ['number'],
                default: 1000
            },
            waveAnimateTime: {
                type: ['number'],
                default: 18000
            },
            waveRise: {
                type: ['boolean'],
                default: true
            },
            waveHeightScaling: {
                type: ['boolean'],
                default: true
            },
            waveAnimate: {
                type: ['boolean'],
                default: true
            },
            waveColor: {
                type: ['string', Array],
                default: "#178BCA"
            },
            waveOffset: {
                type: ['number'],
                default: 0
            },
            textVertPosition: {
                type: ['number'],
                default: 0.5
            },
            textSize: {
                type: ['number'],
                default: 1
            },
            valueCountUp: {
                type: ['boolean'],
                default: true
            },
            displayPercent: {
                type: ['boolean'],
                default: true
            },
            textColor: {
                type: ['string', Array],
                default: "#045681"
            },
            waveTextColor: {
                type: ['string', Array],
                default: "#A4DBf8"
            },
            radius: {
                type: ['number'],
                default: "75"
            }
        };

        /* LiquidGauge constructor
         *   element: the DOM element that will contain the chart
         *   data: the data id array
         *   contextId: optional.
         *   configuration: additional chart configuration:
         *      {
         *       ~ height: 240, // The gauge height.
         *       ~ minValue: 0, // The gauge minimum value.
         *       ~ maxValue: 100, // The gauge maximum value.
         *       ~ circleThickness:number - The outer circle thickness as a percentage of it's radius.
         *       ~ circleFillGap: number - The size of the gap between the outer circle and wave circle as a percentage of
         *         the outer circles radius.
         *       ~ circleColor: string or array- The color of the outer circle or an array of colors describing a liner scale.
         *       ~ waveHeight: number - The wave height as a percentage of the radius of the wave circle.
         *       ~ waveCount: number - The number of full waves per width of the wave circle or an array (see waveColor).
         *       ~ waveRiseTime:number - The amount of time in milliseconds for the wave to rise from 0 to it's final height.
         *       ~ waveAnimateTime: number - The amount of time in milliseconds for a full wave to enter the wave circle.
         *       ~ waveRise: boolean - Control if the wave should rise from 0 to it's full height, or start at it's full height.
         *       ~ waveHeightScaling: boolean - Controls wave size scaling at low and high fill percentages. When true, wave
         *         height reaches it's maximum at 50% fill, and minimum at 0% and 100% fill. This helps to prevent the wave
         *         from making the wave circle from appear totally full or empty when near it's minimum or maximum fill.
         *       ~ waveAnimate: boolean - Controls if the wave scrolls or is static.
         *       ~ waveColor: string or array - The color of the fill wave or an array of colors describing a liner scale.
         *       ~ waveOffset: number - The amount to initially offset the wave. 0 = no offset. 1 = offset of one full wave.
         *       ~ textVertPosition: number - The height at which to display the percentage text withing the wave circle.
         *         0 = bottom, 1 = top.
         *       ~ textSize: number - The relative height of the text to display in the wave circle. 1 = 50%
         *       ~ valueCountUp: boolean - If true, the displayed value counts up from 0 to it's final value upon loading.
         *         If false, the final value is displayed.
         *       ~ displayPercent: boolean - If true, a % symbol is displayed after the value.
         *       ~ textColor: string or array - The color of the value text when the wave does not overlap it or an array of
         *         colors describing a liner scale.
         *       ~ waveTextColor: string or array - The color of the value text when the wave overlaps it or an array of
         *         colors describing a liner scale.
         *       ~ radius: number - The gauge radius size.
         *      }
         */
        var LiquidGauge = function LiquidGauge(element, metrics, contextId, configuration) {

            // CHECK FRAMEWORK
            if(!framework.isReady()) {
                console.error("LiquidGauge object could not be created because framework is not loaded.");
                return;
            }

            // CHECK D3
            if(typeof d3 === 'undefined') {
                console.error("LiquidGauge could not be loaded because d3 did not exist.");
                return;
            }

            this.element = $(element); //Store as jquery object
            this.svg = null;
            this.data = null;
            this.chart = null;
            this.status = 0; // 0 - not initialized, 1 - ready, 2 - destroyed

            // Extending widget
            framework.widgets.CommonWidget.call(this, false, this.element.get(0));

            // Configuration
            this.configuration = this.normalizeConfig(defaultConfig, configuration);

            // Create SVG element inside the container element
            this.element.append('<svg class="blurable"></svg>');
            this.svg = this.element.children("svg");
            //this.svg.get(0).style.minHeight = this.configuration.height + "px";
            this.svg.get(0).style.height = this.configuration.height + "px";

            this.observeCallback = this.commonObserveCallback.bind(this);

            framework.data.observe(metrics, this.observeCallback , contextId);

        };

        LiquidGauge.prototype = new framework.widgets.CommonWidget(true);

        LiquidGauge.prototype.updateData = function(data) {
            var resourceId = Object.keys(data)[0];
            var resourceUID = Object.keys(data[resourceId])[0];
            this.data = data[resourceId][resourceUID]['data'];
<commit_msg>[Widget][Liquid] Use height as width<commit_after>/*
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      This file is part of the Smart Developer Hub Project:
        http://www.smartdeveloperhub.org/
      Center for Open Middleware
            http://www.centeropenmiddleware.com/
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      Copyright (C) 2015 Center for Open Middleware.
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
                http://www.apache.org/licenses/LICENSE-2.0
      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
*/

(function() {

    var __loader = (function() {


        var defaultConfig = {
            height: {
                type: ['number'],
                default: 150
            },
            minValue: {
                type: ['number'],
                default: 100
            },
            circleThickness: {
                type: ['number'],
                default: 0.05
            },
            circleFillGap: {
                type: ['number'],
                default: 0.05
            },
            circleColor: {
                type: ['string', Array],
                default: "#178BCA"
            },
            waveHeight: {
                type: ['number'],
                default: 0.05
            },
            waveCount: {
                type: ['number'],
                default: 1
            },
            waveRiseTime: {
                type: ['number'],
                default: 1000
            },
            waveAnimateTime: {
                type: ['number'],
                default: 18000
            },
            waveRise: {
                type: ['boolean'],
                default: true
            },
            waveHeightScaling: {
                type: ['boolean'],
                default: true
            },
            waveAnimate: {
                type: ['boolean'],
                default: true
            },
            waveColor: {
                type: ['string', Array],
                default: "#178BCA"
            },
            waveOffset: {
                type: ['number'],
                default: 0
            },
            textVertPosition: {
                type: ['number'],
                default: 0.5
            },
            textSize: {
                type: ['number'],
                default: 1
            },
            valueCountUp: {
                type: ['boolean'],
                default: true
            },
            displayPercent: {
                type: ['boolean'],
                default: true
            },
            textColor: {
                type: ['string', Array],
                default: "#045681"
            },
            waveTextColor: {
                type: ['string', Array],
                default: "#A4DBf8"
            },
            radius: {
                type: ['number'],
                default: "75"
            }
        };

        /* LiquidGauge constructor
         *   element: the DOM element that will contain the chart
         *   data: the data id array
         *   contextId: optional.
         *   configuration: additional chart configuration:
         *      {
         *       ~ height: 240, // The gauge height.
         *       ~ minValue: 0, // The gauge minimum value.
         *       ~ maxValue: 100, // The gauge maximum value.
         *       ~ circleThickness:number - The outer circle thickness as a percentage of it's radius.
         *       ~ circleFillGap: number - The size of the gap between the outer circle and wave circle as a percentage of
         *         the outer circles radius.
         *       ~ circleColor: string or array- The color of the outer circle or an array of colors describing a liner scale.
         *       ~ waveHeight: number - The wave height as a percentage of the radius of the wave circle.
         *       ~ waveCount: number - The number of full waves per width of the wave circle or an array (see waveColor).
         *       ~ waveRiseTime:number - The amount of time in milliseconds for the wave to rise from 0 to it's final height.
         *       ~ waveAnimateTime: number - The amount of time in milliseconds for a full wave to enter the wave circle.
         *       ~ waveRise: boolean - Control if the wave should rise from 0 to it's full height, or start at it's full height.
         *       ~ waveHeightScaling: boolean - Controls wave size scaling at low and high fill percentages. When true, wave
         *         height reaches it's maximum at 50% fill, and minimum at 0% and 100% fill. This helps to prevent the wave
         *         from making the wave circle from appear totally full or empty when near it's minimum or maximum fill.
         *       ~ waveAnimate: boolean - Controls if the wave scrolls or is static.
         *       ~ waveColor: string or array - The color of the fill wave or an array of colors describing a liner scale.
         *       ~ waveOffset: number - The amount to initially offset the wave. 0 = no offset. 1 = offset of one full wave.
         *       ~ textVertPosition: number - The height at which to display the percentage text withing the wave circle.
         *         0 = bottom, 1 = top.
         *       ~ textSize: number - The relative height of the text to display in the wave circle. 1 = 50%
         *       ~ valueCountUp: boolean - If true, the displayed value counts up from 0 to it's final value upon loading.
         *         If false, the final value is displayed.
         *       ~ displayPercent: boolean - If true, a % symbol is displayed after the value.
         *       ~ textColor: string or array - The color of the value text when the wave does not overlap it or an array of
         *         colors describing a liner scale.
         *       ~ waveTextColor: string or array - The color of the value text when the wave overlaps it or an array of
         *         colors describing a liner scale.
         *       ~ radius: number - The gauge radius size.
         *      }
         */
        var LiquidGauge = function LiquidGauge(element, metrics, contextId, configuration) {

            // CHECK FRAMEWORK
            if(!framework.isReady()) {
                console.error("LiquidGauge object could not be created because framework is not loaded.");
                return;
            }

            // CHECK D3
            if(typeof d3 === 'undefined') {
                console.error("LiquidGauge could not be loaded because d3 did not exist.");
                return;
            }

            this.element = $(element); //Store as jquery object
            this.svg = null;
            this.data = null;
            this.chart = null;
            this.status = 0; // 0 - not initialized, 1 - ready, 2 - destroyed

            // Extending widget
            framework.widgets.CommonWidget.call(this, false, this.element.get(0));

            // Configuration
            this.configuration = this.normalizeConfig(defaultConfig, configuration);

            // Create SVG element inside the container element
            this.element.append('<svg class="blurable"></svg>');
            this.svg = this.element.children("svg");
            //this.svg.get(0).style.minHeight = this.configuration.height + "px";
            this.svg.get(0).style.height = this.configuration.height + "px";
            this.svg.get(0).style.width = this.configuration.height + "px";

            this.observeCallback = this.commonObserveCallback.bind(this);

            framework.data.observe(metrics, this.observeCallback , contextId);

        };

        LiquidGauge.prototype = new framework.widgets.CommonWidget(true);

        LiquidGauge.prototype.updateData = function(data) {
            var resourceId = Object.keys(data)[0];
            var resourceUID = Object.keys(data[resourceId])[0];
            this.data = data[resourceId][resourceUID]['data'];

{'fraction_non_alphanumeric': 0.11796199329293405, 'fraction_numerical': 0.010413602400423605, 'mean_word_length': 1.4415397874174087, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6521235', 'n_tokens_mistral': 4428, 'n_tokens_neox': 3970, 'n_words': 1457}