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

Smooth Lines in the Chart #1

Open
4 tasks done
liuderchi opened this issue May 24, 2017 · 1 comment
Open
4 tasks done

Smooth Lines in the Chart #1

liuderchi opened this issue May 24, 2017 · 1 comment
Assignees

Comments

@liuderchi
Copy link
Owner

liuderchi commented May 24, 2017

it would look better if the line in the chart is smooth.
Currently there are cusps.

example

GOAL

  • to have better interpolation methods to have curve with higher dimension (e.g. Bézier)

NOTE

  • currently it is drawn with svg <polyline> with point data specified in points attr
  • relevant react component: react-sparklines

TODO

  • survey possible curve interpolation api for react-sparklines
  • understand how react-sparklines generate polyline with data
  • check polyline attr to support Bézier curves
  • svg path survey
@liuderchi liuderchi self-assigned this May 24, 2017
@liuderchi
Copy link
Owner Author

liuderchi commented May 24, 2017

Actions

  • survey possible curve interpolation api for react-sparklines
    • from README.md looks like NO API for smooth curve
      • using <SparklinesLine />
      • in src it has <SparklinesCurve /> using svg path and additional points are inserted
    • PlanB: manually insert points to look smoother. (Require Bézier Math Lib)
  • understand how react-sparklines generate polyline with data
    • array of numbers will be processed then sent to data of <polyline>
  • check polyline attr to support Bézier curves
    • NO. polyline is for straight lines. Adding more points won't help when zoomed.
    • BTW svg path supports Bézier curve
    • PlanC use other component to generate svg path from data (D3?)
  • svg path survey
    • command C is for cubic Bézier curve
    • command Q is for quadratic Bézier curve
    • currently <SparklinesCurve /> uses C

Result

by using <SparklinesCurve /> with setting prop divisor, we now have smoother curve

compare-divosor-0 3

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant