(darkTheme?: boolean)
| 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; |
no test coverage detected