BlogsDatadogiOS Data Visualization Library

iOS Data Visualization Library

iOS Data Visualization Library

1
posts
2024

Datadog developed and continues to evolve DogGraphs, an internal iOS graphing library built with Swift and SwiftUI, to bring complex data visualizations to the Datadog mobile application and widgets. The library focuses on ease of use, a flexible API, default Datadog styling, and high-performance rendering, supporting various widget types and data sources. Recent efforts have concentrated on optimizing SwiftUI rendering pipelines, identifying and fixing performance bottlenecks through tools like _printChanges() and Xcode Instruments, and ensuring compatibility with older iOS versions.

2024

How we brought Datadog’s data visualization to iOS: A focus on performance | Datadog

4/18/2024

This post details the development of DogGraphs, an internal iOS data visualization library using Swift and SwiftUI. It highlights the challenges of building a performant graphing solution for complex Datadog data on iOS, especially with constraints like iOS 14 compatibility and the absence of native charting libraries at the time of inception. The article explains the library's API design, leveraging Swift's result builders, and its integration into various Datadog mobile products. A significant portion is dedicated to performance optimization strategies, including the use of _printChanges() and Xcode Instruments to identify and resolve SwiftUI view body evaluation bottlenecks and slow function calls. The post emphasizes the importance of profiling during key events like initial rendering, updates, and environment changes.