Settings

Theme

Replicating D3 Charts with Swift Charts

github.com

91 points by sawaali 2 years ago · 14 comments

Reader

reverius42 2 years ago

Nice! The examples all look very close. Nice to have a repository of examples for how to re-create D3 charts in native apps.

Disclaimer: I worked on Swift Charts at Apple and I'm very excited to see it used!

  • sawaaliOP 2 years ago

    Thank you for Swift Charts. I was surprised by how flexible and powerful the API is.

  • vsgherzi 2 years ago

    did it seem like swift charts would be supported long term? It seems interesting but I'm hesitant to use it if it seems like it might get axed

    • cageface 2 years ago

      Apple is pretty good about not axing published APIs, unlike another FAANG company we could compare them to.

      • monocularvision 2 years ago

        Instead of axing the API, it will be allowed to languish with longstanding bugs going unaddressed in perpetuity. Not sure that’s better.

    • frou_dh 2 years ago

      I wonder if Apple do (or will) use Swift-Charts in their own major apps, e.g. for all the various metrics in the Health app on iOS.

      • tmpz22 2 years ago

        Im fairly certain they're using it in Battery Health and Screen Time.

        I've had a chance to use Swift Charts in some personal apps and am really impressed by it. It's so nice to have a native charting library available out of the box.

        As with all Apple APIs (especially newer ones) watch the WWDC sessions and read the Apple documentation first instead of trying to sling it. It makes it way more intuitive.

jiehong 2 years ago

Recently, a post about the limits of box plots went through HN. It praised violin plots as better alternatives[0]. Are those supported in Swift Charts?

[0]: https://en.m.wikipedia.org/wiki/Violin_plot

  • sawaaliOP 2 years ago

    Not directly, but like most of the examples in the repository, they can be recreated with some custom drawing.

zebomon 2 years ago

Thank you very much for this! They look great.

ukuina 2 years ago

Can Swift Charts render on a browser?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection