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

Develop PlotlyView - A generally reusable UIView for displaying Figures #14

Open
vojtamolda opened this issue May 29, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vojtamolda
Copy link
Owner

vojtamolda commented May 29, 2020

To make the library easier to use on Apple devices (i.e. iOS/iPadOS/macOS) it would be nice to develop a generally reusable UIView. Such UI component can then be used as a "LEGO block" that displays a chart within a larger app.

PlotlyView should be a subclass of WKWebView and expose it's model as a settable property of type Plotly.Figure. Simply setting the figure object should be everything one needs to display a chart.

Here's an example use:

import Plotly

let trace = Scatter(
    x: [1, 2, 3],
    y: [3, 4, 5]
)

var view = PlotlyView()
view.figure = Figure(data: [trace])

Developing PlotlyView helps a great deal with building the standalone viewer app per #7. For more details about the motivation and general background check out the discussion in #11.

@vojtamolda vojtamolda added this to the Plotly.swift 0.4.0 milestone May 29, 2020
@vojtamolda vojtamolda added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 29, 2020
@vojtamolda
Copy link
Owner Author

Here's a few pieces of code that may be helpful to read before getting started:

@vojtamolda
Copy link
Owner Author

vojtamolda commented May 29, 2020

Here's a suggestted task list:

  • 0. Make sure the project can be built for iOS/iPadOS.

  • 1. Convert the playground example to use UIKit instead of AppKit (i.e. iOS/iPadOS instead of macOS). This is needed because we eventually want to use Catalyst to support macOS.

  • 2. Start iterating on the design of PlotlyView from the code converted in 1. The Xcode Playgrounds may be a good place to do it.

  • 3. Once the design of PlotlyView makes sense from a user's perspective, try to build a sample iOS/iPadOS application that shows a very simple plot. This may eventually end up in the Examples/ folder as a demo.

  • 4. Attempt Create a standalone chart viewer app #7 to see how the design works in a larger project. The point of doing this is to reveal missing features and delegate callbacks.

vojtamolda pushed a commit that referenced this issue Jun 20, 2020
- Availability annotation for macOS and iOS
vojtamolda pushed a commit that referenced this issue Jun 20, 2020
- Availability annotation for macOS and iOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant