Skip to content

Commit

Permalink
feat(ScatterPlot): force axes to show in 2D mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Jan 20, 2025
1 parent c013087 commit a9056b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vue-components/src/components/ScatterPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type { ColorMap } from '@colormap/core'
import type { Vector3, Vector2 } from '../types'
import { toRGB } from '../utilities/colors'
import { makeStyles } from 'scatter-gl/dist/styles'

Check warning on line 11 in vue-components/src/components/ScatterPlot.vue

View workflow job for this annotation

GitHub Actions / ubuntu-latest-linters-vue

'makeStyles' is defined but never used

Check warning on line 11 in vue-components/src/components/ScatterPlot.vue

View workflow job for this annotation

GitHub Actions / ubuntu-latest-linters-vue

'makeStyles' is defined but never used
const UNSELECTED_POINT_COLOR = 'rgba(189,189,189,255)'
const SELECTED_POINT_COLOR = 'rgba(70,70,70,255)'
Expand Down Expand Up @@ -125,6 +126,9 @@ onMounted(() => {
scatterPlot = new ScatterGL(plotContainer.value, {
rotateOnStart: false,
selectEnabled: true,
styles: {
axesVisible: true
},
pointColorer(i) {
const id = indexToId(i)
const isTrans = isTransformed(i)
Expand Down Expand Up @@ -165,6 +169,8 @@ onMounted(() => {
}
})
scatterPlotRef.value = scatterPlot
// @ts-expect-error: force axes in 2D mode
scatterPlot.scatterPlot.add3dAxes()
const cameraControls = ((scatterPlot as any).scatterPlot as any).orbitCameraControls
cameraControls.addEventListener('start', emitCameraPosition)
Expand Down

0 comments on commit a9056b0

Please sign in to comment.