Code Monkey home page Code Monkey logo

hdc-colors's People

Contributors

kirill888 avatar valpesendorfer avatar

Watchers

 avatar  avatar  avatar

hdc-colors's Issues

Support config from a single list of tuples

Current interface expects 2/3 arrays of equal size to configure value,color[,label]

class HDCBaseClass:
"""Parent class for HDC color classes"""
def __init__(
self,
values: List[Union[int, float]],
colors: List[str],
labels: Optional[List[str]] = None,
):

This leads to hard to manage and inspect definitions like here:

rfh_16_0_300 = HDCDiscreteRamp(
values=[
0,
2,
5,
10,
20,
30,
40,
50,
60,
80,
100,
120,
150,
200,
300,
INF,
],
colors=[
"#fafafa",
"#fffadf",
"#d3f9d0",
"#a9e4a3",
"#7cc594",
"#5eab91",
"#9fffe8",
"#90e0ef",
"#00b1de",
"#0083f3",
"#0052cd",
"#0000c8",
"#6003b8",
"#a002fa",
"#fa78fa",
"#ffc4ee",
],
labels=[
"0 mm",
"1-2 mm",
"2-5 mm",
"5-10 mm",
"10-20 mm",
"20-30 mm",
"30-40 mm",
"40-50 mm",
"50-60 mm",
"60-80 mm",
"80-100 mm",
"100-120 mm",
"120-150 mm",
"150-200 mm",
"200-300 mm",
"> 300 mm",
],
)

I suggest either changing interface to expect a List[Tuple[Number, Color, Label]|Tuple[Number, Color]] only, or adding an option to accept list of tuples instead of 3 separate named lists.

Add additional features

To improve user interface I'd like to add two additional features:

  • property or method that creates a matplotlib object that can be used to plot xarray arrays with the selected color ramp
  • a HTML representation of the color ramp object, so when selected and executed in a jupyter notebook it shows a useful and nice visual (maybe similar to what odc.geo.GeoBox does?)

@Kirill888 for your input

publish package

@Kirill888 as discussed, this is the repo containing the color maps for various data products.

There are still a couple of todos on my side, but if you could look into packaging and publishing so it can be a) wrapped in hdc-tools if we wish so, and more importantly b) integrated into hdc-ows

Add documentation

Add list of available color ramps, descriptions and mapping to indicators

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.