MCPcopy
hub / github.com/markmap/markmap / setOptions

Method setOptions

packages/markmap-view/src/view.ts:273–288  ·  view source on GitHub ↗
(opts?: Partial<IMarkmapOptions>)

Source from the content-addressed store, hash-verified

271 }
272
273 setOptions(opts?: Partial<IMarkmapOptions>): void {
274 this.options = {
275 ...this.options,
276 ...opts,
277 };
278 if (this.options.zoom) {
279 this.svg.call(this.zoom);
280 } else {
281 this.svg.on('.zoom', null);
282 }
283 if (this.options.pan) {
284 this.svg.on('wheel', this.handlePan);
285 } else {
286 this.svg.on('wheel', null);
287 }
288 }
289
290 async setData(data?: IPureNode | null, opts?: Partial<IMarkmapOptions>) {
291 if (opts) this.setOptions(opts);

Callers 4

constructorMethod · 0.95
setDataMethod · 0.95
constructorMethod · 0.80
checkDataFunction · 0.80

Calls 1

callMethod · 0.80

Tested by

no test coverage detected