From 83203a12e816b91588677c03dbefc4f7524e64a8 Mon Sep 17 00:00:00 2001 From: Asgeir Nyvoll <47146384+asnyv@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:18:51 +0200 Subject: [PATCH] modified colors (#45) Change colorscales and colorway in plotly theme --- setup.py | 2 +- webviz_config_equinor/__init__.py | 48 ++++++------------------------- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/setup.py b/setup.py index 3bf7e8f..746e29a 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ entry_points={ "webviz_config_themes": ["equinor_theme = webviz_config_equinor:equinor_theme"] }, - install_requires=["webviz-config>=0.0.48"], + install_requires=["plotly", "webviz-config>=0.0.48"], tests_require=tests_require, extras_require={"tests": tests_require}, setup_requires=["setuptools_scm~=3.2"], diff --git a/webviz_config_equinor/__init__.py b/webviz_config_equinor/__init__.py index f3cec25..1f1ad53 100644 --- a/webviz_config_equinor/__init__.py +++ b/webviz_config_equinor/__init__.py @@ -3,7 +3,7 @@ from pkg_resources import get_distribution, DistributionNotFound from webviz_config import WebvizConfigTheme - +from plotly import colors try: __version__ = get_distribution(__name__).version @@ -11,6 +11,7 @@ # package is not installed pass + equinor_theme = WebvizConfigTheme(theme_name="equinor") equinor_theme.external_stylesheets = [ @@ -35,46 +36,13 @@ "font": {"family": "Equinor"}, "hoverlabel": {"font": {"family": "Equinor"}}, "plot_bgcolor": "white", + "xaxis": {"exponentformat": "SI"}, + "yaxis": {"exponentformat": "SI"}, + "coloraxis": {"colorbar": {"exponentformat": "SI"}}, "colorscale": { - "diverging": [ - [0, "rgb(255, 18, 67)"], - [0.1, "rgb(36, 55, 70)"], - [0.2, "rgb(0, 112, 121)"], - [0.3, "rgb(213, 234, 244)"], - [0.4, "rgb(230, 250, 236)"], - [0.5, "rgb(255, 231, 214)"], - [0.6, "rgb(128, 183, 188)"], - [0.7, "rgb(255, 18, 67)"], - [0.8, "rgb(145, 155, 162)"], - [0.9, "rgb(190, 128, 145)"], - [1, "rgb(178, 212, 215)"], - ], - "sequential": [ - [0.0, "rgb(36, 55, 70)"], - [0.125, "rgb(102, 115, 125)"], - [0.25, "rgb(145, 155, 162)"], - [0.375, "rgb(189, 195, 199)"], - [0.5, "rgb(255, 231, 214)"], - [0.625, "rgb(216, 178, 189)"], - [0.75, "rgb(190, 128, 145)"], - [0.875, "rgb(164, 76, 101)"], - [1.0, "rgb(125, 0, 35)"], - ], + "diverging": colors.get_colorscale("spectral"), + "sequential": colors.get_colorscale("viridis"), }, - "colorway": [ - "#FF1243", - "#243746", - "#007079", - "#80B7BC", - "#919BA2", - "#BE8091", - "#B2D4D7", - "#FF597B", - "#BDC3C7", - "#D8B2BD", - "#FFE7D6", - "#D5EAF4", - "#FF88A1", - ], + "colorway": colors.qualitative.D3 + colors.qualitative.Light24, } }