Skip to content

Commit

Permalink
Tweaks comments
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamABradley committed Mar 5, 2024
1 parent 4736ca4 commit fd757b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 11 additions & 11 deletions website/src/data/components/line/props.ts
Expand Up @@ -389,7 +389,7 @@ const props: ChartProperty[] = [
'Enable/disable interactivity.',
'Using `enableSlices` will enable a crosshair on the `x` or `y` axis, that will move between the nearest slice to the mouse/touch point, and will show a tooltip of all data points for that slice.',
'Using `useMesh` will use a voronoi mesh to detect the closest point to the mouse cursor/touch point, which is useful for very dense datasets, as it can become difficult to hover a specific point, however, it will only return one data point.',
].join('\n'),
].join(' '),
}),
{
key: 'useMesh',
Expand Down Expand Up @@ -443,15 +443,6 @@ const props: ChartProperty[] = [
type: '(point, event) => void',
required: false,
},
{
key: 'enableTouchCrosshair',
flavors: ['svg'],
group: 'Interactivity',
help: `Enables the crosshair to be dragged around a touch screen, requires useMesh and slices disabled.`,
type: 'boolean',
defaultValue: defaults.enableTouchCrosshair,
control: { type: 'switch' },
},
{
key: 'onTouchStart',
flavors: ['svg'],
Expand All @@ -467,7 +458,7 @@ const props: ChartProperty[] = [
help: [
'onTouchMove handler, when a touch gesture that originated from inside the graph is moved.',
'Note, when using slices, this will return the originally touched slice, not the slice currently being hovered over (use document.elementFromPoint()).',
].join('\n'),
].join(' '),
type: '(point, event) => void',
required: false,
},
Expand Down Expand Up @@ -541,6 +532,15 @@ const props: ChartProperty[] = [
control: { type: 'switch' },
defaultValue: defaults.enableCrosshair,
},
{
key: 'enableTouchCrosshair',
flavors: ['svg'],
group: 'Interactivity',
help: `Enables the crosshair to be dragged around a touch screen.`,
type: 'boolean',
defaultValue: defaults.enableTouchCrosshair,
control: { type: 'switch' },
},
{
key: 'crosshairType',
flavors: ['svg'],
Expand Down
4 changes: 3 additions & 1 deletion website/src/lib/chart-properties/interactivity.ts
Expand Up @@ -3,14 +3,16 @@ import { ChartProperty, Flavor } from '../../types'
export const isInteractive = ({
flavors,
defaultValue,
help,
}: {
flavors: Flavor[]
defaultValue: boolean
help?: string
}): ChartProperty => ({
key: 'isInteractive',
group: 'Interactivity',
type: 'boolean',
help: 'Enable/disable interactivity.',
help: help ?? 'Enable/disable interactivity.',
required: false,
defaultValue,
flavors,
Expand Down

0 comments on commit fd757b9

Please sign in to comment.