1818from qwt import QwtInterval , toQImage
1919
2020from plotpy .config import CONF
21- from plotpy .widgets .colormap .widget import CustomQwtLinearColormap
21+ from plotpy .widgets .colormap .widget import EditableColormap
2222
2323# from guidata.dataset.datatypes import NoDefault
2424FULLRANGE = QwtInterval (0.0 , 1.0 )
25- DEFAULT = CustomQwtLinearColormap (name = "default" )
25+ DEFAULT = EditableColormap (name = "default" )
2626
2727
2828def load_raw_colormaps_from_json (
@@ -48,7 +48,7 @@ def load_raw_colormaps_from_json(
4848 return {}
4949
5050
51- def load_qwt_colormaps_from_json (json_path : str ) -> dict [str , CustomQwtLinearColormap ]:
51+ def load_qwt_colormaps_from_json (json_path : str ) -> dict [str , EditableColormap ]:
5252 """Same as function load_raw_colormaps_from_json but transforms the raw colormaps
5353 into CustomQwtLinearColormap objects that are used by plotpy.
5454
@@ -60,12 +60,12 @@ def load_qwt_colormaps_from_json(json_path: str) -> dict[str, CustomQwtLinearCol
6060 Dictionnary of colormpas names -> CustomQwtLinearColormap
6161 """
6262 return {
63- name .lower (): CustomQwtLinearColormap .from_iterable (iterable , name = name )
63+ name .lower (): EditableColormap .from_iterable (iterable , name = name )
6464 for name , iterable in load_raw_colormaps_from_json (json_path ).items ()
6565 }
6666
6767
68- def save_colormaps (json_filename : str , colormaps : dict [str , CustomQwtLinearColormap ]):
68+ def save_colormaps (json_filename : str , colormaps : dict [str , EditableColormap ]):
6969 """Saves colormaps into the given json file. Refer ton function get_cmap_path to
7070 know what json_filename can be used.
7171
@@ -80,7 +80,7 @@ def save_colormaps(json_filename: str, colormaps: dict[str, CustomQwtLinearColor
8080
8181
8282def build_icon_from_cmap (
83- cmap : CustomQwtLinearColormap , width : int = 16 , height : int = 16
83+ cmap : EditableColormap , width : int = 16 , height : int = 16
8484) -> QG .QIcon :
8585 """Builds an icon representing the colormap
8686
@@ -110,7 +110,7 @@ def build_icon_from_cmap_name(cmap_name: str) -> QG.QIcon:
110110 return build_icon_from_cmap (get_cmap (cmap_name .lower ()))
111111
112112
113- def get_cmap (cmap_name : str ) -> CustomQwtLinearColormap :
113+ def get_cmap (cmap_name : str ) -> EditableColormap :
114114 """Returns the colormap with the given name from the ALL_COLORMAPS global variable.
115115 If the colormap is not found, returns the DEFAULT colormap.
116116
0 commit comments