Skip to content

Commit

Permalink
fix import of unused const
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Dec 18, 2023
1 parent 4aac6d7 commit de9808e
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 45 deletions.
8 changes: 4 additions & 4 deletions components/src/hardware-sim/Labware/LabwareRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,29 @@ export const LabwareRender = (props: LabwareRenderProps): JSX.Element => {
? props.disabledWells.map((well, index) => (
<StyledWells
key={index}
wellContents='disabledWell'
wellContents="disabledWell"
definition={props.definition}
wells={well}
/>
))
: null}
{props.highlightedWells != null ? (
<StyledWells
wellContents='highlightedWell'
wellContents="highlightedWell"
definition={props.definition}
wells={props.highlightedWells}
/>
) : null}
{props.selectedWells != null ? (
<StyledWells
wellContents='selectedWell'
wellContents="selectedWell"
definition={props.definition}
wells={props.selectedWells}
/>
) : null}
{props.missingTips != null ? (
<StyledWells
wellContents='tipMissing'
wellContents="tipMissing"
definition={props.definition}
wells={props.missingTips}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function FilledWellsComponent(props: FilledWellsProps): JSX.Element {
well={definition.wells[wellName]}
fill={color}
stroke={COLORS.black}
strokeWidth='0.6'
strokeWidth="0.6"
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const TipDecoration = React.memo(function TipDecoration(props: {
{...STYLE_BY_WELL_CONTENTS.tipPresent}
cx={well.x}
cy={well.y}
r={radius - 1} />
r={radius - 1}
/>
)
}
return null
Expand Down Expand Up @@ -69,7 +70,9 @@ export function StaticLabwareComponent(props: StaticLabwareProps): JSX.Element {
well={props.definition.wells[wellName]}
onMouseEnterWell={props.onMouseEnterWell}
onMouseLeaveWell={props.onMouseLeaveWell}
{...(isTiprack ? STYLE_BY_WELL_CONTENTS.tipPresent : STYLE_BY_WELL_CONTENTS.defaultWell)}
{...(isTiprack
? STYLE_BY_WELL_CONTENTS.tipPresent
: STYLE_BY_WELL_CONTENTS.defaultWell)}
/>

{isTiprack ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function StrokedWellsComponent(props: StrokedWellProps): JSX.Element {
well={definition.wells[wellName]}
stroke={color}
fill={COLORS.white}
strokeWidth='0.6'
strokeWidth="0.6"
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ export const STYLE_BY_WELL_CONTENTS: {
stroke: React.CSSProperties['stroke']
fill: React.CSSProperties['fill']
strokeWidth: React.CSSProperties['strokeWidth']
} } = {
}
} = {
highlightedWell: {
stroke: COLORS.blueEnabled,
fill: `${COLORS.blueEnabled}33`, // 20% opacity
strokeWidth: 1,
},
disabledWell: {
stroke: '#C6C6C6', // LEGACY --light-grey-hover
fill: '#EDEDEDCC', // LEGACY --lightest-gray + 80% opacity
fill: '#EDEDEDCC', // LEGACY --lightest-gray + 80% opacity
strokeWidth: 0.6,
},
selectedWell: {
Expand All @@ -52,7 +53,7 @@ export const STYLE_BY_WELL_CONTENTS: {
fill: COLORS.white,
stroke: COLORS.black,
strokeWidth: 0.6,
}
},
}

function StyledWellsComponent(props: StyledWellProps): JSX.Element {
Expand Down
27 changes: 14 additions & 13 deletions components/src/hardware-sim/Labware/labwareInternals/Well.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@ export function WellComponent(props: WellProps): JSX.Element {
} = props
const { x, y } = well

const isInteractive = onMouseEnterWell != null || onMouseLeaveWell != null
const pointerEvents: React.CSSProperties['pointerEvents'] = isInteractive ? 'auto' : 'none'
const isInteractive = onMouseEnterWell != null || onMouseLeaveWell != null
const pointerEvents: React.CSSProperties['pointerEvents'] = isInteractive
? 'auto'
: 'none'
const commonProps = {
[INTERACTIVE_WELL_DATA_ATTRIBUTE]: isInteractive ? wellName : undefined,
onMouseEnter: onMouseEnterWell != null ? (event: React.MouseEvent) => onMouseEnterWell({ wellName, event }) : undefined,
onMouseLeave: onMouseLeaveWell != null ? (event: React.MouseEvent) => onMouseLeaveWell({ wellName, event }) : undefined,
style: { pointerEvents, stroke, strokeWidth, fill }
onMouseEnter:
onMouseEnterWell != null
? (event: React.MouseEvent) => onMouseEnterWell({ wellName, event })
: undefined,
onMouseLeave:
onMouseLeaveWell != null
? (event: React.MouseEvent) => onMouseLeaveWell({ wellName, event })
: undefined,
style: { pointerEvents, stroke, strokeWidth, fill },
}


if (well.shape === 'circular') {
const { diameter } = well
const radius = diameter / 2
return (
<circle
{...commonProps}
cx={x}
cy={y}
r={radius} />
)
return <circle {...commonProps} cx={x} cy={y} r={radius} />
}

const { xDimension, yDimension } = well
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,20 @@ const Labels = (props: {
}
style={{
color: COLORS.darkGrey, // LEGACY --c-font-dark
fontSize: '0.2rem', // LEGACY --fs-micro
fontSize: '0.2rem', // LEGACY --fs-micro
textAnchor: 'middle',
dominantBaseline: props.isLetterColumn === true ? 'middle' : 'auto'
dominantBaseline:
props.isLetterColumn === true ? 'middle' : 'auto',
}}
fill={
highlightedWellLabels?.wells.includes(wellName) ?? false
? highlightColor
: fillColor
}
>
{(props.isLetterColumn === true ? /[A-Z]+/g : /\d+/g).exec(wellName)}
{(props.isLetterColumn === true ? /[A-Z]+/g : /\d+/g).exec(
wellName
)}
</RobotCoordsText>
)
})}
Expand All @@ -88,7 +91,7 @@ export function WellLabelsComponent(props: WellLabelsProps): JSX.Element {
wellLabelColor,
} = props
const letterColumn = definition.ordering[0] ?? []
const numberRow = definition.ordering.map((wellCol) => wellCol[0])
const numberRow = definition.ordering.map(wellCol => wellCol[0])

return (
<g>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as React from 'react'
import reduce from 'lodash/reduce'

import {
WellMouseEvent,
WellGroup,
} from '@opentrons/components'
import { WellMouseEvent, WellGroup } from '@opentrons/components'
import { COLUMN } from '@opentrons/shared-data'
import {
arrayToWellGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
ALIGN_CENTER,
PrimaryButton,
JUSTIFY_SPACE_BETWEEN,
LEFT,
RIGHT,
InstrumentDiagram,
} from '@opentrons/components'
import {
Expand All @@ -21,6 +19,8 @@ import {
OT3_PIPETTES,
getAllPipetteNames,
getPipetteNameSpecs,
LEFT,
RIGHT,
} from '@opentrons/shared-data'

import { i18n } from '../../../localization'
Expand Down
16 changes: 8 additions & 8 deletions protocol-designer/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { INTERACTIVE_WELL_DATA_ATTRIBUTE } from '@opentrons/components/src/hardw
export const registerSelectors: (arg0: any) => void =
process.env.NODE_ENV === 'development'
? // eslint-disable-next-line @typescript-eslint/no-var-requires
require('reselect-tools').registerSelectors
: (a: any) => { }
require('reselect-tools').registerSelectors
: (a: any) => {}
export const uuid: () => string = uuidv1
// Collision detection for SelectionRect / SelectableLabware
export const rectCollision = (
Expand All @@ -44,9 +44,7 @@ export function clientRectToBoundingRect(rect: ClientRect): BoundingRect {
height: rect.height,
}
}
export const getCollidingWells = (
rectPositions: GenericRect,
): WellGroup => {
export const getCollidingWells = (rectPositions: GenericRect): WellGroup => {
// Returns set of selected wells under a collision rect
const { x0, y0, x1, y1 } = rectPositions
const selectionBoundingRect = {
Expand All @@ -57,7 +55,9 @@ export const getCollidingWells = (
}
// NOTE: querySelectorAll returns a NodeList, so you need to unpack it as an Array to do .filter
const selectableElems: HTMLElement[] = [
...document.querySelectorAll<HTMLElement>(`[${INTERACTIVE_WELL_DATA_ATTRIBUTE}]`),
...document.querySelectorAll<HTMLElement>(
`[${INTERACTIVE_WELL_DATA_ATTRIBUTE}]`
),
]
const collidedElems = selectableElems.filter((selectableElem, i) =>
rectCollision(
Expand Down Expand Up @@ -117,8 +117,8 @@ export const makeTimerText = (
targetMinutes === null && targetSeconds === null
? null
: `${targetMinutes} ${i18n.t(
'application.units.minutes'
)} ${targetSeconds} ${i18n.t('application.units.seconds')} timer`
'application.units.minutes'
)} ${targetSeconds} ${i18n.t('application.units.seconds')} timer`

export const getIsAdapter = (
labwareId: string,
Expand Down
4 changes: 1 addition & 3 deletions shared-data/js/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ export interface RectangularWellShapeProperties {
yDimension: number
}



export type LabwareWellShapeProperties =
| CircularWellShapeProperties
| CircularWellShapeProperties
| RectangularWellShapeProperties

// well without x,y,z
Expand Down

0 comments on commit de9808e

Please sign in to comment.