All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.graphic.shape.Polyline.ts Maven / Gradle / Ivy

/**
 * @module zrender/graphic/shape/Polyline
 */

import Path, { PathProps } from '../Path';
import * as polyHelper from '../helper/poly';
import { VectorArray } from '../../core/vector';

export class PolylineShape {
    points: VectorArray[] = null
    // Percent of displayed polyline. For animating purpose
    percent?: number = 1
    smooth?: number = 0
    smoothConstraint?: VectorArray[] = null
}

export interface PolylineProps extends PathProps {
    shape?: Partial
}
class Polyline extends Path {

    shape: PolylineShape

    constructor(opts?: PolylineProps) {
        super(opts);
    }

    getDefaultStyle() {
        return {
            stroke: '#000',
            fill: null as string
        };
    }

    getDefaultShape() {
        return new PolylineShape();
    }

    buildPath(ctx: CanvasRenderingContext2D, shape: PolylineShape) {
        polyHelper.buildPath(ctx, shape, false);
    }
}

Polyline.prototype.type = 'polyline';
export default Polyline;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy