Skip to content

Commit 9266019

Browse files
committed
Reuse the basic example in basic_dark to keep them in sync
1 parent 31b9e48 commit 9266019

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

cicd_utils/ridgeplot_examples/_basic.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
if TYPE_CHECKING:
66
import plotly.graph_objects as go
77

8+
from ridgeplot._types import PlotlyTemplate
89

9-
def main() -> go.Figure:
10+
11+
def main(
12+
template: PlotlyTemplate | None = None,
13+
) -> go.Figure:
1014
import numpy as np
1115

1216
from ridgeplot import ridgeplot
1317

1418
rng = np.random.default_rng(42)
1519
my_samples = [rng.normal(n, size=900) for n in range(6, 0, -2)]
16-
fig = ridgeplot(samples=my_samples)
20+
fig = ridgeplot(samples=my_samples, template=template)
1721
fig.update_layout(height=400, width=800)
1822

1923
return fig

cicd_utils/ridgeplot_examples/_basic_dark.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22

33
from typing import TYPE_CHECKING
44

5+
from ridgeplot_examples._basic import main as basic
6+
57
if TYPE_CHECKING:
68
import plotly.graph_objects as go
79

810

911
def main() -> go.Figure:
10-
import numpy as np
11-
12-
from ridgeplot import ridgeplot
13-
14-
rng = np.random.default_rng(42)
15-
my_samples = [rng.normal(n, size=900) for n in range(6, 0, -2)]
16-
fig = ridgeplot(samples=my_samples, template="plotly_dark")
17-
fig.update_layout(height=400, width=800)
18-
12+
fig = basic(template="plotly_dark")
1913
return fig
2014

2115

0 commit comments

Comments
 (0)