Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,587 changes: 1,578 additions & 9 deletions docs/index.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ python_requires = >=3.7
install_requires =
matplotlib>=3.5.1
seaborn>=0.11.2
plotly>=5.9.0

[options.extras_require]
docs =
Expand Down
10 changes: 10 additions & 0 deletions tests/unit_tests/test_plotly_theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Test plotly theme"""
import pytest
import vizta


def test_plotly_styles():
"""Really just check that theme doesn't error"""
vizta.plotly.plotly_vizta_theme()
with pytest.raises(ValueError):
vizta.mpl.set_theme(style="blah")
2 changes: 1 addition & 1 deletion vizta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""See the README for detailed documentation and examples."""
from .version import _get_version
from . import mpl
from . import mpl, plotly

__version__ = _get_version()
1 change: 1 addition & 0 deletions vizta/plotly/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .themes import plotly_vizta_theme
25 changes: 25 additions & 0 deletions vizta/plotly/themes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Plotly theme"""
import plotly.graph_objects as go
import plotly.io as pio


def plotly_vizta_theme():
"""Generates theme for x called 'talusbio'"""
pio.templates["talusbio"] = go.layout.Template(
layout={
"title": {
"font": {
"family": "Helvetica,Arial,sans-serif",
"size": 30,
"color": "#333",
}
},
"font": {
"family": "Helvetica,Arial,sans-serif",
"size": 16,
"color": "#333",
},
# Colorways
"colorway": ["#308AAD", "#C8102E", "#96D8D8", "#B2EE79"],
}
)