proteic icon indicating copy to clipboard operation
proteic copied to clipboard

Function.name error in proteus-web

Open gyeongchan-yun opened this issue 7 years ago • 0 comments

In proteus-spring-dashboard/src/app/pages/dashboard/proteic/proteic.component.ts, I noticed this issue that when I'd added 'statistics' method, like below:

this.proteicChart = new Linechart([],this.chart.configuration)
                                   .annotations(annotations)
                                   .statistics(statistics)
                                   .unpivot(unpivot);

In proteic/src/svg/base/SvgStrategy.ts,

    public addComponent(component: Function, config: any) {
        let axes: XYAxes = this.container.getComponent(XYAxes.name) as XYAxes;
        switch (component.name) {
            case Annotations.name:
                this.container.add(new Annotations(axes.x, axes.y, config));
                break;
            case ErrorSet.name:
                this.container.add(new ErrorSet());
                break;
            case Statistics.name:
                this.container.add(new Statistics(axes.x, axes.y));
                break;
        }
    }

switch only enter first case , so annotations component is only called

reference site: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name 'JavaScript compressors and minifiers'

gyeongchan-yun avatar Oct 31 '17 15:10 gyeongchan-yun