MCPcopy Index your code
hub / github.com/microsoft/SandDance / createConfig

Method createConfig

packages/sanddance/src/viewer.ts:634–705  ·  view source on GitHub ↗
(c?: VegaDeckGl.types.PresenterConfig)

Source from the content-addressed store, hash-verified

632 }
633
634 private createConfig(c?: VegaDeckGl.types.PresenterConfig): VegaDeckGl.types.ViewGlConfig {
635 const { getTextColor, getTextHighlightColor, getTextHighlightAlphaCutoff, onTextClick } = this.options;
636 const defaultPresenterConfig: VegaDeckGl.types.PresenterConfig = {
637 zAxisZindex,
638 getCharacterSet: stage => this._characterSet.getCharacterSet(stage),
639 getTextColor,
640 getTextHighlightColor,
641 getTextHighlightAlphaCutoff,
642 onTextClick: (e, t) => {
643 if (t.metaData && t.metaData.search) {
644 const search = getSearchGroupFromVegaValue(t.metaData.search);
645 if (this.options.onAxisClick) {
646 this.options.onAxisClick(e, search);
647 } else {
648 this.select(search);
649 }
650 }
651 if (onTextClick) {
652 onTextClick(e, t);
653 }
654 },
655 onCubeClick: this.onCubeClick.bind(this),
656 onCubeHover: this.onCubeHover.bind(this),
657 onTextHover: this.onTextHover.bind(this),
658 preStage: this.preStage.bind(this),
659 onPresent: this.options.onPresent,
660 onLayerClick: (info: VegaDeckGl.PickInfo<any>, e: MouseEvent) => {
661 if (!info || !info.object) {
662 this.deselect();
663 }
664 },
665 onLegendClick: (e: MouseEvent, legend: VegaDeckGl.types.Legend, clickedIndex: number) => {
666 const legendRow = clickedIndex !== null && legend.rows[clickedIndex] as LegendRowWithSearch;
667 if (legendRow) {
668 if (this.options.onLegendRowClick) {
669 this.options.onLegendRowClick(e, legendRow);
670 } else {
671 this.select(legendRow.search);
672 }
673 } else if (this.options.onLegendHeaderClick) {
674 //header clicked
675 this.options.onLegendHeaderClick(e);
676 }
677 },
678 onSceneRectAssignCubeOrdinal: datum => {
679 //TODO see if datum is a facet selection rect
680 return datum[GL_ORDINAL];
681 },
682 onTargetViewState: (h, w) => {
683 const { height, width } = this.insight.size;
684 let newViewStateTarget: boolean;
685 if (this.options.onNewViewStateTarget) {
686 newViewStateTarget = this.options.onNewViewStateTarget();
687 }
688 return { height, width, newViewStateTarget };
689 },
690 preserveDrawingBuffer: this.options.preserveDrawingBuffer,
691 };

Callers 2

renderNewLayoutMethod · 0.95
renderSameLayoutMethod · 0.95

Calls 4

selectMethod · 0.95
deselectMethod · 0.95
getCharacterSetMethod · 0.45

Tested by

no test coverage detected