MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

VoiceOver question:

Should I be able to use .accessibilityLabel and .accessibilityValue with a RuleMark in Swift Charts?

I'm having to create an invisible PointMark to get around the fact that I can't seem to.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I liked the segmented Picker that I added to my precipitation chart so much that I used one to create a new "feels like" variation of the temperature chart.

Please Don't Rain showing a temperature chart that is toggling between "actual temperature" and "feels like" temperature.

MuseumShuffle, to accessibility
@MuseumShuffle@mastodon.social avatar

Wow did I spot an obscure issue with VoiceOver. Took me quite a while to nail down what was happening. I thought I was doing something wrong.

VoiceOver will normally read an appropriate description of an SF Symbol.

I realized that if there is a small amount of data VO reads the description for the symbol in a chart.

However, if there is much more data and values are grouped together VO completely ignores the symbol.

🧵 1/3

Filed FB13555954

MuseumShuffle,
@MuseumShuffle@mastodon.social avatar

Here's an example with a small amount of data. You'll notice that VoiceOver is saying "symbol heavy rain", which is what is expected.

🧵 2/3

A bar chart with 6 entries. The user is moving to each entry.

MuseumShuffle, (edited )
@MuseumShuffle@mastodon.social avatar

But looks what happens with 24 entries and VoiceOver grouping entries together. VoiceOver is just saying "symbol" as if the SF Symbol was not there at all.

🧵 3/3

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I really like the segmented Picker that I added to my precipitation chart.

I got the idea that if I added a "feels like" variation to my temperature chart I could do something similar.

I didn't expect to be able to hold my finger down to display the RuleMark but still be able to change the chart type with another finger. It works!

Shout out to Portland OR for continuing to be the ideal test case.

baronetty, to swift
@baronetty@mastodontech.de avatar

Today I started the short video series about by @StewartLynch
I finished the first one and nearly the second one that I will finish tomorrow. Also tomorrow I wanne try to code a LineMark chart because I have an app idea and for that I wanna use a LineMark chart. So far all the tutorials I found were for BarMarks but as I learned so far work most of the charts pretty similar.

MuseumShuffle, (edited ) to accessibility
@MuseumShuffle@mastodon.social avatar

I don’t have room to show the weather symbol for each hour, especially if the largest accessibility text sizes are in use.

However, I’m adding the hourly weather symbol to the RuleMark that can be shown for each hour with a long press.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

Surprised to see that in the iOS Weather app when you are using the largest accessibility text size the chart legend shows the large text, but each axis of the chart retains very small text.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar
MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I was talking with @Drwave in December about adding symbols to this chart to indicate the precipitation type and I just got it working for the first time!

I would be nice if I could get the symbols to appear above the chart instead of inside it, but at least I'm making progress.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

Spent FAR too much time today wrangling with KeyValuePairs trying to get my chart legends looking like I want and was getting nowhere.

After doing more searches I finally found a StackOverflow post that made me realize that there are alternatives that don't use KeyValuePairs that let me build the legend dynamically.

I can't believe I didn't think of that. Now the legend only shows the precipitation types that are in the chart.

Thanks to Marcy for their answer. For those who don't want to mess around with KeyValuePairs there is also a version of chartForegroundStyleScale that takes domain and mapping which worked better for me: .chartForegroundStyleScale(domain: selectedCategories, mapping: { category in viewModel.color(forCategory: category)) })

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I’m experimenting with putting the precipitation chart in a widget.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I have a SubView that shows a Swift Chart. The data passed to the chart is a let constant. In the onAppear for the chart I calculate some PointMarks to show.

Hours later when the chart's data changes the chart DOES update but the PointMarks do NOT.

What would be the best way to address this?

MuseumShuffle, to random
@MuseumShuffle@mastodon.social avatar

I honestly thought that it was going to be simple adding PointMarks for high and low temperatures to this chart. I keep finding things that are making this challenging.

I realized that on a very hot day the "H" in the high PointMark is pushing the max of the chart to be 150F. That makes the "hot" color less intense since 150 is where it's the strongest.

Now I'm experimenting with putting the "H" below the PointMark for hotter temps.

MuseumShuffle, (edited ) to accessibility
@MuseumShuffle@mastodon.social avatar

The formula to make me nervous is new feature + iPhone SE + German + the largest accessibility text size.

Testing is going great and I'm really happy with how this new chart for @PleaseDontRain is looking. I'm so glad that we have Swift Charts now and don't have to make things like this ourselves anymore.

Also shoutout to @natpanferova for another great blog post about creating this chart.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

The iPhone SE and the largest accessibility text sizes have not defeated me! I think I've finally got a chart I'm happy with concerning axis sizes and the popover. Thanks @ryanlintott !

An iPhone SE showing the precipitation chart for Please Don't Rain with the biggest text size. A popover is showing hour rain amount when the user selects an hour.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

One thing that I've noticed is that when I'm using my app to track a day I still found myself going to another weather app to look at the temperatures throughout the day.

Why not add that below the precipitation chart? And the popover that iOS 17 adds will let me show details about the hour.

Still very rough but I already like how it's progressing.

A new continuous, arching temperature chart below the existing precipitation bar chart in Please Don't Rain. It is colored red with a red gradient below the graph line.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I haven't gotten to scrollable charts yet but the popover is really nice for the largest text size on the smallest screen.

MuseumShuffle, (edited ) to SwiftUI
@MuseumShuffle@mastodon.social avatar

Last summer I experimented with adding a "lollipop" popover to my charts in Foodlapse but the implementation was kind of clunky/painful.

Now the functionality is built-in to Swift Charts and is a delight to use. I've already got this basic version implemented for my hourly precipitation charts.

MuseumShuffle, to SwiftUI
@MuseumShuffle@mastodon.social avatar

I watched the WWDC video about interactivity with Swift Charts (very cool) but I'm confused about their example for selection. This raw selected date seems like something that would only be used by this View. Why is it a @\Binding instead of a @\State?

rmaraujo, to random Portuguese
@rmaraujo@mastodon.social avatar

Been hard at work on Charty 2.0 these last couple of days! 🤓

As mentioned, it’s an entire rewrite of the app, here are some of the changes:

As Swift Charts doesn’t have Pie and donut charts, I’ve had to build my own. This allowed me to create new stuff like this two level donut chart 😊

actions will get a big revamp with better error handling, more intuitive parameters and new actions!

🚀

luckkerr, to random Polish
@luckkerr@mastodon.world avatar

Some progress on next update. Added a way to view hashtag timelines with follow/unfollow action.

Video of Pipilo application where I view posts with hashtag, then navigate to . Video displays how navigation between posts work with horizontal swipes like in rest of the app. It also displays that there are actions to follow/unfollow hashtag or view timeline in browser.

finestructure, to swift
@finestructure@mastodon.social avatar

I had a hunch that I could take on tasks that I used to do with Python + matplotlib + Jupyter with Swift Charts + SwiftUI + Playgrounds instead. But I had no idea it’d be this nice and easy. Plus I find the default result better looking and I have much more control over everything around the chart, like labels, titles etc.

This will change everything for me when working with charts.

finestructure,
@finestructure@mastodon.social avatar

Since people asked, I’ve posted the self-contained example as a gist on Github and added a button to export the page as a PDF. Works wonderfully, even from within a simple playground 🎉

NB: the PDF is not rasterised - you can select the text and zoom in without any loss of fidelity.

https://gist.github.com/finestructure/45881a35819b5ebf850c437c54f43b8c

A Swift Playground window showing the code to generate a page with two histograms laid out vertically, complete with titles and chart headers. The charts are the MB size and file count distribution for documentation archives hosted on the Swift Package Index. Below the charts is a button to export them to PDF.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • GTA5RPClips
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • Durango
  • slotface
  • rosin
  • thenastyranch
  • kavyap
  • modclub
  • anitta
  • cubers
  • tester
  • osvaldo12
  • tacticalgear
  • ethstaker
  • ngwrru68w68
  • khanakhh
  • Leos
  • normalnudes
  • cisconetworking
  • provamag3
  • megavids
  • lostlight
  • All magazines