HeatmapSeries extends MarkerSeries
HeatmapSeries의 기능을 사용하기 위해서는 'heatmap'모듈이 필요하다. 자세한 설명은 guide/modules에서 확인할 수 있다.
Heatmap 시리즈 모델.
type은 'heatmap'이고,
설정 모델은 HeatmapSeriesOptions이다.
HeatmapSeries의 기능을 사용하기 위해서는 'heatmap'모듈이 필요하다. 자세한 설명은 guide/modules에서 확인할 수 있다.
Properties
data: any (opens in a new tab) readonly
데이터포인터들을 생성하는 데 사용되는 값 목록.
default :undefined
index: number (opens in a new tab) readonly
차트 시리즈 목록에서 위치.
default :undefined
name: string (opens in a new tab) readonly
시리즈 이름.
시리즈 생성시 지정된 후 변경할 수 없다.
맵차트의 다른 구성 요소에서 이 시리즈를 참조할 때 사용되며,
레전드나 툴팁에서 시리즈를 나타내는 텍스트로도 사용된다.
default :undefined
pointLabel: DataPointLabel readonly
데이터포인트 label 설정 모델.
default :undefined
visible: boolean (opens in a new tab)
표시 여부.
options.visible 값을 그대로 return하는 것이 아니라,
undefined나 null 등으로 지정하는 경우 모델의 상태에 따라 true나 false로 해석될 수 있다.
설정의 경우 updateOptions({visible: value})로 지정하는 것과 동일하다.
default :undefined
Methods
addPoint(source, index?, duration?): DataPoint
데이터포인트를 하나 추가한다.
데이터포인트 하나를 제거하라면 removePoint를 사용한다.
| Parameter | Type | Description |
|---|---|---|
| source | any (opens in a new tab) | 데이터포인트 정보 |
| index | number (opens in a new tab) | 추가 위치. 0보다 적으면 마지막에 추가된다. |
| duration | number (opens in a new tab) | 0보다 큰값을 지정하면 애니메이션이 표시된다. |
return 생성된 데이터포인트 객체
addPointList(source, index?, duration?): Array (opens in a new tab)<DataPoint>
데이터포인트를 하나 이상 추가한다.
여러 데이터포인트 한꺼번에 제거하라면 removePointList를 사용한다.
| Parameter | Type | Description |
|---|---|---|
| source | Array (opens in a new tab)<any (opens in a new tab)> | 데이터포인트 정보 목록 |
| index | number (opens in a new tab) | 추가 위치. 0보다 적으면 마지막에 추가된다. |
| duration | number (opens in a new tab) | 0보다 큰값을 지정하면 애니메이션이 표시된다. |
return 생성된 데이터포인트 객체 목록
bool(prop, def?, fallback?): boolean (opens in a new tab)
boolean (opens in a new tab) 타입의 옵션 값에 특화된 prop() 메서드. prop()과 달리 boolean (opens in a new tab)으로 변환해서 반환한다.
| Parameter | Type | Description |
|---|---|---|
| prop | K | 설정 항목 이름 |
| def | boolean (opens in a new tab) | 기본값. 설정하지 않으면 defaults의 값을 사용한다. |
| fallback | boolean (opens in a new tab) |
return boolean (opens in a new tab) 타입의 옵션 값.
boolAt(path, def?, fallback?): boolean (opens in a new tab)
점(dot) 표기법으로 경로를 지정해서 boolean (opens in a new tab) 타입의 옵션 값을 반환한다.
| Parameter | Type | Description |
|---|---|---|
| path | string (opens in a new tab) | 경로 문자열 |
| def | boolean (opens in a new tab) | |
| fallback | boolean (opens in a new tab) |
return 경로에 해당하는 boolean (opens in a new tab) 타입의 옵션 값 또는 false
clean(recursive?): HeatmapSeries
_op에 명시적으로 설정되어 있지만 값이 현재 defaults와 동일한 항목들을 제거해
_op를 minimal delta 상태로 정규화한다.
[주의] 대부분의 경우 호출할 필요가 없다.
- 효과 값(
prop/num/props)은 영향 없음. - 직렬화(
saveOptions)도 어차피 defaults와 같은 값을 필터링하므로 결과가 동일하다. 즉 외부 저장 결과는 clean 전후가 같다.
clean이 실제로 차이를 만드는 경우는 다음과 같다.
_op의 메모리 사용을 줄이고 싶을 때(loadOptions로 큰 source를 읽어들인 직후 등).getOption()/saveOption()처럼 _op의 own value를 그대로 반환하는 API의 결과를 "사용자가 명시했는가"의 의미로 사용해야 할 때(예: 디자이너 UI의 "기본값 사용 중" 표시). 이 경우 clean 후에는 defaults와 같은 값들이undefined로 보고된다.
| Parameter | Type | Description |
|---|---|---|
| recursive | boolean (opens in a new tab) | true로 지정하면 모든 자식 모델에 대해서도 재귀적으로 수행한다. 기본값: true |
return 모델 객체 자신
clearOptions(recursive?, render?): HeatmapSeries
명시적으로 설정된 모든 모델 설정 값들을 제거한다.
| Parameter | Type | Description |
|---|---|---|
| recursive | boolean (opens in a new tab) | true로 지정하면 모든 자식 모델에 대해서도 재귀적으로 제거한다. 기본값: false |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 컨트롤을 다시 그린다. 기본값: true |
return 모델 객체 자신
clearStyle(render?): HeatmapSeries
명시적으로 모델에 설정된 모든 style 값들을 제거한다.
| Parameter | Type | Description |
|---|---|---|
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값 false |
dispose(): null
객체를 해제하고 null을 반환한다.
사용 예: this._obj = this._obj.dispose();
return null
getOption(option): any (opens in a new tab)
옵션 값을 읽는다.
prop()과 달리 효과 값이 아닌 명시적으로 설정된 값만 읽는다. 설정되지 않은 옵션은 undefined를 반환한다.
| Parameter | Type | Description |
|---|---|---|
| option | string (opens in a new tab) | 설정 항목 이름 |
return 명시적으로 설정된 값 또는 undefined
getOptionAt(path): any (opens in a new tab)
점(dot) 표기법으로 경로를 지정해서 옵션 값을 읽는다.
| Parameter | Type | Description |
|---|---|---|
| path | string (opens in a new tab) | 경로 문자열 |
return 경로에 해당하는 옵션 값 또는 undefined
init(): HeatmapSeries
특정 부모에 마운팅되지 않은 독립된 옵션 객체를 초기화한다.
initAndLoad(source): HeatmapSeries
특정 부모에 마운팅되지 않은 독립된 옵션 객체를 초기화하고, source 객체로부터 옵션 값을 읽어서 설정한다.
| Parameter | Type |
|---|---|
| source | any (opens in a new tab) |
loadOptions(source): HeatmapSeries
source 객체로부터 모델 설정 값을 읽어서 적용한다.
[정책] load는 source에 명시된 값을 "사용자 의도"로 그대로 보존한다. 즉 source의 값이
현재 defaults와 같더라도 _op에 그대로 기록된다. 이는 단순한 성능 최적화가 아니라
의미상 의도된 동작이다:
defaults는 라이브러리 버전업 시 변경될 수 있다.- load 시점에 "defaults와 같다"는 이유로 키를 버리면, 이후
defaults가 바뀌었을 때 저장본이 표현하던 값이 조용히 달라진다. - 그대로 보존하면 사용자가 명시적으로 지정한 값이 항상 우선한다.
직렬화(saveOptions)는 어차피 defaults와 같은 값을 필터링하므로, 외부에 저장되는
결과의 크기와 내용에는 영향이 없다. 추가 비용은 _op에 약간의 메모리뿐이다.
(메모리 정리나 getOption()의 "사용자 명시 여부" 의미가 필요한 특수 케이스에 한해서만
clean()을 명시적으로 호출한다.)
| Parameter | Type |
|---|---|
| source | any (opens in a new tab) |
lock(): void (opens in a new tab)
rendering lock.
num(prop, def?): number (opens in a new tab)
숫자 타입의 옵션 값에 특화된 prop() 메서드. prop()과 달리 숫자로 변환해서 반환한다.
| Parameter | Type | Description |
|---|---|---|
| prop | K | 설정 항목 이름 |
| def | number (opens in a new tab) | 기본값. 설정하지 않으면 defaults의 값을 사용한다. |
return 숫자 타입의 옵션 값.
numAt(path, def?): number (opens in a new tab)
점(dot) 표기법으로 경로를 지정해서 숫자 타입의 옵션 값을 반환한다.
| Parameter | Type | Description |
|---|---|---|
| path | string (opens in a new tab) | 경로 문자열 |
| def | number (opens in a new tab) |
return 경로에 해당하는 숫자 타입의 옵션 값 또는 NaN
prop(prop, def?): HeatmapSeriesOptions[K]
옵션의 효과 값(effective value)을 반환한다.
명시적으로 설정된 값이 있으면 그 값을, 없으면 클래스의 defaults에 정의된 기본값을 반환한다.
옵션 값을 읽을 때는 options.prop 직접 접근 대신 이 메서드를 사용한다.
| Parameter | Type | Description |
|---|---|---|
| prop | K | 설정 항목 이름 |
| def | any (opens in a new tab) | 기본값. 설정하지 않으면 defaults의 값을 사용한다. |
propAt(path, def?): any (opens in a new tab)
점(dot) 표기법으로 경로를 지정해서 옵션의 효과 값(effective value)을 반환한다.
| Parameter | Type | Description |
|---|---|---|
| path | string (opens in a new tab) | 경로 문자열 |
| def | any (opens in a new tab) |
return 경로에 해당하는 옵션 값 또는 undefined
propIs(prop, value): boolean (opens in a new tab)
옵션 값이 특정 값과 일치하는지 여부를 반환한다.
| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) HeatmapSeriesOptions | 설정 항목 이름 |
| value | any (opens in a new tab) | 비교할 값 |
return 일치 여부
propIsNot(prop, value): boolean (opens in a new tab)
옵션 값이 특정 값과 일치하지 않는지 여부를 반환한다.
| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) HeatmapSeriesOptions | 설정 항목 이름 |
| value | any (opens in a new tab) | 비교할 값 |
return 불일치 여부
props(props): Pick<HeatmapSeriesOptions, K>
지정한 옵션들의 효과 값(effective value)을 묶어서 반환한다.
여러 옵션을 destructuring으로 한꺼번에 읽을 때 사용한다.
const { color, radius } = this.props('color', 'radius');| Parameter | Type | Description |
|---|---|---|
| props | Array (opens in a new tab)<K> | 설정 항목 이름들 |
removeAt(path, render?): any (opens in a new tab)
명시적으로 설정된 하위 모델의 설정 값을 제거해서 모델의 기본 값이 적용되도록 한다.
path 매개변수는 하위 모델의 속성 이름을 점(.)으로 구분해서 지정한다.
예를 들어, "axis.x"는 axis 모델의 x 속성을 의미한다.
render와 force 매개변수는 toggleOption과 동일하다.
| Parameter | Type |
|---|---|
| path | string (opens in a new tab) |
| render | boolean (opens in a new tab) |
removeOption(prop, render?): HeatmapSeries
명시적으로 설정된 모델 설정 값을 제거해서 모델의 기본 값이 적용되도록 한다.
prop이 자식 모델 이름인 경우에는 해당 자식의 clearOptions(true)를 호출한다.
| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) HeatmapSeriesOptions | 설정 항목 이름 |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 컨트롤을 다시 그린다. 기본값 true |
return 모델 객체 자신
removePoint(p, duration?): void (opens in a new tab)
지정한 데이터포인트를 제거한다.
데이터포인트 하나를 추가하라면 addPoint를 사용한다.
| Parameter | Type | Description |
|---|---|---|
| p | string (opens in a new tab) | number (opens in a new tab) | DataPoint | 삭제할 데이터포인트 객체나 인덱스 또는 문자열 id |
| duration | number (opens in a new tab) | 0보다 크면 삭제 애니메이션 표시 |
removePointList(points, duration?): Array (opens in a new tab)<DataPoint>
복수 개 데이터포인트를 제거한다.
데이터포인트를 여러개 동시에 추가하라면 addPointList를 사용한다.
| Parameter | Type | Description |
|---|---|---|
| points | Array (opens in a new tab)<string (opens in a new tab) | number (opens in a new tab) | DataPoint> | |
| duration | number (opens in a new tab) | 0보다 크면 삭제 애니메이션 표시 |
saveOption(prop): HeatmapSeriesOptions[K] | Record<string (opens in a new tab), any (opens in a new tab)>
옵션 값을 읽는다.
prop()과 달리 효과 값이 아닌 명시적으로 설정된 값만 읽는다. 설정되지 않은 옵션은 undefined를 반환한다.
| Parameter | Type | Description |
|---|---|---|
| prop | K | 설정 항목 이름 |
return 명시적으로 설정된 값 또는 undefined
saveOptions(props?, recursive?, includeDefs?): Partial<HeatmapSeriesOptions>
모델의 설정 값을 json 객체로 직렬화한다.
| Parameter | Type | Description |
|---|---|---|
| props | Record<string (opens in a new tab), any (opens in a new tab)> | Array (opens in a new tab)<keyof (opens in a new tab) HeatmapSeriesOptions> | 저장할 속성 필터. |
(keyof OP)[]배열: 해당 키들만 저장.- 객체 (
{ [K in keyof OP]?: any }): 객체에 정의된 키들만 저장. 자식 모델 키의 값으로 객체를 지정하면 해당 자식의saveOptions(childFilter, true, includeDefs)호출 시 필터로 전달된다. - 생략 또는 빈 배열: 모든 속성 저장. |
| recursive |
boolean(opens in a new tab) | 자식 모델까지 재귀 저장 여부. | | includeDefs |boolean(opens in a new tab) | 기본값과 동일한 값도 저장 여부. |
saveTo(target, props?, recursive?, includeDefs?): Partial<HeatmapSeriesOptions>
모델의 설정 값을 target 객체에 복사해서 저장한다.
| Parameter | Type |
|---|---|
| target | Partial<HeatmapSeriesOptions> |
| props | Array (opens in a new tab)<keyof (opens in a new tab) HeatmapSeriesOptions> | Record<string (opens in a new tab), any (opens in a new tab)> |
| recursive | boolean (opens in a new tab) |
| includeDefs | boolean (opens in a new tab) |
setStyle(prop, value, render?): HeatmapSeries
모델 css style 값을 변경한다.
value에 undefined나 null, ''을 지정하면 기존에 설정됐던 스타일 항목이 제거된다.
| Parameter | Type | Description |
|---|---|---|
| prop | string (opens in a new tab) | css 스타일 항목 이름. |
| value | any (opens in a new tab) | 적용할 스타일 값. |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값 true |
setStyles(props, clear?, render?): HeatmapSeries
여러 항목의 모델 css style 값들을 json 객체로 지정해서 동시에 변경한다.
value에 undefined나 null, ''을 지정하면 기존에 설정됐던 스타일 항목이 제거된다.
| Parameter | Type | Description |
|---|---|---|
| props | object (opens in a new tab) | 스타일 항목들과 값들이 설정된 json 객체 |
| clear | boolean (opens in a new tab) | true로 지정하면 기존 스타일 값을 모두 제거한다. 기본값 false |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값 true |
toggleAt(path, render?): any (opens in a new tab)
boolean (opens in a new tab) 타입의 모델 설정 값을 반대 값으로 변경한다.
path 매개변수는 하위 모델의 속성 이름을 점(.)으로 구분해서 지정한다.
예를 들어, "axis.x"는 axis 모델의 x 속성을 의미한다.
render와 force 매개변수는 toggleOption과 동일하다.
| Parameter | Type |
|---|---|
| path | string (opens in a new tab) |
| render | boolean (opens in a new tab) |
toggleOption(prop, render?): HeatmapSeries
boolean (opens in a new tab) 타입의 모델 설정 값을 반대 값으로 변경한다.
prop이 자식 모델 이름인 경우에는 아무것도 하지 않고 무시된다.
| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) HeatmapSeriesOptions | 설정 항목 이름 |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 컨트롤을 다시 그린다. 기본값 true |
return 모델 객체 자신
updateAt(path, value, render?, force?): any (opens in a new tab)
하위 모델의 설정 값을 변경한다.
path 매개변수는 하위 모델의 속성 이름을 점(.)으로 구분해서 지정한다.
예를 들어, "axis.x"는 axis 모델의 x 속성을 의미한다.
render와 force 매개변수는 updateOption과 동일하다.
| Parameter | Type |
|---|---|
| path | string (opens in a new tab) |
| value | any (opens in a new tab) |
| render | boolean (opens in a new tab) |
| force | boolean (opens in a new tab) |
updateOption(prop, value, render?, force?): HeatmapSeries
하나의 속성 값을 설정한다.
여러 속성들을 한꺼번에 변경할 때는 updateOptions를 사용한다.
기본적으로 이전 값과 다른 경우에만 적용된다.
특히, 속성값이 객체인 경우 객체 속성만 바뀐 경우 적용되지 않는다.
바꾸고 싶다면 force 매개변수를 true로 지정해서 호출한다.
또, prop 매개변수가 하위 모델 이름인 경우 하위 모델의 updateOptions를 호출한 것과 동일하다.
| Parameter | Type | Description |
|---|---|---|
| prop | K | 설정 항목 이름 |
| value | HeatmapSeriesOptions[K] | 설정 값 |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 컨트롤을 다시 그린다. 기본값: true |
| force | boolean (opens in a new tab) | 지정한 값이 이전 값과 동일한 경우에도 적용한다. 기본값: false |
return 모델 객체 자신
updateOptions(source?, render?): HeatmapSeries
모델 설정 값들을 변경한다.
source에 자식 모델 이름의 키가 포함되면 해당 값은 자식 모델의 updateOptions에 위임된다.
| Parameter | Type | Description |
|---|---|---|
| source | Partial<HeatmapSeriesOptions> | 설정 옵션들이 포함된 json 객체 |
| render | boolean (opens in a new tab) | true로 지정하면 옵션 변경 시 컨트롤을 다시 그린다. 기본값 true |
return 모델 객체 자신