-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update Matplotlib plugin to register widget view (#189)
- 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() ```
- Loading branch information
Showing
8 changed files
with
711 additions
and
145 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { type WidgetPlugin, PluginType } from '@deephaven/plugin'; | ||
import { vsGraph } from '@deephaven/icons'; | ||
import { MatplotlibView } from './MatplotlibView'; | ||
|
||
export const MatplotlibPlugin: WidgetPlugin = { | ||
name: '@deephaven/js-plugin-matplotlib', | ||
type: PluginType.WIDGET_PLUGIN, | ||
supportedTypes: 'matplotlib.figure.Figure', | ||
component: MatplotlibView, | ||
icon: vsGraph, | ||
}; | ||
|
||
export default MatplotlibPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './MatPlotLibPanel'; | ||
export * from './DashboardPlugin'; | ||
import { MatplotlibPlugin } from './MatplotlibPlugin'; | ||
|
||
export default MatplotlibPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters