Code Monkey home page Code Monkey logo

tastymap's Introduction

TastyMap

๐ŸŽจ Color palettes for your palate ๐Ÿ˜‹

Make, customize, and/or use colormaps, any way you like.

tastykitchen

๐Ÿ“– Quick start

Start cooking from pre-made colormaps...

from tastymap import cook_tmap

tmap = cook_tmap("viridis", num_colors=12, reverse=True)
tmap

viridis_12

Or start from scratch!

from tastymap import cook_tmap

tmap = cook_tmap(
    ["red", "green", "blue"],
    num_colors=256,
    reverse=True,
    name="rgb",
)
tmap

rgb_256

Then pair it with your plots effortlessly:

import numpy as np
from matplotlib import pyplot as plt
from tastymap import cook_tmap, pair_tbar

fig, ax = plt.subplots()
img = ax.imshow(np.random.random((10, 10)))
tmap = cook_tmap(["red", "green", "blue"], num_colors=256)
pair_tbar(
    img,
    tmap,
    bounds=[0, 0.01, 0.5, 1],
    labels=["zero", "tiny", "half", "one"],
    uniform_spacing=True,
)

example

Or if you need suggestions, get help from AI by providing a description of what you're imagining:

from tastymap import ai

tmap = ai.suggest_tmap("Pikachu")
tmap

image

Try to craft your visual delight interactively with the TastyKitchen UI, hosted here.

tastymap ui

Check out the docs for more recipes!

๐Ÿ“ฆ Installation

To get started on your culinary color journey, install tastymap with:

pip install tastymap

To get access to TastyKitchen UI, install tastymap with:

pip install tastymap[ui]

build codecov PyPI version

Documentation: https://ahuang11.github.io/tastymap/

Source Code: https://github.com/ahuang11/tastymap

tastymap's People

Contributors

ahuang11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tastymap's Issues

Add HEX color support in tastykitchen[ui]

It would be nice to have the option to add HEX color code when manually adding colors in the UI.

I mean here, you can see HEX code when importing a colormap but I am not able to add new colors in HEX format
Screenshot_20231214_090100

when launching tastymap ui: AttributeError: module 'panel.widgets' has no attribute 'ColorMap'

ALL software version info

# Name                    Version                   Build  Channel
panel                     1.2.3              pyhd8ed1ab_0    conda-forge
tastymap                  0.3.0                    pypi_0    pypi
bokeh                     3.2.2              pyhd8ed1ab_0    conda-forge
python                    3.11.5          hab00c5b_0_cpython    conda-forge
jupyter                   1.0.0           py311h38be061_8    conda-forge
notebook                  7.0.4              pyhd8ed1ab_0    conda-forge

Description of expected behavior and the observed behavior

When running tastymap ui in the terminal I get:

Traceback (most recent call last):
  File "/user/jgiles/mambaforge/envs/wradlib4/bin/tastymap", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/user/jgiles/mambaforge/envs/wradlib4/lib/python3.11/site-packages/tastymap/cli.py", line 12, in main
    TastyKitchen().serve(port=8888, show=True)
    ^^^^^^^^^^^^^^
  File "/user/jgiles/mambaforge/envs/wradlib4/lib/python3.11/site-packages/tastymap/ui.py", line 147, in __init__
    self.cmap_input = pn.widgets.ColorMap(
                      ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'panel.widgets' has no attribute 'ColorMap'

Complete, minimal, self-contained example code that reproduces the issue

# in a terminal
tastymap ui

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.