---
code: "3D-02"
id: "c-globe"
tab: "spatial"
kind: "core"
title: "Globe · 키워드 글로브"
library: "ECharts-GL"
deps: ["echarts@5", "echarts-gl"]
load: "high"
pasteKind: "echarts-mount"
family: "geospatial"
dataShape: "points on sphere surface"
tasks: ["inspect spatial form", "rotate perspective", "show structure", "inspect shape in 3D", "show global spread"]
tags: ["3d", "spatial", "webgl", "globe", "geo", "키워드", "글로브"]
gallery: "https://graph.heal7.com/#3D-02"
js: "/sku/3D-02.js"
---

# [3D-02] Globe · 키워드 글로브

> AI 붙여넣기 카드. 갤러리 런타임(`main.js`)이 아니라 이 파일을 가져와라.

## 언제 가져가나
3D 구체에 핀 배치 — 본인 키워드(황금) vs 참고.

**응용** 도시 클러스터, 글로벌 사용자 분포.

## 데이터 모양
- family: `geospatial`
- dataShape: points on sphere surface
- tasks: inspect spatial form, rotate perspective, show structure, inspect shape in 3D, show global spread
- tags: 3d, spatial, webgl, globe, geo, 키워드, 글로브


## 의존
echarts@5, echarts-gl · load `high` · library `ECharts-GL`

## 붙여넣는 법
1. echarts 5.x 로드 (GL이면 echarts-gl도)
2. 컨테이너 id를 원본 id와 맞추거나 `document.getElementById` 한 줄만 바꾼다
3. `T`, `reg`, `cssv` 가 필요하면 갤러리 테마 스텁을 함께 가져간다

```js
const T = {
  "bg": "transparent",
  "fg": "#ece8f5",
  "sub": "#a59bbd",
  "grid": "rgba(255,255,255,.08)",
  "gold": "#e8c069",
  "royal": "#6b8cff",
  "rose": "#e07a9f",
  "teal": "#6dd2c4",
  "plum": "#b487e8"
};
const cssv = (n, fb) => (getComputedStyle(document.documentElement).getPropertyValue(n).trim() || fb);
const isDark = () => document.documentElement.getAttribute('data-theme') !== 'light';
const charts = [];
const reg = (id, opt) => {
  const dom = document.getElementById(id); if (!dom) return;
  const c = echarts.init(dom, null, {renderer:'canvas'});
  c.setOption(opt);
  charts.push(c);
  return c;
};
const factory = function(){
  const pts = [];
  for(let i=0;i<60;i++){
    const lat = (Math.random()-.5)*Math.PI;
    const lon = Math.random()*Math.PI*2;
    const r = 1;
    pts.push([r*Math.cos(lat)*Math.cos(lon), r*Math.sin(lat), r*Math.cos(lat)*Math.sin(lon), Math.random()<.2?1:0]);
  }
  reg('c-globe', {
    backgroundColor:T.bg,
    grid3D:{show:false, viewControl:{autoRotate:true, autoRotateSpeed:8, distance:160}},
    xAxis3D:{show:false,type:'value',min:-1.4,max:1.4}, yAxis3D:{show:false,type:'value',min:-1.4,max:1.4}, zAxis3D:{show:false,type:'value',min:-1.4,max:1.4},
    series:[
      // 구체 표현용 surface
      {type:'surface', wireframe:{show:false}, shading:'color', itemStyle:{color:'rgba(107,140,255,.15)', opacity:.4},
        parametric:true, parametricEquation:{
          u:{min:0,max:Math.PI*2,step:Math.PI/30}, v:{min:0,max:Math.PI,step:Math.PI/20},
          x:(u,v)=>Math.sin(v)*Math.cos(u), y:(u,v)=>Math.cos(v), z:(u,v)=>Math.sin(v)*Math.sin(u)
        }
      },
      {type:'scatter3D', data:pts, symbolSize:p=>p[3]?12:5,
        itemStyle:{color:p=>p.data[3]?T.gold:'rgba(255,255,255,.5)', opacity:.9}}
    ]
  });
};
factory();
```

## 원본 factory (갤러리 정본 발췌)
- file: `frontend/js/graph-gallery/main.js`
- lines: 710-734
- gallery: https://graph.heal7.com/#3D-02
- raw js: https://graph.heal7.com/sku/3D-02.js

```js
function(){
  const pts = [];
  for(let i=0;i<60;i++){
    const lat = (Math.random()-.5)*Math.PI;
    const lon = Math.random()*Math.PI*2;
    const r = 1;
    pts.push([r*Math.cos(lat)*Math.cos(lon), r*Math.sin(lat), r*Math.cos(lat)*Math.sin(lon), Math.random()<.2?1:0]);
  }
  reg('c-globe', {
    backgroundColor:T.bg,
    grid3D:{show:false, viewControl:{autoRotate:true, autoRotateSpeed:8, distance:160}},
    xAxis3D:{show:false,type:'value',min:-1.4,max:1.4}, yAxis3D:{show:false,type:'value',min:-1.4,max:1.4}, zAxis3D:{show:false,type:'value',min:-1.4,max:1.4},
    series:[
      // 구체 표현용 surface
      {type:'surface', wireframe:{show:false}, shading:'color', itemStyle:{color:'rgba(107,140,255,.15)', opacity:.4},
        parametric:true, parametricEquation:{
          u:{min:0,max:Math.PI*2,step:Math.PI/30}, v:{min:0,max:Math.PI,step:Math.PI/20},
          x:(u,v)=>Math.sin(v)*Math.cos(u), y:(u,v)=>Math.cos(v), z:(u,v)=>Math.sin(v)*Math.sin(u)
        }
      },
      {type:'scatter3D', data:pts, symbolSize:p=>p[3]?12:5,
        itemStyle:{color:p=>p.data[3]?T.gold:'rgba(255,255,255,.5)', opacity:.9}}
    ]
  });
}
```

