Skip to content

Commit

Permalink
Sarah Segel: Merge pull request #86 from automl/bugfix/color-range
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Nov 3, 2023
1 parent 93c672c commit b3588da
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion development/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 12de9be90f4b41a7a697ecb8f0d92aeb
config: 439ea99219ea3cfcfcb6a0ab98c735be
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified development/.doctrees/api/deepcave.utils.styled_plotty.doctree
Binary file not shown.
Binary file modified development/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 5 additions & 2 deletions development/_modules/deepcave/utils/styled_plotty.html
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,12 @@ <h1>Source code for deepcave.utils.styled_plotty</h1><div class="highlight"><pre
<a class="viewcode-back" href="../../../api/deepcave.utils.styled_plotty.html#deepcave.utils.styled_plotty.get_color">[docs]</a>
<span class="k">def</span> <span class="nf">get_color</span><span class="p">(</span><span class="n">id_</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span> <span class="n">alpha</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Currently (Plotly version 5.3.1) there are 10 possible colors.</span>
<span class="sd"> Using Plotly palette for the first 10 ids and Alphabet palette for the next 26, currently 36 colors are possible.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">color</span> <span class="o">=</span> <span class="n">px</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">qualitative</span><span class="o">.</span><span class="n">Plotly</span><span class="p">[</span><span class="n">id_</span><span class="p">]</span>
<span class="k">if</span> <span class="n">id_</span> <span class="o">&lt;</span> <span class="mi">10</span><span class="p">:</span>
<span class="n">color</span> <span class="o">=</span> <span class="n">px</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">qualitative</span><span class="o">.</span><span class="n">Plotly</span><span class="p">[</span><span class="n">id_</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">color</span> <span class="o">=</span> <span class="n">px</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">qualitative</span><span class="o">.</span><span class="n">Alphabet</span><span class="p">[</span><span class="n">id_</span> <span class="o">-</span> <span class="mi">10</span><span class="p">]</span>

<span class="n">r</span><span class="p">,</span> <span class="n">g</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">hex_to_rgb</span><span class="p">(</span><span class="n">color</span><span class="p">)</span>
<span class="k">return</span> <span class="sa">f</span><span class="s2">&quot;rgba(</span><span class="si">{</span><span class="n">r</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">g</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">b</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">alpha</span><span class="si">}</span><span class="s2">)&quot;</span></div>
Expand Down
4 changes: 2 additions & 2 deletions development/api/deepcave.utils.styled_plotty.html
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@
</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#deepcave.utils.styled_plotty.get_color" title="deepcave.utils.styled_plotty.get_color"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_color</span></code></a>(id_[, alpha])</p></td>
<td><p>Currently (Plotly version 5.3.1) there are 10 possible colors.</p></td>
<td><p>Using Plotly palette for the first 10 ids and Alphabet palette for the next 26, currently 36 colors are possible.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#deepcave.utils.styled_plotty.get_discrete_heatmap" title="deepcave.utils.styled_plotty.get_discrete_heatmap"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_discrete_heatmap</span></code></a>(x, y, values, labels)</p></td>
<td><p>Generate a discrete colorscale from a (nested) list or numpy array of values.</p></td>
Expand Down Expand Up @@ -808,7 +808,7 @@
<dl class="py function">
<dt class="sig sig-object py" id="deepcave.utils.styled_plotty.get_color">
<span class="sig-prename descclassname"><span class="pre">deepcave.utils.styled_plotty.</span></span><span class="sig-name descname"><span class="pre">get_color</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">id_</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/deepcave/utils/styled_plotty.html#get_color"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#deepcave.utils.styled_plotty.get_color" title="Link to this definition"></a></dt>
<dd><p>Currently (Plotly version 5.3.1) there are 10 possible colors.</p>
<dd><p>Using Plotly palette for the first 10 ids and Alphabet palette for the next 26, currently 36 colors are possible.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-data docutils literal notranslate"><span class="pre">Tuple</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code>]]</p>
Expand Down
2 changes: 1 addition & 1 deletion development/searchindex.js

Large diffs are not rendered by default.

0 comments on commit b3588da

Please sign in to comment.