slider icon indicating copy to clipboard operation
slider copied to clipboard

Add additional data to markers

Open orioltf opened this issue 6 years ago • 5 comments

This PR adds the option to bind additional data to Markers

orioltf avatar Mar 05 '18 18:03 orioltf

Coverage Status

Coverage increased (+0.03%) to 86.173% when pulling 7e788d1de6caa8db58f94b5a4875e9137876e0e5 on unic:add-additional-data-to-markers into a32ba642cd82e2ca42b95c0cb716838b6f3f999c on react-component:master.

coveralls avatar Mar 05 '18 19:03 coveralls

We can pass all the reset properties of mark to the element.

if (markPointIsObject) {
  const { label, style, ...resetProps } = markPoint;
}

<span {...resetProps>{label}</span>

yesmeck avatar Mar 06 '18 09:03 yesmeck

There you go 😃 I hope I got your idea

orioltf avatar Mar 06 '18 10:03 orioltf

I mean we can write mark prop on the config object directly.

const marks = [{
 label: '85°C',
 id: 'custom-id',
}];

if (markPointIsObject) {
  const { label, style, ...resetProps } = markPoint;
}

<span {...resetProps>{label}</span>

yesmeck avatar Mar 06 '18 10:03 yesmeck

Rebase please.

yoyo837 avatar Apr 15 '23 15:04 yoyo837