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

feat: Update Matplotlib plugin to register widget view #189

Merged
merged 5 commits into from
Jan 10, 2024

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Dec 23, 2023

  • Now can be embedded and/or used in deephaven.ui
  • Renamed components from MatPlotLib to Matplotlib to match the product name
  • Styling set directly on element... can't register a styles component, should we have an app level render for components?
  • Tested with deephaven.ui:
from deephaven import ui

@ui.component
def foo():
    import matplotlib.pyplot as plt
    import numpy as np

    from matplotlib.patches import PathPatch
    from matplotlib.path import Path

    N = 400
    t = np.linspace(0, 2 * np.pi, N)
    r = 0.5 + np.cos(t)
    x, y = r * np.cos(t), r * np.sin(t)

    fig, ax = plt.subplots()
    ax.plot(x, y, "k")
    ax.set(aspect=1)
    return fig

f = foo()

- Now can be embedded and/or used in deephaven.ui
- Renamed components from MatPlotLib to Matplotlib to match the product name
- Styling set directly on element... can't register a styles component, should we have an app level render for components?
- Tested with deephaven.ui:
```
from deephaven import ui

@ui.component
def foo():
    import matplotlib.pyplot as plt
    import numpy as np

    from matplotlib.patches import PathPatch
    from matplotlib.path import Path

    N = 400
    t = np.linspace(0, 2 * np.pi, N)
    r = 0.5 + np.cos(t)
    x, y = r * np.cos(t), r * np.sin(t)

    fig, ax = plt.subplots()
    ax.plot(x, y, "k")
    ax.set(aspect=1)
    return fig

f = foo()
```
@mofojed mofojed requested a review from mattrunyon January 2, 2024 19:16
plugins/matplotlib/src/js/src/MatplotlibView.tsx Outdated Show resolved Hide resolved
plugins/matplotlib/src/js/src/MatplotlibView.tsx Outdated Show resolved Hide resolved
plugins/matplotlib/src/js/src/MatplotlibView.tsx Outdated Show resolved Hide resolved
plugins/matplotlib/src/js/src/MatplotlibView.tsx Outdated Show resolved Hide resolved
plugins/matplotlib/src/js/src/index.ts Outdated Show resolved Hide resolved
@mofojed mofojed requested a review from mattrunyon January 8, 2024 15:28
@mofojed mofojed merged commit cd52fb2 into deephaven:main Jan 10, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants