How to use the tui-code-snippet.extend function in tui-code-snippet

To help you get started, weโ€™ve selected a few tui-code-snippet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nhn / tui.chart / src / js / plugins / raphaelLineTypeBase.js View on Github external
_hideDot(dot, groupIndex, opacity) {
        const prev = this._prevDotAttributes[groupIndex];
        let {outDotStyle} = this;

        // if prev data exists, use prev.r
        // there is dot disappearing issue, when hideDot
        if (prev && !snippet.isUndefined(opacity)) {
            outDotStyle = snippet.extend({
                'r': prev.r,
                'stroke': prev.stroke,
                'fill': prev.fill,
                'stroke-opacity': prev['stroke-opacity'],
                'stroke-width': prev['stroke-width'],
                'fill-opacity': prev['fill-opacity']
            });
        }

        dot.attr(outDotStyle);
        if (dot.node) {
            dot.node.setAttribute('filter', '');
        }

        this.resetSeriesOrder(groupIndex);
    }
github nhn / tui.editor / src / js / ui / popupCodeBlockEditor.js View on Github external
constructor(options) {
    const TEMPLATE_CONTENT = `
            <div class="${CLASS_PREFIX}body"></div>
            <div class="te-button-section">
                <button class="${CLASS_OK_BUTTON}" type="button">${i18n.get('OK')}</button>
                <button class="${CLASS_CLOSE_BUTTON}" type="button">${i18n.get('Cancel')}</button>
            </div>
        `;
    options = util.extend({
      header: true,
      title: 'CodeBlock Editor',
      content: TEMPLATE_CONTENT,
      className: 'tui-popup-code-block-editor',
      headerButtons: TEMPLATE_HEADER_BUTTONS,
      modal: true
    }, options);
    super(options);
  }
github nhn / tui.chart / src / js / components / series / pieChartSeries.js View on Github external
positions.forEach(position =&gt; {
            if (!position) {
                return;
            }

            const end = snippet.extend({}, position.middle);
            if (end.left &lt; centerLeft) {
                end.left -= SERIES_OUTER_LABEL_PADDING;
            } else {
                end.left += SERIES_OUTER_LABEL_PADDING;
            }
            position.end = end;
        });
    }
github nhn / tui.chart / src / js / components / tooltips / mapChartTooltip.js View on Github external
_makeShowTooltipParams(indexes, additionParams) {
        const datum = this.mapModel.getDatum(indexes.index);
        const params = snippet.extend({
            chartType: this.chartType,
            code: datum.code,
            name: datum.name,
            value: datum.label,
            index: indexes.index
        }, additionParams);

        return params;
    }
github nhn / tui.chart / src / js / components / series / pieChartSeries.js View on Github external
};
            const positionData = {
                cx,
                cy,
                angle: popupAngle
            };

            angle = endAngle;

            return {
                ratio,
                angles,
                centerPosition: this._getArcPosition(snippet.extend({
                    r: centerR
                }, positionData)),
                outerPosition: this._getArcPosition(snippet.extend({
                    r: r + (this.legendLongestWidth / 2) + PIE_GRAPH_LEGEND_LABEL_INTERVAL
                }, positionData))
            };
        });
github nhn / tui.chart / src / js / components / series / lineTypeSeriesBase.js View on Github external
LineTypeSeriesBase.mixin = function(func) {
    snippet.extend(func.prototype, LineTypeSeriesBase.prototype);
};
github nhn / tui.image-editor / src / js / action.js View on Github external
mixin(ImageEditor) {
        extend(ImageEditor.prototype, this);
    }
};
github nhn / tui.calendar / src / js / view / week / allday.js View on Github external
scheduleHeight: 18,
        scheduleGutter: 2,
        scheduleContainerTop: 1,
        getViewModelFunc: function(viewModel) {
            return viewModel.schedulesInDateRange.allday;
        }
    }, options);

    /**
     * height of content
     */
    this.contentHeight = 0;

    this.viewType = options.alldayViewType || 'scroll';
    this.collapsed = (this.viewType === 'toggle');
    this.aboutMe = util.extend(
        aboutMe, {
            name: 'allday'
        }
    );

    this.maxScheduleInDay = 0;

    View.call(this, container);
}
github nhn / tui.chart / src / js / components / tooltips / singleTooltipMixer.js View on Github external
if (params.chartType === 'line') {
            this.makeLineLegendIcon(elTooltip.querySelectorAll('.tui-chart-legend-rect.line'));
        }

        elTooltip.setAttribute('data-chart-type', params.chartType);
        this._setIndexesCustomAttribute(elTooltip, indexes);
        this._setShowedCustomAttribute(elTooltip, true);

        this._fireBeforeShowTooltipPublicEvent(indexes, params.silent);

        dom.addClass(elTooltip, 'show');

        positionOption.left = offset.x || 0;
        positionOption.top = offset.y || 0;

        const position = this._makeTooltipPosition(snippet.extend({
            dimension: this.getTooltipDimension(elTooltip),
            positionOption,
            alignOption: this.options.align || ''
        }, params));

        this._moveToPosition(elTooltip, position, prevPosition);
        this.eventBus.fire('hoverSeries', indexes, params.chartType);
        this._fireAfterShowTooltipPublicEvent(indexes, {
            element: elTooltip,
            position
        }, params.silent);
        delete params.silent;
    },