realmap
Version:
Wooritech map chart component library
8 lines (6 loc) • 2.51 kB
JavaScript
/**
* RealMap Chart v1.1.20
* Copyright (C) 2023-2026 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 n=a(t),i=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.Annotation.defaults,{animatable:!0});class h extends t.AnnotationView{constructor(e){super(e,h.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,n){const i=r.getSize(a,n),h=this._htmlView;return this._foreignObj.resize(t.pickNum(i.width,o.DEF_SIZE),i.height),this.model.realchart||this.$_prepareChart(e),isNaN(this._foreignObj.height)&&(this._foreignObj.height=h.offsetHeight),t.rectToSize(this._foreignObj.bbox())}_doDispose(){this.model.realchart&&(this.model.realchart.destroy(),this.model.realchart=null),this._foreignObj.remove()}$_prepareChart(e){try{const r=this._htmlView,a=t.ExternalModuleManager.getInstance().findModule("realchart");if(!a)throw new Error("리얼차트 모듈을 로드하지 못했습니다. realchart 모듈을 등록했는지 확인하세요.");this.model.realchart=a.createChart(e,r,this.model.prop("config"),this.model.prop("animatable"))}catch(e){console.error("차트 생성 중 오류가 발생했습니다. 리얼차트의 모듈과 라이선스가 올바르게 적용되었는지 확인하세요.")}}}function s(e,t){if(function(e){return e.Series&&e.SeriesView}(e)){e.Annotation.register(o),e.AnnotationView.register([o,h]);const r=e.ExternalModuleManager.getInstance();t&&r.registerModule("realchart",t)}}h.CLASS_NAME="rm-chart-annotation",s(n,i),e.ChartAnnotation=o,e.default=s,Object.defineProperty(e,"__esModule",{value:!0})}));