UNPKG

realmap

Version:

Wooritech map chart component library

8 lines (6 loc) 2.48 kB
/** * RealMap Chart v1.0.11 * Copyright (C) 2023-2025 WooriTech Inc. * All Rights Reserved. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("realmap"),require("realchart")):"function"==typeof define&&define.amd?define(["exports","realmap","realchart"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RealMapChart={},e.RealMap,e.RealChart)}(this,(function(e,t,r){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=a(t),n=a(r);class o extends t.Annotation{constructor(){super(...arguments),this._chart=null}get realchart(){return this._chart}set realchart(e){this._chart=e}}o.DEF_SIZE=100,o.type=t.ChartAnnotationType,o.defaults=t.extend(t.MarkerSeries.defaults,{});class s extends t.AnnotationView{constructor(e){super(e,s.CLASS_NAME),this.add(this._foreignObj=new t.RmElement(e,"","foreignObject")),this._htmlView=e.createElementNS("http://www.w3.org/1999/xhtml","div"),this._htmlView.className="rm-chart-annotation-container",this._foreignObj.addDom(this._htmlView)}_doMeasure(e,r,a,i){const n=r.getSize(a,i),s=this._htmlView;return this._foreignObj.resize(t.pickNum(n.width,o.DEF_SIZE),n.height),this.model.realchart||this.$_prepareChart(e),isNaN(this._foreignObj.height)&&(this._foreignObj.height=s.offsetHeight),t.rectToSize(this._foreignObj.bbox())}_doDestory(){this.model.realchart&&(this.model.realchart.destroy(),this.model.realchart=null),this._foreignObj.remove()}$_prepareChart(e){try{const r=this.model.options,a=this._htmlView,i=t.ExternalModuleManager.getInstance().findModule("realchart");if(!i)throw new Error("리얼차트 모듈을 로드하지 못했습니다. realchart 모듈을 등록했는지 확인하세요.");this.model.realchart=i.createChart(e,a,r.config||{},!0)}catch(e){console.error("차트 생성 중 오류가 발생했습니다. 리얼차트의 모듈과 라이선스가 올바르게 적용되었는지 확인하세요.")}}}function h(e,t){if(function(e){return e.Series&&e.SeriesView}(e)){e.Annotation.register(o),e.AnnotationView.register([o,s]);const r=e.ExternalModuleManager.getInstance();t&&r.registerModule("realchart",t)}}s.CLASS_NAME="rm-chart-annotation",h(i,n),e.ChartAnnotation=o,e.default=h,Object.defineProperty(e,"__esModule",{value:!0})}));