MCPcopy Create free account
hub / github.com/microsoft/SandDance / getViewerOptions

Method getViewerOptions

packages/powerbi/src/app.ts:81–105  ·  view source on GitHub ↗
(darkTheme?: boolean)

Source from the content-addressed store, hash-verified

79 }
80
81 private getViewerOptions(darkTheme?: boolean): Partial<SandDance.types.ViewerOptions> {
82 const textColor = darkTheme ? 'white' : 'black';
83 const color = textColor;
84 return {
85 colors: {
86 axisLine: color,
87 axisText: color,
88 hoveredCube: color,
89 },
90 onCubeClick: (e, cube) => {
91 const { button } = e as unknown as MSPointerEvent;
92 if (button === RIGHT_MOUSE_BUTTON) {
93 const row = this.explorer.state.dataContent.data[cube.ordinal];
94 const selectionId = row[SandDance.constants.FieldNames.PowerBISelectionId];
95 this.props.onContextMenu(<MouseEvent>e, selectionId);
96 e.stopPropagation();
97 e.preventDefault();
98 return;
99 }
100 },
101 onDataFilter: this.props.onDataFilter,
102 onSelectionChanged: this.props.onSelectionChanged,
103 preserveDrawingBuffer: true,
104 };
105 }
106
107 getDataContent() {
108 return this.explorer && this.explorer.state.dataContent && this.explorer.state.dataContent.data;

Callers 2

constructorMethod · 0.95
changeThemeMethod · 0.95

Calls 1

stopPropagationMethod · 0.45

Tested by

no test coverage detected