Tuesday, June 14, 2022

Swift Charts

Hello Swift Charts:

Say hello to Swift Charts — a flexible framework that helps you create charts entirely in SwiftUI that look and feel right at home on all Apple platforms. Discover how you can use compositional syntax to make informative, delightful, and accessible charts with less code. We’ll share the building blocks for making visualizations with Swift Charts, and explore how you can change your charts’ design with a simple modifier. We’ll also take you through the latest updates to Xcode Previews to help you chart a path toward an engaging experience.

Swift Charts: Raise the bar:

Dive deep into data visualizations: Learn how Swift Charts and SwiftUI can help your apps represent complex datasets through a wide variety of chart options. We’ll show you how to plot different kinds of data and compose marks to create more elaborate charts. We’ll also take you through Swift Charts’ extensive chart customization API to help you match the style of your charts to your app.

Matthaus Woolard:

From my quick look over the API, the framework can provide a lot more than the basic graphics generated by apps like Numbers etc. In this post I would like to share my initial experiments with the APIs.

[…]

You can find the code for this chart in our GitHub project, this includes the code to download and parse the CSV file.

Ron Avitzur:

I’ve worked on math & data visualization for 35 years, and the simplicity and power of the Swift Charts API is truly a thing of beauty, as are the visualizations it creates.

It does not include pie charts.

Update (2022-06-24): Matthaus Woolard:

To build a histogram, I need to group my data into bins and count how many samples are within each bin.

He also demonstrates a 2D density plot.

4 Comments RSS · Twitter

>The data visualization academic community right now has mixed feelings generally about pie charts. They aren't supported in Swift Charts.

Sorry, boss, we can't do a pie chart because someone at Apple thinks someone in academia's opinions on them matter more than yours.

(I take it Swift Charts is not OSS?)

More like:

Sorry, boss, we can't do a pie chart because I'm unable to write software myself, or even use third-party components. I'm only able to use pre-packaged modules from Apple, and macOS 13 beta (that's what our app is targeting, even though zero of our users have it yet, remember?) doesn't have that particular chart. It's a good thing you didn't ask for any charts last week, because then I wouldn't have been able to provide anything at all! What lucky timing.

If you want to confuse or obfuscate our data, instead of a pie chart, we could just present a raw table of numbers. Or if you just want something round on the screen, we can add some clip-art circles.

P.S., This is the same situation as when you wanted our entire UI to use the "Curlz" font, which isn't included with macOS by default, and you complained that someone at Apple must think their own opinion on fonts matters more than yours.

"Sorry, boss, we can't do a pie chart because someone at Apple thinks someone in academia's opinions on them matter more than yours."

That's an odd way of framing it. It's a bit like saying "sorry, we can't buy lead cookies, because someone at the store thinks someone in academia's opinions on the toxicity of lead matters more than your desire to feed lead cookies to your mum." I guess you'll just have to bake your own lead cookies if you want to poison your mum and don't believe in "academia" and their "reality" and other such peculiar ideas. It's not like the store took away your oven, they just made it a bit harder to do something stupid.

Props to Apple for putting user experience above making it convenient for devs to trick their users by showing them misleading visualizations. I wish they'd do that more.

I also wish Microsoft started doing the same. Microsoft has had utterly wrong pie charts in Office for like thirty years now. The complete abdication of responsibility boggles the mind. These clowns have caused literally billions of people to see completely misleading data visualizations.

> Sorry, boss, we can't do a pie chart because I'm unable to write software myself, or even use third-party components.

Nah. Apple describes the library as "a flexible framework that helps you create charts entirely in SwiftUI that look and feel right at home on all Apple platforms. Discover how you can use compositional syntax to make informative, delightful, and accessible charts with less code." If it doesn't have pie charts, it doesn't do that.

Obviously, the existence of Swift Charts doesn't take away from my ability to use a different library instead, or to roll my own. But that doesn't change that this is an asinine ivory-tower decision.

> If you want to confuse or obfuscate our data, instead of a pie chart, we could just present a raw table of numbers. Or if you just want something round on the screen, we can add some clip-art circles.

OK, so Apple now wants to remove pie charts from Numbers dot app?

Or Apple wants to stop using 3D pie charts in their keynotes? At least those are _actually_ problematic, because the faux perspective distorts perceived values.

>These clowns have caused literally billions of people to see completely misleading data visualizations.

Users want pie charts. Therefore, Excel supports pie charts. As does Apple's Numbers.

If you want to get rid of bad math from Swift, start with floating-point numbers instead of pie charts.

Leave a Comment