<commit_before>'use strict';

// ---external global dependencies
/* global d3:false */

var pie = module.exports = {},
    Plotly = require('./plotly'),
    isNumeric = require('./isnumeric'),
    tinycolor = require('tinycolor2');

Plotly.Plots.register(pie, 'pie', ['pie']);

pie.attributes = {
    // data
    labels: {type: 'data_array'},
    // equivalent of x0 and dx, if label is missing
    label0: {type: 'number', dflt: 0},
    dlabel: {type: 'number', dflt: 1},

    values: {type: 'data_array'},

    // if color is missing, use default trace color set
    colors: {type: 'data_array'},

    scalegroup: {
        /**
         * if there are multiple pies that should be sized according to
         * their totals, link them by providing a non-empty group id here
         * shared by every trace in the same group
         * see eg:
         * https://www.e-education.psu.edu/natureofgeoinfo/sites/www.e-education.psu.edu.natureofgeoinfo/files/image/hisp_pies.gif
         * (this example involves a map too - may someday be a whole trace type
         * of its own. but the point is the size of the whole pie is important.)
         */
        type: 'string',
        dflt: ''
    },

    // TODO: after this add to restyle lists

    // labels (legend is handled by plots.attributes.showlegend and layout.legend.hiddenslices)
    insideinfo: {
        // text to show in the slices
        mode: {
            type: 'enumerated',
            values: ['label', 'percent', 'value', 'none'],
            dflt: 'percent'
        },
        font: {type: 'font'}
    },
    outsideinfo: {
        // text to show around the outside of the slices
        mode: {
            type: 'enumerated',
            values: ['label', 'percent', 'value', 'none'],
            dflt: 'none'
        },
        font: {type: 'font'}
    },

    // position and shape
    domain: { // TODO: this breaks filehst.utils.DATA_ARRAY_KEYS because we need x and y to be data.
        x: [
            {type: 'number', min: 0, max: 1, dflt: 0},
            {type: 'number', min: 0, max: 1, dflt: 1}
        ],
        y: [
            {type: 'number', min: 0, max: 1, dflt: 0},
            {type: 'number', min: 0, max: 1, dflt: 1}
        ]
    },
    tilt: {
        // degrees to tilt the pie back from straight on
        type: 'number',
        min: 0,
        max: 90,
        dflt: 0
    },
    tiltaxis: {
        // degrees away from straight up to tilt the pie
        // only has an effect if tilt is nonzero
        type: 'number',
        min: -360,
        max: 360,
        dflt: 0
    },
    depth: {
        // "3D" size, as a fraction of radius
        // only has an effect if tilt is nonzero
        type: 'number',
        min: 0,
        max: 10,
        dflt: 0.5
    },
    hole: {
        // fraction of the radius to cut out and make a donut
        type: 'number',
        min: 0,
        max: 1,
        dflt: 0
    },

    // ordering and direction
    sort: {
        // reorder slices from largest to smallest?
        type: 'boolean',
        dflt: true
    },
    direction: {
        /**
         * there are two common conventions, both of which place the first
         * (largest, if sorted) slice with its left edge at 12 o'clock but
         * succeeding slices follow either cw or ccw from there.
         *
         * see http://visage.co/data-visualization-101-pie-charts/
         */
        type: 'enumerated',
        values: ['cw', 'ccw'],
        dflt: 'ccw'
    },
    rotation: {
        // instead of the first slice starting at 12 o'clock, rotate to some other angle
        type: 'number',
        min: -360,
        max: 360,
        dflt: 0
    },

    // style
    line: {
        color: {
            type: 'color',
            arrayOk: true
        },
        width: {
            type: 'number',
            min: 0,
            dflt: 0,
            arrayOk: true
        }
    },
    shading: {
        // how much darker to make the sides than the top,
        // with a 3D effect. We could of course get all
        // fancy with lighting effects, but maybe this is
        // sufficient.
        type: 'number',
        min: 0,
        max: 1,
        dflt: 0.2
    },
    pull: {
        // fraction of larger radius to pull the slices
        // out from the center. This can be a constant
        // to pull all slices apart from each other equally
        // or an array to highlight one or more slices
        type: 'number',
        min: 0,<commit_msg>pie line default color<commit_after>'use strict';

// ---external global dependencies
/* global d3:false */

var pie = module.exports = {},
    Plotly = require('./plotly'),
    isNumeric = require('./isnumeric'),
    tinycolor = require('tinycolor2');

Plotly.Plots.register(pie, 'pie', ['pie']);

pie.attributes = {
    // data
    labels: {type: 'data_array'},
    // equivalent of x0 and dx, if label is missing
    label0: {type: 'number', dflt: 0},
    dlabel: {type: 'number', dflt: 1},

    values: {type: 'data_array'},

    // if color is missing, use default trace color set
    colors: {type: 'data_array'},

    scalegroup: {
        /**
         * if there are multiple pies that should be sized according to
         * their totals, link them by providing a non-empty group id here
         * shared by every trace in the same group
         * see eg:
         * https://www.e-education.psu.edu/natureofgeoinfo/sites/www.e-education.psu.edu.natureofgeoinfo/files/image/hisp_pies.gif
         * (this example involves a map too - may someday be a whole trace type
         * of its own. but the point is the size of the whole pie is important.)
         */
        type: 'string',
        dflt: ''
    },

    // TODO: after this add to restyle lists

    // labels (legend is handled by plots.attributes.showlegend and layout.legend.hiddenslices)
    insideinfo: {
        // text to show in the slices
        mode: {
            type: 'enumerated',
            values: ['label', 'percent', 'value', 'none'],
            dflt: 'percent'
        },
        font: {type: 'font'}
    },
    outsideinfo: {
        // text to show around the outside of the slices
        mode: {
            type: 'enumerated',
            values: ['label', 'percent', 'value', 'none'],
            dflt: 'none'
        },
        font: {type: 'font'}
    },

    // position and shape
    domain: { // TODO: this breaks filehst.utils.DATA_ARRAY_KEYS because we need x and y to be data.
        x: [
            {type: 'number', min: 0, max: 1, dflt: 0},
            {type: 'number', min: 0, max: 1, dflt: 1}
        ],
        y: [
            {type: 'number', min: 0, max: 1, dflt: 0},
            {type: 'number', min: 0, max: 1, dflt: 1}
        ]
    },
    tilt: {
        // degrees to tilt the pie back from straight on
        type: 'number',
        min: 0,
        max: 90,
        dflt: 0
    },
    tiltaxis: {
        // degrees away from straight up to tilt the pie
        // only has an effect if tilt is nonzero
        type: 'number',
        min: -360,
        max: 360,
        dflt: 0
    },
    depth: {
        // "3D" size, as a fraction of radius
        // only has an effect if tilt is nonzero
        type: 'number',
        min: 0,
        max: 10,
        dflt: 0.5
    },
    hole: {
        // fraction of the radius to cut out and make a donut
        type: 'number',
        min: 0,
        max: 1,
        dflt: 0
    },

    // ordering and direction
    sort: {
        // reorder slices from largest to smallest?
        type: 'boolean',
        dflt: true
    },
    direction: {
        /**
         * there are two common conventions, both of which place the first
         * (largest, if sorted) slice with its left edge at 12 o'clock but
         * succeeding slices follow either cw or ccw from there.
         *
         * see http://visage.co/data-visualization-101-pie-charts/
         */
        type: 'enumerated',
        values: ['cw', 'ccw'],
        dflt: 'ccw'
    },
    rotation: {
        // instead of the first slice starting at 12 o'clock, rotate to some other angle
        type: 'number',
        min: -360,
        max: 360,
        dflt: 0
    },

    // style
    line: {
        color: {
            type: 'color',
            dflt: Plotly.Color.defaultLine,
            arrayOk: true
        },
        width: {
            type: 'number',
            min: 0,
            dflt: 0,
            arrayOk: true
        }
    },
    shading: {
        // how much darker to make the sides than the top,
        // with a 3D effect. We could of course get all
        // fancy with lighting effects, but maybe this is
        // sufficient.
        type: 'number',
        min: 0,
        max: 1,
        dflt: 0.2
    },
    pull: {
        // fraction of larger radius to pull the slices
        // out from the center. This can be a constant
        // to pull all slices apart from each other equally
        // or an array to highlight one or more slices
        type: 'number',
        min: 0,
{'fraction_non_alphanumeric': 0.1165434278777177, 'fraction_numerical': 0.013243571349740647, 'mean_word_length': 1.5832383124287344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '240983', 'n_tokens_mistral': 2860, 'n_tokens_neox': 2687, 'n_words': 990}