<commit_before>//
//  PolylineGraphic.swift
//  SwiftyEcharts
//
//  Created by <NAME> on 12/02/2017.
//  Copyright © 2017 com.pluto-y. All rights reserved.
//

/// 折线类型的 `Graphic`
public final class PolylineGraphic: Graphic {
    
    /// 折线的位置节点
    public final class Shape {
        
        /// 是否平滑曲线
        ///
        /// - val: 如果为 val：表示贝塞尔 (bezier) 差值平滑，smooth 指定了平滑等级，范围 [0, 1]。
        /// - spline: 如果为 'spline'：表示 Catmull-Rom spline 差值平滑。
        public enum Smooth: Jsonable {
            case val(Float)
            case spline
            
            public var jsonString: String {
                switch self {
                case let .val(val):
                    return "\(val)"
                case .spline:
                    return "\"spline\""
                }
            }
        }
        
        /// 点列表，用于定义形状，如 [[22, 44], [44, 55], [11, 44], ...]
        public var point: [[Float]]?
        /// 是否平滑曲线
        public var smooth: Smooth?
        /// 是否将平滑曲线约束在包围盒中。smooth 为 number（bezier）时生效。
        public var smoothConstraint: Bool?
        
        public init() {}
    }
    
    /// MARK: Graphic
    public var type: GraphicType {
        return .polygon
    }
    public var id: String?
    public var action: GraphicAction?
    public var left: Position?
    public var right: Position?
    public var top: Position?
    public var bottom: Position?
    public var bounding: GraphicBounding?
    public var z: Float?
    public var zlevel: Float?
    public var silent: Bool?
    public var invisible: Bool?
    public var cursor: String?
    public var draggable: Bool?
    public var progressive: Bool?
    
    /// 折线的位置节点
    public var shape: Shape?
    /// 折线的样式
    public var style: CommonGraphicStyle?
    
    public init() {}
}

extension PolylineGraphic.Shape: Enumable {
    public enum Enums {
        case point([[Float]]), smooth(Smooth), smoothConstraint(Bool)
    }
    
    public typealias ContentEnum = Enums
    
    public convenience init(_ elements: Enums...) {
        self.init()
        for ele in elements {
            switch ele {
            case let .point(point):
                self.point = point
            case let .smooth(smooth):
                self.smooth = smooth
            case let .smoothConstraint(smoothConstraint):
                self.smoothConstraint = smoothConstraint
            }
        }
    }<commit_msg>fix: Update property's type for 'point' in `PolylineGraphic`<commit_after>//
//  PolylineGraphic.swift
//  SwiftyEcharts
//
//  Created by <NAME> on 12/02/2017.
//  Copyright © 2017 com.pluto-y. All rights reserved.
//

/// 折线类型的 `Graphic`
public final class PolylineGraphic: Graphic {
    
    /// 折线的位置节点
    public final class Shape {
        
        /// 是否平滑曲线
        ///
        /// - val: 如果为 val：表示贝塞尔 (bezier) 差值平滑，smooth 指定了平滑等级，范围 [0, 1]。
        /// - spline: 如果为 'spline'：表示 Catmull-Rom spline 差值平滑。
        public enum Smooth: Jsonable {
            case val(Float)
            case spline
            
            public var jsonString: String {
                switch self {
                case let .val(val):
                    return "\(val)"
                case .spline:
                    return "\"spline\""
                }
            }
        }
        
        /// 点列表，用于定义形状，如 [[22, 44], [44, 55], [11, 44], ...]
        public var point: [Point]?
        /// 是否平滑曲线
        public var smooth: Smooth?
        /// 是否将平滑曲线约束在包围盒中。smooth 为 number（bezier）时生效。
        public var smoothConstraint: Bool?
        
        public init() {}
    }
    
    /// MARK: Graphic
    public var type: GraphicType {
        return .polygon
    }
    public var id: String?
    public var action: GraphicAction?
    public var left: Position?
    public var right: Position?
    public var top: Position?
    public var bottom: Position?
    public var bounding: GraphicBounding?
    public var z: Float?
    public var zlevel: Float?
    public var silent: Bool?
    public var invisible: Bool?
    public var cursor: String?
    public var draggable: Bool?
    public var progressive: Bool?
    
    /// 折线的位置节点
    public var shape: Shape?
    /// 折线的样式
    public var style: CommonGraphicStyle?
    
    public init() {}
}

extension PolylineGraphic.Shape: Enumable {
    public enum Enums {
        case point([Point]), smooth(Smooth), smoothConstraint(Bool)
    }
    
    public typealias ContentEnum = Enums
    
    public convenience init(_ elements: Enums...) {
        self.init()
        for ele in elements {
            switch ele {
            case let .point(point):
                self.point = point
            case let .smooth(smooth):
                self.smooth = smooth
            case let .smoothConstraint(smoothConstraint):
                self.smoothConstraint = smoothConstraint
            }
        }
    }
{'fraction_non_alphanumeric': 0.10104744300677758, 'fraction_numerical': 0.010679811049496817, 'mean_word_length': 1.5931842385516506, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '129133', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1583, 'n_words': 421}