Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ScatterPlot): dark gray for selected points #122

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions vue-components/src/components/ScatterPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import type { ColorMap } from '@colormap/core'
import type { Vector3, Vector2 } from '../types'
import { toRGB } from '../utilities/colors'

const UNSELECTED_POINT_COLOR = 'rgba(189,189,189,255)'
const SELECTED_POINT_COLOR = 'rgba(70,70,70,255)'

type IdToPoint = Record<string, Vector3<number> | Vector2<number>>

interface Props {
Expand Down Expand Up @@ -95,13 +98,15 @@ onMounted(() => {
}

if (props.selectedPoints.includes(id)) {
// silver for original points that are selected
return `rgba(189,189,189,255)`
// for original points that are selected
return SELECTED_POINT_COLOR
}

if (hideSourcePoints.value) {
return 'rgba(0,0,0,0)'
}

// blue for unselected points
let alpha = hideSourcePoints.value ? 0 : 255
return `rgba(25,118,210,${alpha})`
return UNSELECTED_POINT_COLOR
},
onHover(index: number | null) {
const id = index == null ? '' : indexToId(index)
Expand Down
Loading