<commit_before>define(function (require) {

    var zrUtil = require('zrender/core/util');
    var Group = require('zrender/container/Group');
    var symbolUtil = require('../../util/symbol');
    var graphic = require('../../util/graphic');

    function normalizeSymbolSize(symbolSize) {
        if (!zrUtil.isArray(symbolSize)) {
            symbolSize = [+symbolSize, +symbolSize];
        }
        return symbolSize;
    }

    function isAroundEqual(a, b) {
        return Math.abs(a - b) < 1e-4;
    }

    function isSymbolSizeSame(a, b) {
        return isAroundEqual(a[0], b[0]) && isAroundEqual(a[1], b[1]);
    }

    function createSymbol(data, idx, enableAnimation) {
        var point = data.getItemLayout(idx);
        var color = data.getItemVisual(idx, 'color');

        var symbolSize = data.getItemVisual(idx, 'symbolSize');
        var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';

        if (!symbolType || symbolType === 'none') {
            return;
        }

        symbolSize = normalizeSymbolSize(symbolSize);

        var x = -symbolSize[0] / 2;
        var y = -symbolSize[1] / 2;
        var w = symbolSize[0];
        var h = symbolSize[1];
        var symbolEl = symbolUtil.createSymbol(
            symbolType, x, y, w, h, color
        );

        symbolEl.position = point;

        symbolEl.z2 = 100;

        if (enableAnimation) {

            symbolEl.scale = [0, 0];

            symbolEl.animateTo({
                scale: [1, 1]
            }, 500);
        }
        else {
            symbolEl.scale = [1, 1];
        }

        return symbolEl;
    }

    function DataSymbol() {
        this.group = new Group();
    }

    DataSymbol.prototype = {

        getData: function () {
            return this._data;
        },

        updateData: function (data, enableAnimation) {

            var group = this.group;
            var oldData = this._data;

            data.diff(oldData)
                .add(function (newIdx) {
                    // 空数据
                    // TODO
                    if (!data.hasValue(newIdx)) {
                        return;
                    }

                    var symbolEl = createSymbol(
                        data, newIdx, enableAnimation
                    );

                    if (symbolEl) {
                        data.setItemGraphicEl(newIdx, symbolEl);

                        group.add(symbolEl);
                    }
                })
                .update(function (newIdx, oldIdx) {
                    var el = oldData.getItemGraphicEl(oldIdx);

                    // Empty data
                    if (!data.hasValue(newIdx)) {
                        group.remove(el);
                        return;
                    }

                    var symbolSize = normalizeSymbolSize(
                        data.getItemVisual(newIdx, 'symbolSize')
                    );
                    var point = data.getItemLayout(newIdx);

                    var symbolType = data.getItemVisual(newIdx, 'symbol');
                    // Symbol changed
                    if (oldData.getItemVisual(oldIdx, 'symbol') !== symbolType) {
                        // Remove the old one
                        el && group.remove(el);
                        el = createSymbol(data, newIdx, enableAnimation);
                        // Disable symbol by setting `symbol: 'none'`
                        if (!el) {
                            return;
                        }
                    }
                    else {
                        var newTarget = {};
                        if (!isSymbolSizeSame(
                            symbolSize, normalizeSymbolSize(
                                oldData.getItemVisual(oldIdx, 'symbolSize')
                            )
                        )) {
                            // FIXME symbol created with pathStr has symbolSizeChanged
                            newTarget = symbolUtil.getSymbolShape(
                                symbolType,<commit_msg>Bug in line chart updating when symbol is none<commit_after>define(function (require) {

    var zrUtil = require('zrender/core/util');
    var Group = require('zrender/container/Group');
    var symbolUtil = require('../../util/symbol');
    var graphic = require('../../util/graphic');

    function normalizeSymbolSize(symbolSize) {
        if (!zrUtil.isArray(symbolSize)) {
            symbolSize = [+symbolSize, +symbolSize];
        }
        return symbolSize;
    }

    function isAroundEqual(a, b) {
        return Math.abs(a - b) < 1e-4;
    }

    function isSymbolSizeSame(a, b) {
        return isAroundEqual(a[0], b[0]) && isAroundEqual(a[1], b[1]);
    }

    function createSymbol(data, idx, enableAnimation) {
        var point = data.getItemLayout(idx);
        var color = data.getItemVisual(idx, 'color');

        var symbolSize = data.getItemVisual(idx, 'symbolSize');
        var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';

        if (!symbolType || symbolType === 'none') {
            return;
        }

        symbolSize = normalizeSymbolSize(symbolSize);

        var x = -symbolSize[0] / 2;
        var y = -symbolSize[1] / 2;
        var w = symbolSize[0];
        var h = symbolSize[1];
        var symbolEl = symbolUtil.createSymbol(
            symbolType, x, y, w, h, color
        );

        symbolEl.position = point;

        symbolEl.z2 = 100;

        if (enableAnimation) {

            symbolEl.scale = [0, 0];

            symbolEl.animateTo({
                scale: [1, 1]
            }, 500);
        }
        else {
            symbolEl.scale = [1, 1];
        }

        return symbolEl;
    }

    function DataSymbol() {
        this.group = new Group();
    }

    DataSymbol.prototype = {

        getData: function () {
            return this._data;
        },

        updateData: function (data, enableAnimation) {

            var group = this.group;
            var oldData = this._data;

            data.diff(oldData)
                .add(function (newIdx) {
                    // 空数据
                    // TODO
                    if (!data.hasValue(newIdx)) {
                        return;
                    }

                    var symbolEl = createSymbol(
                        data, newIdx, enableAnimation
                    );

                    if (symbolEl) {
                        data.setItemGraphicEl(newIdx, symbolEl);

                        group.add(symbolEl);
                    }
                })
                .update(function (newIdx, oldIdx) {
                    var el = oldData.getItemGraphicEl(oldIdx);
                    // Empty data
                    if (!data.hasValue(newIdx)) {
                        group.remove(el);
                        return;
                    }

                    var symbolSize = normalizeSymbolSize(
                        data.getItemVisual(newIdx, 'symbolSize')
                    );
                    var point = data.getItemLayout(newIdx);

                    var symbolType = data.getItemVisual(newIdx, 'symbol');
                    // Symbol changed
                    if (oldData.getItemVisual(oldIdx, 'symbol') !== symbolType) {
                        // Remove the old one
                        el && group.remove(el);
                        el = createSymbol(data, newIdx, enableAnimation);
                        // Disable symbol by setting `symbol: 'none'`
                        if (!el) {
                            return;
                        }
                    }
                    else {
                        // Update animation
                        if (!el) {
                            return;
                        }
                        var newTarget = {};
                        if (!isSymbolSizeSame(
                            symbolSize, normalizeSymbolSize(
                                oldData.getItemVisual(oldIdx, 'symbolSize')
                            )
                        )) {
                            // FIXME symbol created with pathStr has symbolSizeChanged
                            newTarget = symbolUtil.getSymbolShape(
                                symbolType,
{'fraction_non_alphanumeric': 0.10134236304268956, 'fraction_numerical': 0.006046680372475511, 'mean_word_length': 1.1303451828954147, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4601800', 'n_tokens_mistral': 2138, 'n_tokens_neox': 1976, 'n_words': 442}