From fd757b92b331eada80014dd7cf18b51d9edd7e21 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 5 Mar 2024 20:25:32 +1300 Subject: [PATCH] Tweaks comments --- website/src/data/components/line/props.ts | 22 +++++++++---------- .../src/lib/chart-properties/interactivity.ts | 4 +++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/website/src/data/components/line/props.ts b/website/src/data/components/line/props.ts index fc8960bdb..1b4d8dc58 100644 --- a/website/src/data/components/line/props.ts +++ b/website/src/data/components/line/props.ts @@ -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', @@ -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'], @@ -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, }, @@ -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'], diff --git a/website/src/lib/chart-properties/interactivity.ts b/website/src/lib/chart-properties/interactivity.ts index 01e472fe7..40ccc2fa8 100644 --- a/website/src/lib/chart-properties/interactivity.ts +++ b/website/src/lib/chart-properties/interactivity.ts @@ -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,