Skip to content

Commit 401d9e8

Browse files
committed
🎨 port interface adaptions - use plotly figures directly
1 parent b59c3c3 commit 401d9e8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/vuecore/viz.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def get_markdown(text, args={}):
101101
"""
102102
Converts a given text into a Dash Markdown component. It includes a syntax for things
103103
like bold text and italics, links, inline code snippets, lists, quotes, and more.
104+
104105
For more information visit https://dash.plot.ly/dash-core-components/markdown.
105106
106107
:param str text: markdown string (or array of strings) that adhreres to the CommonMark spec.
@@ -665,7 +666,7 @@ def get_scatterplot_matrix(data, identifier, args):
665666
for g in data[group].unique():
666667
gdata = data[data[group] == g].dropna()
667668
gfig = get_simple_scatterplot(gdata, identifier + "_" + str(g), args)
668-
trace = gfig.figure["data"].pop()
669+
trace = gfig["data"].pop()
669670
trace.name = g
670671
fig.append_trace(trace, r, c)
671672

@@ -690,7 +691,7 @@ def get_scatterplot_matrix(data, identifier, args):
690691
dict(xref="paper", yref="paper", showarrow=False, text="")
691692
]
692693

693-
return dcc.Graph(id=identifier, figure=fig)
694+
return fig
694695

695696

696697
def get_simple_scatterplot(data, identifier, args):
@@ -781,7 +782,7 @@ def get_simple_scatterplot(data, identifier, args):
781782
template="plotly_white",
782783
)
783784

784-
return dcc.Graph(id=identifier, figure=figure)
785+
return figure
785786

786787

787788
def get_scatterplot(data, identifier, args):
@@ -916,7 +917,7 @@ def get_scatterplot(data, identifier, args):
916917
template="plotly_white",
917918
)
918919

919-
return dcc.Graph(id=identifier, figure=figure)
920+
return figure
920921

921922

922923
def get_density(x: np.ndarray, y: np.ndarray):
@@ -1986,7 +1987,7 @@ def get_pca_plot(data, identifier, args):
19861987
figure = {}
19871988
traces = []
19881989
annotations = []
1989-
sct = get_scatterplot(pca_data, identifier, args).figure
1990+
sct = get_scatterplot(pca_data, identifier, args)
19901991
traces.extend(sct["data"])
19911992
figure["layout"] = sct["layout"]
19921993
factor = 50
@@ -2035,7 +2036,7 @@ def get_pca_plot(data, identifier, args):
20352036
figure["layout"].annotations = annotations
20362037
figure["layout"]["template"] = "plotly_white"
20372038

2038-
return dcc.Graph(id=identifier, figure=figure)
2039+
return figure
20392040

20402041

20412042
def get_sankey_plot(

0 commit comments

Comments
 (0)